Go to the documentation of this file.
40 #define CHAP_SUPPORT DISABLED
41 #elif (CHAP_SUPPORT != ENABLED && CHAP_SUPPORT != DISABLED)
42 #error CHAP_SUPPORT parameter is not valid
46 #ifndef CHAP_RESTART_TIMER
47 #define CHAP_RESTART_TIMER 3000
48 #elif (CHAP_RESTART_TIMER < 1000)
49 #error CHAP_RESTART_TIMER parameter is not valid
53 #ifndef CHAP_MAX_CHALLENGES
54 #define CHAP_MAX_CHALLENGES 5
55 #elif (CHAP_MAX_CHALLENGES < 1)
56 #error CHAP_MAX_CHALLENGES parameter is not valid
110 #if defined(__CCRX__)
112 #elif defined(__CWCC__) || defined(_WIN32)
113 #pragma pack(push, 1)
172 #if defined(__CCRX__)
174 #elif defined(__CWCC__) || defined(_WIN32)
191 uint8_t challenge[16];
@ CHAP_STATE_3_CHALLENGE_RCVD
@ CHAP_CODE_SUCCESS
Success.
ChapAlgoId
CHAP algorithm identifiers.
bool_t chapCheckPassword(PppContext *context, const char_t *password)
Password verification.
uint_t restartCounter
Restart counter.
@ CHAP_STATE_6_SUCCESS_SENT
error_t chapProcessResponse(PppContext *context, const ChapResponsePacket *responsePacket, size_t length)
Process Response packet.
error_t chapAbortAuth(PppContext *context)
Abort CHAP authentication.
@ CHAP_CODE_CHALLENGE
Challenge.
error_t chapStartAuth(PppContext *context)
Start CHAP authentication.
@ CHAP_STATE_2_CHALLENGE_SENT
@ CHAP_CODE_RESPONSE
Response.
void chapProcessPacket(PppContext *context, const PppPacket *packet, size_t length)
Process an incoming CHAP packet.
error_t chapSendFailure(PppContext *context)
Send Failure packet.
error_t chapSendResponse(PppContext *context, const uint8_t *value)
Send Response packet.
@ CHAP_CODE_FAILURE
Failure.
error_t chapProcessSuccess(PppContext *context, const ChapSuccessPacket *successPacket, size_t length)
Process Success packet.
ChapCode
Code field values.
@ CHAP_STATE_4_RESPONSE_SENT
@ CHAP_ALGO_ID_MS_CHAP_V2
@ CHAP_STATE_7_SUCCESS_RCVD
@ CHAP_STATE_9_FAILURE_RCVD
typedef __packed_struct
Challenge packet.
@ CHAP_STATE_5_RESPONSE_RCVD
error_t chapSendChallenge(PppContext *context)
Send Challenge packet.
uint32_t systime_t
System time.
error_t chapSendSuccess(PppContext *context)
Send Success packet.
error_t chapProcessFailure(PppContext *context, const ChapFailurePacket *failurePacket, size_t length)
Process Failure packet.
uint8_t peerIdentifier
Identifier used to match requests and replies.
uint_t localState
Local state.
error_t chapProcessChallenge(PppContext *context, const ChapChallengePacket *challengePacket, size_t length)
Process Challenge packet.
PPP (Point-to-Point Protocol)
uint_t peerState
Peer state.
const uint8_t * response
Response value from the peer.
systime_t timestamp
Timestamp to manage retransmissions.
@ CHAP_STATE_8_FAILURE_SENT
void chapTick(PppContext *context)
CHAP timer handler.
uint8_t localIdentifier
Identifier used to match requests and replies.
CHAP finite state machine.