4 IDL structures for WINS replication protocol (port 42)
6 Note that WINS replication is not traditionally encoded using
9 Written by Andrew Tridgell <tridge@osdl.org>
15 uuid("915f5653-bac1-431c-97ee-9ffb34526921"),
16 helpstring("WINS Replication PDUs"),
17 helper
("../libcli/nbt/libnbt.h")
20 const int WINS_REPLICATION_PORT
= 42;
22 typedef [flag
(NDR_BIG_ENDIAN
)] struct {
27 typedef [flag
(NDR_LITTLE_ENDIAN
)] struct {
29 wrepl_ip ips
[num_ips
];
32 typedef [nodiscriminant
] union {
33 [case(0)] ipv4address ip
;
34 [case(2)] wrepl_address_list addresses
;
37 typedef [enum8bit
] enum {
38 WREPL_TYPE_UNIQUE
= 0x0,
39 WREPL_TYPE_GROUP
= 0x1,
40 WREPL_TYPE_SGROUP
= 0x2,
41 WREPL_TYPE_MHOMED
= 0x3
44 typedef [enum8bit
] enum {
45 WREPL_STATE_ACTIVE
= 0x0,
46 WREPL_STATE_RELEASED
= 0x1,
47 WREPL_STATE_TOMBSTONE
= 0x2,
48 WREPL_STATE_RESERVED
= 0x3
51 typedef [enum8bit
] enum {
58 typedef [bitmap32bit
] bitmap
{
59 WREPL_FLAGS_RECORD_TYPE
= 0x00000003,
60 WREPL_FLAGS_RECORD_STATE
= 0x0000000C,
61 WREPL_FLAGS_REGISTERED_LOCAL
= 0x00000010,
62 WREPL_FLAGS_NODE_TYPE
= 0x00000060,
63 WREPL_FLAGS_IS_STATIC
= 0x00000080
66 typedef [v1_enum] enum {
67 WREPL_GROUP_FLAG_NO_GROUP
= 0x00000000,
68 WREPL_GROUP_FLAG_IS_GROUP
= 0x00000001
71 #define WREPL_IS_GROUP
(flags
) (\
72 ((((flags
) & WREPL_FLAGS_RECORD_TYPE
) == WREPL_TYPE_GROUP
)|| \
73 (((flags
) & WREPL_FLAGS_RECORD_TYPE
) == WREPL_TYPE_SGROUP
))\
74 ? WREPL_GROUP_FLAG_IS_GROUP
: WREPL_GROUP_FLAG_NO_GROUP
)
79 [flag
(NDR_LITTLE_ENDIAN
),value
(WREPL_IS_GROUP
(flags
))] wrepl_group_flag is_group
;
81 [switch_is(flags
& 2)] wrepl_addresses addresses
;
87 wrepl_wins_name names
[num_names
];
99 wrepl_wins_owner partners
[partner_count
];
100 ipv4address initiator
;
103 typedef [v1_enum] enum {
104 WREPL_REPL_TABLE_QUERY
= 0,
105 WREPL_REPL_TABLE_REPLY
= 1,
106 WREPL_REPL_SEND_REQUEST
= 2,
107 WREPL_REPL_SEND_REPLY
= 3,
108 WREPL_REPL_UPDATE
= 4,
109 WREPL_REPL_UPDATE2
= 5,
110 WREPL_REPL_INFORM
= 8,
111 WREPL_REPL_INFORM2
= 9
112 } wrepl_replication_cmd
;
114 typedef [nodiscriminant
] union {
115 [case(WREPL_REPL_TABLE_QUERY
)] ;
116 [case(WREPL_REPL_TABLE_REPLY
)] wrepl_table table
;
117 [case(WREPL_REPL_SEND_REQUEST
)] wrepl_wins_owner owner
;
118 [case(WREPL_REPL_SEND_REPLY
)] wrepl_send_reply reply
;
119 [case(WREPL_REPL_UPDATE
)] wrepl_table table
;
120 [case(WREPL_REPL_UPDATE2
)] wrepl_table table
;
121 [case(WREPL_REPL_INFORM
)] wrepl_table table
;
122 [case(WREPL_REPL_INFORM2
)] wrepl_table table
;
123 } wrepl_replication_info
;
126 wrepl_replication_cmd command
;
127 [switch_is(command
)] wrepl_replication_info info
;
132 uint16 minor_version
;
133 uint16 major_version
;
140 typedef [v1_enum] enum {
141 WREPL_START_ASSOCIATION
= 0,
142 WREPL_START_ASSOCIATION_REPLY
= 1,
143 WREPL_STOP_ASSOCIATION
= 2,
144 WREPL_REPLICATION
= 3
147 typedef [nodiscriminant
] union {
148 [case(WREPL_START_ASSOCIATION
)] wrepl_start start
;
149 [case(WREPL_START_ASSOCIATION_REPLY
)] wrepl_start start_reply
;
150 [case(WREPL_STOP_ASSOCIATION
)] wrepl_stop stop
;
151 [case(WREPL_REPLICATION
)] wrepl_replication replication
;
155 the opcode appears to be a bitfield, but as far as I can tell
156 you must always set the following bits. Additional bits don't
157 seem to matter. Very strange.
159 const int WREPL_OPCODE_BITS
= 0x7800;
162 typedef [gensize
,flag
(NDR_BIG_ENDIAN|NDR_PAHEX
),public] struct {
165 wrepl_mess_type mess_type
;
166 [switch_is(mess_type
)] wrepl_message
message;
167 [flag
(NDR_REMAINING
)] DATA_BLOB padding
;
170 typedef [flag
(NDR_BIG_ENDIAN|NDR_PAHEX
),public] struct {
171 [value
(ndr_size_wrepl_packet
(&packet
, ndr
->flags
))] uint32 size
;
175 void decode_winsrepl
(