Nut/OS  5.0.5
API Reference
LCP

Link control protocol. More...

Collaboration diagram for LCP:

Functions

void LcpRxProtRej (NUTDEVICE *dev)
void NutLcpInput (NUTDEVICE *dev, NETBUF *nb)
 Handle incoming LCP packets.
int NutLcpOutput (NUTDEVICE *dev, uint8_t code, uint8_t id, NETBUF *nb)
 Send a LCP packet.
void LcpTxConfReq (NUTDEVICE *dev, uint8_t id, uint8_t rejected)
void LcpTxProtRej (NUTDEVICE *dev, uint16_t protocol, NETBUF *nb)

Variables

uint32_t new_magic
uint32_t new_magic

Detailed Description

Link control protocol.


Function Documentation

void LcpRxProtRej ( NUTDEVICE dev)

References _PPPDCB::dcb_lcp_state, _PPPDCB::dcb_reqid, _NUTDEVICE::dev_dcb, IpcpLowerDown(), NutIpcpOutput(), PPPS_ACKRCVD, PPPS_ACKSENT, PPPS_CLOSED, PPPS_CLOSING, PPPS_OPENED, PPPS_REQSENT, PPPS_STOPPED, PPPS_STOPPING, and XCP_TERMREQ.

Here is the call graph for this function:

void NutLcpInput ( NUTDEVICE dev,
NETBUF nb 
)

Handle incoming LCP packets.

Packets not destined to us or packets with unsupported address type or item length are silently discarded.

Note:
This routine is called by the Ethernet layer on incoming ARP packets. Applications typically do not call this function.
Parameters:
devIdentifies the device that received the packet.
nbPointer to a network buffer structure containing the ARP packet.

References _PPPDCB::dcb_lcp_state, _NUTDEVICE::dev_dcb, htons, LCP_DRQ, LCP_ERP, LCP_ERQ, _NETBUF::nb_ap, _NETBUF::nb_nw, NutNetBufFree(), PPPS_INITIAL, PPPS_STARTING, _NBDATA::sz, _NBDATA::vp, xcphdr::xch_code, xcphdr::xch_id, xcphdr::xch_len, XCP_CODEREJ, XCP_CONFACK, XCP_CONFNAK, XCP_CONFREJ, XCP_CONFREQ, XCP_TERMACK, and XCP_TERMREQ.

Referenced by NutPppInput().

Here is the call graph for this function:

int NutLcpOutput ( NUTDEVICE dev,
uint8_t  code,
uint8_t  id,
NETBUF nb 
)

Send a LCP packet.

Note:
Applications typically do not call this function.
Parameters:
devIdentifies the device to use.
codeType subcode.
idExchange identifier.
nbNetwork buffer structure containing the packet to send or null if the packet contains no information. The structure must have been allocated by a previous call NutNetBufAlloc() and will be freed when this function returns.
Returns:
0 on success, -1 in case of any errors.

References htons, _NETBUF::nb_ap, _NETBUF::nb_nw, _NETBUF::nb_tp, NBAF_NETWORK, NutNetBufAlloc(), NutNetBufFree(), NutPppOutput(), PPP_LCP, _NBDATA::sz, _NBDATA::vp, xcphdr::xch_code, xcphdr::xch_id, and xcphdr::xch_len.

Referenced by LcpClose(), LcpTxConfReq(), LcpTxProtRej(), and NutPppSm().

Here is the call graph for this function:

void LcpTxConfReq ( NUTDEVICE dev,
uint8_t  id,
uint8_t  rejected 
)
void LcpTxProtRej ( NUTDEVICE dev,
uint16_t  protocol,
NETBUF nb 
)

References _PPPDCB::dcb_rejid, _NUTDEVICE::dev_dcb, htons, LCP_PROTREJ, memcpy(), _NETBUF::nb_ap, _NETBUF::nb_nw, NBAF_APPLICATION, NutLcpOutput(), NutNetBufAlloc(), NutNetBufFree(), _NBDATA::sz, and _NBDATA::vp.

Referenced by NutPppInput().

Here is the call graph for this function:


Variable Documentation

Referenced by NutPppSm().