|
Retro Rocket Kernel
BASIC-Powered Operating System
|
Data Structures | |
| struct | ethernet_frame |
| There is actually more to an ethernet frame than this (see the STD documents!) but we don't have access to it from the software. More... | |
Macros | |
| #define | HARDWARE_TYPE_ETHERNET 0x01 |
| Ethernet hardware type. More... | |
Typedefs | |
| typedef void(* | ethernet_protocol_t) (void *, int) |
Functions | |
| struct ethernet_frame | __attribute__ ((packed)) ethernet_frame_t |
| There is actually more to an ethernet frame than this (see the STD documents!) but we don't have access to it from the software. More... | |
| int | ethernet_send_packet (uint8_t *dst_mac_addr, uint8_t *data, int len, uint16_t protocol) |
| Send a raw ethernet packet to the network card driver. More... | |
| void | ethernet_handle_packet (ethernet_frame_t *packet, int len) |
| Handle inbound packet via interrupt from network card driver. More... | |
| bool | ethernet_register_iee802_number (uint16_t protocol_number, ethernet_protocol_t handler) |
| Register a protocol with the ethernet layer See https://www.iana.org/assignments/ieee-802-numbers/ieee-802-numbers.xhtml for a list of protocol numbers. More... | |
Variables | |
| uint8_t | dst_mac_addr [6] |
| uint8_t | src_mac_addr [6] |
| uint16_t | type |
| uint8_t | data [] |
| #define HARDWARE_TYPE_ETHERNET 0x01 |
Ethernet hardware type.
| typedef void(* ethernet_protocol_t) (void *, int) |
| struct ethernet_frame __attribute__ | ( | (packed) | ) |
There is actually more to an ethernet frame than this (see the STD documents!) but we don't have access to it from the software.
| void ethernet_handle_packet | ( | ethernet_frame_t * | packet, |
| int | len | ||
| ) |
Handle inbound packet via interrupt from network card driver.
| packet | raw packet data |
| len | packet data length |
| bool ethernet_register_iee802_number | ( | uint16_t | protocol_number, |
| ethernet_protocol_t | handler | ||
| ) |
Register a protocol with the ethernet layer See https://www.iana.org/assignments/ieee-802-numbers/ieee-802-numbers.xhtml for a list of protocol numbers.
| protocol_number | IEE802 protocol number to register |
| handler | protocol handler |
| int ethernet_send_packet | ( | uint8_t * | dst_mac_addr, |
| uint8_t * | data, | ||
| int | len, | ||
| uint16_t | protocol | ||
| ) |
Send a raw ethernet packet to the network card driver.
| dst_mac_addr | destination MAC address (FF:FF:FF:FF:FF:FF for broadcast) |
| data | raw packet data |
| len | packet data length |
| protocol | protocol type |
| uint8_t data[] |
| uint8_t dst_mac_addr[6] |
| uint8_t src_mac_addr[6] |
| uint16_t type |