KallistiOS
##version##
|
PPP device structure. More...
#include <ppp/ppp.h>
Data Fields | |
const char * | name |
Device name ("modem", "scif", etc). More... | |
const char * | descr |
Long description of the device. More... | |
int | index |
Unit index (starts at zero and counts upwards for multiple network devices of the same type). More... | |
uint32_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. More... | |
void * | 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. More... | |
int(* | detect )(struct ppp_device *self) |
Attempt to detect the device. More... | |
int(* | init )(struct ppp_device *self) |
Initialize the device. More... | |
int(* | shutdown )(struct ppp_device *self) |
Shutdown the device. More... | |
int(* | tx )(struct ppp_device *self, const uint8_t *data, size_t len, uint32_t flags) |
Transmit data on the device. More... | |
const uint8_t *(* | rx )(struct ppp_device *self, ssize_t *out_len) |
Poll for queued receive data. More... | |
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::descr |
Long description of the device.
int(* ppp_device::detect)(struct ppp_device *self) |
Attempt to detect the device.
self | The network device in question. |
uint32_t ppp_device::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::index |
Unit index (starts at zero and counts upwards for multiple network devices of the same type).
int(* ppp_device::init)(struct ppp_device *self) |
Initialize the device.
self | The network device in question. |
const char* ppp_device::name |
Device name ("modem", "scif", etc).
void* ppp_device::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::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::shutdown)(struct ppp_device *self) |
Shutdown the device.
self | The network device in question. |
int(* ppp_device::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. |