IPCP
[PPP]

Collaboration diagram for IPCP:
IP control protocol. More...

Functions

void IpcpRxConfReq (NUTDEVICE *dev, uint8_t id, NETBUF *nb)
void IpcpRxConfAck (NUTDEVICE *dev, uint8_t id, NETBUF *nb)
void IpcpRxTermReq (NUTDEVICE *dev, uint8_t id, NETBUF *nb)
void IpcpRxTermAck (NUTDEVICE *dev, uint8_t id, NETBUF *nb)
void IpcpRxProtRej (NUTDEVICE *dev)
void NutIpcpInput (NUTDEVICE *dev, NETBUF *nb)
 Handle incoming IPCP packets.
int NutIpcpOutput (NUTDEVICE *dev, uint8_t code, uint8_t id, NETBUF *nb)
 Send a IPCP packet.
void IpcpTxConfReq (NUTDEVICE *dev, uint8_t id)

Detailed Description

IP control protocol.


Function Documentation

void IpcpRxConfReq ( NUTDEVICE dev,
uint8_t  id,
NETBUF nb 
)

Definition at line 104 of file ipcpin.c.

References _PPPDCB::dcb_ip_dns1, _PPPDCB::dcb_ip_dns2, _PPPDCB::dcb_ipcp_naks, _PPPDCB::dcb_ipcp_state, _PPPDCB::dcb_remote_ip, _PPPDCB::dcb_reqid, _PPPDCB::dcb_state_chg, _NUTDEVICE::dev_dcb, IPCP_ADDR, IPCP_COMPRESSTYPE, IPCP_MS_DNS1, IPCP_MS_DNS2, IpcpLowerDown(), IpcpTxConfReq(), _NETBUF::nb_ap, NutEventPost(), NutIpcpOutput(), NutNetBufFree(), PPPS_ACKRCVD, PPPS_ACKSENT, PPPS_CLOSED, PPPS_CLOSING, PPPS_OPENED, PPPS_REQSENT, PPPS_STOPPED, PPPS_STOPPING, _NBDATA::sz, XCPOPT::uc, XCPOPT::ul, _NBDATA::vp, XCP_CONFACK, XCP_CONFNAK, XCP_CONFREJ, XCP_TERMACK, XCPOPT::xcpo_, XCPOPT::xcpo_len, and XCPOPT::xcpo_type.

Referenced by NutIpcpInput().

void IpcpRxConfAck ( NUTDEVICE dev,
uint8_t  id,
NETBUF nb 
)

Definition at line 258 of file ipcpin.c.

References _PPPDCB::dcb_acked, _PPPDCB::dcb_ip_dns1, _PPPDCB::dcb_ip_dns2, _PPPDCB::dcb_ipcp_state, _PPPDCB::dcb_local_ip, _PPPDCB::dcb_reqid, _PPPDCB::dcb_retries, _PPPDCB::dcb_state_chg, _NUTDEVICE::dev_dcb, IPCP_ADDR, IPCP_COMPRESSTYPE, IPCP_MS_DNS1, IPCP_MS_DNS2, IpcpLowerDown(), IpcpTxConfReq(), _NETBUF::nb_ap, NutEventPost(), NutIpcpOutput(), NutNetBufFree(), PPPS_ACKRCVD, PPPS_ACKSENT, PPPS_CLOSED, PPPS_OPENED, PPPS_REQSENT, PPPS_STOPPED, _NBDATA::sz, XCPOPT::ul, _NBDATA::vp, XCP_TERMACK, XCPOPT::xcpo_, XCPOPT::xcpo_len, and XCPOPT::xcpo_type.

Referenced by NutIpcpInput().

void IpcpRxTermReq ( NUTDEVICE dev,
uint8_t  id,
NETBUF nb 
)

Definition at line 429 of file ipcpin.c.

References _PPPDCB::dcb_ipcp_state, _NUTDEVICE::dev_dcb, IpcpLowerDown(), NutIpcpOutput(), NutNetBufFree(), PPPS_ACKRCVD, PPPS_ACKSENT, PPPS_OPENED, PPPS_REQSENT, PPPS_STOPPING, and XCP_TERMACK.

Referenced by NutIpcpInput().

void IpcpRxTermAck ( NUTDEVICE dev,
uint8_t  id,
NETBUF nb 
)

Definition at line 451 of file ipcpin.c.

References _PPPDCB::dcb_ipcp_state, _PPPDCB::dcb_reqid, _NUTDEVICE::dev_dcb, IpcpLowerDown(), IpcpTxConfReq(), PPPS_ACKRCVD, PPPS_CLOSED, PPPS_CLOSING, PPPS_OPENED, PPPS_REQSENT, PPPS_STOPPED, and PPPS_STOPPING.

Referenced by NutIpcpInput().

void IpcpRxProtRej ( NUTDEVICE dev  ) 

Definition at line 479 of file ipcpin.c.

References _PPPDCB::dcb_ipcp_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 NutIpcpInput ( NUTDEVICE dev,
NETBUF nb 
)

Handle incoming IPCP 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 533 of file ipcpin.c.

References _PPPDCB::dcb_ipcp_state, _NUTDEVICE::dev_dcb, htons, IpcpRxConfAck(), IpcpRxConfReq(), IpcpRxTermAck(), IpcpRxTermReq(), _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.

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

Send a IPCP 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 117 of file ipcpout.c.

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

void IpcpTxConfReq ( NUTDEVICE dev,
uint8_t  id 
)

Definition at line 140 of file ipcpout.c.

References _PPPDCB::dcb_acked, _PPPDCB::dcb_ip_dns1, _PPPDCB::dcb_ip_dns2, _PPPDCB::dcb_ipcp_naks, _PPPDCB::dcb_ipcp_state, _PPPDCB::dcb_local_ip, _PPPDCB::dcb_rejects, _NUTDEVICE::dev_dcb, IPCP_ADDR, IPCP_MS_DNS1, IPCP_MS_DNS2, _NETBUF::nb_ap, NBAF_APPLICATION, NutIpcpOutput(), NutNetBufAlloc(), PPPS_ACKRCVD, PPPS_ACKSENT, PPPS_REQSENT, REJ_IPCP_DNS1, REJ_IPCP_DNS2, XCPOPT::ul, _NBDATA::vp, XCP_CONFREQ, XCPOPT::xcpo_, XCPOPT::xcpo_len, and XCPOPT::xcpo_type.


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