KallistiOS git master
Independent SDK for the Sega Dreamcast
|
PPP device structure. More...
#include <ppp/ppp.h>
Data Fields | |
const char * | name |
Device name ("modem", "scif", 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_t | flags |
Device flags. | |
void * | privdata |
Private, device-specific data. | |
int(* | detect )(struct ppp_device *self) |
Attempt to detect the device. | |
int(* | init )(struct ppp_device *self) |
Initialize the device. | |
int(* | shutdown )(struct ppp_device *self) |
Shutdown the device. | |
int(* | tx )(struct ppp_device *self, const uint8_t *data, size_t len, uint32_t flags) |
Transmit data on the device. | |
const uint8_t *(* | rx )(struct ppp_device *self, ssize_t *out_len) |
Poll for queued receive data. | |
PPP device structure.
This structure defines a basic output device for PPP packets. This structure is largely modeled after netif_t from the main network stack, with a bit of functionality removed that is irrelevant for PPP.
Note that we only allow one device and one connection in this library.
const char* ppp_device_t::descr |
Long description of the device.
int(* ppp_device_t::detect) (struct ppp_device *self) |
Attempt to detect the device.
self | The network device in question. |
uint32_t ppp_device_t::flags |
Device flags.
The lowest 16 bits of this value are reserved for use by libppp. You are free to use the other 16 bits as you see fit in your driver.
int ppp_device_t::index |
Unit index (starts at zero and counts upwards for multiple network devices of the same type).
int(* ppp_device_t::init) (struct ppp_device *self) |
Initialize the device.
self | The network device in question. |
const char* ppp_device_t::name |
Device name ("modem", "scif", etc).
void* ppp_device_t::privdata |
Private, device-specific data.
This can be used for whatever the driver deems fit. The PPP code won't touch this data at all. Set to NULL if you don't need anything here.
const uint8_t *(* ppp_device_t::rx) (struct ppp_device *self, ssize_t *out_len) |
Poll for queued receive data.
This function will be called periodically by a thread to check the device for any new incoming data.
self | The network device in question. |
int(* ppp_device_t::shutdown) (struct ppp_device *self) |
Shutdown the device.
self | The network device in question. |
int(* ppp_device_t::tx) (struct ppp_device *self, const uint8_t *data, size_t len, uint32_t flags) |
Transmit data on the device.
This function will be called periodically to transmit data on the underlying device. The data passed in may not necessarily be a whole packet (check the flags to see what's being passed in).
self | The network device in question. |
data | The data to transmit. |
len | The length of the data to transmit in bytes. |
flags | Flags to describe what data is being sent in. |