ipv6cp.h File Reference

IPV6CP (PPP IPv6 Control Protocol) More...

#include "core/net.h"
#include "ppp/ppp.h"

Go to the source code of this file.

Enumerations

enum  Ipv6cpOptionType { IPV6CP_OPTION_INTERFACE_ID = 1, IPV6CP_OPTION_IPV6_COMP_PROTOCOL = 2 }
 IPV6CP option types. More...
 

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

typedef __packed_struct
 Interface-Identifier option. More...
 
uint8_t length
 
Eui64 interfaceId
 
 Ipv6cpInterfaceIdOption
 
uint16_t protocol
 
uint8_t data []
 
 Ipv6cpIpCompProtocolOption
 

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.h.

Enumeration Type Documentation

◆ Ipv6cpOptionType

IPV6CP option types.

Enumerator
IPV6CP_OPTION_INTERFACE_ID 

Interface-Identifier.

IPV6CP_OPTION_IPV6_COMP_PROTOCOL 

IPv6-Compression-Protocol.

Definition at line 48 of file ipv6cp.h.

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

◆ __packed_struct

typedef __packed_struct
Initial value:
{
uint8_t type

Interface-Identifier option.

IPv6-Compression-Protocol option.

Definition at line 67 of file ipv6cp.h.

◆ data

uint8_t data[]

Definition at line 84 of file ipv6cp.h.

◆ interfaceId

Eui64 interfaceId

Definition at line 71 of file ipv6cp.h.

◆ Ipv6cpInterfaceIdOption

Ipv6cpInterfaceIdOption

Definition at line 72 of file ipv6cp.h.

◆ Ipv6cpIpCompProtocolOption

Ipv6cpIpCompProtocolOption

Definition at line 85 of file ipv6cp.h.

◆ length

uint8_t length

Definition at line 70 of file ipv6cp.h.

◆ protocol

uint16_t protocol

Definition at line 83 of file ipv6cp.h.

uint8_t type
Definition: coap_common.h:176