|
Retro Rocket Kernel
BASIC-Powered Operating System
|
#include "kernel.h"Data Structures | |
| struct | udp_packet |
| Raw structure for UDP. More... | |
Typedefs | |
| typedef void(* | udp_daemon_handler) (uint16_t, void *, uint32_t) |
Functions | |
| struct udp_packet | __attribute__ ((packed)) udp_packet_t |
| Raw structure for UDP. More... | |
| uint16_t | udp_calculate_checksum (udp_packet_t *packet) |
| This returns 0 for all checksums as it is optional in ipv4. More... | |
| void | udp_send_packet (uint8_t *dst_ip, uint16_t src_port, uint16_t dst_port, void *data, uint16_t len) |
| Send a UDP packet via the ethernet driver. More... | |
| void | udp_handle_packet ([[maybe_unused]] ip_packet_t *encap_packet, udp_packet_t *packet, size_t len) |
| Handle UDP packet from the IP driver. More... | |
| uint16_t | udp_register_daemon (uint16_t dst_port, udp_daemon_handler handler) |
| Register a daemon function to listen on a udp dest port. More... | |
Variables | |
| uint16_t | src_port |
| uint16_t | dst_port |
| uint16_t | length |
| uint16_t | checksum |
| uint8_t | data [] |
| typedef void(* udp_daemon_handler) (uint16_t, void *, uint32_t) |
| struct udp_packet __attribute__ | ( | (packed) | ) |
Raw structure for UDP.
| uint16_t udp_calculate_checksum | ( | udp_packet_t * | packet | ) |
This returns 0 for all checksums as it is optional in ipv4.
| packet | packet data |
| void udp_handle_packet | ( | [[maybe_unused] ] ip_packet_t * | encap_packet, |
| udp_packet_t * | packet, | ||
| size_t | len | ||
| ) |
Handle UDP packet from the IP driver.
| ip | Encapsulating IP packet |
| packet | raw UDP packet |
| length | UDP packet length |
| uint16_t udp_register_daemon | ( | uint16_t | dst_port, |
| udp_daemon_handler | handler | ||
| ) |
Register a daemon function to listen on a udp dest port.
| dst_port | destination port to listen on. If 0 is passed, a random port above or equal to 1024 is allocated for use and will be returned as the return value. |
| handler | handler for incoming packets |
| void udp_send_packet | ( | uint8_t * | dst_ip, |
| uint16_t | src_port, | ||
| uint16_t | dst_port, | ||
| void * | data, | ||
| uint16_t | len | ||
| ) |
Send a UDP packet via the ethernet driver.
| dst_ip | destination IP address |
| src_port | source port number |
| dst_port | destination port number |
| data | raw packet data |
| len | raw packet length |
| uint16_t checksum |
| uint8_t data[] |
| uint16_t dst_port |
| uint16_t length |
| uint16_t src_port |