Home --> Documentations --> PJLIB-UTIL Reference
Go to the documentation of this file.
19#ifndef __PJLIB_UTIL_DNS_H__
20#define __PJLIB_UTIL_DNS_H__
144#define PJ_DNS_SET_RCODE(c) ((pj_uint16_t)((c) & 0x0F))
147#define PJ_DNS_SET_RA(on) ((pj_uint16_t)((on) << 7))
150#define PJ_DNS_SET_RD(on) ((pj_uint16_t)((on) << 8))
153#define PJ_DNS_SET_TC(on) ((pj_uint16_t)((on) << 9))
156#define PJ_DNS_SET_AA(on) ((pj_uint16_t)((on) << 10))
159#define PJ_DNS_SET_OPCODE(o) ((pj_uint16_t)((o) << 11))
162#define PJ_DNS_SET_QR(on) ((pj_uint16_t)((on) << 15))
166#define PJ_DNS_GET_RCODE(val) (((val) & PJ_DNS_SET_RCODE(0x0F)) >> 0)
169#define PJ_DNS_GET_RA(val) (((val) & PJ_DNS_SET_RA(1)) >> 7)
172#define PJ_DNS_GET_RD(val) (((val) & PJ_DNS_SET_RD(1)) >> 8)
175#define PJ_DNS_GET_TC(val) (((val) & PJ_DNS_SET_TC(1)) >> 9)
178#define PJ_DNS_GET_AA(val) (((val) & PJ_DNS_SET_AA(1)) >> 10)
181#define PJ_DNS_GET_OPCODE(val) (((val) & PJ_DNS_SET_OPCODE(0x0F)) >> 11)
184#define PJ_DNS_GET_QR(val) (((val) & PJ_DNS_SET_QR(1)) >> 15)
unsigned short pj_uint16_t
pj_status_t pj_dns_make_query(void *packet, unsigned *size, pj_uint16_t id, int qtype, const pj_str_t *name)
void pj_dns_init_a_rr(pj_dns_parsed_rr *rec, const pj_str_t *res_name, unsigned dnsclass, unsigned ttl, const pj_in_addr *ip_addr)
pj_dns_rcode Definition: dns.h:193
pj_dns_type Definition: dns.h:72
void pj_dns_init_aaaa_rr(pj_dns_parsed_rr *rec, const pj_str_t *res_name, unsigned dnsclass, unsigned ttl, const pj_in6_addr *ip_addr)
void pj_dns_init_srv_rr(pj_dns_parsed_rr *rec, const pj_str_t *res_name, unsigned dnsclass, unsigned ttl, unsigned prio, unsigned weight, unsigned port, const pj_str_t *target)
void pj_dns_init_cname_rr(pj_dns_parsed_rr *rec, const pj_str_t *res_name, unsigned dnsclass, unsigned ttl, const pj_str_t *name)
const char * pj_dns_get_type_name(int type)
pj_dns_dup_options Definition: dns.h:297
void pj_dns_dump_packet(const pj_dns_parsed_packet *res)
void pj_dns_packet_dup(pj_pool_t *pool, const pj_dns_parsed_packet *p, unsigned options, pj_dns_parsed_packet **p_dst)
pj_status_t pj_dns_parse_packet(pj_pool_t *pool, const void *packet, unsigned size, pj_dns_parsed_packet **p_res)
@ PJ_DNS_CLASS_IN Definition: dns.h:64
@ PJ_DNS_RCODE_YXRRSET Definition: dns.h:200
@ PJ_DNS_RCODE_NOTZONE Definition: dns.h:203
@ PJ_DNS_RCODE_REFUSED Definition: dns.h:198
@ PJ_DNS_RCODE_NXDOMAIN Definition: dns.h:196
@ PJ_DNS_RCODE_SERVFAIL Definition: dns.h:195
@ PJ_DNS_RCODE_NOTIMPL Definition: dns.h:197
@ PJ_DNS_RCODE_NXRRSET Definition: dns.h:201
@ PJ_DNS_RCODE_YXDOMAIN Definition: dns.h:199
@ PJ_DNS_RCODE_FORMERR Definition: dns.h:194
@ PJ_DNS_RCODE_NOTAUTH Definition: dns.h:202
@ PJ_DNS_TYPE_DNSKEY Definition: dns.h:120
@ PJ_DNS_TYPE_PX Definition: dns.h:98
@ PJ_DNS_TYPE_SIG Definition: dns.h:96
@ PJ_DNS_TYPE_SSHFP Definition: dns.h:116
@ PJ_DNS_TYPE_WKS Definition: dns.h:83
@ PJ_DNS_TYPE_MINFO Definition: dns.h:86
@ PJ_DNS_TYPE_IPSECKEY Definition: dns.h:117
@ PJ_DNS_TYPE_RT Definition: dns.h:93
@ PJ_DNS_TYPE_KEY Definition: dns.h:97
@ PJ_DNS_TYPE_LOC Definition: dns.h:101
@ PJ_DNS_TYPE_A Definition: dns.h:73
@ PJ_DNS_TYPE_PTR Definition: dns.h:84
@ PJ_DNS_TYPE_GPOS Definition: dns.h:99
@ PJ_DNS_TYPE_SOA Definition: dns.h:78
@ PJ_DNS_TYPE_RRSIG Definition: dns.h:118
@ PJ_DNS_TYPE_ISDN Definition: dns.h:92
@ PJ_DNS_TYPE_DNAME Definition: dns.h:111
@ PJ_DNS_TYPE_MB Definition: dns.h:79
@ PJ_DNS_TYPE_CERT Definition: dns.h:109
@ PJ_DNS_TYPE_SRV Definition: dns.h:105
@ PJ_DNS_TYPE_AFSB Definition: dns.h:90
@ PJ_DNS_TYPE_MF Definition: dns.h:76
@ PJ_DNS_TYPE_X25 Definition: dns.h:91
@ PJ_DNS_TYPE_OPT Definition: dns.h:113
@ PJ_DNS_TYPE_AAAA Definition: dns.h:100
@ PJ_DNS_TYPE_APL Definition: dns.h:114
@ PJ_DNS_TYPE_NULL Definition: dns.h:82
@ PJ_DNS_TYPE_NIMLOC Definition: dns.h:104
@ PJ_DNS_TYPE_NAPTR Definition: dns.h:107
@ PJ_DNS_TYPE_CNAME Definition: dns.h:77
@ PJ_DNS_TYPE_EID Definition: dns.h:103
@ PJ_DNS_TYPE_ATMA Definition: dns.h:106
@ PJ_DNS_TYPE_MX Definition: dns.h:87
@ PJ_DNS_TYPE_MG Definition: dns.h:80
@ PJ_DNS_TYPE_KX Definition: dns.h:108
@ PJ_DNS_TYPE_A6 Definition: dns.h:110
@ PJ_DNS_TYPE_RP Definition: dns.h:89
@ PJ_DNS_TYPE_DS Definition: dns.h:115
@ PJ_DNS_TYPE_NS Definition: dns.h:74
@ PJ_DNS_TYPE_HINFO Definition: dns.h:85
@ PJ_DNS_TYPE_NSEC Definition: dns.h:119
@ PJ_DNS_TYPE_TXT Definition: dns.h:88
@ PJ_DNS_TYPE_NSAP_PTR Definition: dns.h:95
@ PJ_DNS_TYPE_MD Definition: dns.h:75
@ PJ_DNS_TYPE_NSAP Definition: dns.h:94
@ PJ_DNS_TYPE_NXT Definition: dns.h:102
@ PJ_DNS_TYPE_MR Definition: dns.h:81
@ PJ_DNS_NO_NS Definition: dns.h:300
@ PJ_DNS_NO_ANS Definition: dns.h:299
@ PJ_DNS_NO_AR Definition: dns.h:301
@ PJ_DNS_NO_QD Definition: dns.h:298
struct in_addr pj_in_addr
struct in6_addr pj_in6_addr
pj_uint16_t nscount Definition: dns.h:139
pj_uint16_t id Definition: dns.h:135
pj_uint16_t qdcount Definition: dns.h:137
pj_uint16_t flags Definition: dns.h:136
pj_uint16_t arcount Definition: dns.h:140
pj_uint16_t anscount Definition: dns.h:138
pj_dns_parsed_query * q Definition: dns.h:285
pj_dns_hdr hdr Definition: dns.h:284
pj_dns_parsed_rr * ns Definition: dns.h:287
pj_dns_parsed_rr * ans Definition: dns.h:286
pj_dns_parsed_rr * arr Definition: dns.h:288
pj_uint16_t dnsclass Definition: dns.h:215
pj_str_t name Definition: dns.h:213
pj_uint16_t type Definition: dns.h:214
pj_in_addr ip_addr Definition: dns.h:264
pj_in6_addr ip_addr Definition: dns.h:269
pj_str_t name Definition: dns.h:249
pj_str_t name Definition: dns.h:254
pj_str_t name Definition: dns.h:259
pj_uint16_t port Definition: dns.h:243
pj_uint16_t prio Definition: dns.h:241
pj_uint16_t weight Definition: dns.h:242
pj_str_t target Definition: dns.h:244
pj_uint16_t type Definition: dns.h:226
pj_uint16_t rdlength Definition: dns.h:229
pj_uint16_t dnsclass Definition: dns.h:227
void * data Definition: dns.h:230
pj_str_t name Definition: dns.h:225
pj_uint32_t ttl Definition: dns.h:228
struct pj_dns_parsed_rr::rdata::aaaa aaaa
struct pj_dns_parsed_rr::rdata::cname cname
struct pj_dns_parsed_rr::rdata::ptr ptr
struct pj_dns_parsed_rr::rdata::a a
struct pj_dns_parsed_rr::rdata::srv srv
struct pj_dns_parsed_rr::rdata::ns ns
PJLIB-UTIL Open Source, small footprint, and portable asynchronous/caching DNS resolver, text scanner, STUN client, and XML library
Copyright (C) 2006-2009 Teluu Inc.
|