acl  3.5.3.0
acl_rfc1035.h 文件参考
+ acl_rfc1035.h 的引用(Include)关系图:
+ 此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

struct  ACL_RFC1035_RR
 
struct  ACL_RFC1035_QUERY
 
struct  ACL_RFC1035_MESSAGE
 
struct  ACL_RFC1035_REPLY
 

宏定义

#define ACL_RFC1035_MAXHOSTNAMESZ   256
 
#define ACL_RFC1035_TYPE_A   1 /* a host address */
 
#define ACL_RFC1035_TYPE_NS   2 /* an authoritative name server */
 
#define ACL_RFC1035_TYPE_MD   3 /* a mail destination (Obsolete - use MX) */
 
#define ACL_RFC1035_TYPE_MF   4 /* a mail forwarder (Obsolete - use MX) */
 
#define ACL_RFC1035_TYPE_CNAME   5 /* the canonical name for an alias */
 
#define ACL_RFC1035_TYPE_SOA   6 /* marks the start of a zone of authority */
 
#define ACL_RFC1035_TYPE_MB   7 /* a mailbox domain name (EXPERIMENTAL) */
 
#define ACL_RFC1035_TYPE_MG   8 /* a mail group member (EXPERIMENTAL) */
 
#define ACL_RFC1035_TYPE_MR   9 /* a mail rename domain name (EXPERIMENTAL) */
 
#define ACL_RFC1035_TYPE_NULL   10 /* a null RR (EXPERIMENTAL) */
 
#define ACL_RFC1035_TYPE_WKS   11 /* a well known service description */
 
#define ACL_RFC1035_TYPE_PTR   12 /* a domain name pointer */
 
#define ACL_RFC1035_TYPE_HINFO   13 /* host information */
 
#define ACL_RFC1035_TYPE_MINFO   14 /* mailbox or mail list information */
 
#define ACL_RFC1035_TYPE_MX   15 /* mail exchange */
 
#define ACL_RFC1035_TYPE_TXT   16 /* text strings */
 
#define ACL_RFC1035_TYPE_AAAA   28 /* a IPv6 address of host */
 
#define ACL_RFC1035_TYPE_AXFR   252 /* a request for a transfer of an entire zone */
 
#define ACL_RFC1035_TYPE_MAILB   253 /* a request for mailbox-related records (MB, MG or MR) */
 
#define ACL_RFC1035_TYPE_MAILA   253 /* a request for mail agent RRs (Obsolete - see MX) */
 
#define ACL_RFC1035_TYPE_ALL   255 /* a request for all records */
 
#define ACL_RFC1035_CLASS_IN   1 /* the Internet */
 
#define ACL_RFC1035_CLASS_CS   2 /* the CSNET class (Obsolete - used only for examples in some obsolete RFCs */
 
#define ACL_RFC1035_CLASS_CH   3 /* the CHAOS class */
 
#define ACL_RFC1035_CLASS_HS   4 /* Hesiod [Dyer 87] */
 

类型定义

typedef struct ACL_RFC1035_RR ACL_RFC1035_RR
 
typedef struct ACL_RFC1035_QUERY ACL_RFC1035_QUERY
 
typedef struct ACL_RFC1035_MESSAGE ACL_RFC1035_MESSAGE
 
typedef struct ACL_RFC1035_REPLY ACL_RFC1035_REPLY
 

函数

ACL_API const char * acl_rfc1035_strerror (int errnum)
 
ACL_API size_t acl_rfc1035_build_query4a (const char *hostname, char *buf, size_t sz, unsigned short qid, ACL_RFC1035_QUERY *query)
 
ACL_API size_t acl_rfc1035_build_query4aaaa (const char *hostname, char *buf, size_t sz, unsigned short qid, ACL_RFC1035_QUERY *query)
 
ACL_API size_t acl_rfc1035_build_query4mx (const char *hostname, char *buf, size_t sz, unsigned short qid, ACL_RFC1035_QUERY *query)
 
ACL_API size_t acl_rfc1035_build_query4ptr (const struct in_addr addr, char *buf, size_t sz, unsigned short qid, ACL_RFC1035_QUERY *query)
 
ACL_API void acl_rfc1035_set_query_id (char *buf, size_t sz, unsigned short qid)
 
ACL_API int acl_rfc1035_query_compare (const ACL_RFC1035_QUERY *a, const ACL_RFC1035_QUERY *b)
 
ACL_API ACL_RFC1035_MESSAGEacl_rfc1035_response_unpack (const char *buf, size_t sz)
 
ACL_API ACL_RFC1035_MESSAGEacl_rfc1035_request_unpack (const char *buf, size_t sz)
 
ACL_API void acl_rfc1035_message_destroy (ACL_RFC1035_MESSAGE *message)
 
ACL_API size_t acl_rfc1035_build_reply4a (const char *hostname, const ACL_ARGV *ips, const char *domain_root, const char *dnsname, const char *dnsip, unsigned short qid, char *buf, size_t sz)
 
ACL_API size_t acl_rfc1035_build_reply4aaaa (const char *hostname, const ACL_ARGV *ips, const char *domain_root, const char *dnsname, const char *dnsip, unsigned short qid, char *buf, size_t sz)
 
ACL_API size_t acl_rfc1035_build_reply (const ACL_RFC1035_REPLY *reply, char *buf, size_t sz)
 

宏定义说明

◆ ACL_RFC1035_CLASS_CH

#define ACL_RFC1035_CLASS_CH   3 /* the CHAOS class */

在文件 acl_rfc1035.h236 行定义.

◆ ACL_RFC1035_CLASS_CS

#define ACL_RFC1035_CLASS_CS   2 /* the CSNET class (Obsolete - used only for examples in some obsolete RFCs */

在文件 acl_rfc1035.h235 行定义.

◆ ACL_RFC1035_CLASS_HS

#define ACL_RFC1035_CLASS_HS   4 /* Hesiod [Dyer 87] */

在文件 acl_rfc1035.h237 行定义.

◆ ACL_RFC1035_CLASS_IN

#define ACL_RFC1035_CLASS_IN   1 /* the Internet */

在文件 acl_rfc1035.h234 行定义.

◆ ACL_RFC1035_MAXHOSTNAMESZ

#define ACL_RFC1035_MAXHOSTNAMESZ   256

在文件 acl_rfc1035.h16 行定义.

◆ ACL_RFC1035_TYPE_A

#define ACL_RFC1035_TYPE_A   1 /* a host address */

在文件 acl_rfc1035.h212 行定义.

◆ ACL_RFC1035_TYPE_AAAA

#define ACL_RFC1035_TYPE_AAAA   28 /* a IPv6 address of host */

在文件 acl_rfc1035.h228 行定义.

◆ ACL_RFC1035_TYPE_ALL

#define ACL_RFC1035_TYPE_ALL   255 /* a request for all records */

在文件 acl_rfc1035.h232 行定义.

◆ ACL_RFC1035_TYPE_AXFR

#define ACL_RFC1035_TYPE_AXFR   252 /* a request for a transfer of an entire zone */

在文件 acl_rfc1035.h229 行定义.

◆ ACL_RFC1035_TYPE_CNAME

#define ACL_RFC1035_TYPE_CNAME   5 /* the canonical name for an alias */

在文件 acl_rfc1035.h216 行定义.

◆ ACL_RFC1035_TYPE_HINFO

#define ACL_RFC1035_TYPE_HINFO   13 /* host information */

在文件 acl_rfc1035.h224 行定义.

◆ ACL_RFC1035_TYPE_MAILA

#define ACL_RFC1035_TYPE_MAILA   253 /* a request for mail agent RRs (Obsolete - see MX) */

在文件 acl_rfc1035.h231 行定义.

◆ ACL_RFC1035_TYPE_MAILB

#define ACL_RFC1035_TYPE_MAILB   253 /* a request for mailbox-related records (MB, MG or MR) */

在文件 acl_rfc1035.h230 行定义.

◆ ACL_RFC1035_TYPE_MB

#define ACL_RFC1035_TYPE_MB   7 /* a mailbox domain name (EXPERIMENTAL) */

在文件 acl_rfc1035.h218 行定义.

◆ ACL_RFC1035_TYPE_MD

#define ACL_RFC1035_TYPE_MD   3 /* a mail destination (Obsolete - use MX) */

在文件 acl_rfc1035.h214 行定义.

◆ ACL_RFC1035_TYPE_MF

#define ACL_RFC1035_TYPE_MF   4 /* a mail forwarder (Obsolete - use MX) */

在文件 acl_rfc1035.h215 行定义.

◆ ACL_RFC1035_TYPE_MG

#define ACL_RFC1035_TYPE_MG   8 /* a mail group member (EXPERIMENTAL) */

在文件 acl_rfc1035.h219 行定义.

◆ ACL_RFC1035_TYPE_MINFO

#define ACL_RFC1035_TYPE_MINFO   14 /* mailbox or mail list information */

在文件 acl_rfc1035.h225 行定义.

◆ ACL_RFC1035_TYPE_MR

#define ACL_RFC1035_TYPE_MR   9 /* a mail rename domain name (EXPERIMENTAL) */

在文件 acl_rfc1035.h220 行定义.

◆ ACL_RFC1035_TYPE_MX

#define ACL_RFC1035_TYPE_MX   15 /* mail exchange */

在文件 acl_rfc1035.h226 行定义.

◆ ACL_RFC1035_TYPE_NS

#define ACL_RFC1035_TYPE_NS   2 /* an authoritative name server */

在文件 acl_rfc1035.h213 行定义.

◆ ACL_RFC1035_TYPE_NULL

#define ACL_RFC1035_TYPE_NULL   10 /* a null RR (EXPERIMENTAL) */

在文件 acl_rfc1035.h221 行定义.

◆ ACL_RFC1035_TYPE_PTR

#define ACL_RFC1035_TYPE_PTR   12 /* a domain name pointer */

在文件 acl_rfc1035.h223 行定义.

◆ ACL_RFC1035_TYPE_SOA

#define ACL_RFC1035_TYPE_SOA   6 /* marks the start of a zone of authority */

在文件 acl_rfc1035.h217 行定义.

◆ ACL_RFC1035_TYPE_TXT

#define ACL_RFC1035_TYPE_TXT   16 /* text strings */

在文件 acl_rfc1035.h227 行定义.

◆ ACL_RFC1035_TYPE_WKS

#define ACL_RFC1035_TYPE_WKS   11 /* a well known service description */

在文件 acl_rfc1035.h222 行定义.

类型定义说明

◆ ACL_RFC1035_MESSAGE

◆ ACL_RFC1035_QUERY

◆ ACL_RFC1035_REPLY

◆ ACL_RFC1035_RR

函数说明

◆ acl_rfc1035_build_query4a()

ACL_API size_t acl_rfc1035_build_query4a ( const char *  hostname,
char *  buf,
size_t  sz,
unsigned short  qid,
ACL_RFC1035_QUERY query 
)

Builds a message buffer with a QUESTION to lookup A records for a hostname. Caller must allocate 'buf' which should probably be at least 512 octets. The 'szp' initially specifies the size of the buffer, on return it contains the size of the message (i.e. how much to write).

参数
hostname{const char*} the hostname to be resolved
buf{char*} the buffer for holding the query content
sz{size_t} the buffer's size
qid{unsigned short} the unique ID number for thie quering
query{ACL_RFC1035_QUERY*} if not null, it's qtype, qclass and hostname will be set.
返回
{size_t} return the size of the query in the buf, 0 return if some error happened.

◆ acl_rfc1035_build_query4aaaa()

ACL_API size_t acl_rfc1035_build_query4aaaa ( const char *  hostname,
char *  buf,
size_t  sz,
unsigned short  qid,
ACL_RFC1035_QUERY query 
)

Builds a message buffer with a QUESTION to lookup AAAA records for a hostname.

参数
hostname{const char*}
buf{char*}
sz{size_t}
qid{unsigned short}
query{ACL_RFC1035_QUERY*}
返回
{size_t}

◆ acl_rfc1035_build_query4mx()

ACL_API size_t acl_rfc1035_build_query4mx ( const char *  hostname,
char *  buf,
size_t  sz,
unsigned short  qid,
ACL_RFC1035_QUERY query 
)

Builds a message buffer with a QUESTION to lookup MX records for a hostname.

参数
hostname{const char*}
buf{char*}
sz{size_t}
qid{unsigned short}
query{ACL_RFC1035_QUERY*}
返回
{size_t}

◆ acl_rfc1035_build_query4ptr()

ACL_API size_t acl_rfc1035_build_query4ptr ( const struct in_addr  addr,
char *  buf,
size_t  sz,
unsigned short  qid,
ACL_RFC1035_QUERY query 
)

Builds a message buffer with a QUESTION to lookup PTR records for an address. Caller must allocate 'buf' which should probably be at least 512 octets. The 'szp' initially specifies the size of the buffer, on return it contains the size of the message (i.e. how much to write).

参数
addr{const struct in_addr} the addr to resolve for name
buf{char*} hold the query package
sz{size_t} the buf's size at least 512 octets
qid{unsigned short} the query ID
query{ACL_RFC1035_QUERY*} if no null, it's some member variable
返回
{size_t} Returns the size of the query in the buff

◆ acl_rfc1035_build_reply()

ACL_API size_t acl_rfc1035_build_reply ( const ACL_RFC1035_REPLY reply,
char *  buf,
size_t  sz 
)

◆ acl_rfc1035_build_reply4a()

ACL_API size_t acl_rfc1035_build_reply4a ( const char *  hostname,
const ACL_ARGV ips,
const char *  domain_root,
const char *  dnsname,
const char *  dnsip,
unsigned short  qid,
char *  buf,
size_t  sz 
)

Builds a response message for the query client.

参数
hostname{const char*} the name to be resolved
ips{const ACL_ARGV*} the ip list of the hostname
domain_root{const char*}
dnsname{const char*}
dnsip{const char*}
qid{unsigned short}
buf{char*} hold the result
sz{size_t} the buf's size
返回
{size_t} content size in buf

◆ acl_rfc1035_build_reply4aaaa()

ACL_API size_t acl_rfc1035_build_reply4aaaa ( const char *  hostname,
const ACL_ARGV ips,
const char *  domain_root,
const char *  dnsname,
const char *  dnsip,
unsigned short  qid,
char *  buf,
size_t  sz 
)

◆ acl_rfc1035_message_destroy()

ACL_API void acl_rfc1035_message_destroy ( ACL_RFC1035_MESSAGE message)

destroy and free the message created by RFC1035MessageUnpack()

参数
message{ACL_RFC1035_MESSAGE*}

◆ acl_rfc1035_query_compare()

ACL_API int acl_rfc1035_query_compare ( const ACL_RFC1035_QUERY a,
const ACL_RFC1035_QUERY b 
)

Compares two RFC1035_QUERY entries

参数
a{const ACL_RFC1035_QUERY *}
b{const ACL_RFC1035_QUERY *}
返回
Returns 0 (equal) or !=0 (different)

◆ acl_rfc1035_request_unpack()

ACL_API ACL_RFC1035_MESSAGE* acl_rfc1035_request_unpack ( const char *  buf,
size_t  sz 
)

Takes the contents of a DNS request and fills in an array of resource record structures. The records array is allocated here, and should be freed by calling acl_rfc1035_message_destroy().

参数
buf{const char*} the data of the DNS reply
sz{size_t} the buf's size
返回
{ACL_RFC1035_MESSAGE*} return the parsing result

◆ acl_rfc1035_response_unpack()

ACL_API ACL_RFC1035_MESSAGE* acl_rfc1035_response_unpack ( const char *  buf,
size_t  sz 
)

Takes the contents of a DNS reply and fills in an array of resource record structures. The records array is allocated here, and should be freed by calling acl_rfc1035_message_destroy().

参数
buf{const char*} the data of the DNS reply
sz{size_t} the buf's size
返回
{ACL_RFC1035_MESSAGE*} return the parsing result

◆ acl_rfc1035_set_query_id()

ACL_API void acl_rfc1035_set_query_id ( char *  buf,
size_t  sz,
unsigned short  qid 
)

We're going to retry a former query, but we just need a new ID for it. Lucky for us ID is the first field in the message buffer.

参数
buf{char*} hold the result
sz{size_t} the buf's size
qid{unsigned short} the query ID

◆ acl_rfc1035_strerror()

ACL_API const char* acl_rfc1035_strerror ( int  errnum)

Get error description with the specifed error number

参数
errnum{int}
返回
{const char*}