The FreeRADIUS server
$Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
Functions to parse and construct ethernet headers. More...
#include "ethernet.h"
#include <string.h>
#include <arpa/inet.h>
#include <freeradius-devel/io/proto.h>
Go to the source code of this file.
Functions | |
static ssize_t | fr_ethernet_decode (void *proto_ctx, uint8_t const *data, size_t data_len) |
Decodes an ethernet header with up to two levels of VLAN nesting. More... | |
static ssize_t | fr_ethernet_encode (void *proto_ctx, uint8_t *data, size_t data_len) |
Encodes an ethernet header and up to two levels of VLAN nesting. More... | |
static int | fr_ethernet_get_option (fr_value_box_t *out, void const *proto_ctx, fr_proto_opt_group_t group, int opt) |
Retrieve an option value from the proto_ctx. More... | |
static void | fr_ethernet_invert (void *proto_ctx) |
Inverts addresses, so that a decoder proto_ctx can be used for encoding. More... | |
static int | fr_ethernet_set_option (void *proto_ctx, fr_proto_opt_group_t group, int opt, fr_value_box_t *in) |
Set an option in the proto_ctx. More... | |
Variables | |
fr_proto_lib_t const | libfreeradius_ethernet |
Functions to parse and construct ethernet headers.
Definition in file ethernet.c.
|
static |
Decodes an ethernet header with up to two levels of VLAN nesting.
Technically this should be a .1Q protocol, but because of how .1Q subsumes the ether_type field, it's just easier to munge it together with the ethernet decoder.
[out] | proto_ctx | Header information extracted from the ethernet frame, and any additional VLAN tags discovered. Must point to memory of the size indicated by the fr_proto_lib_t struct exported by this library. |
[in] | data | Start of packet data. |
[in] | data_len | of the data. |
Definition at line 44 of file ethernet.c.
Encodes an ethernet header and up to two levels of VLAN nesting.
[in] | proto_ctx | produced by fr_ethernet_decode, or by the code creating a new packet. |
[out] | data | Where to write output data. |
[in] | data_len | Length of the output buffer. |
Definition at line 148 of file ethernet.c.
|
static |
Retrieve an option value from the proto_ctx.
[out] | out | value box to place option value into. |
[in] | proto_ctx | to retrieve value from. |
[in] | group | Option group. Which collection of options to query. |
[in] | opt | Option to retrieve. |
Definition at line 260 of file ethernet.c.
|
static |
Inverts addresses, so that a decoder proto_ctx can be used for encoding.
[in] | proto_ctx | created by the user or decoder. |
Definition at line 237 of file ethernet.c.
|
static |
Set an option in the proto_ctx.
[in] | proto_ctx | to set value in. |
[in] | group | Option group. Which collection of options opt exists in. |
[in] | opt | Option to set. |
[in] | in | value to set. |
Definition at line 333 of file ethernet.c.
fr_proto_lib_t const libfreeradius_ethernet |
Definition at line 403 of file ethernet.c.