ipv6cp.c File Reference

IPV6CP (PPP IPv6 Control Protocol) More...

#include "core/net.h"
#include "ipv6/ipv6.h"
#include "ipv6/ipv6_misc.h"
#include "ppp/ppp_fsm.h"
#include "ppp/ppp_misc.h"
#include "ppp/ppp_debug.h"
#include "ppp/ipv6cp.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   PPP_TRACE_LEVEL
 

Functions

error_t ipv6cpOpen (PppContext *context)
 IPV6CP Open event. More...
 
error_t ipv6cpClose (PppContext *context)
 IPV6CP Close event. More...
 
void ipv6cpTick (PppContext *context)
 IPV6CP timer handler. More...
 
void ipv6cpProcessPacket (PppContext *context, const PppPacket *packet, size_t length)
 Process an incoming IPV6CP packet. More...
 
error_t ipv6cpProcessConfigureReq (PppContext *context, const PppConfigurePacket *configureReqPacket)
 Process Configure-Request packet. More...
 
error_t ipv6cpProcessConfigureAck (PppContext *context, const PppConfigurePacket *configureAckPacket)
 Process Configure-Ack packet. More...
 
error_t ipv6cpProcessConfigureNak (PppContext *context, const PppConfigurePacket *configureNakPacket)
 Process Configure-Nak packet. More...
 
error_t ipv6cpProcessConfigureReject (PppContext *context, const PppConfigurePacket *configureRejPacket)
 Process Configure-Reject packet. More...
 
error_t ipv6cpProcessTerminateReq (PppContext *context, const PppTerminatePacket *terminateReqPacket)
 Process Terminate-Request packet. More...
 
error_t ipv6cpProcessTerminateAck (PppContext *context, const PppTerminatePacket *terminateAckPacket)
 Process Terminate-Ack packet. More...
 
error_t ipv6cpProcessCodeRej (PppContext *context, const PppCodeRejPacket *codeRejPacket)
 Process Code-Reject packet. More...
 
error_t ipv6cpProcessUnknownCode (PppContext *context, const PppPacket *packet)
 Process packet with unknown code. More...
 
void ipv6cpThisLayerUp (PppContext *context)
 This-Layer-Up callback function. More...
 
void ipv6cpThisLayerDown (PppContext *context)
 This-Layer-Down callback function. More...
 
void ipv6cpThisLayerStarted (PppContext *context)
 This-Layer-Started callback function. More...
 
void ipv6cpThisLayerFinished (PppContext *context)
 This-Layer-Finished callback function. More...
 
void ipv6cpInitRestartCount (PppContext *context, uint_t value)
 Initialize-Restart-Count callback function. More...
 
void ipv6cpZeroRestartCount (PppContext *context)
 Zero-Restart-Count callback function. More...
 
error_t ipv6cpSendConfigureReq (PppContext *context)
 Send-Configure-Request callback function. More...
 
error_t ipv6cpSendConfigureAck (PppContext *context, const PppConfigurePacket *configureReqPacket)
 Send-Configure-Ack callback function. More...
 
error_t ipv6cpSendConfigureNak (PppContext *context, const PppConfigurePacket *configureReqPacket)
 Send-Configure-Nak callback function. More...
 
error_t ipv6cpSendConfigureRej (PppContext *context, const PppConfigurePacket *configureReqPacket)
 Send-Configure-Reject callback function. More...
 
error_t ipv6cpSendTerminateReq (PppContext *context)
 Send-Terminate-Request callback function. More...
 
error_t ipv6cpSendTerminateAck (PppContext *context, const PppTerminatePacket *terminateReqPacket)
 Send-Terminate-Ack callback function. More...
 
error_t ipv6cpSendCodeRej (PppContext *context, const PppPacket *packet)
 Send-Code-Reject callback function. More...
 
error_t ipv6cpParseOption (PppContext *context, PppOption *option, size_t inPacketLen, PppConfigurePacket *outPacket)
 Parse IPV6CP configuration option. More...
 
error_t ipv6cpParseInterfaceIdOption (PppContext *context, Ipv6cpInterfaceIdOption *option, PppConfigurePacket *outPacket)
 Parse Interface-Identifier option. More...
 

Variables

const PppCallbacks ipv6cpCallbacks
 IPV6CP FSM callbacks. More...
 

Detailed Description

IPV6CP (PPP IPv6 Control 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 ipv6cp.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   PPP_TRACE_LEVEL

Definition at line 30 of file ipv6cp.c.

Function Documentation

◆ ipv6cpClose()

error_t ipv6cpClose ( PppContext context)

IPV6CP Close event.

Parameters
[in]contextPPP context
Returns
Error code

Definition at line 96 of file ipv6cp.c.

◆ ipv6cpInitRestartCount()

void ipv6cpInitRestartCount ( PppContext context,
uint_t  value 
)

Initialize-Restart-Count callback function.

Parameters
[in]contextPPP context
[in]valueRestart counter value

Definition at line 677 of file ipv6cp.c.

◆ ipv6cpOpen()

error_t ipv6cpOpen ( PppContext context)

IPV6CP Open event.

Parameters
[in]contextPPP context
Returns
Error code

Definition at line 75 of file ipv6cp.c.

◆ ipv6cpParseInterfaceIdOption()

error_t ipv6cpParseInterfaceIdOption ( PppContext context,
Ipv6cpInterfaceIdOption option,
PppConfigurePacket outPacket 
)

Parse Interface-Identifier option.

Parameters
[in]contextPPP context
[in]optionOption to be checked
[out]outPacketPointer to the Configure-Nak or Configure-Reject packet
Returns
Error code

Definition at line 979 of file ipv6cp.c.

◆ ipv6cpParseOption()

error_t ipv6cpParseOption ( PppContext context,
PppOption option,
size_t  inPacketLen,
PppConfigurePacket outPacket 
)

Parse IPV6CP configuration option.

Parameters
[in]contextPPP context
[in]optionOption to be checked
[in]inPacketLenRemaining bytes to process in the incoming packet
[out]outPacketPointer to the Configure-Ack, Nak or Reject packet
Returns
Error code

Definition at line 927 of file ipv6cp.c.

◆ ipv6cpProcessCodeRej()

error_t ipv6cpProcessCodeRej ( PppContext context,
const PppCodeRejPacket codeRejPacket 
)

Process Code-Reject packet.

Parameters
[in]contextPPP context
[in]codeRejPacketPacket received from the peer
Returns
Error code

Definition at line 510 of file ipv6cp.c.

◆ ipv6cpProcessConfigureAck()

error_t ipv6cpProcessConfigureAck ( PppContext context,
const PppConfigurePacket configureAckPacket 
)

Process Configure-Ack packet.

Parameters
[in]contextPPP context
[in]configureAckPacketPacket received from the peer
Returns
Error code

Definition at line 320 of file ipv6cp.c.

◆ ipv6cpProcessConfigureNak()

error_t ipv6cpProcessConfigureNak ( PppContext context,
const PppConfigurePacket configureNakPacket 
)

Process Configure-Nak packet.

Parameters
[in]contextPPP context
[in]configureNakPacketPacket received from the peer
Returns
Error code

Definition at line 346 of file ipv6cp.c.

◆ ipv6cpProcessConfigureReject()

error_t ipv6cpProcessConfigureReject ( PppContext context,
const PppConfigurePacket configureRejPacket 
)

Process Configure-Reject packet.

Parameters
[in]contextPPP context
[in]configureRejPacketPacket received from the peer
Returns
Error code

Definition at line 409 of file ipv6cp.c.

◆ ipv6cpProcessConfigureReq()

error_t ipv6cpProcessConfigureReq ( PppContext context,
const PppConfigurePacket configureReqPacket 
)

Process Configure-Request packet.

Parameters
[in]contextPPP context
[in]configureReqPacketPacket received from the peer
Returns
Error code

Definition at line 224 of file ipv6cp.c.

◆ ipv6cpProcessPacket()

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

Process an incoming IPV6CP packet.

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

Definition at line 150 of file ipv6cp.c.

◆ ipv6cpProcessTerminateAck()

error_t ipv6cpProcessTerminateAck ( PppContext context,
const PppTerminatePacket terminateAckPacket 
)

Process Terminate-Ack packet.

Parameters
[in]contextPPP context
[in]terminateAckPacketPacket received from the peer
Returns
Error code

Definition at line 487 of file ipv6cp.c.

◆ ipv6cpProcessTerminateReq()

error_t ipv6cpProcessTerminateReq ( PppContext context,
const PppTerminatePacket terminateReqPacket 
)

Process Terminate-Request packet.

Parameters
[in]contextPPP context
[in]terminateReqPacketPacket received from the peer
Returns
Error code

Definition at line 465 of file ipv6cp.c.

◆ ipv6cpProcessUnknownCode()

error_t ipv6cpProcessUnknownCode ( PppContext context,
const PppPacket packet 
)

Process packet with unknown code.

Parameters
[in]contextPPP context
[in]packetUn-interpretable packet received from the peer
Returns
Error code

Definition at line 557 of file ipv6cp.c.

◆ ipv6cpSendCodeRej()

error_t ipv6cpSendCodeRej ( PppContext context,
const PppPacket packet 
)

Send-Code-Reject callback function.

Parameters
[in]contextPPP context
[in]packetUn-interpretable packet received from the peer
Returns
Error code

Definition at line 905 of file ipv6cp.c.

◆ ipv6cpSendConfigureAck()

error_t ipv6cpSendConfigureAck ( PppContext context,
const PppConfigurePacket configureReqPacket 
)

Send-Configure-Ack callback function.

Parameters
[in]contextPPP context
[in]configureReqPacketConfigure-Request packet received from the peer
Returns
Error code

Definition at line 783 of file ipv6cp.c.

◆ ipv6cpSendConfigureNak()

error_t ipv6cpSendConfigureNak ( PppContext context,
const PppConfigurePacket configureReqPacket 
)

Send-Configure-Nak callback function.

Parameters
[in]contextPPP context
[in]configureReqPacketConfigure-Request packet received from the peer
Returns
Error code

Definition at line 802 of file ipv6cp.c.

◆ ipv6cpSendConfigureRej()

error_t ipv6cpSendConfigureRej ( PppContext context,
const PppConfigurePacket configureReqPacket 
)

Send-Configure-Reject callback function.

Parameters
[in]contextPPP context
[in]configureReqPacketConfigure-Request packet received from the peer
Returns
Error code

Definition at line 821 of file ipv6cp.c.

◆ ipv6cpSendConfigureReq()

error_t ipv6cpSendConfigureReq ( PppContext context)

Send-Configure-Request callback function.

Parameters
[in]contextPPP context
Returns
Error code

Definition at line 713 of file ipv6cp.c.

◆ ipv6cpSendTerminateAck()

error_t ipv6cpSendTerminateAck ( PppContext context,
const PppTerminatePacket terminateReqPacket 
)

Send-Terminate-Ack callback function.

Parameters
[in]contextPPP context
[in]terminateReqPacketTerminate-Request packet received from the peer
Returns
Error code

Definition at line 871 of file ipv6cp.c.

◆ ipv6cpSendTerminateReq()

error_t ipv6cpSendTerminateReq ( PppContext context)

Send-Terminate-Request callback function.

Parameters
[in]contextPPP context
Returns
Error code

Definition at line 839 of file ipv6cp.c.

◆ ipv6cpThisLayerDown()

void ipv6cpThisLayerDown ( PppContext context)

This-Layer-Down callback function.

Parameters
[in]contextPPP context

Definition at line 625 of file ipv6cp.c.

◆ ipv6cpThisLayerFinished()

void ipv6cpThisLayerFinished ( PppContext context)

This-Layer-Finished callback function.

Parameters
[in]contextPPP context

Definition at line 664 of file ipv6cp.c.

◆ ipv6cpThisLayerStarted()

void ipv6cpThisLayerStarted ( PppContext context)

This-Layer-Started callback function.

Parameters
[in]contextPPP context

Definition at line 652 of file ipv6cp.c.

◆ ipv6cpThisLayerUp()

void ipv6cpThisLayerUp ( PppContext context)

This-Layer-Up callback function.

Parameters
[in]contextPPP context

Definition at line 577 of file ipv6cp.c.

◆ ipv6cpTick()

void ipv6cpTick ( PppContext context)

IPV6CP timer handler.

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

Parameters
[in]contextPPP context

Definition at line 120 of file ipv6cp.c.

◆ ipv6cpZeroRestartCount()

void ipv6cpZeroRestartCount ( PppContext context)

Zero-Restart-Count callback function.

Parameters
[in]contextPPP context

Definition at line 692 of file ipv6cp.c.

Variable Documentation

◆ ipv6cpCallbacks

const PppCallbacks ipv6cpCallbacks
Initial value:
=
{
NULL
}
error_t ipv6cpSendConfigureRej(PppContext *context, const PppConfigurePacket *configureReqPacket)
Send-Configure-Reject callback function.
Definition: ipv6cp.c:821
error_t ipv6cpSendConfigureAck(PppContext *context, const PppConfigurePacket *configureReqPacket)
Send-Configure-Ack callback function.
Definition: ipv6cp.c:783
void ipv6cpThisLayerUp(PppContext *context)
This-Layer-Up callback function.
Definition: ipv6cp.c:577
error_t ipv6cpSendCodeRej(PppContext *context, const PppPacket *packet)
Send-Code-Reject callback function.
Definition: ipv6cp.c:905
error_t ipv6cpSendConfigureReq(PppContext *context)
Send-Configure-Request callback function.
Definition: ipv6cp.c:713
void ipv6cpInitRestartCount(PppContext *context, uint_t value)
Initialize-Restart-Count callback function.
Definition: ipv6cp.c:677
error_t ipv6cpSendConfigureNak(PppContext *context, const PppConfigurePacket *configureReqPacket)
Send-Configure-Nak callback function.
Definition: ipv6cp.c:802
error_t ipv6cpSendTerminateReq(PppContext *context)
Send-Terminate-Request callback function.
Definition: ipv6cp.c:839
void ipv6cpZeroRestartCount(PppContext *context)
Zero-Restart-Count callback function.
Definition: ipv6cp.c:692
void ipv6cpThisLayerDown(PppContext *context)
This-Layer-Down callback function.
Definition: ipv6cp.c:625
error_t ipv6cpSendTerminateAck(PppContext *context, const PppTerminatePacket *terminateReqPacket)
Send-Terminate-Ack callback function.
Definition: ipv6cp.c:871
void ipv6cpThisLayerStarted(PppContext *context)
This-Layer-Started callback function.
Definition: ipv6cp.c:652
void ipv6cpThisLayerFinished(PppContext *context)
This-Layer-Finished callback function.
Definition: ipv6cp.c:664

IPV6CP FSM callbacks.

Definition at line 50 of file ipv6cp.c.