Functions to decode DNS packets.
More...
#include <freeradius-devel/io/test_point.h>
#include <freeradius-devel/util/dns.h>
#include <freeradius-devel/util/proto.h>
#include <freeradius-devel/util/struct.h>
#include "dns.h"
#include "attrs.h"
Go to the source code of this file.
|
static ssize_t | decode_option (TALLOC_CTX *ctx, fr_pair_list_t *out, fr_dict_attr_t const *parent, uint8_t const *data, size_t const data_len, void *decode_ctx) |
|
static ssize_t | decode_proto (TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *data, size_t data_len, void *proto_ctx) |
|
static ssize_t | decode_record (TALLOC_CTX *ctx, fr_pair_list_t *out, fr_dict_attr_t const *attr, uint8_t const *rr, uint8_t const *end, fr_dns_ctx_t *packet_ctx, uint8_t const *counter) |
|
static ssize_t | decode_rr (TALLOC_CTX *ctx, fr_pair_list_t *out, UNUSED fr_dict_attr_t const *parent, uint8_t const *data, size_t data_len, void *decode_ctx) |
| Decode DNS RR. More...
|
|
static int | decode_test_ctx (void **out, TALLOC_CTX *ctx) |
|
static ssize_t | decode_tlv_trampoline (TALLOC_CTX *ctx, fr_pair_list_t *out, fr_dict_attr_t const *parent, uint8_t const *data, size_t const data_len, void *decode_ctx) |
|
static ssize_t | decode_value (TALLOC_CTX *ctx, fr_pair_list_t *out, fr_dict_attr_t const *parent, uint8_t const *data, size_t const data_len, void *decode_ctx) |
|
static ssize_t | decode_value_trampoline (TALLOC_CTX *ctx, fr_pair_list_t *out, fr_dict_attr_t const *parent, uint8_t const *data, size_t const data_len, void *decode_ctx) |
|
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...
|
|
Functions to decode DNS packets.
- Id
- 6097a513850db9c462ca00b8bf7555072dc178c0
- Author
- Alan DeKok (aland.nosp@m.@fre.nosp@m.eradi.nosp@m.us.o.nosp@m.rg)
- Copyright
- 2021 The FreeRADIUS server project
-
2021 NetworkRADIUS SARL (legal.nosp@m.@net.nosp@m.workr.nosp@m.adiu.nosp@m.s.com)
Definition in file decode.c.
◆ DNS_GET_OPTION_LEN
◆ DNS_GET_OPTION_NUM
◆ decode_option()
◆ decode_proto()
◆ decode_record()
◆ decode_rr()
Decode DNS RR.
- Parameters
-
[in] | ctx | context to alloc new attributes in. |
[in,out] | out | Where to write the decoded options. |
[in] | parent | to lookup attributes in. |
[in] | data | to parse. |
[in] | data_len | of data to parse. |
[in] | decode_ctx | Unused. |
Definition at line 338 of file decode.c.
◆ decode_test_ctx()
static int decode_test_ctx |
( |
void ** |
out, |
|
|
TALLOC_CTX * |
ctx |
|
) |
| |
|
static |
◆ decode_tlv_trampoline()
◆ decode_value()
◆ decode_value_trampoline()
◆ fr_dns_decode()
Decode a DNS packet.
Definition at line 265 of file decode.c.
◆ dns_tp_decode_pair
Initial value:= {
}
static ssize_t decode_rr(TALLOC_CTX *ctx, fr_pair_list_t *out, UNUSED fr_dict_attr_t const *parent, uint8_t const *data, size_t data_len, void *decode_ctx)
Decode DNS RR.
static int decode_test_ctx(void **out, TALLOC_CTX *ctx)
Definition at line 448 of file decode.c.
◆ dns_tp_decode_proto
Initial value:= {
}
static ssize_t decode_proto(TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *data, size_t data_len, void *proto_ctx)
Definition at line 454 of file decode.c.
◆ fr_dns_reason_fail_table
Initial value:= {
}
#define L(_str)
Helper for initialising arrays of string literals.
@ FR_DNS_DECODE_FAIL_ANSWERS_IN_QUESTION
@ FR_DNS_DECODE_FAIL_TOO_MANY_RRS
@ FR_DNS_DECODE_FAIL_RR_OVERFLOWS_PACKET
@ FR_DNS_DECODE_FAIL_INVALID_RR_LABEL
@ FR_DNS_DECODE_FAIL_POINTER_TO_NON_LABEL
@ FR_DNS_DECODE_FAIL_INVALID_POINTER
@ FR_DNS_DECODE_FAIL_POINTER_OVERFLOWS_PACKET
@ FR_DNS_DECODE_FAIL_LABEL_OVERFLOWS_PACKET
@ FR_DNS_DECODE_FAIL_MISSING_TLV_HEADER
@ FR_DNS_DECODE_FAIL_UNEXPECTED
@ FR_DNS_DECODE_FAIL_POINTER_TO_HEADER
@ FR_DNS_DECODE_FAIL_ZERO_RR_LEN
@ FR_DNS_DECODE_FAIL_LABEL_TOO_LONG
@ FR_DNS_DECODE_FAIL_TOO_FEW_RRS
@ FR_DNS_DECODE_FAIL_MISSING_RR_LEN
@ FR_DNS_DECODE_FAIL_MISSING_QD_HEADER
@ FR_DNS_DECODE_FAIL_MAX_LENGTH_PACKET
@ FR_DNS_DECODE_FAIL_NS_IN_QUESTION
@ FR_DNS_DECODE_FAIL_NO_QUESTIONS
@ FR_DNS_DECODE_FAIL_NONE
@ FR_DNS_DECODE_FAIL_TLV_OVERFLOWS_RR
@ FR_DNS_DECODE_FAIL_POINTER_LOOPS
@ FR_DNS_DECODE_FAIL_MISSING_RR_HEADER
@ FR_DNS_DECODE_FAIL_MIN_LENGTH_PACKET
Definition at line 387 of file decode.c.
◆ fr_dns_reason_fail_table_len