Commit ecaeaa97 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

dnsapi: Add support for DNS_TYPE_OPT records.

parent 563da6fe
......@@ -218,6 +218,7 @@ static unsigned int dns_get_record_size( const ns_rr *rr )
break;
}
case ns_t_null:
case ns_t_opt:
{
size += rr->rdlength - 1;
break;
......@@ -313,6 +314,15 @@ static DNS_STATUS dns_copy_rdata( ns_msg msg, const ns_rr *rr, DNS_RECORDA *r, W
*dlen = sizeof(DNS_NULL_DATA) + rr->rdlength - 1;
break;
}
case ns_t_opt:
{
r->Data.OPT.wDataLength = rr->rdlength;
r->Data.OPT.wPad = 0;
memcpy( r->Data.OPT.Data, rr->rdata, rr->rdlength );
*dlen = sizeof(DNS_OPT_DATA) + rr->rdlength - 1;
break;
}
case ns_t_cname:
case ns_t_ns:
case ns_t_mb:
......
......@@ -222,6 +222,16 @@ BOOL WINAPI DnsRecordCompare( PDNS_RECORD r1, PDNS_RECORD r2 )
return FALSE;
break;
}
case DNS_TYPE_OPT:
{
if (r1->Data.Opt.wDataLength != r2->Data.Opt.wDataLength)
return FALSE;
/* ignore wPad */
if (memcmp( r1->Data.Opt.Data,
r2->Data.Opt.Data, r1->Data.Opt.wDataLength ))
return FALSE;
break;
}
case DNS_TYPE_AAAA:
{
for (i = 0; i < sizeof(IP6_ADDRESS)/sizeof(DWORD); i++)
......
......@@ -519,6 +519,14 @@ typedef struct
DECL_WINELIB_TYPE_AW(DNS_WINSR_DATA)
DECL_WINELIB_TYPE_AW(PDNS_WINSR_DATA)
typedef struct
{
WORD wDataLength;
WORD wPad;
BYTE Data[1];
}
DNS_OPT_DATA, *PDNS_OPT_DATA;
typedef struct _DnsRecordA
{
struct _DnsRecordA *pNext;
......@@ -552,6 +560,7 @@ typedef struct _DnsRecordA
DNS_TSIG_DATAA TSIG, Tsig;
DNS_WINS_DATA WINS, Wins;
DNS_WINSR_DATAA WINSR, WinsR, NBSTAT, Nbstat;
DNS_OPT_DATA OPT, Opt;
} Data;
} DNS_RECORDA, *PDNS_RECORDA;
......@@ -588,6 +597,7 @@ typedef struct _DnsRecordW
DNS_TSIG_DATAW TSIG, Tsig;
DNS_WINS_DATA WINS, Wins;
DNS_WINSR_DATAW WINSR, WinsR, NBSTAT, Nbstat;
DNS_OPT_DATA OPT, Opt;
} Data;
} DNS_RECORDW, *PDNS_RECORDW;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment