Go to the documentation of this file.
37 #if (PPP_SUPPORT == ENABLED && PPP_TRACE_LEVEL >= TRACE_LEVEL_DEBUG)
40 static const char_t *
const lcpCodeLabel[] =
57 static const char_t *
const ncpCodeLabel[] =
70 static const char_t *
const papCodeLabel[] =
73 "Authenticate-Request",
79 static const char_t *
const chapCodeLabel[] =
89 static const char_t *
const lcpOptionLabel[] =
92 "Maximum-Receive-Unit",
93 "Async-Control-Character-Map",
94 "Authentication-Protocol",
98 "Protocol-Field-Compression",
99 "Address-and-Control-Field-Compression",
101 "Self-Describing-Pad",
108 static const char_t *
const ipcpOptionLabel[] =
112 "IP-Compression-Protocol",
117 static const char_t *
const ipcpOptionLabel2[] =
120 "Primary-DNS-Server-Address",
121 "Primary-NBNS-Server-Address",
122 "Secondary-DNS-Server-Address",
123 "Secondary-NBNS-Server-Address"
127 static const char_t *
const ipv6cpOptionLabel[] =
130 "Interface-Identifier",
131 "IPv6-Compression-Protocol"
207 if(packet->code <
arraysize(lcpCodeLabel))
209 label = lcpCodeLabel[packet->code];
217 TRACE_DEBUG(
" Code = %" PRIu8
" (%s)\r\n", packet->code, label);
218 TRACE_DEBUG(
" Identifier = %" PRIu8
"\r\n", packet->identifier);
369 if(packet->code <
arraysize(ncpCodeLabel))
371 label = ncpCodeLabel[packet->code];
379 TRACE_DEBUG(
" Code = %" PRIu8
" (%s)\r\n", packet->code, label);
380 TRACE_DEBUG(
" Identifier = %" PRIu8
"\r\n", packet->identifier);
502 if(packet->code <
arraysize(papCodeLabel))
504 label = papCodeLabel[packet->code];
512 TRACE_DEBUG(
" Code = %" PRIu8
" (%s)\r\n", packet->code, label);
513 TRACE_DEBUG(
" Identifier = %" PRIu8
"\r\n", packet->identifier);
530 TRACE_DEBUG(
" Peer-ID-Length = %" PRIu8
"\r\n",
p->peerIdLength);
541 q =
p->peerId +
p->peerIdLength;
544 TRACE_DEBUG(
" Passwd-Length = %" PRIu8
"\r\n", q[0]);
568 TRACE_DEBUG(
" Msg-Length = %" PRIu8
"\r\n",
p->msgLength);
626 if(packet->code <
arraysize(chapCodeLabel))
628 label = chapCodeLabel[packet->code];
636 TRACE_DEBUG(
" Code = %" PRIu8
" (%s)\r\n", packet->code, label);
637 TRACE_DEBUG(
" Identifier = %" PRIu8
"\r\n", packet->identifier);
655 TRACE_DEBUG(
" Value-Size = %" PRIu8
"\r\n",
p->valueSize);
666 q =
p->value +
p->valueSize;
735 if(option->length >
length)
739 if(option->type <
arraysize(lcpOptionLabel))
742 lcpOptionLabel[option->type], option->length);
746 TRACE_DEBUG(
" Option %" PRIu8
" (%" PRIu8
" bytes)\r\n",
747 option->type, option->length);
756 if(option->length != (
sizeof(
PppOption) +
sizeof(uint16_t)))
768 if(option->length != (
sizeof(
PppOption) +
sizeof(uint32_t)))
786 option = (
PppOption *) ((uint8_t *) option + option->length);
802 #if (IPV4_SUPPORT == ENABLED)
816 if(option->length >
length)
820 if(option->type <
arraysize(ipcpOptionLabel))
823 ipcpOptionLabel[option->type], option->length);
825 else if(option->type >= 128 && option->type < (128 +
arraysize(ipcpOptionLabel2)))
828 ipcpOptionLabel2[option->type - 128], option->length);
832 TRACE_DEBUG(
" Option %" PRIu8
" (%" PRIu8
" bytes)\r\n",
833 option->type, option->length);
839 #if (IPV4_SUPPORT == ENABLED)
865 option = (
PppOption *) ((uint8_t *) option + option->length);
892 if(option->length >
length)
896 if(option->type <
arraysize(ipv6cpOptionLabel))
899 ipv6cpOptionLabel[option->type], option->length);
903 TRACE_DEBUG(
" Option %" PRIu8
" (%" PRIu8
" bytes)\r\n",
904 option->type, option->length);
920 option = (
PppOption *) ((uint8_t *) option + option->length);
Data logging functions for debugging purpose (PPP)
@ PPP_CODE_CONFIGURE_REJ
Configure-Reject.
error_t papDumpPacket(const PppPacket *packet, size_t length)
Dump PAP packet for debugging purpose.
@ PPP_CODE_CONFIGURE_ACK
Configure-Ack.
@ LCP_OPTION_ACCM
Async-Control-Character-Map.
error_t lcpDumpPacket(const PppPacket *packet, size_t length)
Dump LCP packet for debugging purpose.
PppProtocol
Protocol field values.
@ PPP_CODE_PROTOCOL_REJ
Protocol-Reject.
@ CHAP_CODE_SUCCESS
Success.
@ PPP_PROTOCOL_CHAP
Challenge Handshake Authentication Protocol.
@ IPCP_OPTION_PRIMARY_DNS
Primary-DNS-Server-Address.
@ CHAP_CODE_CHALLENGE
Challenge.
@ CHAP_CODE_RESPONSE
Response.
uint32_t Ipv4Addr
IPv4 network address.
@ PPP_CODE_CODE_REJ
Code-Reject.
@ PPP_CODE_CONFIGURE_REQ
Configure-Request.
error_t ipv6cpDumpOptions(const PppOption *option, size_t length)
Dump IPV6CP options for debugging purpose.
@ PPP_CODE_ECHO_REP
Echo-Reply.
@ PAP_CODE_AUTH_REQ
Authenticate-Request.
@ CHAP_CODE_FAILURE
Failure.
@ ERROR_FAILURE
Generic error code.
error_t lcpDumpOptions(const PppOption *option, size_t length)
Dump LCP options for debugging purpose.
@ PPP_CODE_CONFIGURE_NAK
Configure-Nak.
@ PAP_CODE_AUTH_ACK
Authenticate-Ack.
@ PPP_PROTOCOL_IPV6CP
IPv6 Control Protocol.
@ PPP_CODE_TERMINATE_ACK
Terminate-Ack.
@ IPCP_OPTION_PRIMARY_NBNS
Primary-NBNS-Server-Address.
@ PPP_CODE_DISCARD_REQ
Discard-Request.
@ PPP_PROTOCOL_LCP
Link Control Protocol.
@ PPP_CODE_ECHO_REQ
Echo-Request.
error_t ncpDumpPacket(const PppPacket *packet, size_t length, PppProtocol protocol)
Dump NCP packet for debugging purpose.
#define TRACE_DEBUG_ARRAY(p, a, n)
@ PPP_PROTOCOL_IPCP
IP Control Protocol.
error_t chapDumpPacket(const PppPacket *packet, size_t length)
Dump CHAP packet for debugging purpose.
error_t pppDumpPacket(const PppPacket *packet, size_t length, PppProtocol protocol)
Dump LCP/NCP packet for debugging purpose.
@ IPCP_OPTION_SECONDARY_NBNS
Secondary-NBNS-Server-Address.
@ LCP_OPTION_MRU
Maximum-Receive-Unit.
#define ipv4CopyAddr(destIpAddr, srcIpAddr)
@ LCP_OPTION_MAGIC_NUMBER
Magic-Number.
@ IPCP_OPTION_SECONDARY_DNS
Secondary-DNS-Server-Address.
@ IPCP_OPTION_IP_ADDRESS
IP-Address.
error_t ipcpDumpOptions(const PppOption *option, size_t length)
Dump IPCP options for debugging purpose.
char_t * ipv4AddrToString(Ipv4Addr ipAddr, char_t *str)
Convert a binary IPv4 address to dot-decimal notation.
@ PPP_CODE_TERMINATE_REQ
Terminate-Request.
@ PAP_CODE_AUTH_NAK
Authenticate-Nak.
@ PPP_PROTOCOL_PAP
Password Authentication Protocol.