net.h File Reference

Basic Networking Types. More...

#include <isc/platform.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <isc/ipv6.h>
#include <isc/lang.h>
#include <isc/types.h>

Go to the source code of this file.

Data Structures

struct  in6_pktinfo
 IPv6 packet info. More...
struct  sockaddr_storage

Defines

#define ISC_NET_H   1
#define AF_INET6   99
 IPv6.
#define PF_INET6   AF_INET6
 IPv6.
#define INADDR_LOOPBACK   0x7f000001UL
 inaddr loopback
#define _SS_MAXSIZE   128
#define _SS_ALIGNSIZE   (sizeof (isc_uint64_t))
#define _SS_PAD1SIZE   (_SS_ALIGNSIZE - sizeof(isc_uint16_t))
#define _SS_PAD2SIZE
#define ISC_PLATFORM_RECVOVERFLOW
 If this system does not have MSG_TRUNC (as returned from recvmsg()) ISC_PLATFORM_RECVOVERFLOW will be defined. This will enable the MSG_TRUNC faking code in socket.c.
#define ISC__IPADDR(x)   ((isc_uint32_t)htonl((isc_uint32_t)(x)))
 IP address.
#define ISC_IPADDR_ISMULTICAST(i)
 Is IP address multicast?
#define ISC_IPADDR_ISEXPERIMENTAL(i)
#define ISC_NET_DSCPRECVV4   0x01
#define ISC_NET_DSCPRECVV6   0x02
#define ISC_NET_DSCPSETV4   0x04
#define ISC_NET_DSCPSETV6   0x08
#define ISC_NET_DSCPPKTV4   0x10
#define ISC_NET_DSCPPKTV6   0x20
#define ISC_NET_DSCPALL   0x3f
#define inet_aton   isc_net_aton

Functions

ISC_LANG_BEGINDECLS isc_result_t isc_net_probeipv4 (void)
 Check if the system's kernel supports IPv4.
isc_result_t isc_net_probeipv6 (void)
 Check if the system's kernel supports IPv6.
isc_result_t isc_net_probe_ipv6only (void)
 Check if the system's kernel supports the IPV6_V6ONLY socket option.
isc_result_t isc_net_probe_ipv6pktinfo (void)
void isc_net_disableipv4 (void)
void isc_net_disableipv6 (void)
void isc_net_enableipv4 (void)
void isc_net_enableipv6 (void)
isc_result_t isc_net_probeunix (void)
unsigned int isc_net_probedscp (void)
 Probe the level of DSCP support.
isc_result_t isc_net_getudpportrange (int af, in_port_t *low, in_port_t *high)
 Returns system's default range of ephemeral UDP ports, if defined. If the range is not available or unknown, ISC_NET_PORTRANGELOW and ISC_NET_PORTRANGEHIGH will be returned.
int isc_net_aton (const char *cp, struct in_addr *addr)
 Check whether "cp" is a valid ascii representation of an Internet address and convert to a binary address. Returns 1 if the address is valid, 0 if not. This replaces inet_addr, the return value from which cannot distinguish between failure and a local broadcast address.


Detailed Description

Basic Networking Types.

This module is responsible for defining the following basic networking types:

It ensures that the AF_ and PF_ macros are defined.

It declares ntoh[sl]() and hton[sl]().

It declares inet_aton(), inet_ntop(), and inet_pton().

It ensures that INADDR_LOOPBACK, INADDR_ANY, IN6ADDR_ANY_INIT, in6addr_any, and in6addr_loopback are available.

It ensures that IN_MULTICAST() is available to check for multicast addresses.

MP:

Reliability: Resources: Security: Standards:

Definition in file net.h.


Define Documentation

#define ISC_NET_H   1

Definition at line 21 of file net.h.

#define AF_INET6   99

IPv6.

Definition at line 162 of file net.h.

Referenced by _new_prefix(), _ref_prefix(), add_listenelt(), add_listener(), add_nameserver(), addr2af(), ATF_TC_BODY(), bind9_getaddresses(), build_msghdr_recv(), build_msghdr_send(), byaddr_done(), cfg_parse_netprefix(), check_dns64(), check_mx(), check_ns(), checkns(), client_request(), configure_staticstub_serveraddrs(), configure_view(), copy_server_list(), dash_option(), dns_acl_match2(), dns_adb_dumpfind(), dns_byaddr_createptrname2(), dns_client_createx2(), dns_dispatch_createtcp2(), dns_dns64_create(), dns_peer_new(), dns_portlist_add(), dns_portlist_match(), dns_portlist_remove(), dns_rpz_find_ip(), do_scan(), evaluate_local(), fctx_getaddresses(), fctx_query(), fromtext_in_a6(), fromtext_in_aaaa(), fromtext_in_apl(), fromtext_ipseckey(), get_addr(), get_reverse(), get_view_querysource_dispatch(), getudpdispatch(), internal_current(), internal_current4(), is_insecure(), isc_interfaceiter_create(), isc_net_ntop(), isc_net_pton(), isc_netaddr_any6(), isc_netaddr_eqprefix(), isc_netaddr_equal(), isc_netaddr_fromin6(), isc_netaddr_fromsockaddr(), isc_netaddr_fromv4mapped(), isc_netaddr_islinklocal(), isc_netaddr_ismulticast(), isc_netaddr_issitelocal(), isc_netaddr_masktoprefixlen(), isc_netaddr_prefixok(), isc_netaddr_setzone(), isc_netaddr_totext(), isc_netscope_pton(), isc_sockaddr_any6(), isc_sockaddr_anyofpf(), isc_sockaddr_compare(), isc_sockaddr_fromin6(), isc_sockaddr_fromnetaddr(), isc_sockaddr_getport(), isc_sockaddr_hash(), isc_sockaddr_islinklocal(), isc_sockaddr_ismulticast(), isc_sockaddr_issitelocal(), isc_sockaddr_pf(), isc_sockaddr_setport(), isc_sockaddr_totext(), isc_sockaddr_v6fromin(), listener_bind(), load_configuration(), lwaddr_lwresaddr_fromnetaddr(), main(), make_key(), make_log_buf(), ns_add_reserved_dispatch(), ns_client_addopt(), ns_lwdclient_processgnba(), parse_netprefix(), possibly_mark(), process_ecs(), recvsoa(), render_ecs(), resolveaddr_done(), reverse_from_address(), rndc_startconnect(), send_update(), sendrequest(), setup_addresses(), setup_locals(), setup_system(), stf_from_address(), token_addr(), totext_in_a6(), totext_in_aaaa(), totext_in_apl(), and totext_ipseckey().

#define PF_INET6   AF_INET6

IPv6.

Definition at line 167 of file net.h.

Referenced by ATF_TC_BODY(), bind9_getaddresses(), dns_xfrin_create(), fctx_query(), find_udp_dispatch(), got_transfer_quota(), initialize_action(), isc_sockaddr_pf(), notify_isself(), notify_send_toaddr(), ns_query(), sendtomaster(), soa_query(), try_proto(), and udp_recv().

#define INADDR_LOOPBACK   0x7f000001UL

inaddr loopback

Definition at line 172 of file net.h.

Referenced by ATF_TC_BODY(), is_insecure(), ns_controls_configure(), ns_lwresd_configure(), and setup_system().

#define _SS_MAXSIZE   128

Definition at line 185 of file net.h.

#define _SS_ALIGNSIZE   (sizeof (isc_uint64_t))

Definition at line 186 of file net.h.

#define _SS_PAD1SIZE   (_SS_ALIGNSIZE - sizeof(isc_uint16_t))

Definition at line 192 of file net.h.

#define _SS_PAD2SIZE

Value:

Definition at line 193 of file net.h.

#define ISC_PLATFORM_RECVOVERFLOW

If this system does not have MSG_TRUNC (as returned from recvmsg()) ISC_PLATFORM_RECVOVERFLOW will be defined. This will enable the MSG_TRUNC faking code in socket.c.

Definition at line 254 of file net.h.

#define ISC__IPADDR (  )     ((isc_uint32_t)htonl((isc_uint32_t)(x)))

IP address.

Definition at line 258 of file net.h.

#define ISC_IPADDR_ISMULTICAST (  ) 

Value:

(((isc_uint32_t)(i) & ISC__IPADDR(0xf0000000)) \
                 == ISC__IPADDR(0xe0000000))
Is IP address multicast?

Definition at line 261 of file net.h.

Referenced by isc_netaddr_ismulticast().

#define ISC_IPADDR_ISEXPERIMENTAL (  ) 

Value:

(((isc_uint32_t)(i) & ISC__IPADDR(0xf0000000)) \
                 == ISC__IPADDR(0xf0000000))

Definition at line 265 of file net.h.

Referenced by isc_netaddr_isexperimental().

#define ISC_NET_DSCPRECVV4   0x01

Definition at line 344 of file net.h.

Referenced by ATF_TC_BODY(), and try_dscp_v4().

#define ISC_NET_DSCPRECVV6   0x02

Definition at line 345 of file net.h.

Referenced by ATF_TC_BODY().

#define ISC_NET_DSCPSETV4   0x04

Definition at line 346 of file net.h.

Referenced by ATF_TC_BODY(), and try_dscp_v4().

#define ISC_NET_DSCPSETV6   0x08

Definition at line 347 of file net.h.

Referenced by ATF_TC_BODY().

#define ISC_NET_DSCPPKTV4   0x10

Definition at line 348 of file net.h.

Referenced by ATF_TC_BODY(), and try_dscp_v4().

#define ISC_NET_DSCPPKTV6   0x20

Definition at line 349 of file net.h.

Referenced by ATF_TC_BODY().

#define ISC_NET_DSCPALL   0x3f

Definition at line 350 of file net.h.

Referenced by ATF_TC_BODY().

#define inet_aton   isc_net_aton

Definition at line 392 of file net.h.

Referenced by check_mx(), check_ns(), and getquad().


Function Documentation

ISC_LANG_BEGINDECLS isc_result_t isc_net_probeipv4 ( void   ) 

Check if the system's kernel supports IPv4.

Returns:

Definition at line 230 of file net.c.

References initialize(), and ipv4_result.

Referenced by add_listener(), bind9_getaddresses(), do_scan(), get_view_querysource_dispatch(), listener_bind(), ns_controls_configure(), parse_command_line(), setup_libs(), and setup_system().

isc_result_t isc_net_probeipv6 ( void   ) 

Check if the system's kernel supports IPv6.

Returns:

Definition at line 236 of file net.c.

References initialize(), and ipv6_result.

Referenced by add_listener(), bind9_getaddresses(), do_scan(), get_view_querysource_dispatch(), isc_interfaceiter_create(), listener_bind(), load_configuration(), ns_controls_configure(), parse_command_line(), setup_libs(), and setup_system().

isc_result_t isc_net_probe_ipv6only ( void   ) 

Check if the system's kernel supports the IPV6_V6ONLY socket option.

Returns:

Definition at line 384 of file net.c.

References ipv6only_result, and ISC_R_NOTFOUND.

Referenced by do_scan().

isc_result_t isc_net_probe_ipv6pktinfo ( void   ) 

Definition at line 396 of file net.c.

References ipv6pktinfo_result, and ISC_R_NOTFOUND.

Referenced by do_scan().

void isc_net_disableipv4 ( void   ) 

Definition at line 882 of file net.c.

Referenced by dash_option(), parse_args(), and parse_command_line().

void isc_net_disableipv6 ( void   ) 

Definition at line 889 of file net.c.

Referenced by dash_option(), parse_args(), and parse_command_line().

void isc_net_enableipv4 ( void   ) 

Definition at line 896 of file net.c.

void isc_net_enableipv6 ( void   ) 

Definition at line 903 of file net.c.

isc_result_t isc_net_probeunix ( void   ) 

Definition at line 242 of file net.c.

References initialize(), and unix_result.

Referenced by add_listener().

unsigned int isc_net_probedscp ( void   ) 

Probe the level of DSCP support.

Definition at line 758 of file net.c.

Referenced by ATF_TC_BODY(), and socket_create().

isc_result_t isc_net_getudpportrange ( int  af,
in_port_t *  low,
in_port_t *  high 
)

Returns system's default range of ephemeral UDP ports, if defined. If the range is not available or unknown, ISC_NET_PORTRANGELOW and ISC_NET_PORTRANGEHIGH will be returned.

Requires:

Returns:

Definition at line 839 of file net.c.

References ISC_NET_PORTRANGEHIGH, ISC_NET_PORTRANGELOW, ISC_R_FAILURE, ISC_R_SUCCESS, REQUIRE, and UNUSED.

Referenced by load_configuration().

int isc_net_aton ( const char *  cp,
struct in_addr *  addr 
)

Check whether "cp" is a valid ascii representation of an Internet address and convert to a binary address. Returns 1 if the address is valid, 0 if not. This replaces inet_addr, the return value from which cannot distinguish between failure and a local broadcast address.

Definition at line 89 of file inet_aton.c.


Generated on Tue Apr 28 17:41:19 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha