pap.c File Reference

PAP (Password Authentication Protocol) More...

#include "core/net.h"
#include "ppp/ppp_debug.h"
#include "ppp/lcp.h"
#include "ppp/ipcp.h"
#include "ppp/ipv6cp.h"
#include "ppp/pap.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   PPP_TRACE_LEVEL
 

Functions

error_t papStartAuth (PppContext *context)
 Start PAP authentication. More...
 
error_t papAbortAuth (PppContext *context)
 Abort PAP authentication. More...
 
void papTick (PppContext *context)
 PAP timer handler. More...
 
void papProcessPacket (PppContext *context, const PppPacket *packet, size_t length)
 Process an incoming PAP packet. More...
 
error_t papProcessAuthReq (PppContext *context, const PapAuthReqPacket *authReqPacket, size_t length)
 Process Authenticate-Request packet. More...
 
error_t papProcessAuthAck (PppContext *context, const PapAuthAckPacket *authAckPacket, size_t length)
 Process Authenticate-Ack packet. More...
 
error_t papProcessAuthNak (PppContext *context, const PapAuthNakPacket *authNakPacket, size_t length)
 Process Authenticate-Nak packet. More...
 
error_t papSendAuthReq (PppContext *context)
 Send Authenticate-Request packet. More...
 
error_t papSendAuthAck (PppContext *context, uint8_t identifier)
 Send Authenticate-Ack packet. More...
 
error_t papSendAuthNak (PppContext *context, uint8_t identifier)
 Send Authenticate-Nak packet. More...
 
bool_t papCheckPassword (PppContext *context, const char_t *password)
 Password verification. More...
 

Detailed Description

PAP (Password Authentication Protocol)

License

Copyright (C) 2010-2018 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneTCP Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
1.9.0

Definition in file pap.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   PPP_TRACE_LEVEL

Definition at line 30 of file pap.c.

Function Documentation

◆ papAbortAuth()

error_t papAbortAuth ( PppContext context)

Abort PAP authentication.

Parameters
[in]contextPPP context
Returns
Error code

Definition at line 85 of file pap.c.

◆ papCheckPassword()

bool_t papCheckPassword ( PppContext context,
const char_t password 
)

Password verification.

Parameters
[in]contextPPP context
[in]passwordNULL-terminated string containing the password to be checked
Returns
TRUE if the password is valid, else FALSE

Definition at line 600 of file pap.c.

◆ papProcessAuthAck()

error_t papProcessAuthAck ( PppContext context,
const PapAuthAckPacket authAckPacket,
size_t  length 
)

Process Authenticate-Ack packet.

Parameters
[in]contextPPP context
[in]authAckPacketPacket received from the peer
[in]lengthLength of the packet, in bytes
Returns
Error code

Definition at line 328 of file pap.c.

◆ papProcessAuthNak()

error_t papProcessAuthNak ( PppContext context,
const PapAuthNakPacket authNakPacket,
size_t  length 
)

Process Authenticate-Nak packet.

Parameters
[in]contextPPP context
[in]authNakPacketPacket received from the peer
[in]lengthLength of the packet, in bytes
Returns
Error code

Definition at line 385 of file pap.c.

◆ papProcessAuthReq()

error_t papProcessAuthReq ( PppContext context,
const PapAuthReqPacket authReqPacket,
size_t  length 
)

Process Authenticate-Request packet.

Parameters
[in]contextPPP context
[in]authReqPacketPacket received from the peer
[in]lengthLength of the packet, in bytes
Returns
Error code

Definition at line 212 of file pap.c.

◆ papProcessPacket()

void papProcessPacket ( PppContext context,
const PppPacket packet,
size_t  length 
)

Process an incoming PAP packet.

Parameters
[in]contextPPP context
[in]packetPAP packet received from the peer
[in]lengthLength of the packet, in bytes

Definition at line 147 of file pap.c.

◆ papSendAuthAck()

error_t papSendAuthAck ( PppContext context,
uint8_t  identifier 
)

Send Authenticate-Ack packet.

Parameters
[in]contextPPP context
[in]identifierIdentifier field
Returns
Error code

Definition at line 498 of file pap.c.

◆ papSendAuthNak()

error_t papSendAuthNak ( PppContext context,
uint8_t  identifier 
)

Send Authenticate-Nak packet.

Parameters
[in]contextPPP context
[in]identifierIdentifier field
Returns
Error code

Definition at line 549 of file pap.c.

◆ papSendAuthReq()

error_t papSendAuthReq ( PppContext context)

Send Authenticate-Request packet.

Parameters
[in]contextPPP context
Returns
Error code

Definition at line 420 of file pap.c.

◆ papStartAuth()

error_t papStartAuth ( PppContext context)

Start PAP authentication.

Parameters
[in]contextPPP context
Returns
Error code

Definition at line 51 of file pap.c.

◆ papTick()

void papTick ( PppContext context)

PAP timer handler.

This routine must be periodically called by the TCP/IP stack to manage retransmissions

Parameters
[in]contextPPP context

Definition at line 108 of file pap.c.