Go to the source code of this file.
Data Structures | |||||||||||
struct | ip | ||||||||||
The IP packet structure. More... | |||||||||||
Defines | |||||||||||
#define | IP_V4 4 | ||||||||||
IP version 4. | |||||||||||
#define | IP_V6 6 | ||||||||||
IP version 6. | |||||||||||
#define | IP_FRAME_LEN 65535 | ||||||||||
Maximum IP frame length. | |||||||||||
#define | IP_HEAD_MIN_LEN 20 | ||||||||||
Minimum IP header length. | |||||||||||
#define | IP_DEFAULT_TTL 64 | ||||||||||
Default TTL (Time To Live). | |||||||||||
#define | IPPROTO_ICMP 1 | ||||||||||
ICMP (Internet Control Message Protocol) packet type. | |||||||||||
#define | IPPROTO_IGMP 2 | ||||||||||
IGMP (Internet Group Message Protocol) packet type. | |||||||||||
#define | IPPROTO_TCP 6 | ||||||||||
TCP (Transmition Control Protocol) packet type. | |||||||||||
#define | IPPROTO_UDP 17 | ||||||||||
UDP (User Datagram Protocol) packet type. | |||||||||||
#define | IP_TOS_MIN_DELAY 0x10 | ||||||||||
Type of service :: Minimum delay. | |||||||||||
#define | IP_TOS_MAX_THRU 0x08 | ||||||||||
Type of service :: Maximum throughput. | |||||||||||
#define | IP_TOS_MAX_RELY 0x04 | ||||||||||
Type of service :: Maximum rely. | |||||||||||
#define | IP_TOS_MIN_COST 0x02 | ||||||||||
Type of service :: Minimum cost. | |||||||||||
#define | IP_FLAG_MF 0x2000 | ||||||||||
More Fragments. | |||||||||||
#define | IP_FLAG_DF 0x4000 | ||||||||||
Don't Fragment. | |||||||||||
#define | IP_FLAG_CE 0x8000 | ||||||||||
The CE flag. | |||||||||||
#define | IP_FLAG_MASK 0x1FFF | ||||||||||
The flag mask. | |||||||||||
#define | IP_ADDRESS(a, b, c, d) ((a) | (b) << 8 | (c) << 16 | (d) << 24) | ||||||||||
Create an IP address in the binary network format from the notation "a.b.c.d". | |||||||||||
#define | IP_A(ip) ((uint8_t) ((ip) >> 24)) | ||||||||||
Get the 1st most significant byte of a host-format IP address. | |||||||||||
#define | IP_B(ip) ((uint8_t) ((ip) >> 16)) | ||||||||||
Get the 2nd most significant byte of a host-format IP address. | |||||||||||
#define | IP_C(ip) ((uint8_t) ((ip) >> 8)) | ||||||||||
Get the 3rd most significant byte of a host-format IP address. | |||||||||||
#define | IP_D(ip) ((uint8_t) ((ip) >> 0)) | ||||||||||
Get the less significant byte of a host-format IP address. | |||||||||||
#define | INADDR_LOOPBACK IP_ADDRESS(127, 0, 0, 1) | ||||||||||
Loopback IP address. | |||||||||||
#define | INADDR_ANY IP_ADDRESS(0, 0, 0, 0) | ||||||||||
Null IP address. | |||||||||||
#define | INADDR_BROADCAST IP_ADDRESS(255, 255, 255, 255) | ||||||||||
Broadcast IP address. | |||||||||||
Typedefs | |||||||||||
typedef uint32_t | in_addr_t | ||||||||||
IP address type (in binary network format). | |||||||||||
typedef ip | ip_t | ||||||||||
The IP packet structure. | |||||||||||
Functions | |||||||||||
uint16_t | ip_checksum (const void *buf, size_t hdr_len) | ||||||||||
Calculate the IP header checksum.
| |||||||||||
void | set_host_ip_net (in_addr_t ip, in_addr_t netmask) | ||||||||||
Set the IP and netmask for this host.
| |||||||||||
in_addr_t | get_host_ip () | ||||||||||
Get the IP address of this host.
| |||||||||||
in_addr_t | get_host_netmask () | ||||||||||
Get the netmask of this host.
| |||||||||||
in_addr_t | get_host_bcast () | ||||||||||
Get the broadcast address of the local network.
| |||||||||||
void | to_ip_layer (ip_t *packet) | ||||||||||
Process an IP packet received from the ethernet layer.
| |||||||||||
int | inet_aton (const char *cp, in_addr_t *inp) | ||||||||||
Converts an internet IP addres from number-and-dot string notation into binary data network byte order.
| |||||||||||
int | send_ip_packet (uint32_t ip_to, const void *data, size_t len, uint8_t ttl, uint8_t proto) | ||||||||||
Send an IP packet to the ethernet layer.
|
Definition in file ip.h.
|
Default TTL (Time To Live).
|
|
The CE flag.
|
|
Don't Fragment.
|
|
The flag mask.
|
|
More Fragments.
|
|
Maximum IP frame length.
|
|
Minimum IP header length.
|
|
Type of service :: Maximum rely.
|
|
Type of service :: Maximum throughput.
|
|
Type of service :: Minimum cost.
|
|
Type of service :: Minimum delay.
|
|
IP version 4.
|
|
IP version 6.
|
|
ICMP (Internet Control Message Protocol) packet type.
|
|
IGMP (Internet Group Message Protocol) packet type.
|
|
TCP (Transmition Control Protocol) packet type.
|
|
UDP (User Datagram Protocol) packet type.
|