2005-02-15 02:27:45 +00:00
#include "idl_types.h"
/*
IDL structures for WINS replication protocol (port 42)
Note that WINS replication is not traditionally encoded using
IDL/NDR
Written by Andrew Tridgell <tridge@osdl.org>
*/
[
uuid("0-1-2-3-4"),
version(0.0),
r6973: Merge new version of pidl into the main SAMBA_4_0 branch.
The main difference in this new version is the extra data structure generated
between the IDL data structure and the NDR parser:
IDL -> NDR -> { ndr_parser, ndr_header, eparser, etc }
This makes the ndr_parser.pm internals much more sane.
Other changes include:
- Remove unnecessary calls with NDR_BUFFERS (for example, GUID doesn't have any buffers, just scalars) as well as some (unnecessary) nested setting of flags.
- Parse array loops in the C code rather then calling ndr_pull_array(). This allows us to have, for example, arrays of pointers or arrays of pointers to arrays, etc..
- Use if() {} rather then if () goto foo; everywhere
- NDR_IN no longer implies LIBNDR_FLAG_REF_ALLOC
- By default, top level pointers are now "ref" (as is the default in
most other IDL compilers). This can be overridden using the
default_pointer_top() property.
- initial work on new ethereal parser generators by Alan DeKok and me
- pidl now writes errors in the standard format used by compilers, which
is parsable by most editors
- ability to warn about the fact that pidl extension(s) have been used,
useful for making sure IDL files work with other IDL compilers.
oh, and there's probably some other things I can't think of right now..
(This used to be commit 13cf227615f6b9e0e5fa62e59197024410254f01)
2005-05-25 13:50:27 +00:00
pointer_default(unique),
2005-09-29 14:02:57 +00:00
pointer_default_top(unique),
depends(nbt)
2005-02-15 02:27:45 +00:00
]
interface wrepl
{
const int WINS_REPLICATION_PORT = 42;
typedef [flag(NDR_BIG_ENDIAN)] struct {
ipv4address owner;
ipv4address ip;
} wrepl_ip;
typedef [flag(NDR_LITTLE_ENDIAN)] struct {
2005-02-16 10:03:18 +00:00
uint32 num_ips;
wrepl_ip ips[num_ips];
2005-02-15 02:27:45 +00:00
} wrepl_address_list;
typedef [nodiscriminant] union {
2005-09-09 19:55:34 +00:00
[case(0)] ipv4address ip;
2005-02-15 02:27:45 +00:00
[case(2)] wrepl_address_list addresses;
} wrepl_addresses;
2005-09-29 14:02:57 +00:00
typedef [enum8bit] enum {
WREPL_TYPE_UNIQUE = 0x0,
WREPL_TYPE_GROUP = 0x1,
WREPL_TYPE_SGROUP = 0x2,
WREPL_TYPE_MHOMED = 0x3
} wrepl_name_type;
typedef [enum8bit] enum {
WREPL_STATE_ACTIVE = 0x0,
WREPL_STATE_RELEASED = 0x1,
WREPL_STATE_TOMBSTONE = 0x2,
WREPL_STATE_RESERVED = 0x3
} wrepl_name_state;
typedef [bitmap32bit] bitmap {
WREPL_FLAGS_RECORD_TYPE = 0x00000003,
WREPL_FLAGS_RECORD_STATE = 0x0000000C,
WREPL_FLAGS_0x00000010 = 0x00000010,
WREPL_FLAGS_NODE_TYPE = 0x00000060,
WREPL_FLAGS_IS_STATIC = 0x00000080
} wrepl_flags;
typedef [v1_enum] enum {
WREPL_GROUP_FLAG_NO_GROUP = 0x00000000,
WREPL_GROUP_FLAG_IS_GROUP = 0x00000001
} wrepl_group_flag;
#define WREPL_IS_GROUP(flags) (\
((((flags) & WREPL_FLAGS_RECORD_TYPE) == WREPL_TYPE_GROUP)|| \
(((flags) & WREPL_FLAGS_RECORD_TYPE) == WREPL_TYPE_SGROUP))\
? WREPL_GROUP_FLAG_IS_GROUP : WREPL_GROUP_FLAG_NO_GROUP)
2005-02-15 02:27:45 +00:00
typedef struct {
2005-09-29 14:02:57 +00:00
wrepl_nbt_name name;
wrepl_flags flags;
[flag(NDR_LITTLE_ENDIAN),value(WREPL_IS_GROUP(flags))] wrepl_group_flag is_group;
2005-02-16 10:03:18 +00:00
udlongr id;
2005-02-15 02:27:45 +00:00
[switch_is(flags & 2)] wrepl_addresses addresses;
2005-09-09 19:55:34 +00:00
ipv4address unknown;
2005-02-15 02:27:45 +00:00
} wrepl_wins_name;
typedef struct {
2005-02-16 10:03:18 +00:00
uint32 num_names;
2005-02-15 02:27:45 +00:00
wrepl_wins_name names[num_names];
} wrepl_send_reply;
typedef struct {
ipv4address address;
2005-02-16 10:03:18 +00:00
udlongr max_version;
udlongr min_version;
uint32 type;
2005-02-15 02:27:45 +00:00
} wrepl_wins_owner;
typedef struct {
2005-02-16 10:03:18 +00:00
uint32 partner_count;
2005-02-15 02:27:45 +00:00
wrepl_wins_owner partners[partner_count];
2005-02-16 10:03:18 +00:00
ipv4address initiator;
2005-02-15 02:27:45 +00:00
} wrepl_table;
typedef [v1_enum] enum {
WREPL_REPL_TABLE_QUERY = 0,
WREPL_REPL_TABLE_REPLY = 1,
WREPL_REPL_SEND_REQUEST = 2,
WREPL_REPL_SEND_REPLY = 3,
WREPL_REPL_UPDATE = 4,
2005-09-08 15:05:29 +00:00
WREPL_REPL_5 = 5,
WREPL_REPL_INFORM = 8,
WREPL_REPL_9 = 9
2005-02-15 02:27:45 +00:00
} wrepl_replication_cmd;
typedef [nodiscriminant] union {
[case(WREPL_REPL_TABLE_QUERY)] ;
2005-02-16 10:03:18 +00:00
[case(WREPL_REPL_TABLE_REPLY)] wrepl_table table;
2005-02-15 02:27:45 +00:00
[case(WREPL_REPL_SEND_REQUEST)] wrepl_wins_owner owner;
2005-02-16 10:03:18 +00:00
[case(WREPL_REPL_SEND_REPLY)] wrepl_send_reply reply;
2005-09-09 19:08:36 +00:00
[case(WREPL_REPL_UPDATE)] wrepl_table table;
2005-09-08 15:05:29 +00:00
[case(WREPL_REPL_5)] wrepl_table table;
2005-02-16 10:03:18 +00:00
[case(WREPL_REPL_INFORM)] wrepl_table table;
2005-09-08 15:05:29 +00:00
[case(WREPL_REPL_9)] wrepl_table table;
2005-02-15 02:27:45 +00:00
} wrepl_replication_info;
typedef struct {
wrepl_replication_cmd command;
[switch_is(command)] wrepl_replication_info info;
} wrepl_replication;
typedef struct {
uint32 assoc_ctx;
uint16 minor_version;
uint16 major_version;
} wrepl_start;
typedef struct {
uint32 reason;
} wrepl_stop;
typedef [v1_enum] enum {
WREPL_START_ASSOCIATION = 0,
WREPL_START_ASSOCIATION_REPLY = 1,
WREPL_STOP_ASSOCIATION = 2,
WREPL_REPLICATION = 3
} wrepl_mess_type;
typedef [nodiscriminant] union {
2005-02-16 10:03:18 +00:00
[case(WREPL_START_ASSOCIATION)] wrepl_start start;
2005-02-15 02:27:45 +00:00
[case(WREPL_START_ASSOCIATION_REPLY)] wrepl_start start_reply;
2005-02-16 10:03:18 +00:00
[case(WREPL_STOP_ASSOCIATION)] wrepl_stop stop;
[case(WREPL_REPLICATION)] wrepl_replication replication;
2005-02-15 02:27:45 +00:00
} wrepl_message;
2005-02-16 10:03:18 +00:00
/*
the opcode appears to be a bitfield, but as far as I can tell
you must always set the following bits. Additional bits don't
seem to matter. Very strange.
*/
const int WREPL_OPCODE_BITS = 0x7800;
2005-02-15 02:27:45 +00:00
2005-02-16 10:03:18 +00:00
typedef [gensize,flag(NDR_BIG_ENDIAN|NDR_PAHEX),public] struct {
uint32 opcode;
uint32 assoc_ctx;
wrepl_mess_type mess_type;
2005-02-15 02:27:45 +00:00
[switch_is(mess_type)] wrepl_message message;
[flag(NDR_REMAINING)] DATA_BLOB padding;
} wrepl_packet;
2005-02-16 10:03:18 +00:00
typedef [flag(NDR_BIG_ENDIAN|NDR_PAHEX),public] struct {
2005-06-13 22:22:51 +00:00
[value(ndr_size_wrepl_packet(&packet, ndr->flags))] uint32 size;
2005-02-15 02:27:45 +00:00
wrepl_packet packet;
} wrepl_wrap;
void decode_winsrepl(
[in] wrepl_wrap p
);
}