KallistiOS
##version##
|
Structure describing one usable network device. More...
#include <kos/net.h>
Public Member Functions | |
LIST_ENTRY (knetif) if_list | |
Device list handle (not a function!) More... | |
Data Fields | |
const char * | name |
Device name ("bba", "la", etc) More... | |
const char * | descr |
Long description of the device. More... | |
int | index |
Unit index (starts at zero and counts upwards for multiple network devices of the same type) More... | |
uint32 | dev_id |
Internal device ID (for whatever the driver wants) More... | |
uint32 | flags |
Interface flags. More... | |
uint8 | mac_addr [6] |
The device's MAC address. More... | |
uint8 | ip_addr [4] |
The device's IP address (if any) More... | |
uint8 | netmask [4] |
The device's netmask. More... | |
uint8 | gateway [4] |
The device's gateway's IP address. More... | |
uint8 | broadcast [4] |
The device's broadcast address. More... | |
uint8 | dns [4] |
The device's DNS server address. More... | |
int | mtu |
The device's MTU. More... | |
struct in6_addr | ip6_lladdr |
The device's Link-local IPv6 address. More... | |
struct in6_addr * | ip6_addrs |
Any further IPv6 addresses the device has. The first address in this list will always be used, unless otherwise specified. More... | |
int | ip6_addr_count |
struct in6_addr | ip6_gateway |
The device's gateway's IPv6 address. More... | |
uint32 | mtu6 |
Default MTU over IPv6. More... | |
int | hop_limit |
Default hop limit over IPv6. More... | |
int(* | if_detect )(struct knetif *self) |
Attempt to detect the device. More... | |
int(* | if_init )(struct knetif *self) |
Initialize the device. More... | |
int(* | if_shutdown )(struct knetif *self) |
Shutdown the device. More... | |
int(* | if_start )(struct knetif *self) |
Start the device (after init or stop). More... | |
int(* | if_stop )(struct knetif *self) |
Stop (hibernate) the device. More... | |
int(* | if_tx )(struct knetif *self, const uint8 *data, int len, int blocking) |
Queue a packet for transmission. More... | |
int(* | if_tx_commit )(struct knetif *self) |
Commit any queued output packets. More... | |
int(* | if_rx_poll )(struct knetif *self) |
Poll for queued receive packets, if neccessary. More... | |
int(* | if_set_flags )(struct knetif *self, uint32 flags_and, uint32 flags_or) |
Set flags; you should generally manipulate flags through here so that the driver gets a chance to act on the info. More... | |
int(* | if_set_mc )(struct knetif *self, const uint8 *list, int count) |
Set the device's multicast list. More... | |
Structure describing one usable network device.
Each usable network device should have one of these describing it. These must be registered to the network layer before the device is useable.
knetif::LIST_ENTRY | ( | knetif | ) |
Device list handle (not a function!)
uint8 knetif::broadcast[4] |
The device's broadcast address.
const char* knetif::descr |
Long description of the device.
uint32 knetif::dev_id |
Internal device ID (for whatever the driver wants)
uint8 knetif::dns[4] |
The device's DNS server address.
uint32 knetif::flags |
Interface flags.
uint8 knetif::gateway[4] |
The device's gateway's IP address.
int knetif::hop_limit |
Default hop limit over IPv6.
int(* knetif::if_detect)(struct knetif *self) |
Attempt to detect the device.
self | The network device in question. |
int(* knetif::if_init)(struct knetif *self) |
Initialize the device.
self | The network device in question. |
int(* knetif::if_rx_poll)(struct knetif *self) |
Poll for queued receive packets, if neccessary.
self | The network device in question. |
Set flags; you should generally manipulate flags through here so that the driver gets a chance to act on the info.
self | The network device in question. |
flags_and | Bitmask to and with the flags. |
flags_or | Bitmask to or with the flags. |
Set the device's multicast list.
self | The network device in question. |
list | The list of MAC addresses (6 * count bytes). |
count | The number of addresses in list. |
int(* knetif::if_shutdown)(struct knetif *self) |
Shutdown the device.
self | The network device in question. |
int(* knetif::if_start)(struct knetif *self) |
Start the device (after init or stop).
self | The network device in question. |
int(* knetif::if_stop)(struct knetif *self) |
Stop (hibernate) the device.
self | The network device in question. |
Queue a packet for transmission.
self | The network device in question. |
data | The packet to transmit. |
len | The length of the packet in bytes. |
blocking | 1 if we should block if needed, 0 otherwise. |
NETIF_TX_OK | On success. |
NETIF_TX_ERROR | On general failure. |
NETIF_TX_AGAIN | If non-blocking and we must block to send. |
int(* knetif::if_tx_commit)(struct knetif *self) |
Commit any queued output packets.
self | The network device in question. |
int knetif::index |
Unit index (starts at zero and counts upwards for multiple network devices of the same type)
int knetif::ip6_addr_count |
struct in6_addr* knetif::ip6_addrs |
Any further IPv6 addresses the device has. The first address in this list will always be used, unless otherwise specified.
struct in6_addr knetif::ip6_gateway |
The device's gateway's IPv6 address.
struct in6_addr knetif::ip6_lladdr |
The device's Link-local IPv6 address.
uint8 knetif::ip_addr[4] |
The device's IP address (if any)
uint8 knetif::mac_addr[6] |
The device's MAC address.
int knetif::mtu |
The device's MTU.
uint32 knetif::mtu6 |
Default MTU over IPv6.
const char* knetif::name |
Device name ("bba", "la", etc)
uint8 knetif::netmask[4] |
The device's netmask.