apr  1.7.0
About: APR (Apache Portable Runtime) project offers software libraries that provide a predictable and consistent interface to underlying platform-specific implementations (APR core library).
  Fossies Dox: apr-1.7.0.tar.bz2  ("inofficial" and yet experimental doxygen-generated source code documentation)  

sockaddr.c File Reference
#include "apr_arch_networkio.h"
#include "apr_strings.h"
#include "apr.h"
#include "apr_lib.h"
#include "apr_private.h"
#include "apr_want.h"
Include dependency graph for sockaddr.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  apr_ipsubnet_t
 

Macros

#define APR_WANT_STRFUNC
 
#define SET_H_ERRNO(newval)   h_errno = (newval)
 
#define AIX_SERVNAME_HACK   0
 
#define V4MAPPED_EQUAL(a, b)
 
#define SCOPE_OR_ZERO(sa_)   (0)
 

Functions

static apr_status_t get_local_addr (apr_socket_t *sock)
 
static apr_status_t get_remote_addr (apr_socket_t *sock)
 
 APR_DECLARE (apr_status_t)
 
void apr_sockaddr_vars_set (apr_sockaddr_t *addr, int family, apr_port_t port)
 
static apr_status_t find_addresses (apr_sockaddr_t **sa, const char *hostname, apr_int32_t family, apr_port_t port, apr_int32_t flags, apr_pool_t *p)
 
static apr_status_t parse_network (apr_ipsubnet_t *ipsub, const char *network)
 
static apr_status_t parse_ip (apr_ipsubnet_t *ipsub, const char *ipstr, int network_allowed)
 
static int looks_like_ip (const char *ipstr)
 
static void fix_subnet (apr_ipsubnet_t *ipsub)
 

Macro Definition Documentation

◆ AIX_SERVNAME_HACK

#define AIX_SERVNAME_HACK   0

Definition at line 75 of file sockaddr.c.

◆ APR_WANT_STRFUNC

#define APR_WANT_STRFUNC

Definition at line 36 of file sockaddr.c.

◆ SCOPE_OR_ZERO

#define SCOPE_OR_ZERO (   sa_)    (0)

Definition at line 937 of file sockaddr.c.

◆ SET_H_ERRNO

#define SET_H_ERRNO (   newval)    h_errno = (newval)

Definition at line 54 of file sockaddr.c.

◆ V4MAPPED_EQUAL

#define V4MAPPED_EQUAL (   a,
  b 
)
Value:
((a)->sa.sin.sin_family == AF_INET && \
(b)->sa.sin.sin_family == AF_INET6 && \
IN6_IS_ADDR_V4MAPPED((struct in6_addr *)(b)->ipaddr_ptr) && \
!memcmp((a)->ipaddr_ptr, \
&((struct in6_addr *)(b)->ipaddr_ptr)->s6_addr[12], \
(a)->ipaddr_len))

Definition at line 925 of file sockaddr.c.

Function Documentation

◆ apr_sockaddr_vars_set()

◆ find_addresses()

static apr_status_t find_addresses ( apr_sockaddr_t **  sa,
const char *  hostname,
apr_int32_t  family,
apr_port_t  port,
apr_int32_t  flags,
apr_pool_t p 
)
static

◆ fix_subnet()

static void fix_subnet ( apr_ipsubnet_t ipsub)
static

Definition at line 1110 of file sockaddr.c.

References apr_ipsubnet_t::mask, and apr_ipsubnet_t::sub.

◆ get_local_addr()

◆ get_remote_addr()

◆ looks_like_ip()

static int looks_like_ip ( const char *  ipstr)
static

Definition at line 1093 of file sockaddr.c.

References apr_isdigit, and ipstr.

◆ parse_ip()

static apr_status_t parse_ip ( apr_ipsubnet_t ipsub,
const char *  ipstr,
int  network_allowed 
)
static

◆ parse_network()

static apr_status_t parse_network ( apr_ipsubnet_t ipsub,
const char *  network 
)
static
apr_sockaddr_t::sin
struct sockaddr_in sin
Definition: apr_network_io.h:293
b
apr_pool_t * b
Definition: apr_pools.h:529
sa
apr_sockaddr_t * sa
Definition: apr_network_io.h:379