The FreeRADIUS server $Id: a4e7f8c94e8038b7627bcf52356b7ed15955c1d7 $
Loading...
Searching...
No Matches
Macros | Functions
network.h File Reference

BIO patricia trie filtering handlers. More...

#include <freeradius-devel/util/inet.h>
#include <freeradius-devel/util/trie.h>
+ Include dependency graph for network.h:

Go to the source code of this file.

Macros

#define FR_BIO_NETWORK_ALLOW   ((void *) (-1))
 
#define FR_BIO_NETWORK_DENY   ((void *) (-2))
 

Functions

fr_trie_t * fr_bio_network_trie_alloc (TALLOC_CTX *ctx, int af, fr_ipaddr_t const *allow, fr_ipaddr_t const *deny)
 Create a patricia trie for doing network filtering.
 
bool fr_bio_network_trie_allow (fr_trie_t const *trie, struct sockaddr const *sockaddr, socklen_t socklen)
 Check if the source of a packet or connection is allowed by the network trie.
 

Detailed Description

BIO patricia trie filtering handlers.

Id
75c82280e93b18ce3006aacc87e27fbc34d47f60

Definition in file network.h.

Macro Definition Documentation

◆ FR_BIO_NETWORK_ALLOW

#define FR_BIO_NETWORK_ALLOW   ((void *) (-1))

Definition at line 43 of file network.h.

◆ FR_BIO_NETWORK_DENY

#define FR_BIO_NETWORK_DENY   ((void *) (-2))

Definition at line 44 of file network.h.

Function Documentation

◆ fr_bio_network_trie_alloc()

fr_trie_t * fr_bio_network_trie_alloc ( TALLOC_CTX *  ctx,
int  af,
fr_ipaddr_t const *  allow,
fr_ipaddr_t const *  deny 
)

Create a patricia trie for doing network filtering.

Definition at line 51 of file network.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_bio_network_trie_allow()

bool fr_bio_network_trie_allow ( fr_trie_t const *  trie,
struct sockaddr const *  sockaddr,
socklen_t  socklen 
)

Check if the source of a packet or connection is allowed by the network trie.

Parameters
triecreated by fr_bio_network_trie_alloc().
sockaddrthe source address of the packet or connection.
socklenthe length of the source address.
Returns
  • true if the source address is allowed.
  • false if the source address is denied, is not in the trie, or is not an IP address.

Definition at line 39 of file network.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: