24RCSID(
"$Id: 5a66a58568a06cafc2c901b7d63e3d193bfb76b4 $")
26#include <freeradius-devel/util/atexit.h>
27#include <freeradius-devel/util/pair_legacy.h>
29#include <freeradius-devel/server/packet.h>
128 if (
vp) *ipaddr =
vp->vp_ip;
131 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)
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_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_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_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.