The FreeRADIUS server
$Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
Functions to deal with fr_packet_t data structures. More...
#include "attrs.h"
#include <freeradius-devel/util/udp.h>
#include <freeradius-devel/util/syserror.h>
#include <fcntl.h>
Go to the source code of this file.
Data Structures | |
struct | radius_packet_t |
Macros | |
#define | FR_DEBUG_STRERROR_PRINTF if (fr_debug_lvl) fr_strerror_printf_push |
Functions | |
void | _fr_packet_log_hex (fr_log_t const *log, fr_packet_t const *packet, char const *file, int line) |
ssize_t | fr_packet_encode (fr_packet_t *packet, fr_pair_list_t *list, fr_packet_t const *original, char const *secret) |
Encode a packet. More... | |
bool | fr_packet_ok (fr_packet_t *packet, uint32_t max_attributes, bool require_message_authenticator, decode_fail_t *reason) |
See if the data pointed to by PTR is a valid RADIUS packet. More... | |
fr_packet_t * | fr_packet_recv (TALLOC_CTX *ctx, int fd, int flags, uint32_t max_attributes, bool require_message_authenticator) |
Receive UDP client requests, and fill in the basics of a fr_packet_t structure. More... | |
int | fr_packet_send (fr_packet_t *packet, fr_pair_list_t *list, fr_packet_t const *original, char const *secret) |
Reply to the request. More... | |
int | fr_packet_sign (fr_packet_t *packet, fr_packet_t const *original, char const *secret) |
Sign a previously encoded packet. More... | |
int | fr_packet_verify (fr_packet_t *packet, fr_packet_t *original, char const *secret) |
Verify the Request/Response Authenticator (and Message-Authenticator if present) of a packet. More... | |
void | fr_radius_packet_header_log (fr_log_t const *log, fr_packet_t *packet, bool received) |
void | fr_radius_packet_log (fr_log_t const *log, fr_packet_t *packet, fr_pair_list_t *list, bool received) |
static ssize_t | rad_recvfrom (int sockfd, fr_packet_t *packet, int flags) |
Wrapper for recvfrom, which handles recvfromto, IPv6, and all possible combinations. More... | |
Functions to deal with fr_packet_t data structures.
TCP-specific functions.
Definition in file packet.c.
struct radius_packet_t |
Definition at line 100 of file radsniff.h.
Data Fields | ||
---|---|---|
uint8_t | code | |
uint8_t | data[] | |
uint8_t | id | |
uint8_t | length[2] | |
uint8_t | vector[RADIUS_AUTH_VECTOR_LENGTH] |
#define FR_DEBUG_STRERROR_PRINTF if (fr_debug_lvl) fr_strerror_printf_push |
void _fr_packet_log_hex | ( | fr_log_t const * | log, |
fr_packet_t const * | packet, | ||
char const * | file, | ||
int | line | ||
) |
ssize_t fr_packet_encode | ( | fr_packet_t * | packet, |
fr_pair_list_t * | list, | ||
fr_packet_t const * | original, | ||
char const * | secret | ||
) |
bool fr_packet_ok | ( | fr_packet_t * | packet, |
uint32_t | max_attributes, | ||
bool | require_message_authenticator, | ||
decode_fail_t * | reason | ||
) |
See if the data pointed to by PTR is a valid RADIUS packet.
Packet is not 'const * const' because we may update data_len, if there's more data in the UDP packet than in the RADIUS packet.
[in] | packet | to check. |
[in] | max_attributes | to decode. |
[in] | require_message_authenticator | to require Message-Authenticator. |
[out] | reason | if not NULL, will have the failure reason written to where it points. |
Definition at line 119 of file packet.c.
fr_packet_t* fr_packet_recv | ( | TALLOC_CTX * | ctx, |
int | fd, | ||
int | flags, | ||
uint32_t | max_attributes, | ||
bool | require_message_authenticator | ||
) |
Receive UDP client requests, and fill in the basics of a fr_packet_t structure.
Definition at line 205 of file packet.c.
int fr_packet_send | ( | fr_packet_t * | packet, |
fr_pair_list_t * | list, | ||
fr_packet_t const * | original, | ||
char const * | secret | ||
) |
int fr_packet_sign | ( | fr_packet_t * | packet, |
fr_packet_t const * | original, | ||
char const * | secret | ||
) |
int fr_packet_verify | ( | fr_packet_t * | packet, |
fr_packet_t * | original, | ||
char const * | secret | ||
) |
void fr_radius_packet_header_log | ( | fr_log_t const * | log, |
fr_packet_t * | packet, | ||
bool | received | ||
) |
void fr_radius_packet_log | ( | fr_log_t const * | log, |
fr_packet_t * | packet, | ||
fr_pair_list_t * | list, | ||
bool | received | ||
) |
|
static |