![]() |
The FreeRADIUS server $Id: f3670dba8951ca10eb4948feb3dc3db9423a334f $
|
Implementation of the DNS protocol. More...
#include <freeradius-devel/util/packet.h>#include <freeradius-devel/util/dns.h>
Include dependency graph for dns.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | fr_dns_attr_flags_t |
| struct | fr_dns_ctx_t |
| struct | fr_dns_packet_t |
Macros | |
| #define | DNS_HDR_LEN (12) |
| #define | DNS_MAX_ATTRIBUTES 255 |
| #define | FR_DNS_PACKET_CODE_VALID(_code) (((_code) < FR_DNS_CODE_MAX) || (((_code & 0x10) != 0) && ((_code & ~0x10) < FR_DNS_CODE_MAX))) |
Functions | |
| static fr_dns_attr_flags_t const * | fr_dns_attr_flags (fr_dict_attr_t const *da) |
| Return DNS-specific flags for a given attribute. | |
| ssize_t | fr_dns_decode (TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *packet, size_t packet_len, fr_dns_ctx_t *packet_ctx) |
| Decode a DNS packet. | |
| ssize_t | fr_dns_encode (fr_dbuff_t *dbuff, fr_pair_list_t *vps, fr_dns_ctx_t *encode_ctx) |
| Encode a DNS packet. | |
| static bool | fr_dns_flag_dns_label (fr_dict_attr_t const *da) |
| static bool | fr_dns_flag_dns_label_any (fr_dict_attr_t const *da) |
| static bool | fr_dns_flag_dns_label_uncompressed (fr_dict_attr_t const *da) |
| void | fr_dns_global_free (void) |
| int | fr_dns_global_init (void) |
| Resolve/cache attributes in the DNS dictionary. | |
| fr_dns_labels_t * | fr_dns_labels_get (uint8_t const *packet, size_t packet_len, bool init_mark) |
| bool | fr_dns_packet_ok (uint8_t const *packet, size_t packet_len, bool query, fr_dns_decode_fail_t *reason) |
Variables | |
| char const * | fr_dns_packet_names [FR_DNS_CODE_MAX] |
| fr_table_num_ordered_t | fr_dns_reason_fail_table [] |
| size_t | fr_dns_reason_fail_table_len |
| fr_dict_protocol_t | libfreeradius_dns_dict_protocol |
Implementation of the DNS protocol.
Definition in file dns.h.
| struct fr_dns_attr_flags_t |
| struct fr_dns_ctx_t |
Collaboration diagram for fr_dns_ctx_t:| Data Fields | ||
|---|---|---|
| fr_dns_labels_t * | lb | |
| uint8_t const * | packet | DNS labels can point anywhere in the packet :(. |
| size_t | packet_len | |
| TALLOC_CTX * | tmp_ctx | for temporary things cleaned up during decoding |
| struct fr_dns_packet_t |
| Data Fields | ||
|---|---|---|
| uint16_t | ancount | |
| uint16_t | arcount | |
| unsigned int | authentic_data: 1 | |
| unsigned int | authoritative: 1 | |
| unsigned int | checking_disabled: 1 | |
| uint16_t | id | |
| uint16_t | nscount | |
| unsigned int | opcode: 4 | |
| uint16_t | qdcount | |
| unsigned int | query: 1 | |
| unsigned int | rcode: 4 | |
| unsigned int | recursion_available: 1 | |
| unsigned int | recursion_desired: 1 | |
| unsigned int | reserved: 1 | |
| unsigned int | truncated: 1 | |
| #define FR_DNS_PACKET_CODE_VALID | ( | _code | ) | (((_code) < FR_DNS_CODE_MAX) || (((_code & 0x10) != 0) && ((_code & ~0x10) < FR_DNS_CODE_MAX))) |
| enum fr_dns_decode_fail_t |
| enum fr_dns_packet_code_t |
|
inlinestatic |
Return DNS-specific flags for a given attribute.
Assert in debug builds when the attribute belongs to another dictionary, as the flags of one protocol say nothing about an attribute of another.
If the attribute does not carry the protocol-specific extension, then assert. Other builds log the error and return zeroed flags instead of NULL.
Definition at line 151 of file dns.h.
Here is the call graph for this function:
Here is the caller graph for this function:| ssize_t fr_dns_decode | ( | TALLOC_CTX * | ctx, |
| fr_pair_list_t * | out, | ||
| uint8_t const * | packet, | ||
| size_t | packet_len, | ||
| fr_dns_ctx_t * | packet_ctx | ||
| ) |
| ssize_t fr_dns_encode | ( | fr_dbuff_t * | dbuff, |
| fr_pair_list_t * | vps, | ||
| fr_dns_ctx_t * | encode_ctx | ||
| ) |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
| void fr_dns_global_free | ( | void | ) |
| int fr_dns_global_init | ( | void | ) |
| fr_dns_labels_t * fr_dns_labels_get | ( | uint8_t const * | packet, |
| size_t | packet_len, | ||
| bool | init_mark | ||
| ) |
| bool fr_dns_packet_ok | ( | uint8_t const * | packet, |
| size_t | packet_len, | ||
| bool | query, | ||
| fr_dns_decode_fail_t * | reason | ||
| ) |
|
extern |
|
extern |
|
extern |
1.9.8