KallistiOS git master
Independent SDK for the Sega Dreamcast
|
PPP Protocol structure. More...
#include <ppp/ppp.h>
Public Member Functions | |
TAILQ_ENTRY (ppp_proto) entry | |
Protocol list entry (not a function!). | |
Data Fields | |
const char * | name |
Protocol name ("lcp", "pap", etc). | |
uint16_t | code |
Protocol code. | |
void * | privdata |
Private data (if any). | |
int(* | init )(struct ppp_proto *self) |
Initialization function. | |
int(* | shutdown )(struct ppp_proto *self) |
Shutdown function. | |
int(* | input )(struct ppp_proto *self, const uint8_t *buf, size_t len) |
Protocol packet input function. | |
void(* | enter_phase )(struct ppp_proto *self, int oldp, int newp) |
Notify the protocol of a PPP phase change. | |
void(* | check_timeouts )(struct ppp_proto *self, uint64_t tm) |
Check timeouts for resending packets. | |
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_protocol_t::TAILQ_ENTRY | ( | ppp_proto | ) |
Protocol list entry (not a function!).
void(* ppp_protocol_t::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_protocol_t::code |
Protocol code.
void(* ppp_protocol_t::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_protocol_t::init) (struct ppp_proto *self) |
Initialization function.
self | The protocol structure for this protocol. |
int(* ppp_protocol_t::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_protocol_t::name |
Protocol name ("lcp", "pap", etc).
void* ppp_protocol_t::privdata |
Private data (if any).
int(* ppp_protocol_t::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. |