dns: auto-calculate the wDataLength field in DNS records
authorAndrew Tridgell <tridge@samba.org>
Tue, 21 Dec 2010 00:59:05 +0000 (11:59 +1100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 21 Dec 2010 01:42:37 +0000 (02:42 +0100)
we need this for creating new records

librpc/idl/dnsp.idl

index 905e42048223e1bbe71d8492bd9028f8588fef8d..eed0c478fb87e945344b7d117b7d72580a75f988 100644 (file)
@@ -92,7 +92,7 @@ interface dnsp
                dnsp_name       nameTarget;
        } dnsp_srv;
 
-       typedef [nodiscriminant] union {
+       typedef [nodiscriminant,gensize] union {
                [case(DNS_TYPE_A)] [flag(NDR_BIG_ENDIAN)]   ipv4address ipv4;
                [case(DNS_TYPE_NS)]                         dnsp_name ns;
                [case(DNS_TYPE_CNAME)]                      dnsp_name cname;
@@ -109,7 +109,7 @@ interface dnsp
        /* this is the format for the dnsRecord attribute in the DNS
           partitions in AD */
        typedef [public] struct {
-               uint16          wDataLength;
+               [value(ndr_size_dnsRecordData(&data,wType,ndr->flags))] uint16 wDataLength;
                dns_record_type wType;
                uint32          dwFlags;
                uint32          dwSerial;