Implementation of the DNS protocol.
More...
#include <freeradius-devel/util/packet.h>
#include <freeradius-devel/util/dns.h>
Go to the source code of this file.
|
enum | fr_dns_decode_fail_t {
FR_DNS_DECODE_FAIL_NONE = 0
,
FR_DNS_DECODE_FAIL_MIN_LENGTH_PACKET
,
FR_DNS_DECODE_FAIL_MAX_LENGTH_PACKET
,
FR_DNS_DECODE_FAIL_UNEXPECTED
,
FR_DNS_DECODE_FAIL_NO_QUESTIONS
,
FR_DNS_DECODE_FAIL_ANSWERS_IN_QUESTION
,
FR_DNS_DECODE_FAIL_NS_IN_QUESTION
,
FR_DNS_DECODE_FAIL_INVALID_RR_LABEL
,
FR_DNS_DECODE_FAIL_MISSING_RR_HEADER
,
FR_DNS_DECODE_FAIL_MISSING_RR_LEN
,
FR_DNS_DECODE_FAIL_ZERO_RR_LEN
,
FR_DNS_DECODE_FAIL_RR_OVERFLOWS_PACKET
,
FR_DNS_DECODE_FAIL_TOO_MANY_RRS
,
FR_DNS_DECODE_FAIL_TOO_FEW_RRS
,
FR_DNS_DECODE_FAIL_POINTER_TO_NON_LABEL
,
FR_DNS_DECODE_FAIL_POINTER_OVERFLOWS_PACKET
,
FR_DNS_DECODE_FAIL_POINTER_TO_HEADER
,
FR_DNS_DECODE_FAIL_POINTER_LOOPS
,
FR_DNS_DECODE_FAIL_INVALID_POINTER
,
FR_DNS_DECODE_FAIL_LABEL_OVERFLOWS_PACKET
,
FR_DNS_DECODE_FAIL_LABEL_TOO_LONG
,
FR_DNS_DECODE_FAIL_MISSING_QD_HEADER
,
FR_DNS_DECODE_FAIL_MISSING_TLV_HEADER
,
FR_DNS_DECODE_FAIL_TLV_OVERFLOWS_RR
,
FR_DNS_DECODE_FAIL_MAX
} |
|
enum | fr_dns_packet_code_t {
FR_DNS_QUERY = 0
,
FR_DNS_INVERSE_QUERY = 1
,
FR_DNS_STATUS = 2
,
FR_DNS_NOTIFY = 4
,
FR_DNS_UPDATE = 5
,
FR_DNS_STATEFUL_OPERATION = 6
,
FR_DNS_CODE_MAX = 7
,
FR_DNS_QUERY_RESPONSE = 16
,
FR_DNS_INVERSE_QUERY_RESPONSE = 17
,
FR_DNS_STATUS_RESPONSE = 18
,
FR_DNS_NOTIFY_RESPONSE = 20
,
FR_DNS_UPDATE_RESPONSE = 21
,
FR_DNS_STATEFUL_OPERATION_RESPONSE = 22
,
FR_DNS_DO_NOT_RESPOND = 256
} |
|
|
static fr_dns_attr_flags_t const * | fr_dns_attr_flags (fr_dict_attr_t const *da) |
|
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. More...
|
|
ssize_t | fr_dns_encode (fr_dbuff_t *dbuff, fr_pair_list_t *vps, fr_dns_ctx_t *encode_ctx) |
| Encode a DNS packet. More...
|
|
static bool | fr_dns_flag_dns_label_any (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. More...
|
|
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) |
|
Implementation of the DNS protocol.
- Id
- ccd4976e6e62129e2296fc9db32c33ed27714112
- Copyright
- 2021 Network RADIUS SAS (legal.nosp@m.@net.nosp@m.workr.nosp@m.adiu.nosp@m.s.com)
Definition in file dns.h.
◆ fr_dns_attr_flags_t
struct fr_dns_attr_flags_t |
Definition at line 134 of file dns.h.
Data Fields |
bool |
dns_label |
|
bool |
dns_label_uncompressed |
|
◆ fr_dns_ctx_t
Definition at line 73 of file dns.h.
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 |
◆ fr_dns_packet_t
Definition at line 37 of file dns.h.
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 |
|
◆ DNS_HDR_LEN
◆ DNS_MAX_ATTRIBUTES
#define DNS_MAX_ATTRIBUTES 255 |
Definition at line 35 of file dns.h.
◆ fr_dns_flag_dns_label
◆ fr_dns_flag_dns_label_uncompressed
◆ FR_DNS_PACKET_CODE_VALID
◆ fr_dns_decode_fail_t
Enumerator |
---|
FR_DNS_DECODE_FAIL_NONE | |
FR_DNS_DECODE_FAIL_MIN_LENGTH_PACKET | |
FR_DNS_DECODE_FAIL_MAX_LENGTH_PACKET | |
FR_DNS_DECODE_FAIL_UNEXPECTED | |
FR_DNS_DECODE_FAIL_NO_QUESTIONS | |
FR_DNS_DECODE_FAIL_ANSWERS_IN_QUESTION | |
FR_DNS_DECODE_FAIL_NS_IN_QUESTION | |
FR_DNS_DECODE_FAIL_INVALID_RR_LABEL | |
FR_DNS_DECODE_FAIL_MISSING_RR_HEADER | |
FR_DNS_DECODE_FAIL_MISSING_RR_LEN | |
FR_DNS_DECODE_FAIL_ZERO_RR_LEN | |
FR_DNS_DECODE_FAIL_RR_OVERFLOWS_PACKET | |
FR_DNS_DECODE_FAIL_TOO_MANY_RRS | |
FR_DNS_DECODE_FAIL_TOO_FEW_RRS | |
FR_DNS_DECODE_FAIL_POINTER_TO_NON_LABEL | |
FR_DNS_DECODE_FAIL_POINTER_OVERFLOWS_PACKET | |
FR_DNS_DECODE_FAIL_POINTER_TO_HEADER | |
FR_DNS_DECODE_FAIL_POINTER_LOOPS | |
FR_DNS_DECODE_FAIL_INVALID_POINTER | |
FR_DNS_DECODE_FAIL_LABEL_OVERFLOWS_PACKET | |
FR_DNS_DECODE_FAIL_LABEL_TOO_LONG | |
FR_DNS_DECODE_FAIL_MISSING_QD_HEADER | |
FR_DNS_DECODE_FAIL_MISSING_TLV_HEADER | |
FR_DNS_DECODE_FAIL_TLV_OVERFLOWS_RR | |
FR_DNS_DECODE_FAIL_MAX | |
Definition at line 102 of file dns.h.
◆ fr_dns_packet_code_t
Enumerator |
---|
FR_DNS_QUERY | |
FR_DNS_INVERSE_QUERY | |
FR_DNS_STATUS | |
FR_DNS_NOTIFY | |
FR_DNS_UPDATE | |
FR_DNS_STATEFUL_OPERATION | |
FR_DNS_CODE_MAX | |
FR_DNS_QUERY_RESPONSE | |
FR_DNS_INVERSE_QUERY_RESPONSE | |
FR_DNS_STATUS_RESPONSE | |
FR_DNS_NOTIFY_RESPONSE | |
FR_DNS_UPDATE_RESPONSE | |
FR_DNS_STATEFUL_OPERATION_RESPONSE | |
FR_DNS_DO_NOT_RESPOND | |
Definition at line 83 of file dns.h.
◆ fr_dns_attr_flags()
◆ fr_dns_decode()
Decode a DNS packet.
Definition at line 265 of file decode.c.
◆ fr_dns_encode()
Encode a DNS packet.
Definition at line 451 of file encode.c.
◆ fr_dns_flag_dns_label_any()
◆ fr_dns_global_free()
void fr_dns_global_free |
( |
void |
| ) |
|
◆ fr_dns_global_init()
int fr_dns_global_init |
( |
void |
| ) |
|
Resolve/cache attributes in the DNS dictionary.
- Returns
- 0 on success.
- -1 on failure.
Definition at line 412 of file base.c.
◆ fr_dns_labels_get()
◆ fr_dns_packet_ok()
◆ fr_dns_packet_names
◆ fr_dns_reason_fail_table
◆ fr_dns_reason_fail_table_len
size_t fr_dns_reason_fail_table_len |
|
extern |