919d3a94bbba0b8c760611078a471c36f82f183a
[samba.git] / source4 / librpc / idl / winsrepl.idl
1 #include "idl_types.h"
2
3 /*
4    IDL structures for WINS replication protocol (port 42)
5
6    Note that WINS replication is not traditionally encoded using
7    IDL/NDR
8
9    Written by Andrew Tridgell <tridge@osdl.org>
10 */
11
12 [
13   uuid("0-1-2-3-4"),
14   version(0.0),
15   pointer_default(unique),
16   depends(nbt)
17 ]
18 interface wrepl
19 {
20         const int WINS_REPLICATION_PORT = 42;
21
22         declare enum nbt_name_type;
23
24         typedef [flag(NDR_BIG_ENDIAN)] struct {
25                 ipv4address owner;
26                 ipv4address ip;
27         } wrepl_ip;
28
29         typedef [flag(NDR_LITTLE_ENDIAN)] struct {
30                 uint32 num_ips;
31                 wrepl_ip ips[num_ips];
32                 ipv4address unknown;
33         } wrepl_address_list;
34
35         typedef [nodiscriminant] union {
36                 [case(0)] wrepl_ip address;
37                 [case(2)] wrepl_address_list addresses;
38         } wrepl_addresses;
39
40         typedef struct {
41                 uint32 id_high;
42                 uint32 id_low;
43         } wrepl_id;
44
45         typedef struct {
46                 uint32 name_len;
47                 astring15 name;
48                 nbt_name_type type;
49                 uint32 unknown;
50                 uint32 flags;
51                 [flag(NDR_LITTLE_ENDIAN)] uint32 group_flag;
52                 wrepl_id id;
53                 [switch_is(flags & 2)] wrepl_addresses addresses;
54         } wrepl_wins_name;
55
56         typedef struct {
57                 uint32 num_names;
58                 wrepl_wins_name names[num_names];
59         } wrepl_send_reply;
60
61         typedef struct {
62                 ipv4address address;
63                 wrepl_id max_version;
64                 wrepl_id min_version;
65                 uint32 type;
66         } wrepl_wins_owner;
67
68         typedef struct {
69                 uint32 partner_count;
70                 wrepl_wins_owner partners[partner_count];
71                 ipv4address initiator;
72         } wrepl_table;
73
74         typedef [v1_enum] enum {
75                 WREPL_REPL_TABLE_QUERY  = 0,
76                 WREPL_REPL_TABLE_REPLY  = 1,
77                 WREPL_REPL_SEND_REQUEST = 2,
78                 WREPL_REPL_SEND_REPLY   = 3,
79                 WREPL_REPL_UPDATE       = 4,
80                 WREPL_REPL_INFORM       = 8
81         } wrepl_replication_cmd;
82
83         typedef [nodiscriminant] union {
84                 [case(WREPL_REPL_TABLE_QUERY)] ;
85                 [case(WREPL_REPL_TABLE_REPLY)] wrepl_table table;
86                 [case(WREPL_REPL_SEND_REQUEST)] wrepl_wins_owner owner;
87                 [case(WREPL_REPL_SEND_REPLY)] wrepl_send_reply reply;
88                 [case(WREPL_REPL_UPDATE)] ;
89                 [case(WREPL_REPL_INFORM)] wrepl_table table;
90         } wrepl_replication_info;
91
92         typedef struct {
93                 wrepl_replication_cmd command;
94                 [switch_is(command)] wrepl_replication_info info;
95         } wrepl_replication;
96
97         typedef struct {
98                 uint32 assoc_ctx;
99                 uint16 minor_version;
100                 uint16 major_version;
101         } wrepl_start;
102
103         typedef struct {
104                 uint32 reason;
105         } wrepl_stop;
106
107         typedef [v1_enum] enum {
108                 WREPL_START_ASSOCIATION       = 0,
109                 WREPL_START_ASSOCIATION_REPLY = 1,
110                 WREPL_STOP_ASSOCIATION        = 2,
111                 WREPL_REPLICATION             = 3
112         } wrepl_mess_type;
113
114         typedef [nodiscriminant] union {
115                 [case(WREPL_START_ASSOCIATION)] wrepl_start start;
116                 [case(WREPL_START_ASSOCIATION_REPLY)] wrepl_start start_reply;
117                 [case(WREPL_STOP_ASSOCIATION)] wrepl_stop stop;
118                 [case(WREPL_REPLICATION)] wrepl_replication replication;
119         } wrepl_message;
120
121
122         typedef [gensize,flag(NDR_NOALIGN|NDR_BIG_ENDIAN|NDR_PAHEX),public] struct {
123                 uint32          opcode;
124                 uint32          assoc_ctx;
125                 wrepl_mess_type mess_type;
126                 [switch_is(mess_type)] wrepl_message message;
127                 [flag(NDR_REMAINING)] DATA_BLOB padding;
128         } wrepl_packet;
129
130         typedef [flag(NDR_NOALIGN|NDR_BIG_ENDIAN|NDR_PAHEX),public] struct {
131                 [value(ndr_size_wrepl_packet(&r->packet, ndr->flags))] uint32          size;
132                 wrepl_packet    packet;
133         } wrepl_wrap;
134
135         void decode_winsrepl(
136                 [in] wrepl_wrap p
137                 );
138
139 }