6 #define NS_INT16SZ (sizeof(uint16_t))
10 #define NS_INT32SZ (sizeof(uint32_t))
14 #define NS_MAXDNAME 1025
17 #define ns_msg_id_vlmcsd(handle) ((handle)._id + 0)
18 #define ns_msg_base_vlmcsd(handle) ((handle)._msg + 0)
19 #define ns_msg_end_vlmcsd(handle) ((handle)._eom + 0)
20 #define ns_msg_size_vlmcsd(handle) ((handle)._eom - (handle)._msg)
21 #define ns_msg_count_vlmcsd(handle, section) ((handle)._counts[section] + 0)
23 #define ns_rr_name_vlmcsd(rr) (((rr).name[0] != '\0') ? (rr).name : ".")
24 #define ns_rr_type_vlmcsd(rr) ((ns_type)((rr).type + 0))
25 #define ns_rr_class_vlmcsd(rr) ((ns_class)((rr).rr_class + 0))
26 #define ns_rr_ttl_vlmcsd(rr) ((rr).ttl + 0)
27 #define ns_rr_rdlen_vlmcsd(rr) ((rr).rdlength + 0)
28 #define ns_rr_rdata_vlmcsd(rr) ((rr).rdata + 0)
30 #define ns_msg_id_vlmcsd(handle) ((handle)._id + 0)
31 #define ns_msg_base_vlmcsd(handle) ((handle)._msg + 0)
32 #define ns_msg_end_vlmcsd(handle) ((handle)._eom + 0)
33 #define ns_msg_size_vlmcsd(handle) ((handle)._eom - (handle)._msg)
34 #define ns_msg_count_vlmcsd(handle, section) ((handle)._counts[section] + 0)
37 typedef enum __ns_sect_vlmcsd
{
38 ns_s_qd_vlmcsd
= 0, /*%< Query: Question. */
39 ns_s_zn_vlmcsd
= 0, /*%< Update: Zone. */
40 ns_s_an_vlmcsd
= 1, /*%< Query: Answer. */
41 ns_s_pr_vlmcsd
= 1, /*%< Update: Prerequisites. */
42 ns_s_ns_vlmcsd
= 2, /*%< Query: Name servers. */
43 ns_s_ud_vlmcsd
= 2, /*%< Update: Update. */
44 ns_s_ar_vlmcsd
= 3, /*%< Query|Update: Additional records. */
48 typedef struct __ns_msg_vlmcsd
{
49 const uint8_t *_msg
, *_eom
;
50 uint16_t _id
, _flags
, _counts
[ns_s_max_vlmcsd
];
51 const uint8_t *_sections
[ns_s_max_vlmcsd
];
54 const uint8_t *_msg_ptr
;
58 typedef struct __ns_rr_vlmcsd
{
59 char name
[NS_MAXDNAME
];
64 const uint8_t * rdata
;
67 int ns_initparse_vlmcsd(const uint8_t *msg
, int msglen
, ns_msg_vlmcsd
*handle
);
69 int ns_parserr_vlmcsd(ns_msg_vlmcsd
*handle
, ns_sect_vlmcsd section
, int rrnum
, ns_rr_vlmcsd
*rr
);
73 #endif /* NS_PARSE_H_ */