ArvernOS
Loading...
Searching...
No Matches
ipv4.h File Reference
#include <arpa/inet.h>
#include <net/net.h>
#include <sys/types.h>
Include dependency graph for ipv4.h:
This graph shows which files directly or indirectly include this file:

Data Structures

struct  ipv4_header_t
 

Functions

void ipv4_receive_packet (net_interface_t *interface, uint8_t *data, uint32_t len)
 
void ipv4_send_packet (net_interface_t *interface, struct sockaddr_in *dst_addr, uint8_t protocol, uint16_t flags, uint8_t *data, uint32_t len)
 
uint16_t ipv4_checksum (void *addr, int count)
 From: https://tools.ietf.org/html/rfc1071.
 

Detailed Description

Function Documentation

◆ ipv4_checksum()

uint16_t ipv4_checksum ( void * addr,
int count )

From: https://tools.ietf.org/html/rfc1071.

Computes an Internet checksum as defined in RFC1071.

See also
https://tools.ietf.org/html/rfc1071
https://tools.ietf.org/html/rfc1141
Parameters
addrthe address of the data to compute a checksum to
countthe number of data bytes to use for the checksum
Returns
a checksum value

◆ ipv4_receive_packet()

void ipv4_receive_packet ( net_interface_t * interface,
uint8_t * data,
uint32_t len )

Handles IPv4 packets.

Parameters
interfacethe interface that received the IPv4 packet
datathe data containing the IPv4 packet
lenthe length of the data

◆ ipv4_send_packet()

void ipv4_send_packet ( net_interface_t * interface,
struct sockaddr_in * dst_addr,
uint8_t protocol,
uint16_t flags,
uint8_t * data,
uint32_t len )

Sends an IPv4 packet.

Parameters
interfacethe interface to use to send the IPv4 request
dst_addrthe destination socket address
protocolthe protocol encapsulated in the IP packet
flagsIP flags
datathe data to send over IP
lenthe size of the data to send