jabberd2  2.3.6
Functions
access.c File Reference
#include "util.h"

Go to the source code of this file.

Functions

access_t access_new (int order)
 
void access_free (access_t access)
 
static int _access_calc_netsize (const char *mask, int defaultsize)
 
static void _access_unmap_v4 (struct sockaddr_in6 *src, struct sockaddr_in *dst)
 convert a IPv6 mapped IPv4 address to a real IPv4 address More...
 
static int _access_check_match (struct sockaddr_storage *ip_1, struct sockaddr_storage *ip_2, int netsize)
 check if two ip addresses are within the same subnet More...
 
int access_allow (access_t access, const char *ip, const char *mask)
 
int access_deny (access_t access, const char *ip, const char *mask)
 
int access_check (access_t access, const char *ip)
 

Function Documentation

access_t access_new ( int  order)

Definition at line 25 of file access.c.

References access_st::order.

Referenced by _c2s_config_expand(), and _router_config_expand().

void access_free ( access_t  access)

Definition at line 34 of file access.c.

References access_st::allow, and access_st::deny.

Referenced by JABBER_MAIN().

static int _access_calc_netsize ( const char *  mask,
int  defaultsize 
)
static

Definition at line 41 of file access.c.

References j_atoi().

Referenced by access_allow(), and access_deny().

static void _access_unmap_v4 ( struct sockaddr_in6 src,
struct sockaddr_in *  dst 
)
static

convert a IPv6 mapped IPv4 address to a real IPv4 address

Definition at line 70 of file access.c.

References in6_addr::s6_addr, and sockaddr_in6::sin6_addr.

Referenced by _access_check_match().

static int _access_check_match ( struct sockaddr_storage ip_1,
struct sockaddr_storage ip_2,
int  netsize 
)
static

check if two ip addresses are within the same subnet

Definition at line 78 of file access.c.

References _access_unmap_v4(), AF_INET6, IN6_IS_ADDR_V4MAPPED, in6_addr::s6_addr, sockaddr_in6::sin6_addr, and sockaddr_storage::ss_family.

Referenced by access_check().

int access_allow ( access_t  access,
const char *  ip,
const char *  mask 
)
int access_deny ( access_t  access,
const char *  ip,
const char *  mask 
)
int access_check ( access_t  access,
const char *  ip 
)