In addition to low-level drivers on applicable platforms, KOS supports a fully abstracted network datagram system. This system is capable of enumerating devices attached to the system and letting the program send and receive datagrams on those devices. Usually the network system is attached to something more high level, such as a TCP/IP stack. To enable networking, you must use the INIT_NET flag on the KOS_INIT_FLAGS line.
The pieces of the network system which are actually functional and well-specified are described below.
Low-level device drivers should call this function to register datagram input to the network system. The low-level driver's handle should be passed as device, while data and len are the data and length of the datagram.
Sets the output port for datagram inputs. The function t will be called any time a datagram is available from a call to net_input. This function returns the address of the old function. The default target is a simple ICMP echo (ping) handler.
Registers a potentially available device driver with the network system. This should be called by any low-level driver which wants to make itself available. Note that the device need not be physically present on the system - the network system will scan for available drivers at init time.
Unregisters a previously registered network device.