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

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2010-2024 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
2.4.4

Definition in file ipv6cp.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   PPP_TRACE_LEVEL

Definition at line 32 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 98 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 667 of file ipv6cp.c.

◆ ipv6cpOpen()

error_t ipv6cpOpen ( PppContext context)

IPV6CP Open event.

Parameters
[in]contextPPP context
Returns
Error code

Definition at line 77 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 970 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 918 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 512 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 322 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 348 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 411 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 226 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 152 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 489 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 467 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 559 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 896 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 774 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 793 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 812 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 703 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 862 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 830 of file ipv6cp.c.

◆ ipv6cpThisLayerDown()

void ipv6cpThisLayerDown ( PppContext context)

This-Layer-Down callback function.

Parameters
[in]contextPPP context

Definition at line 615 of file ipv6cp.c.

◆ ipv6cpThisLayerFinished()

void ipv6cpThisLayerFinished ( PppContext context)

This-Layer-Finished callback function.

Parameters
[in]contextPPP context

Definition at line 654 of file ipv6cp.c.

◆ ipv6cpThisLayerStarted()

void ipv6cpThisLayerStarted ( PppContext context)

This-Layer-Started callback function.

Parameters
[in]contextPPP context

Definition at line 642 of file ipv6cp.c.

◆ ipv6cpThisLayerUp()

void ipv6cpThisLayerUp ( PppContext context)

This-Layer-Up callback function.

Parameters
[in]contextPPP context

Definition at line 579 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 122 of file ipv6cp.c.

◆ ipv6cpZeroRestartCount()

void ipv6cpZeroRestartCount ( PppContext context)

Zero-Restart-Count callback function.

Parameters
[in]contextPPP context

Definition at line 682 of file ipv6cp.c.

Variable Documentation

◆ ipv6cpCallbacks

void ipv6cpZeroRestartCount(PppContext *context)
Zero-Restart-Count callback function.
Definition: ipv6cp.c:682
error_t ipv6cpSendConfigureReq(PppContext *context)
Send-Configure-Request callback function.
Definition: ipv6cp.c:703
error_t ipv6cpSendTerminateReq(PppContext *context)
Send-Terminate-Request callback function.
Definition: ipv6cp.c:830
void ipv6cpThisLayerFinished(PppContext *context)
This-Layer-Finished callback function.
Definition: ipv6cp.c:654
void ipv6cpThisLayerStarted(PppContext *context)
This-Layer-Started callback function.
Definition: ipv6cp.c:642
error_t ipv6cpSendConfigureNak(PppContext *context, const PppConfigurePacket *configureReqPacket)
Send-Configure-Nak callback function.
Definition: ipv6cp.c:793
void ipv6cpThisLayerDown(PppContext *context)
This-Layer-Down callback function.
Definition: ipv6cp.c:615
error_t ipv6cpSendCodeRej(PppContext *context, const PppPacket *packet)
Send-Code-Reject callback function.
Definition: ipv6cp.c:896
void ipv6cpThisLayerUp(PppContext *context)
This-Layer-Up callback function.
Definition: ipv6cp.c:579
void ipv6cpInitRestartCount(PppContext *context, uint_t value)
Initialize-Restart-Count callback function.
Definition: ipv6cp.c:667
error_t ipv6cpSendTerminateAck(PppContext *context, const PppTerminatePacket *terminateReqPacket)
Send-Terminate-Ack callback function.
Definition: ipv6cp.c:862
error_t ipv6cpSendConfigureAck(PppContext *context, const PppConfigurePacket *configureReqPacket)
Send-Configure-Ack callback function.
Definition: ipv6cp.c:774
error_t ipv6cpSendConfigureRej(PppContext *context, const PppConfigurePacket *configureReqPacket)
Send-Configure-Reject callback function.
Definition: ipv6cp.c:812