KallistiOS
##version##
|
PPP Protocol structure. More...
#include <ppp/ppp.h>
Public Member Functions | |
TAILQ_ENTRY (ppp_proto) entry | |
Protocol list entry (not a function!). More... | |
Data Fields | |
const char * | name |
Protocol name ("lcp", "pap", etc). More... | |
uint16_t | code |
Protocol code. More... | |
void * | privdata |
Private data (if any). More... | |
int(* | init )(struct ppp_proto *self) |
Initialization function. More... | |
int(* | shutdown )(struct ppp_proto *self) |
Shutdown function. More... | |
int(* | input )(struct ppp_proto *self, const uint8_t *buf, size_t len) |
Protocol packet input function. More... | |
void(* | enter_phase )(struct ppp_proto *self, int oldp, int newp) |
Notify the protocol of a PPP phase change. More... | |
void(* | check_timeouts )(struct ppp_proto *self, uint64_t tm) |
Check timeouts for resending packets. More... | |
PPP Protocol structure.
Each protocol that the PPP library can handle must have one of these registered. All protocols should be registered BEFORE attempting to actually establish a PPP session to ensure that each protocol can be used in the setup of the connection as needed.
ppp_proto::TAILQ_ENTRY | ( | ppp_proto | ) |
Protocol list entry (not a function!).
void(* ppp_proto::check_timeouts)(struct ppp_proto *self, uint64_t tm) |
Check timeouts for resending packets.
This function will be called periodically to allow the protocol to check any resend timers that it might have responsibility for.
self | The protocol structure for this protocol. |
tm | The current system time for checking timeouts against (in milliseconds since system startup). |
uint16_t ppp_proto::code |
Protocol code.
void(* ppp_proto::enter_phase)(struct ppp_proto *self, int oldp, int newp) |
Notify the protocol of a PPP phase change.
This function will be called by the PPP automaton any time that a phase change is initiated. This is often used for starting up a protocol when appropriate to do so (for instance, LCP uses this to begin negotiating configuration options with the peer when the establish phase is entered by the automaton).
self | The protocol structure for this protocol. |
oldp | The old phase (the one the automaton is leaving). |
newp | The new phase. |
int(* ppp_proto::init)(struct ppp_proto *self) |
Initialization function.
self | The protocol structure for this protocol. |
int(* ppp_proto::input)(struct ppp_proto *self, const uint8_t *buf, size_t len) |
Protocol packet input function.
This function will be called for each packet delivered to the specified protocol.
self | The protocol structure for this protocol. |
pkt | The packet being delivered. |
len | The length of the packet in bytes. |
const char* ppp_proto::name |
Protocol name ("lcp", "pap", etc).
void* ppp_proto::privdata |
Private data (if any).
int(* ppp_proto::shutdown)(struct ppp_proto *self) |
Shutdown function.
This function should perform any protocol-specific shutdown actions and unregister the protocol from the PPP protocol list.
self | The protocol structure for this protocol. |