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.
|  | 
| 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. 
 | 
|  | 
| bool | fr_packet_ok (fr_packet_t *packet, uint32_t max_attributes, bool require_message_authenticator, fr_radius_decode_fail_t *reason) | 
|  | See if the data pointed to by PTR is a valid RADIUS packet. 
 | 
|  | 
| 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. 
 | 
|  | 
| 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. 
 | 
|  | 
| int | fr_packet_sign (fr_packet_t *packet, fr_packet_t const *original, char const *secret) | 
|  | Sign a previously encoded packet. 
 | 
|  | 
| 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. 
 | 
|  | 
| 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. 
 | 
|  | 
Functions to deal with fr_packet_t data structures. 
TCP-specific functions.
- Id
- ca50d4546c8e9efff6fb2f73a2ffbf005e9b20e7 
- Copyright
- 2000-2017 The FreeRADIUS server project
- Id
- c8ca250f513459c54fa7978f6e18c21d3b328173 
- Copyright
- (C) 2009 Dante http://dante.net 
Definition in file packet.c.
◆ FR_DEBUG_STRERROR_PRINTF
◆ _fr_packet_log_hex()
      
        
          | void _fr_packet_log_hex | ( | fr_log_t const * | log, | 
        
          |  |  | fr_packet_t const * | packet, | 
        
          |  |  | char const * | file, | 
        
          |  |  | int | line | 
        
          |  | ) |  |  | 
      
 
 
◆ fr_packet_encode()
Encode a packet. 
Definition at line 43 of file packet.c.
 
 
◆ fr_packet_ok()
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.
- Parameters
- 
  
    | [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. |  
 
- Returns
- 
- True on success.
- False on failure. 
 
Definition at line 110 of file packet.c.
 
 
◆ fr_packet_recv()
      
        
          | 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 196 of file packet.c.
 
 
◆ fr_packet_send()
Reply to the request. 
Also attach reply attribute value pairs and any user message provided. 
Definition at line 282 of file packet.c.
 
 
◆ fr_packet_sign()
Sign a previously encoded packet. 
Definition at line 155 of file packet.c.
 
 
◆ fr_packet_verify()
Verify the Request/Response Authenticator (and Message-Authenticator if present) of a packet. 
Definition at line 134 of file packet.c.
 
 
◆ fr_radius_packet_header_log()
◆ fr_radius_packet_log()
◆ rad_recvfrom()
Wrapper for recvfrom, which handles recvfromto, IPv6, and all possible combinations. 
Definition at line 172 of file packet.c.