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

Data Structures

struct  udp_header_t
 

Functions

void udp_receive_packet (net_interface_t *interface, uint8_t *packet, ipv4_header_t *ipv4_header)
 
void udp_send_packet (net_interface_t *interface, uint16_t src_port, uint8_t dst_mac[6], struct sockaddr_in *dst_addr, uint8_t *data, uint32_t len)
 

Detailed Description

Function Documentation

◆ udp_receive_packet()

void udp_receive_packet ( net_interface_t * interface,
uint8_t * packet,
ipv4_header_t * ipv4_header )

Receives a UDP packet.

Parameters
interfacethe interface on which the UDP packet has been received
packetthe UDP packet
ipv4_headerthe IPv4 header

◆ udp_send_packet()

void udp_send_packet ( net_interface_t * interface,
uint16_t src_port,
uint8_t dst_mac[6],
struct sockaddr_in * dst_addr,
uint8_t * data,
uint32_t len )

Sends a UDP packet.

Parameters
interfacethe interface that should be used to send the UDP packet
src_portthe source port
dst_macthe destination MAC address
dst_addrthe destination socket address
datathe UDP data
lenthe length of the UDP data