dnsapi: Add support for DNS_TYPE_OPT records.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46704
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hans Leidekker 2019-03-01 17:37:33 +01:00 committed by Alexandre Julliard
parent 563da6fe70
commit ecaeaa974c
3 changed files with 30 additions and 0 deletions

View File

@ -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:

View File

@ -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++)

View File

@ -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;