The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Macros | Enumerations | Functions | Variables
arp.h File Reference
#include <freeradius-devel/util/packet.h>
#include <freeradius-devel/util/rand.h>
#include <freeradius-devel/util/log.h>
#include <freeradius-devel/util/net.h>
#include <freeradius-devel/protocol/arp/dictionary.h>
#include <freeradius-devel/protocol/arp/rfc826.h>
#include <sys/ioctl.h>
+ Include dependency graph for arp.h:

Go to the source code of this file.

Data Structures

struct  fr_arp_packet_t
 

Macros

#define ETH_TYPE_ARP   (0x0806)
 
#define FR_ARP_PACKET_CODE_VALID(_code)   (((_code) > 0) && ((_code) < FR_ARP_CODE_MAX))
 
#define FR_ARP_PACKET_SIZE   (28)
 

Enumerations

enum  fr_arp_packet_code_t {
  FR_ARP_INVALID = 0 ,
  FR_ARP_REQUEST = 1 ,
  FR_ARP_REPLY = 2 ,
  FR_ARP_REVERSE_REQUEST = 3 ,
  FR_ARP_REVERSE_REPLY = 4 ,
  FR_ARP_CODE_MAX = 5 ,
  FR_ARP_DO_NOT_RESPOND = 256
}
 

Functions

ssize_t fr_arp_decode (TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *packet, size_t packet_len)
 Decode a raw ARP packet into VPs. More...
 
ssize_t fr_arp_encode (fr_dbuff_t *dbuff, uint8_t const *original, fr_pair_list_t *vps)
 Encode VPS into a raw ARP packet. More...
 
int fr_arp_entry_add (int fd, char const *interface, uint8_t ipaddr[static 4], uint8_t macaddr[static 6])
 
void fr_arp_global_free (void)
 
int fr_arp_global_init (void)
 

Variables

char const * fr_arp_packet_codes [FR_ARP_CODE_MAX]
 

Data Structure Documentation

◆ fr_arp_packet_t

struct fr_arp_packet_t

Definition at line 51 of file arp.h.

Data Fields
uint8_t hlen Length of hardware address.
uint8_t htype[2] Format of hardware address.
uint8_t op[2] 1 - Request, 2 - Reply.
uint8_t plen Length of protocol address.
uint8_t ptype[2] Format of protocol address.
uint8_t sha[ETHER_ADDR_LEN] sender hardware address.
uint8_t spa[4] Sender protocol address.
uint8_t tha[ETHER_ADDR_LEN] Target hardware address.
uint8_t tpa[4] Target protocol address.

Macro Definition Documentation

◆ ETH_TYPE_ARP

#define ETH_TYPE_ARP   (0x0806)

Definition at line 38 of file arp.h.

◆ FR_ARP_PACKET_CODE_VALID

#define FR_ARP_PACKET_CODE_VALID (   _code)    (((_code) > 0) && ((_code) < FR_ARP_CODE_MAX))

Definition at line 73 of file arp.h.

◆ FR_ARP_PACKET_SIZE

#define FR_ARP_PACKET_SIZE   (28)

Definition at line 37 of file arp.h.

Enumeration Type Documentation

◆ fr_arp_packet_code_t

Enumerator
FR_ARP_INVALID 
FR_ARP_REQUEST 
FR_ARP_REPLY 
FR_ARP_REVERSE_REQUEST 
FR_ARP_REVERSE_REPLY 
FR_ARP_CODE_MAX 
FR_ARP_DO_NOT_RESPOND 

Definition at line 63 of file arp.h.

Function Documentation

◆ fr_arp_decode()

ssize_t fr_arp_decode ( TALLOC_CTX *  ctx,
fr_pair_list_t out,
uint8_t const *  packet,
size_t  packet_len 
)

Decode a raw ARP packet into VPs.

Definition at line 221 of file base.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_arp_encode()

ssize_t fr_arp_encode ( fr_dbuff_t dbuff,
uint8_t const *  original,
fr_pair_list_t vps 
)

Encode VPS into a raw ARP packet.

Definition at line 146 of file base.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_arp_entry_add()

int fr_arp_entry_add ( int  fd,
char const *  interface,
uint8_t  ipaddr[static 4],
uint8_t  macaddr[static 6] 
)
+ Here is the caller graph for this function:

◆ fr_arp_global_free()

void fr_arp_global_free ( void  )

Definition at line 284 of file base.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_arp_global_init()

int fr_arp_global_init ( void  )

Definition at line 261 of file base.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ fr_arp_packet_codes

char const* fr_arp_packet_codes[FR_ARP_CODE_MAX]
extern

Definition at line 63 of file base.c.