r6248: added parsing of type 10 UAS announce netlogon packets
authorAndrew Tridgell <tridge@samba.org>
Fri, 8 Apr 2005 09:38:16 +0000 (09:38 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:11:28 +0000 (13:11 -0500)
source/libcli/dgram/netlogon.c
source/librpc/idl/nbt.idl

index a0218e2cb5eff52e9e1869f3d82eddc3d9dfb8e3..869e99e2fc5f17ce97839296a9f2cf4c82acb555 100644 (file)
@@ -70,5 +70,12 @@ NTSTATUS dgram_mailslot_netlogon_parse(struct dgram_mailslot_handler *dgmslot,
 
        status = ndr_pull_struct_blob(data, mem_ctx, netlogon, 
                                      (ndr_pull_flags_fn_t)ndr_pull_nbt_netlogon_packet);
+       if (!NT_STATUS_IS_OK(status)) {
+               DEBUG(0,("Failed to parse netlogon packet of length %d\n", 
+                        data->length));
+#if 0
+               file_save("netlogon.dat", data->data, data->length);
+#endif
+       }
        return status;
 }
index d9178c6a37fcff4e46c38cdc6d1687eb4e1bfcce..d2e32f68819dd491343d9255646affbf08d6b3e3 100644 (file)
@@ -8,7 +8,10 @@
    encoding if it doesn't work out
 */
 
-interface nbt
+[ uuid("1-2-3-4"),
+  version(1.0),
+  depends(security)
+] interface nbt
 {
        const int NBT_NAME_SERVICE_PORT  = 137;
        const int NBT_DGRAM_SERVICE_PORT = 138;
@@ -326,6 +329,7 @@ interface nbt
        /* \MAILSLOT\NET\NETLOGON mailslot requests */
        typedef [enum8bit] enum {
                NETLOGON_QUERY_FOR_PDC     = 0x7,       
+               NETLOGON_ANNOUNCE_UAS      = 0xa,
                NETLOGON_RESPONSE_FROM_PDC = 0xc
        } nbt_netlogon_command;
 
@@ -351,8 +355,37 @@ interface nbt
                uint16               lm20_token;
        } nbt_netlogon_response_from_pdc;
 
+       /* announce change to UAS or SAM */
+       typedef struct {
+               uint32           db_index;
+               hyper            serial;
+               NTTIME           timestamp;
+       } nbt_db_change;
+
+       /* used to announce SAM changes */
+       typedef struct {
+               uint32           serial_lo;
+               time_t           timestamp;
+               uint32           pulse;
+               uint32           random;
+               astring          pdc_name;
+               astring          domain;
+               [flag(NDR_ALIGN2)] DATA_BLOB _pad;
+               nstring          unicode_pdc_name;
+               nstring          unicode_domain;
+               uint32           db_count;
+               nbt_db_change    dbchange[db_count];
+               [value(ndr_size_dom_sid(&r->sid))] uint32 sid_size;
+               uint16           unknown;
+               dom_sid          sid;
+               uint32           nt_version;
+               uint16           lmnt_token;
+               uint16           lm20_token;
+       } nbt_netlogon_announce_uas;
+
        typedef [nodiscriminant] union {
                [case(NETLOGON_QUERY_FOR_PDC)] nbt_netlogon_query_for_pdc pdc;
+               [case(NETLOGON_ANNOUNCE_UAS)] nbt_netlogon_announce_uas uas;
                [case(NETLOGON_RESPONSE_FROM_PDC)] nbt_netlogon_response_from_pdc response;
        } nbt_netlogon_request;
 
@@ -361,4 +394,6 @@ interface nbt
                uint8                pad;
                [switch_is(command)] nbt_netlogon_request req;
        } nbt_netlogon_packet;
+
+       void nbt_netlogon([in] nbt_netlogon_packet logon);
 }