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

IPv4 Network Stack. More...

Modules

 Options
 Options for v4 of the Internet Protocol.
 

Data Structures

struct  ip_hdr_t
 IPv4 Packet header. More...
 
struct  net_ipv4_stats_t
 IPv4 statistics structure. More...
 
struct  in_addr
 Structure used to store an IPv4 address. More...
 
struct  sockaddr_in
 Structure used to store an IPv4 address for a socket. More...
 

Macros

#define INADDR_ANY   0x00000000
 Local IPv4 host address.
 
#define INADDR_BROADCAST   0xFFFFFFFF
 IPv4 broadcast address.
 
#define INADDR_NONE   0xFFFFFFFF
 IPv4 error address.
 
#define INET_ADDRSTRLEN   16
 Length of a string form of a maximal IPv4 address.
 

Typedefs

typedef uint32_t in_addr_t
 32-bit value used to store an IPv4 address.
 

Functions

net_ipv4_stats_t net_ipv4_get_stats (void)
 Retrieve statistics from the IPv4 layer.
 
uint32 net_ipv4_address (const uint8 addr[4])
 Create a 32-bit IP address, based on the individual numbers contained within the IP.
 
void net_ipv4_parse_address (uint32 addr, uint8 out[4])
 Parse an IP address that is packet into a uint32 into an array of the individual bytes.
 

Detailed Description

IPv4 Network Stack.

Macro Definition Documentation

◆ INADDR_ANY

#define INADDR_ANY   0x00000000

Local IPv4 host address.

This address can be used by many things if you prefer to not specify the local address, and would rather it be detected automatically.

◆ INADDR_BROADCAST

#define INADDR_BROADCAST   0xFFFFFFFF

IPv4 broadcast address.

This address is the normal IPv4 broadcast address (255.255.255.255).

◆ INADDR_NONE

#define INADDR_NONE   0xFFFFFFFF

IPv4 error address.

This address is non-standard, but is available on many systems. It is used to detect failure from some functions that normally return addresses (such as the inet_addr function).

◆ INET_ADDRSTRLEN

#define INET_ADDRSTRLEN   16

Length of a string form of a maximal IPv4 address.

Typedef Documentation

◆ in_addr_t

typedef uint32_t in_addr_t

32-bit value used to store an IPv4 address.

Function Documentation

◆ net_ipv4_address()

uint32 net_ipv4_address ( const uint8  addr[4])

Create a 32-bit IP address, based on the individual numbers contained within the IP.

Parameters
addrArray of IP address octets.
Returns
The address, in host byte order.

◆ net_ipv4_get_stats()

net_ipv4_stats_t net_ipv4_get_stats ( void  )

Retrieve statistics from the IPv4 layer.

Returns
The net_ipv4_stats_t structure.

◆ net_ipv4_parse_address()

void net_ipv4_parse_address ( uint32  addr,
uint8  out[4] 
)

Parse an IP address that is packet into a uint32 into an array of the individual bytes.

Parameters
addrThe full address, in host byte order.
outThe output buffer.