KallistiOS git master
Independent SDK for the Sega Dreamcast
|
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!) | |
Data Fields | |
const char * | name |
Device name ("bba", "la", etc) | |
const char * | descr |
Long description of the device. | |
int | index |
Unit index (starts at zero and counts upwards for multiple network devices of the same type) | |
uint32 | dev_id |
Internal device ID (for whatever the driver wants) | |
uint32 | flags |
Interface flags. | |
uint8 | mac_addr [6] |
The device's MAC address. | |
uint8 | ip_addr [4] |
The device's IP address (if any) | |
uint8 | netmask [4] |
The device's netmask. | |
uint8 | gateway [4] |
The device's gateway's IP address. | |
uint8 | broadcast [4] |
The device's broadcast address. | |
uint8 | dns [4] |
The device's DNS server address. | |
int | mtu |
The device's MTU. | |
struct in6_addr | ip6_lladdr |
The device's Link-local IPv6 address. | |
struct in6_addr * | ip6_addrs |
Any further IPv6 addresses the device has. | |
int | ip6_addr_count |
struct in6_addr | ip6_gateway |
The device's gateway's IPv6 address. | |
uint32 | mtu6 |
Default MTU over IPv6. | |
int | hop_limit |
Default hop limit over IPv6. | |
int(* | if_detect )(struct knetif *self) |
Attempt to detect the device. | |
int(* | if_init )(struct knetif *self) |
Initialize the device. | |
int(* | if_shutdown )(struct knetif *self) |
Shutdown the device. | |
int(* | if_start )(struct knetif *self) |
Start the device (after init or stop). | |
int(* | if_stop )(struct knetif *self) |
Stop (hibernate) the device. | |
int(* | if_tx )(struct knetif *self, const uint8 *data, int len, int blocking) |
Queue a packet for transmission. | |
int(* | if_tx_commit )(struct knetif *self) |
Commit any queued output packets. | |
int(* | if_rx_poll )(struct knetif *self) |
Poll for queued receive packets, if necessary. | |
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. | |
int(* | if_set_mc )(struct knetif *self, const uint8 *list, int count) |
Set the device's multicast list. | |
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 usable.
netif_t::LIST_ENTRY | ( | knetif | ) |
Device list handle (not a function!)
uint8 netif_t::broadcast[4] |
The device's broadcast address.
const char* netif_t::descr |
Long description of the device.
uint32 netif_t::dev_id |
Internal device ID (for whatever the driver wants)
uint8 netif_t::dns[4] |
The device's DNS server address.
uint32 netif_t::flags |
Interface flags.
uint8 netif_t::gateway[4] |
The device's gateway's IP address.
int netif_t::hop_limit |
Default hop limit over IPv6.
int(* netif_t::if_detect) (struct knetif *self) |
Attempt to detect the device.
self | The network device in question. |
int(* netif_t::if_init) (struct knetif *self) |
Initialize the device.
self | The network device in question. |
int(* netif_t::if_rx_poll) (struct knetif *self) |
Poll for queued receive packets, if necessary.
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. |
int(* netif_t::if_set_mc) (struct knetif *self, const uint8 *list, int count) |
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(* netif_t::if_shutdown) (struct knetif *self) |
Shutdown the device.
self | The network device in question. |
int(* netif_t::if_start) (struct knetif *self) |
Start the device (after init or stop).
self | The network device in question. |
int(* netif_t::if_stop) (struct knetif *self) |
Stop (hibernate) the device.
self | The network device in question. |
int(* netif_t::if_tx) (struct knetif *self, const uint8 *data, int len, int blocking) |
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(* netif_t::if_tx_commit) (struct knetif *self) |
Commit any queued output packets.
self | The network device in question. |
int netif_t::index |
Unit index (starts at zero and counts upwards for multiple network devices of the same type)
int netif_t::ip6_addr_count |
struct in6_addr* netif_t::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 netif_t::ip6_gateway |
The device's gateway's IPv6 address.
struct in6_addr netif_t::ip6_lladdr |
The device's Link-local IPv6 address.
uint8 netif_t::ip_addr[4] |
The device's IP address (if any)
uint8 netif_t::mac_addr[6] |
The device's MAC address.
int netif_t::mtu |
The device's MTU.
uint32 netif_t::mtu6 |
Default MTU over IPv6.
const char* netif_t::name |
Device name ("bba", "la", etc)
uint8 netif_t::netmask[4] |
The device's netmask.