EVB-PIC24 WIZnet, EVB-PIC24 Datasheet - Page 91

no-image

EVB-PIC24

Manufacturer Part Number
EVB-PIC24
Description
Development Boards & Kits - PIC / DSPIC W3150A+EVAL BOARD BASED ON PIC24
Manufacturer
WIZnet
Datasheet

Specifications of EVB-PIC24

Rohs
yes
Product
Development Kits
Interface Type
RS-232
Data Bus Width
16 bit
Dimensions
50 mm x 40 mm
dns_makequery() creates DNS Request message to be sent to DNS Name Server. Since DNS Request
Message can query only with Header, Question Section, RRs Sections is not needed to be created. If you
examine the header section creation at dns_makequery(), first, it sets ID Field values as any value in DNS
Message inter-working. On here, ID is set with 0x1122, and for further inter-working, the value is incremented
by 1. QR, Opcode, AA, TC, RD Field are set as QR_QUERY, OP_QUERY/OP_IQUERY, 0, 0, 1 respectively
through MAKE_FLAG0(), and RA, Z, RCODE Field are set as 0, 0, 0 respectively through MAKE_FLAG1().
Since the count fields, QDCOUNT, ANCOUNT, NSCOUNT, and ARCOUNT, have only one question each is
set as 1, 0, 0, 0 respectively.
Let‟s look at Question Section. QNAME Field is Field that sets IP Address String. Domain Name and IP
Address String are composed of Label length of 1 byte and Label of MAX 63 Byte. The end of QNAME is
always set with 0 to find out the variable length of QNAME. <Fig 3.41> is actual example of transformation of
Domain Name “www.wiznet.co.kr” in QNAME field.
#define QR_QUERY
#define QR_RESPONSE
#define OP_QUERY
#define OP_IQUREY
#define OP_STATUS
#define MAKE_FLAG0(qr, op, aa, tc, rd)
#define MAKE_FLAG1(ra, z, rcode)
Label Length
( ((qr & 0x01) << 7) + ((op & 0x0F) << 3) + ((aa & 0x01) << 2) + ((tc & 0x01) << 1) + (rd & 0x01) )
( ((ra & 0x01) << 7) + ((z & 0x07) << 4) + (rcode & 0x0F) )
<Fig 3.41: Example of QNAME Field transformation of Question Section >
0x03 w
0
<Table 3-39: Constants and MACRO used in Header Section>
© Copyright 2006 WIZnet Co., Inc. All rights reserved.
w
w 0x06 w
Label
0
1
0
1
2
i
z
18 Bytes
n
/* a standard query (QUERY) */
/* an inverse query (IQUERY) */
/*a server status request (STATUS)*/
e
t
0x02
c
o 0x02
k
r
0x00
0x12
Zero Terminated
81

Related parts for EVB-PIC24