Main socket header. More...

Detailed Description

#include <inttypes.h>
#include <sys/socket.h>
#include "net/protnum.h"
#include "net/ipv6/addr.h"
#include "sys/bytes.h"
+ Include dependency graph for in.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  in_addr
 IPv4 address structure type. More...
 
struct  in6_addr
 IPv6 address structure type. More...
 
struct  sockaddr_in
 IPv4 socket address type. More...
 
struct  sockaddr_in6
 IPv6 socket address type. More...
 
struct  ipv6_mreq
 IPv6 multicast request. More...
 

Macros

#define INET_ADDRSTRLEN   (16)
 Length of the string form for IPv4.
 
#define INET6_ADDRSTRLEN   (46)
 Length of the string form for IPv6.
 
#define INADDR_ANY   ((in_addr_t)0x00000000)
 IPv4 local host address.
 
#define INADDR_BROADCAST   ((in_addr_t)0xffffffff)
 IPv4 broadcast address.
 
#define IN6ADDR_ANY_INIT   IPV6_ADDR_UNSPECIFIED
 IPv6 wildcard address.
 
#define IN6ADDR_LOOPBACK_INIT   IPV6_ADDR_LOOPBACK
 IPv6 loopback address.
 

Typedefs

typedef uint16_t in_port_t
 Internet port type. More...
 
typedef uint32_t in_addr_t
 IPv4 address type.
 

Variables

const struct in6_addr in6addr_any
 IPv6 socket address for the wildcard address.
 
const struct in6_addr in6addr_loopback
 IPv6 socket address for the loopback address.
 

IPv6 address macros

#define IN6_IS_ADDR_UNSPECIFIED(addr)   ((int)(ipv6_addr_is_unspecified((const ipv6_addr_t *)(addr))))
 Check if address is the unspecified address (::). More...
 
#define IN6_IS_ADDR_LOOPBACK(addr)   ((int)(ipv6_addr_is_loopback((const ipv6_addr_t *)(addr))))
 Check if address is the loopback address (::1). More...
 
#define IN6_IS_ADDR_MULTICAST(addr)   ((int)(ipv6_addr_is_multicast((const ipv6_addr_t *)(addr))))
 Check if address is a multicast address. More...
 
#define IN6_IS_ADDR_LINKLOCAL(addr)   ((int)(ipv6_addr_is_link_local((const ipv6_addr_t *)addr)))
 Check if address is a link-local address. More...
 
#define IN6_IS_ADDR_SITELOCAL(addr)   ((int)(ipv6_addr_is_site_local((const ipv6_addr_t *)addr)))
 Check if address is a site-local address. More...
 
#define IN6_IS_ADDR_V4MAPPED(addr)   ((int)(ipv6_addr_is_ipv4_mapped((const ipv6_addr_t *)addr)))
 Check if address is an IPv4 mapped address. More...
 
#define IN6_IS_ADDR_V4COMPAT(addr)   ((int)(ipv6_addr_is_ipv4_compat((const ipv6_addr_t *)addr)))
 Check if address is an IPv4-compatible address. More...
 
#define IN6_IS_ADDR_MC_NODELOCAL(addr)
 Check if address is a multicast node-local address. More...
 
#define IN6_IS_ADDR_MC_LINKLOCAL(addr)
 Check if address is a multicast link-local address. More...
 
#define IN6_IS_ADDR_MC_SITELOCAL(addr)
 Check if address is a multicast site-local address. More...
 
#define IN6_IS_ADDR_MC_ORGLOCAL(addr)
 Check if address is a multicast organization-local address. More...
 
#define IN6_IS_ADDR_MC_GLOBAL(addr)
 Check if address is a multicast global address. More...
 

Protocol numbers for option

#define IPPROTO_IP   (PROTNUM_IPV4)
 Internet Protocol version 4.
 
#define IPPROTO_IPV6   (PROTNUM_IPV6)
 Internet Protocol version 6.
 
#define IPPROTO_ICMP   (PROTNUM_ICMP)
 Internet Control Message Protocol.
 
#define IPPROTO_ICMPV6   (PROTNUM_ICMPV6)
 ICMP for IPv6.
 
#define IPPROTO_RAW   (PROTNUM_RESERVED)
 Raw IP packets protocol.
 
#define IPPROTO_TCP   (PROTNUM_TCP)
 Transmission control protocol.
 
#define IPPROTO_UDP   (PROTNUM_UDP)
 User datagram protocol.