FreeBSD kernel IPv4 code
|
#include <sys/cdefs.h>
#include <sys/_types.h>
#include <machine/endian.h>
#include <sys/_sockaddr_storage.h>
Go to the source code of this file.
Data Structures | |
struct | in_addr |
struct | sockaddr_in |
Macros | |
#define | IPPROTO_IP 0 /* dummy for IP */ |
#define | IPPROTO_ICMP 1 /* control message protocol */ |
#define | IPPROTO_TCP 6 /* tcp */ |
#define | IPPROTO_UDP 17 /* user datagram protocol */ |
#define | INADDR_ANY ((in_addr_t)0x00000000) |
#define | INADDR_BROADCAST ((in_addr_t)0xffffffff) /* must be masked */ |
#define | _UINT8_T_DECLARED |
#define | _UINT16_T_DECLARED |
#define | _UINT32_T_DECLARED |
#define | _IN_ADDR_T_DECLARED |
#define | _IN_PORT_T_DECLARED |
#define | _SA_FAMILY_T_DECLARED |
#define | _STRUCT_IN_ADDR_DECLARED |
#define | _SOCKLEN_T_DECLARED |
#define | in_hosteq(s, t) ((s).s_addr == (t).s_addr) |
#define | in_nullhost(x) ((x).s_addr == INADDR_ANY) |
#define | in_allhosts(x) ((x).s_addr == htonl(INADDR_ALLHOSTS_GROUP)) |
#define | satosin(sa) ((struct sockaddr_in *)(sa)) |
#define | sintosa(sin) ((struct sockaddr *)(sin)) |
#define | ifatoia(ifa) ((struct in_ifaddr *)(ifa)) |
Typedefs | |
typedef __uint8_t | uint8_t |
typedef __uint16_t | uint16_t |
typedef __uint32_t | uint32_t |
typedef uint32_t | in_addr_t |
typedef uint16_t | in_port_t |
typedef __sa_family_t | sa_family_t |
typedef __socklen_t | socklen_t |
Functions | |
int | in_broadcast (struct in_addr, struct ifnet *) |
int | in_ifaddr_broadcast (struct in_addr, struct in_ifaddr *) |
int | in_canforward (struct in_addr) |
int | in_localaddr (struct in_addr) |
bool | in_localip (struct in_addr) |
bool | in_localip_fib (struct in_addr, uint16_t) |
int | in_ifhasaddr (struct ifnet *, struct in_addr) |
struct in_ifaddr * | in_findlocal (uint32_t, bool) |
int | inet_aton (const char *, struct in_addr *) |
char * | inet_ntoa_r (struct in_addr ina, char *buf) |
char * | inet_ntop (int, const void *, char *, socklen_t) |
int | inet_pton (int af, const char *, void *) |
void | in_ifdetach (struct ifnet *) |
#define in_allhosts | ( | x | ) | ((x).s_addr == htonl(INADDR_ALLHOSTS_GROUP)) |
#define in_nullhost | ( | x | ) | ((x).s_addr == INADDR_ANY) |
#define INADDR_BROADCAST ((in_addr_t)0xffffffff) /* must be masked */ |
#define satosin | ( | sa | ) | ((struct sockaddr_in *)(sa)) |
typedef __sa_family_t sa_family_t |
int in_broadcast | ( | struct in_addr | in, |
struct ifnet * | ifp | ||
) |
Definition at line 1213 of file in.c.
References in_ifaddr_broadcast(), INADDR_ANY, INADDR_BROADCAST, and in_addr::s_addr.
Referenced by div_output_inbound(), rib4_preadd(), tcp_dropwithreset(), and tcp_input_with_port().
int in_canforward | ( | struct in_addr | in | ) |
Definition at line 250 of file in.c.
References in_addr::s_addr.
Referenced by ip_forward().
Definition at line 221 of file in.c.
References in_ifaddr::ia_ifa, IA_SIN, and V_in_ifaddrhead.
Definition at line 1191 of file in.c.
References in_ifaddr::ia_subnet, in_ifaddr::ia_subnetmask, in_addr::s_addr, and V_broadcast_lowest.
Referenced by in_broadcast(), and ip_output().
void in_ifdetach | ( | struct ifnet * | ifp | ) |
Definition at line 1243 of file in.c.
References IN_MULTI_LOCK, IN_MULTI_UNLOCK, in_pcbpurgeif0(), in_purgemaddrs(), inm_release_wait(), V_ripcbinfo, V_udbinfo, and V_ulitecbinfo.
int in_ifhasaddr | ( | struct ifnet * | ifp, |
struct in_addr | in | ||
) |
Definition at line 166 of file in.c.
References in_ifaddr::ia_addr, in_addr::s_addr, and sockaddr_in::sin_addr.
int in_localaddr | ( | struct in_addr | in | ) |
Definition at line 111 of file in.c.
References in_ifaddr::ia_subnet, in_ifaddr::ia_subnetmask, in_addr::s_addr, and V_in_ifaddrhead.
Referenced by tcp_mss_update().
bool in_localip | ( | struct in_addr | in | ) |
Definition at line 131 of file in.c.
References IA_SIN, INADDR_HASH, and in_addr::s_addr.
Referenced by in_gif_set_running(), in_gre_set_running(), ip_output_pfil(), ip_tryforward(), tcp_input_with_port(), and tcp_twstart().
Definition at line 148 of file in.c.
References in_ifaddr::ia_ifa, IA_SIN, INADDR_HASH, and in_addr::s_addr.
Referenced by ip_input().
int inet_aton | ( | const char * | , |
struct in_addr * | |||
) |
char * inet_ntoa_r | ( | struct in_addr | ina, |
char * | buf | ||
) |
Referenced by AliasHandleResourceA(), AliasHandleResourceNB(), AliasHandleUdpNbt(), arp_check_update_lle(), arpresolve_full(), in_getmulti(), ip_dooptions(), netdump_start(), ProxyEncodeTcpStream(), sysctl_tcp_hc_list(), and tcp_log_addr().
char * inet_ntop | ( | int | , |
const void * | , | ||
char * | , | ||
socklen_t | |||
) |
Referenced by sysctl_net_inet_tcp_fastopen_ccache_list().
int inet_pton | ( | int | af, |
const char * | , | ||
void * | |||
) |