61#if defined(__CWCC__) || defined(_WIN32)
100} LcpAuthProtocolOption;
113} LcpQualityProtocolOption;
124 uint32_t magicNumber;
125} LcpMagicNumberOption;
151#if defined(__CWCC__) || defined(_WIN32)
156error_t lcpOpen(PppContext *context);
157error_t lcpClose(PppContext *context);
159void lcpTick(PppContext *context);
161void lcpProcessPacket(PppContext *context,
const PppPacket *packet,
size_t length);
163error_t lcpProcessConfigureReq(PppContext *context,
164 const PppConfigurePacket *configureReqPacket);
166error_t lcpProcessConfigureAck(PppContext *context,
167 const PppConfigurePacket *configureAckPacket);
169error_t lcpProcessConfigureNak(PppContext *context,
170 const PppConfigurePacket *configureNakPacket);
172error_t lcpProcessConfigureReject(PppContext *context,
173 const PppConfigurePacket *configureRejPacket);
175error_t lcpProcessTerminateReq(PppContext *context,
176 const PppTerminatePacket *terminateReqPacket);
178error_t lcpProcessTerminateAck(PppContext *context,
179 const PppTerminatePacket *terminateAckPacket);
181error_t lcpProcessCodeRej(PppContext *context,
182 const PppCodeRejPacket *codeRejPacket);
184error_t lcpProcessProtocolRej(PppContext *context,
185 const PppProtocolRejPacket *protocolRejPacket);
187error_t lcpProcessEchoReq(PppContext *context,
188 const PppEchoPacket *echoReqPacket);
190error_t lcpProcessEchoRep(PppContext *context,
191 const PppEchoPacket *echoRepPacket);
193error_t lcpProcessDiscardReq(PppContext *context,
194 const PppDiscardReqPacket *discardReqPacket);
196error_t lcpProcessUnknownCode(PppContext *context,
197 const PppPacket *packet);
199error_t lcpProcessUnknownProtocol(PppContext *context,
200 uint16_t protocol,
const uint8_t *information,
size_t length);
203void lcpThisLayerUp(PppContext *context);
204void lcpThisLayerDown(PppContext *context);
205void lcpThisLayerStarted(PppContext *context);
206void lcpThisLayerFinished(PppContext *context);
208void lcpInitRestartCount(PppContext *context, uint_t value);
209void lcpZeroRestartCount(PppContext *context);
211error_t lcpSendConfigureReq(PppContext *context);
213error_t lcpSendConfigureAck(PppContext *context,
214 const PppConfigurePacket *configureReqPacket);
216error_t lcpSendConfigureNak(PppContext *context,
217 const PppConfigurePacket *configureReqPacket);
219error_t lcpSendConfigureRej(PppContext *context,
220 const PppConfigurePacket *configureReqPacket);
222error_t lcpSendTerminateReq(PppContext *context);
224error_t lcpSendTerminateAck(PppContext *context,
225 const PppTerminatePacket *terminateReqPacket);
227error_t lcpSendCodeRej(PppContext *context,
const PppPacket *packet);
228error_t lcpSendEchoRep(PppContext *context,
const PppEchoPacket *echoReqPacket);
231error_t lcpParseOption(PppContext *context, PppOption *option,
232 size_t inPacketLen, PppConfigurePacket *outPacket);
234error_t lcpParseMruOption(PppContext *context,
235 LcpMruOption *option, PppConfigurePacket *outPacket);
237error_t lcpParseAccmOption(PppContext *context,
238 LcpAccmOption *option, PppConfigurePacket *outPacket);
240error_t lcpParseAuthProtocolOption(PppContext *context,
241 LcpAuthProtocolOption *option, PppConfigurePacket *outPacket);
243error_t lcpParseMagicNumberOption(PppContext *context,
244 LcpMagicNumberOption *option, PppConfigurePacket *outPacket);
246error_t lcpParsePfcOption(PppContext *context,
247 LcpPfcOption *option, PppConfigurePacket *outPacket);
249error_t lcpParseAcfcOption(PppContext *context,
250 LcpAcfcOption *option, PppConfigurePacket *outPacket);
error_t
Error codes.
Definition error.h:43
LcpOptionType
LCP option types.
Definition lcp.h:49
@ LCP_OPTION_PFC
Protocol-Field-Compression.
Definition lcp.h:55
@ LCP_OPTION_MAGIC_NUMBER
Magic-Number.
Definition lcp.h:54
@ LCP_OPTION_AUTH_PROTOCOL
Authentication-Protocol.
Definition lcp.h:52
@ LCP_OPTION_QUALITY_PROTOCOL
Quality-Protocol.
Definition lcp.h:53
@ LCP_OPTION_ACCM
Async-Control-Character-Map.
Definition lcp.h:51
@ LCP_OPTION_MRU
Maximum-Receive-Unit.
Definition lcp.h:50
@ LCP_OPTION_ACFC
Address-and-Control-Field-Compression.
Definition lcp.h:56
typedef __packed_struct
Maximum-Receive-Unit option.
Definition lcp.h:71
PPP (Point-to-Point Protocol)