Functions to decode DHCP options.
More...
#include <freeradius-devel/io/test_point.h>
#include <freeradius-devel/util/proto.h>
#include <freeradius-devel/util/struct.h>
#include <freeradius-devel/util/dns.h>
#include "dhcpv4.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_option_wrapper (TALLOC_CTX *ctx, fr_pair_list_t *out, NDEBUG_UNUSED fr_dict_attr_t const *parent, uint8_t const *data, size_t data_len, void *decode_ctx) |
|
static int | decode_test_ctx (void **out, TALLOC_CTX *ctx, UNUSED fr_dict_t const *dict) |
|
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 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) |
| Handle arrays of DNS labels for fr_struct_from_network()
|
|
static ssize_t | decode_vsa (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) |
| RFC 4243 Vendor Specific Suboptions.
|
|
ssize_t | fr_dhcpv4_decode_foreign (TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *data, size_t data_len) |
|
ssize_t | fr_dhcpv4_decode_option (TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *data, size_t data_len, void *decode_ctx) |
| Decode DHCP option.
|
|
static ssize_t | fr_dhcpv4_decode_proto (TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *data, size_t data_len, UNUSED void *proto_ctx) |
|
static bool | verify_tlvs (uint8_t const *data, size_t data_len) |
|
Functions to decode DHCP options.
- Id
- 2b1da445986e08f1de2618b250c4f15aa3ba2cb4
- Copyright
- 2008,2017 The FreeRADIUS server project
-
2008 Alan DeKok (aland.nosp@m.@dep.nosp@m.loyin.nosp@m.grad.nosp@m.ius.c.nosp@m.om)
-
2015,2017 Arran Cudbard-Bell (a.cud.nosp@m.bard.nosp@m.b@fre.nosp@m.erad.nosp@m.ius.o.nosp@m.rg)
Definition in file decode.c.
◆ decode_option()
◆ decode_option_wrapper()
◆ decode_test_ctx()
static int decode_test_ctx |
( |
void ** |
out, |
|
|
TALLOC_CTX * |
ctx, |
|
|
UNUSED fr_dict_t const * |
dict |
|
) |
| |
|
static |
◆ decode_tlv_trampoline()
◆ decode_value()
◆ decode_value_trampoline()
◆ decode_vsa()
RFC 4243 Vendor Specific Suboptions.
Vendor specific suboptions are in the format.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Enterprise Number 0 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Len 0 | /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/ Suboption Data 0 /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Enterprise Number n |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Len n | /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/ Suboption Data n /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
So although the vendor is identified, the format of the data isn't specified so we can't actually resolve the suboption to an attribute. For now, we just convert it to an attribute of Vendor-Specific-Information with raw octets contents.
Definition at line 349 of file decode.c.
◆ fr_dhcpv4_decode_foreign()
◆ fr_dhcpv4_decode_option()
Decode DHCP option.
- Parameters
-
[in] | ctx | context to alloc new attributes in. |
[out] | out | Where to write the decoded options. |
[in] | data | to parse. |
[in] | data_len | of data to parse. |
[in] | decode_ctx | Unused. |
Definition at line 538 of file decode.c.
◆ fr_dhcpv4_decode_proto()
◆ verify_tlvs()
◆ concat_buffer
_Thread_local uint8_t concat_buffer[1500] |
|
static |
◆ dhcpv4_tp_decode_pair
Initial value:= {
}
static int decode_test_ctx(void **out, TALLOC_CTX *ctx, UNUSED fr_dict_t const *dict)
static ssize_t decode_option_wrapper(TALLOC_CTX *ctx, fr_pair_list_t *out, NDEBUG_UNUSED fr_dict_attr_t const *parent, uint8_t const *data, size_t data_len, void *decode_ctx)
Definition at line 725 of file decode.c.
◆ dhcpv4_tp_decode_proto
Initial value:= {
}
static ssize_t fr_dhcpv4_decode_proto(TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *data, size_t data_len, UNUSED void *proto_ctx)
Definition at line 731 of file decode.c.