The FreeRADIUS server
$Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
Utility functions for managing UDP sockets. More...
#include <freeradius-devel/build.h>
#include <freeradius-devel/missing.h>
#include <freeradius-devel/util/inet.h>
#include <freeradius-devel/util/socket.h>
#include <freeradius-devel/util/time.h>
#include <freeradius-devel/util/udpfromto.h>
Go to the source code of this file.
Macros | |
#define | UDP_FLAGS_CONNECTED (1 << 0) |
#define | UDP_FLAGS_NONE (0) |
#define | UDP_FLAGS_PEEK (1 << 1) |
Functions | |
ssize_t | udp_recv (int sockfd, int flags, fr_socket_t *socket_out, void *data, size_t data_len, fr_time_t *when) |
Read a UDP packet. More... | |
int | udp_recv_discard (int sockfd) |
Discard the next UDP packet. More... | |
ssize_t | udp_recv_peek (int sockfd, void *data, size_t data_len, int flags, fr_ipaddr_t *src_ipaddr, uint16_t *src_port) |
Peek at the header of a UDP packet. More... | |
int | udp_send (fr_socket_t const *socket, int flags, void *data, size_t data_len) |
Send a packet via a UDP socket. More... | |
Utility functions for managing UDP sockets.
Definition in file udp.h.
ssize_t udp_recv | ( | int | sockfd, |
int | flags, | ||
fr_socket_t * | socket_out, | ||
void * | data, | ||
size_t | data_len, | ||
fr_time_t * | when | ||
) |
Read a UDP packet.
[in] | sockfd | we're reading from. |
[in] | flags | for things |
[out] | socket_out | Information about the src/dst address of the packet and the interface it was received on. |
[out] | data | pointer where data will be written |
[in] | data_len | length of data to read |
[out] | when | the packet was received. |
Definition at line 145 of file udp.c.
int udp_recv_discard | ( | int | sockfd | ) |
ssize_t udp_recv_peek | ( | int | sockfd, |
void * | data, | ||
size_t | data_len, | ||
int | flags, | ||
fr_ipaddr_t * | src_ipaddr, | ||
uint16_t * | src_port | ||
) |
Peek at the header of a UDP packet.
[in] | sockfd | we're reading from. |
[out] | data | pointer where data will be written |
[in] | data_len | length of data to read |
[in] | flags | for things |
[out] | src_ipaddr | of the packet. |
[out] | src_port | of the packet. |
Definition at line 96 of file udp.c.
int udp_send | ( | fr_socket_t const * | sock, |
int | flags, | ||
void * | data, | ||
size_t | data_len | ||
) |
Send a packet via a UDP socket.
[in] | sock | we're reading from. |
[in] | flags | to pass to send(), or sendto() |
[in] | data | to data to send |
[in] | data_len | length of data to send |
Definition at line 43 of file udp.c.