Low-level Drivers for Network Devices
More...
|
file | net.h |
| Network support.
|
|
|
struct | netif_t |
| Structure describing one usable network device. More...
|
|
Low-level Drivers for Network Devices
◆ net_input_func
typedef int(* net_input_func) (netif_t *nif, const uint8 *pkt, int len) |
Network input callback type.
- Parameters
-
nif | The network device in use. |
pkt | The packet received. |
len | The length of the packet, in bytes. |
- Returns
- 0 on success, <0 on failure.
◆ net_get_if_list()
struct netif_list * net_get_if_list |
( |
void | | ) |
|
Function to retrieve the interface list.
- Warning
- Do not manipulate what this returns to you!
- Returns
- The network interface list.
◆ net_init()
Init network support.
- Note
- To auto-detect the IP address to assign to the default device (i.e, over DHCP or from the flashrom on the Dreamcast), pass 0 as the IP parameter.
- Parameters
-
ip | The IPv4 address to set on the default device, in host byte order. |
- Returns
- 0 on success, <0 on failure.
◆ net_input()
int net_input |
( |
netif_t * | device, |
|
|
const uint8 * | data, |
|
|
int | len ) |
Device drivers should call this function to submit packets received in the background.
This function may or may not return immediately but it won't take an infinitely long time (so it's safe to call inside interrupt handlers).
- Parameters
-
device | The network device submitting packets. |
data | The packet to submit. |
len | The length of the packet, in bytes. |
- Returns
- 0 on success, <0 on failure.
◆ net_input_set_target()
Setup a network input target.
- Parameters
-
t | The new target callback. |
- Returns
- The old target.
◆ net_reg_device()
int net_reg_device |
( |
netif_t * | device | ) |
|
Register a network device.
- Parameters
-
device | The device to register. \ |
- Returns
- 0 on success, <0 on failure.
◆ net_set_default()
Set our default device to an arbitrary device.
- Parameters
-
n | The device to set as default. |
- Returns
- The old default device.
◆ net_shutdown()
void net_shutdown |
( |
void | | ) |
|
Shutdown network support.
◆ net_unreg_device()
int net_unreg_device |
( |
netif_t * | device | ) |
|
Unregister a network device.
- Parameters
-
device | The device to unregister. |
- Returns
- 0 on success, <0 on failure.
◆ net_default_dev
The default network device, used with sockets (read-only).
◆ net_if_list
struct netif_list net_if_list |
|
extern |
Interface list; note: do not manipulate directly!
◆ net_input_target
Where will input packets be routed?