|
Retro Rocket Kernel
BASIC-Powered Operating System
|
#include "kernel.h"Data Structures | |
| struct | net_address_t |
| Represents an address that is bound to a protocol on an interface. This is kept as flexible as possible, to represent potentially different protocol's forms of addresses, e.g. IPv4, IPv6, IPX, Econet etc. The length indicates the number of bytes in the address, and the bytes field contains the actual address in host byte order. For example in IPv4, length would be 4 and bytes would essentially point at a uint32_t. The name is purely a human readable label for use in commands. The label might be 'ip.address', 'ip.gateway' etc. More... | |
| struct | netproto_t |
| Represents a protocol, or group of related protocols, that can be attached to an interface and can have addresses. At present only ethernet devices are supported, this covers 99% of the scenarios we might see in the wild on consumer machines. More... | |
| struct | netdev_t |
| An ethernet network device, this relates directly to a physical network card in the machine. A device may have zero or more attached protocols, each protocol intercepts an ethernet id number. Where a protocol requires another protocol to be of use, e.g. ARP with IPv4, the dependency will be added automatically by other protocols that require it. More... | |
Enumerations | |
| enum | netdev_flags_t { ADMINISTRATIVELY_DOWN = 1 , CONNECTED = 2 } |
| Potential flags for the state of a network device. More... | |
Functions | |
| uint8_t | htonb (uint8_t byte, int num_bits) |
| Host to network byte. More... | |
| uint8_t | ntohb (uint8_t byte, int num_bits) |
| Network to host byte. More... | |
| uint16_t | htons (uint16_t hostshort) |
| Host to network short. More... | |
| uint32_t | htonl (uint32_t hostlong) |
| Host to network long. More... | |
| uint16_t | ntohs (uint16_t netshort) |
| Network to host short. More... | |
| uint32_t | ntohl (uint32_t netlong) |
| Network to host long. More... | |
| void | network_up () |
| void | network_down () |
| enum netdev_flags_t |
| uint8_t htonb | ( | uint8_t | byte, |
| int | num_bits | ||
| ) |
Host to network byte.
| byte | input |
| num_bits | number of bits of high nibble |
| uint32_t htonl | ( | uint32_t | hostlong | ) |
Host to network long.
| hostlong | input |
| uint16_t htons | ( | uint16_t | hostshort | ) |
Host to network short.
| hostshort | input |
| void network_down | ( | ) |
| void network_up | ( | ) |
| uint8_t ntohb | ( | uint8_t | byte, |
| int | num_bits | ||
| ) |
Network to host byte.
| byte | input |
| num_bits | number of bits of high nibble |
| uint32_t ntohl | ( | uint32_t | netlong | ) |
Network to host long.
| netlong | input |
| uint16_t ntohs | ( | uint16_t | netshort | ) |
Network to host short.
| netshort | input |