KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
Drivers

Low-level Drivers for Network Devices. More...

Modules

 Blocking Types
 Blocking type avlues for network interfaces.
 
 Broadband Adapter
 Driver for the Dreamcast's BBA (RTL8139C).
 
 LAN Adapter
 Driver for the Dreamcast's LAN Adapter.
 
 Modem
 Driver for the Dreamcast's built-in 56k Modem.
 
 TX Return Values
 Driver return values for TX network interfaces.
 
 netif_t Flags
 Network interface flags.
 

Files

file  net.h
 Network support.
 

Data Structures

struct  netif_t
 Structure describing one usable network device. More...
 

Typedefs

typedef int(* net_input_func) (netif_t *nif, const uint8 *pkt, int len)
 Network input callback type.
 

Functions

int net_input (netif_t *device, const uint8 *data, int len)
 Device drivers should call this function to submit packets received in the background.
 
net_input_func net_input_set_target (net_input_func t)
 Setup a network input target.
 
struct netif_list * net_get_if_list (void)
 Function to retrieve the interface list.
 
netif_tnet_set_default (netif_t *n)
 Set our default device to an arbitrary device.
 
int net_reg_device (netif_t *device)
 Register a network device.
 
int net_unreg_device (netif_t *device)
 Unregister a network device.
 
int net_init (uint32 ip)
 Init network support.
 
void net_shutdown (void)
 Shutdown network support.
 

Variables

net_input_func net_input_target
 Where will input packets be routed?
 
struct netif_list net_if_list
 Interface list; note: do not manipulate directly!
 
netif_tnet_default_dev
 The default network device, used with sockets (read-only). <>
 

Detailed Description

Low-level Drivers for Network Devices.

Typedef Documentation

◆ net_input_func

typedef int(* net_input_func) (netif_t *nif, const uint8 *pkt, int len)

Network input callback type.

Parameters
nifThe network device in use.
pktThe packet received.
lenThe length of the packet, in bytes.
Returns
0 on success, <0 on failure.

Function Documentation

◆ 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()

int net_init ( uint32  ip)

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
ipThe 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
deviceThe network device submitting packets.
dataThe packet to submit.
lenThe length of the packet, in bytes.
Returns
0 on success, <0 on failure.

◆ net_input_set_target()

net_input_func net_input_set_target ( net_input_func  t)

Setup a network input target.

Parameters
tThe new target callback.
Returns
The old target.

◆ net_reg_device()

int net_reg_device ( netif_t device)

Register a network device.

Parameters
deviceThe device to register. \
Returns
0 on success, <0 on failure.

◆ net_set_default()

netif_t * net_set_default ( netif_t n)

Set our default device to an arbitrary device.

Parameters
nThe 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
deviceThe device to unregister.
Returns
0 on success, <0 on failure.

Variable Documentation

◆ net_default_dev

netif_t* net_default_dev
extern

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

net_input_func net_input_target
extern

Where will input packets be routed?