LCP
[PPP]

Collaboration diagram for LCP:


Detailed Description

Link control protocol.


Functions

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

Variables

u_long new_magic
u_long new_magic


Function Documentation

void LcpRxProtRej ( NUTDEVICE dev  ) 

Definition at line 498 of file lcpin.c.

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.

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:
dev Identifies the device that received the packet.
nb Pointer to a network buffer structure containing the ARP packet.

Definition at line 569 of file lcpin.c.

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

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

Send a LCP packet.

Note:
Applications typically do not call this function.
Parameters:
dev Identifies the device to use.
code Type subcode.
id Exchange identifier.
nb Network 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.

Definition at line 113 of file lcpout.c.

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

void LcpResetOptions ( NUTDEVICE dev  ) 

Definition at line 131 of file lcpout.c.

References _PPPDCB::dcb_accm, _PPPDCB::dcb_auth, _PPPDCB::dcb_compr, _PPPDCB::dcb_loc_magic, _PPPDCB::dcb_loc_mru, _PPPDCB::dcb_neg_magic, _PPPDCB::dcb_rem_magic, _NUTDEVICE::dev_dcb, LCP_DEFOPT_ASYNCMAP, new_magic, and PPP_PAP.

Referenced by LcpTxConfReq().

void LcpTxConfReq ( NUTDEVICE dev,
u_char  id,
u_char  rejected 
)

Definition at line 147 of file lcpout.c.

References _PPPDCB::dcb_acked, _PPPDCB::dcb_lcp_naks, _PPPDCB::dcb_lcp_state, _PPPDCB::dcb_neg_magic, _PPPDCB::dcb_retries, _NUTDEVICE::dev_dcb, htonl, LCP_ASYNCMAP, LCP_DEFOPT_ASYNCMAP, LCP_MAGICNUMBER, LcpResetOptions(), _NETBUF::nb_ap, NBAF_APPLICATION, NutLcpOutput(), NutNetBufAlloc(), PPPS_ACKRCVD, PPPS_ACKSENT, PPPS_REQSENT, XCPOPT::ul, _NBDATA::vp, XCP_CONFREQ, XCPOPT::xcpo_, XCPOPT::xcpo_len, and XCPOPT::xcpo_type.

Referenced by LcpLowerUp(), LcpOpen(), and NutPppSm().

void LcpTxProtRej ( NUTDEVICE dev,
u_short  protocol,
NETBUF nb 
)

Definition at line 195 of file lcpout.c.

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


Variable Documentation

u_long new_magic

Definition at line 100 of file pppsm.c.

Referenced by LcpResetOptions(), and NutPppSm().

u_long new_magic

Definition at line 100 of file pppsm.c.


© 2000-2007 by egnite Software GmbH - visit http://www.ethernut.de/