The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Functions | Variables
proto_arp_ethernet.c File Reference

ARP handler for ethernet. More...

#include <netdb.h>
#include <freeradius-devel/server/protocol.h>
#include <freeradius-devel/util/trie.h>
#include <freeradius-devel/io/application.h>
#include <freeradius-devel/io/listen.h>
#include <freeradius-devel/io/schedule.h>
#include "proto_arp.h"
+ Include dependency graph for proto_arp_ethernet.c:

Go to the source code of this file.

Data Structures

struct  proto_arp_ethernet_t
 
struct  proto_arp_ethernet_thread_t
 

Functions

static int mod_bootstrap (module_inst_ctx_t const *mctx)
 
static char const * mod_name (fr_listen_t *li)
 
static int mod_open (fr_listen_t *li)
 Open a pcap file for ARP. More...
 
static ssize_t mod_read (fr_listen_t *li, UNUSED void **packet_ctx, fr_time_t *recv_time_p, uint8_t *buffer, size_t buffer_len, size_t *leftover)
 
static ssize_t mod_write (fr_listen_t *li, UNUSED void *packet_ctx, UNUSED fr_time_t request_time, uint8_t *buffer, size_t buffer_len, UNUSED size_t written)
 

Variables

static conf_parser_t const arp_listen_config []
 How to parse an ARP listen section. More...
 
fr_app_io_t proto_arp_ethernet
 

Detailed Description

ARP handler for ethernet.

Id
6e27fac8d8033e27152d3b777dff2b6f030f8239

Definition in file proto_arp_ethernet.c.


Data Structure Documentation

◆ proto_arp_ethernet_t

struct proto_arp_ethernet_t

Definition at line 41 of file proto_arp_ethernet.c.

+ Collaboration diagram for proto_arp_ethernet_t:
Data Fields
CONF_SECTION * cs our configuration
char const * filter Additional PCAP filter.
char const * interface Interface to bind to.

◆ proto_arp_ethernet_thread_t

struct proto_arp_ethernet_thread_t

Definition at line 36 of file proto_arp_ethernet.c.

Data Fields
char const * name socket name
fr_pcap_t * pcap PCAP handler.

Function Documentation

◆ mod_bootstrap()

static int mod_bootstrap ( module_inst_ctx_t const *  mctx)
static

Definition at line 219 of file proto_arp_ethernet.c.

◆ mod_name()

static char const* mod_name ( fr_listen_t li)
static

Definition at line 211 of file proto_arp_ethernet.c.

◆ mod_open()

static int mod_open ( fr_listen_t li)
static

Open a pcap file for ARP.

Definition at line 168 of file proto_arp_ethernet.c.

+ Here is the call graph for this function:

◆ mod_read()

static ssize_t mod_read ( fr_listen_t li,
UNUSED void **  packet_ctx,
fr_time_t recv_time_p,
uint8_t buffer,
size_t  buffer_len,
size_t leftover 
)
static

Definition at line 60 of file proto_arp_ethernet.c.

◆ mod_write()

static ssize_t mod_write ( fr_listen_t li,
UNUSED void *  packet_ctx,
UNUSED fr_time_t  request_time,
uint8_t buffer,
size_t  buffer_len,
UNUSED size_t  written 
)
static

Definition at line 109 of file proto_arp_ethernet.c.

Variable Documentation

◆ arp_listen_config

conf_parser_t const arp_listen_config[]
static
Initial value:
= {
interface), .dflt = "eth0" },
{ FR_CONF_OFFSET("filter", proto_arp_ethernet_t, filter) },
}
#define CONF_PARSER_TERMINATOR
Definition: cf_parse.h:626
#define FR_CONF_OFFSET(_name, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
Definition: cf_parse.h:268
#define FR_CONF_OFFSET_FLAGS(_name, _flags, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
Definition: cf_parse.h:256
@ CONF_FLAG_NOT_EMPTY
CONF_PAIR is required to have a non zero length value.
Definition: cf_parse.h:421

How to parse an ARP listen section.

Definition at line 51 of file proto_arp_ethernet.c.

◆ proto_arp_ethernet

fr_app_io_t proto_arp_ethernet
Initial value:
= {
.common = {
.name = "arp_ethernet",
.config = arp_listen_config,
.inst_size = sizeof(proto_arp_ethernet_t),
.thread_inst_size = sizeof(proto_arp_ethernet_thread_t),
.bootstrap = mod_bootstrap,
},
.default_message_size = FR_ARP_PACKET_SIZE,
.open = mod_open,
.read = mod_read,
.write = mod_write,
.get_name = mod_name,
}
#define FR_ARP_PACKET_SIZE
Definition: arp.h:37
#define MODULE_MAGIC_INIT
Stop people using different module/library/server versions together.
Definition: dl_module.h:65
static ssize_t mod_write(fr_listen_t *li, UNUSED void *packet_ctx, UNUSED fr_time_t request_time, uint8_t *buffer, size_t buffer_len, UNUSED size_t written)
static int mod_bootstrap(module_inst_ctx_t const *mctx)
static conf_parser_t const arp_listen_config[]
How to parse an ARP listen section.
static int mod_open(fr_listen_t *li)
Open a pcap file for ARP.
static char const * mod_name(fr_listen_t *li)
static ssize_t mod_read(fr_listen_t *li, UNUSED void **packet_ctx, fr_time_t *recv_time_p, uint8_t *buffer, size_t buffer_len, size_t *leftover)

Definition at line 229 of file proto_arp_ethernet.c.