KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
IPv6

IPv6 Network Stack. More...

Modules

 Options
 Options for v6 of the Internet Protocol.
 

Data Structures

struct  ipv6_hdr_t
 IPv6 Packet header. More...
 
struct  net_ipv6_stats_t
 IPv6 statistics structure. More...
 
struct  in6_addr
 Structure used to store an IPv6 address. More...
 
struct  sockaddr_in6
 Structure used to store an IPv6 address for a socket. More...
 

Macros

#define IN6ADDR_ANY_INIT
 Initialize an IPv6 local host address.
 
#define IN6ADDR_LOOPBACK_INIT
 Initialize an IPv6 loopback address.
 
#define INET6_ADDRSTRLEN   46
 Length of a string form of a maximal IPv6 address.
 
#define IN6_IS_ADDR_UNSPECIFIED(a)
 Test if an IPv6 Address is unspecified.
 
#define IN6_IS_ADDR_LOOPBACK(a)
 Test if an IPv6 Address is a loopback address.
 
#define IN6_IS_ADDR_V4MAPPED(a)
 Test if an IPv6 Address is an IPv4 mapped address.
 
#define IN6_IS_ADDR_V4COMPAT(a)
 Test if an IPv6 Address is an IPv4 compatibility address.
 
#define IN6_IS_ADDR_LINKLOCAL(a)
 Test if an IPv6 Address is a link-local address.
 
#define IN6_IS_ADDR_SITELOCAL(a)
 Test if an IPv6 Address is a site-local address.
 
#define IN6_IS_ADDR_MULTICAST(a)    ((a)->__s6_addr.__s6_addr8[0] == 0xFF)
 Test if an IPv6 Address is a multicast address.
 
#define IN6_IS_ADDR_MC_NODELOCAL(a)
 Test if an IPv6 Address is a node-local multicast address.
 
#define IN6_IS_ADDR_MC_LINKLOCAL(a)
 Test if an IPv6 Address is a link-local multicast address.
 
#define IN6_IS_ADDR_MC_SITELOCAL(a)
 Test if an IPv6 Address is a site-local multicast address.
 
#define IN6_IS_ADDR_MC_ORGLOCAL(a)
 Test if an IPv6 Address is an organization-local multicast address.
 
#define IN6_IS_ADDR_MC_GLOBAL(a)
 Test if an IPv6 Address is a global multicast address.
 

Functions

net_ipv6_stats_t net_ipv6_get_stats (void)
 Retrieve statistics from the IPv6 layer.
 

Variables

const struct in6_addr in6addr_any
 IPv6 local host address.
 
const struct in6_addr in6addr_loopback
 IPv6 loopback address.
 

Detailed Description

IPv6 Network Stack.

Macro Definition Documentation

◆ IN6_IS_ADDR_LINKLOCAL

#define IN6_IS_ADDR_LINKLOCAL (   a)
Value:
(((a)->__s6_addr.__s6_addr8[0] == 0xFE) && \
(((a)->__s6_addr.__s6_addr8[1] & 0xC0) == 0x80))

Test if an IPv6 Address is a link-local address.

This macro tests whether an IPv6 address (struct in6_addr *) is a link-local address.

Parameters
aThe address to test (struct in6_addr *)
Returns
Nonzero if the address is link-local, 0 otherwise.

◆ IN6_IS_ADDR_LOOPBACK

#define IN6_IS_ADDR_LOOPBACK (   a)
Value:
((a)->__s6_addr.__s6_addr32[0] == 0 && \
(a)->__s6_addr.__s6_addr32[1] == 0 && \
(a)->__s6_addr.__s6_addr32[2] == 0 && \
(a)->__s6_addr.__s6_addr16[6] == 0 && \
(a)->__s6_addr.__s6_addr8[14] == 0 && \
(a)->__s6_addr.__s6_addr8[15] == 1)

Test if an IPv6 Address is a loopback address.

This macro tests whether an IPv6 address (struct in6_addr *) is a loopback address.

Parameters
aThe address to test (struct in6_addr *)
Returns
Nonzero if the address is a loopback, 0 otherwise.

◆ IN6_IS_ADDR_MC_GLOBAL

#define IN6_IS_ADDR_MC_GLOBAL (   a)
Value:
(((a)->__s6_addr.__s6_addr8[1] & 0x0F) == 0x0E))
#define IN6_IS_ADDR_MULTICAST(a)
Test if an IPv6 Address is a multicast address.
Definition in.h:377

Test if an IPv6 Address is a global multicast address.

This macro tests whether an IPv6 address (struct in6_addr *) is a global multicast address.

Parameters
aThe address to test (struct in6_addr *)
Returns
Nonzero if the address is a global multicast address, 0 otherwise.

◆ IN6_IS_ADDR_MC_LINKLOCAL

#define IN6_IS_ADDR_MC_LINKLOCAL (   a)
Value:
(((a)->__s6_addr.__s6_addr8[1] & 0x0F) == 0x02))

Test if an IPv6 Address is a link-local multicast address.

This macro tests whether an IPv6 address (struct in6_addr *) is a link-local multicast address.

Parameters
aThe address to test (struct in6_addr *)
Returns
Nonzero if the address is a link-local multicast address, 0 otherwise.

◆ IN6_IS_ADDR_MC_NODELOCAL

#define IN6_IS_ADDR_MC_NODELOCAL (   a)
Value:
(((a)->__s6_addr.__s6_addr8[1] & 0x0F) == 0x01))

Test if an IPv6 Address is a node-local multicast address.

This macro tests whether an IPv6 address (struct in6_addr *) is a node-local multicast address.

Parameters
aThe address to test (struct in6_addr *)
Returns
Nonzero if the address is a node-local multicast address, 0 otherwise.

◆ IN6_IS_ADDR_MC_ORGLOCAL

#define IN6_IS_ADDR_MC_ORGLOCAL (   a)
Value:
(((a)->__s6_addr.__s6_addr8[1] & 0x0F) == 0x08))

Test if an IPv6 Address is an organization-local multicast address.

This macro tests whether an IPv6 address (struct in6_addr *) is an organization-local multicast address.

Parameters
aThe address to test (struct in6_addr *)
Returns
Nonzero if the address is an organization-local multicast address, 0 otherwise.

◆ IN6_IS_ADDR_MC_SITELOCAL

#define IN6_IS_ADDR_MC_SITELOCAL (   a)
Value:
(((a)->__s6_addr.__s6_addr8[1] & 0x0F) == 0x05))

Test if an IPv6 Address is a site-local multicast address.

This macro tests whether an IPv6 address (struct in6_addr *) is a site-local multicast address.

Parameters
aThe address to test (struct in6_addr *)
Returns
Nonzero if the address is a site-local multicast address, 0 otherwise.

◆ IN6_IS_ADDR_MULTICAST

#define IN6_IS_ADDR_MULTICAST (   a)     ((a)->__s6_addr.__s6_addr8[0] == 0xFF)

Test if an IPv6 Address is a multicast address.

This macro tests whether an IPv6 address (struct in6_addr *) is a multicast address.

Parameters
aThe address to test (struct in6_addr *)
Returns
Nonzero if the address is multicast, 0 otherwise.

◆ IN6_IS_ADDR_SITELOCAL

#define IN6_IS_ADDR_SITELOCAL (   a)
Value:
(((a)->__s6_addr.__s6_addr8[0] == 0xFE) && \
(((a)->__s6_addr.__s6_addr8[1] & 0xC0) == 0xC0))

Test if an IPv6 Address is a site-local address.

This macro tests whether an IPv6 address (struct in6_addr *) is a site-local address.

Parameters
aThe address to test (struct in6_addr *)
Returns
Nonzero if the address is site-local, 0 otherwise.

◆ IN6_IS_ADDR_UNSPECIFIED

#define IN6_IS_ADDR_UNSPECIFIED (   a)
Value:
((a)->__s6_addr.__s6_addr32[0] == 0 && \
(a)->__s6_addr.__s6_addr32[1] == 0 && \
(a)->__s6_addr.__s6_addr32[2] == 0 && \
(a)->__s6_addr.__s6_addr32[3] == 0)

Test if an IPv6 Address is unspecified.

This macro tests whether an IPv6 address (struct in6_addr *) is an unspecified address.

Parameters
aThe address to test (struct in6_addr *)
Returns
Nonzero if the address is unspecified, 0 otherwise.

◆ IN6_IS_ADDR_V4COMPAT

#define IN6_IS_ADDR_V4COMPAT (   a)
Value:
((a)->__s6_addr.__s6_addr32[0] == 0 && \
(a)->__s6_addr.__s6_addr32[1] == 0 && \
(a)->__s6_addr.__s6_addr32[2] == 0 && \
(a)->__s6_addr.__s6_addr32[3] != 0 && \
(a)->__s6_addr.__s6_addr8[15] != 1)

Test if an IPv6 Address is an IPv4 compatibility address.

This macro tests whether an IPv6 address (struct in6_addr *) is an IPv4 compatibility address.

Parameters
aThe address to test (struct in6_addr *)
Returns
Nonzero if the address is IPv4 compat, 0 otherwise.

◆ IN6_IS_ADDR_V4MAPPED

#define IN6_IS_ADDR_V4MAPPED (   a)
Value:
((a)->__s6_addr.__s6_addr32[0] == 0 && \
(a)->__s6_addr.__s6_addr32[1] == 0 && \
(a)->__s6_addr.__s6_addr16[4] == 0 && \
(a)->__s6_addr.__s6_addr16[5] == 0xFFFF)

Test if an IPv6 Address is an IPv4 mapped address.

This macro tests whether an IPv6 address (struct in6_addr *) is an IPv4 mapped address.

Parameters
aThe address to test (struct in6_addr *)
Returns
Nonzero if the address is IPv4 mapped, 0 otherwise.

◆ IN6ADDR_ANY_INIT

#define IN6ADDR_ANY_INIT
Value:
{{{ 0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0 }}}

Initialize an IPv6 local host address.

This macro can be used to initialize a struct in6_addr to any local address. It functions similarly to INADDR_ANY for IPv4.

◆ IN6ADDR_LOOPBACK_INIT

#define IN6ADDR_LOOPBACK_INIT
Value:
{{{ 0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 1 }}}

Initialize an IPv6 loopback address.

This macro can be used to initialize a struct in6_addr to the loopback address.

◆ INET6_ADDRSTRLEN

#define INET6_ADDRSTRLEN   46

Length of a string form of a maximal IPv6 address.

Function Documentation

◆ net_ipv6_get_stats()

net_ipv6_stats_t net_ipv6_get_stats ( void  )

Retrieve statistics from the IPv6 layer.

Returns
The global IPv6 stats structure.

Variable Documentation

◆ in6addr_any

const struct in6_addr in6addr_any
extern

IPv6 local host address.

This constant variable contains the IPv6 local host address.

◆ in6addr_loopback

const struct in6_addr in6addr_loopback
extern

IPv6 loopback address.

This constant variable contains the IPv6 loopback address.