diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-04-03 04:32:37 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:11:24 -0500 |
commit | a47cb58c2f6d34dd98e3dc2dd023a259ff501643 (patch) | |
tree | 7ce71f8ac40452570f110ec1895d3e5a65fafbd2 /source4/librpc | |
parent | b9df3f5fe80087a55a45474a5a860aec2788a26d (diff) | |
download | samba-a47cb58c2f6d34dd98e3dc2dd023a259ff501643.tar.gz samba-a47cb58c2f6d34dd98e3dc2dd023a259ff501643.tar.bz2 samba-a47cb58c2f6d34dd98e3dc2dd023a259ff501643.zip |
r6184: the beginnings of the libcli/dgram/ library, and the dgram
server. Currently just listens on port 138 and parses the packets
(using IDL like the rest of NBT). This allows me to develop the
structures and test with real packets
(This used to be commit 10d64a525349ff96695ad961a3cfeb5bc7c8844f)
Diffstat (limited to 'source4/librpc')
-rw-r--r-- | source4/librpc/idl/nbt.idl | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/source4/librpc/idl/nbt.idl b/source4/librpc/idl/nbt.idl index 04fe0c4f90..4d12dd02d0 100644 --- a/source4/librpc/idl/nbt.idl +++ b/source4/librpc/idl/nbt.idl @@ -183,4 +183,66 @@ interface nbt nbt_res_rec additional[arcount]; [flag(NDR_REMAINING)] DATA_BLOB padding; } nbt_name_packet; + + + /* + NBT DGRAM packets (UDP/138) + */ + + typedef [enum8bit] enum { + DGRAM_DIRECT_UNIQUE = 0x10, + DGRAM_DIRECT_GROUP = 0x11, + DGRAM_BCAST = 0x12, + DGRAM_ERROR = 0x13, + DGRAM_QUERY = 0x14, + DGRAM_QUERY_POSITIVE = 0x15, + DGRAM_QUERY_NEGATIVE = 0x16 + } dgram_msg_type; + + typedef [bitmap8bit] bitmap { + DGRAM_FLAG_MORE = 0x80, + DGRAM_FLAG_FIRST = 0x40, + DGRAM_FLAG_NODE_TYPE = 0x30 + } dgram_flags; + + typedef [enum8bit] enum { + DGRAM_NODE_B = 0x00, + DGRAM_NODE_P = 0x10, + DGRAM_NODE_M = 0x20, + DGRAM_NODE_NBDD = 0x30 + } dgram_node_type; + + /* a dgram_message is the main dgram body in general use */ + typedef struct { + uint16 length; + uint16 offset; + nbt_name source_name; + nbt_name dest_name; + [flag(NDR_REMAINING)] DATA_BLOB data; + } dgram_message; + + typedef [enum8bit] enum { + DGRAM_ERROR_NAME_NOT_PRESENT = 0x82, + DGRAM_ERROR_INVALID_SOURCE = 0x83, + DGRAM_ERROR_INVALID_DEST = 0x84 + } dgram_err_code; + + typedef [nodiscriminant] union { + [case(DGRAM_DIRECT_UNIQUE)] dgram_message msg; + [case(DGRAM_DIRECT_GROUP)] dgram_message msg; + [case(DGRAM_BCAST)] dgram_message msg; + [case(DGRAM_ERROR)] dgram_err_code error; + [case(DGRAM_QUERY)] nbt_name dest_name; + [case(DGRAM_QUERY_POSITIVE)] nbt_name dest_name; + [case(DGRAM_QUERY_NEGATIVE)] nbt_name dest_name; + } dgram_data; + + typedef [flag(NDR_NOALIGN|NDR_BIG_ENDIAN|NDR_PAHEX),public] struct { + dgram_msg_type msg_type; + dgram_flags flags; + uint16 dgram_id; + ipv4address source; + uint16 src_port; + [switch_is(msg_type)] dgram_data data; + } nbt_dgram_packet; } |