KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
ppp_protocol_t Struct Reference

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.
 

Detailed Description

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.

Member Function Documentation

◆ TAILQ_ENTRY()

ppp_protocol_t::TAILQ_ENTRY ( ppp_proto )

Protocol list entry (not a function!).

Field Documentation

◆ check_timeouts

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.

Parameters
selfThe protocol structure for this protocol.
tmThe current system time for checking timeouts against (in milliseconds since system startup).

◆ code

uint16_t ppp_protocol_t::code

Protocol code.

◆ enter_phase

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).

Parameters
selfThe protocol structure for this protocol.
oldpThe old phase (the one the automaton is leaving).
newpThe new phase.
See also
Automaton Phases

◆ init

int(* ppp_protocol_t::init) (struct ppp_proto *self)

Initialization function.

Parameters
selfThe protocol structure for this protocol.
Returns
0 on success, <0 on failure.
Note
Set to NULL if this is not needed in the protocol.

◆ input

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.

Parameters
selfThe protocol structure for this protocol.
pktThe packet being delivered.
lenThe length of the packet in bytes.
Returns
0 on success, <0 on failure.

◆ name

const char* ppp_protocol_t::name

Protocol name ("lcp", "pap", etc).

◆ privdata

void* ppp_protocol_t::privdata

Private data (if any).

◆ shutdown

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.

Parameters
selfThe protocol structure for this protocol.
Returns
0 on success, <0 on failure.

The documentation for this struct was generated from the following file: