24RCSID(
"$Id: d23eb9001e7c67c3504eb07c65c9aa29135e0e75 $")
 
   26#include <freeradius-devel/util/atexit.h> 
   27#include <freeradius-devel/util/pair_legacy.h> 
   29#include <freeradius-devel/server/packet.h> 
   94#ifdef WITH_IFINDEX_NAME_RESOLUTION 
   95        char if_name[IFNAMSIZ];
 
  124#ifdef WITH_IFINDEX_NAME_RESOLUTION 
  128        if (!packet->
socket.inet.ifindex) 
return 0;
 
  130        fr_ifname_from_ifindex(if_name, packet->
socket.inet.ifindex);
 
 
  143        if (
vp) *ipaddr = 
vp->vp_ip;
 
  146        if (
vp) *port = 
vp->vp_uint16;
 
 
#define fr_dict_autofree(_to_free)
fr_dict_attr_t const  ** out
Where to write a pointer to the resolved fr_dict_attr_t.
fr_dict_t const  ** out
Where to write a pointer to the loaded/resolved fr_dict_t.
int fr_dict_attr_autoload(fr_dict_attr_autoload_t const *to_load)
Process a dict_attr_autoload element to load/verify a dictionary attribute.
#define fr_dict_autoload(_to_load)
#define DICT_AUTOLOAD_TERMINATOR
Specifies an attribute which must be present for the module to function.
Specifies a dictionary which must be loaded/loadable for the module to function.
int packet_global_init(void)
Initialises the Net.
static fr_dict_attr_t const  * attr_net_interface
static fr_dict_attr_t const  * attr_net_src
static void pairs2inet(fr_ipaddr_t *ipaddr, uint16_t *port, fr_pair_list_t const *list, fr_dict_attr_t const *attr_ip, fr_dict_attr_t const *attr_port)
static int inet2pairs(TALLOC_CTX *ctx, fr_pair_list_t *list, fr_dict_attr_t const *attr_ip, fr_dict_attr_t const *attr_port, fr_ipaddr_t const *ipaddr, uint16_t port)
static fr_dict_attr_t const  * attr_net_dst_port
static fr_dict_t const  * dict_freeradius
static fr_dict_attr_t const  * attr_net_timestamp
fr_dict_autoload_t util_packet_dict[]
static fr_dict_attr_t const  * attr_net
int fr_packet_pairs_from_packet(TALLOC_CTX *ctx, fr_pair_list_t *list, fr_packet_t const *packet)
Allocate a "Net." struct with src/dst host and port.
void fr_packet_net_from_pairs(fr_packet_t *packet, fr_pair_list_t const *list)
Convert pairs to information in a packet.
static fr_dict_attr_t const  * attr_net_dst
fr_dict_attr_autoload_t util_packet_dict_attr[]
static int _packet_global_init(UNUSED void *uctx)
static fr_dict_attr_t const  * attr_net_src_ip
static fr_dict_attr_t const  * attr_net_dst_ip
static int _packet_global_free(UNUSED void *uctx)
static fr_dict_attr_t const  * attr_net_src_port
@ FR_TYPE_TLV
Contains nested attributes.
@ FR_TYPE_STRING
String of printable characters.
@ FR_TYPE_UINT16
16 Bit unsigned integer.
@ FR_TYPE_DATE
Unix time stamp, always has value >2^31.
@ FR_TYPE_COMBO_IP_ADDR
IPv4 or IPv6 address depending on length.
fr_pair_t * fr_pair_find_by_da(fr_pair_list_t const *list, fr_pair_t const *prev, fr_dict_attr_t const *da)
Find the first pair with a matching da.
Stores an attribute, a value and various bits of other data.
static fr_unix_time_t fr_time_to_unix_time(fr_time_t when)
Convert an fr_time_t (internal time) to our version of unix time (wallclock time)
fr_socket_t socket
This packet was received on.
fr_time_t timestamp
When we received the packet.
static int fr_pair_find_or_append_by_da(TALLOC_CTX *ctx, fr_pair_t **out, fr_pair_list_t *list, fr_dict_attr_t const *da)
static void fr_pair_set_immutable(fr_pair_t *vp)
void fr_perror(char const *fmt,...)
Print the current error to stderr with a prefix.
int fr_value_box_strdup(TALLOC_CTX *ctx, fr_value_box_t *dst, fr_dict_attr_t const *enumv, char const *src, bool tainted)
Copy a nul terminated string to a fr_value_box_t.
int fr_value_box_ipaddr(fr_value_box_t *dst, fr_dict_attr_t const *enumv, fr_ipaddr_t const *ipaddr, bool tainted)
Assign a fr_value_box_t value from an fr_ipaddr_t.