ah.c File Reference

AH (IP Authentication Header) More...

#include "ipsec/ipsec.h"
#include "ipsec/ipsec_inbound.h"
#include "ipsec/ipsec_anti_replay.h"
#include "ipsec/ipsec_misc.h"
#include "ah/ah.h"
#include "core/tcp_fsm.h"
#include "core/raw_socket.h"
#include "ipv4/icmp.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   AH_TRACE_LEVEL
 

Functions

error_t ipv4ProcessAhHeader (NetInterface *interface, const Ipv4Header *ipv4Header, const NetBuffer *buffer, size_t offset, NetRxAncillary *ancillary)
 Process AH protected packet. More...
 
error_t ahGenerateIcv (IpsecSadEntry *sa, const Ipv4Header *ipv4Header, AhHeader *ahHeader, const NetBuffer *buffer, size_t offset)
 ICV generation. More...
 
error_t ahVerifyIcv (IpsecSadEntry *sa, const Ipv4Header *ipv4Header, const AhHeader *ahHeader, const NetBuffer *buffer, size_t offset)
 ICV verification. More...
 
void ahProcessMutableIpv4Options (Ipv4Header *header)
 Zeroize mutable IPv4 options. More...
 
void ahDumpHeader (const AhHeader *ahHeader)
 Dump AH header for debugging purpose. More...
 

Detailed Description

AH (IP Authentication Header)

License

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

Copyright (C) 2022-2024 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneIPSEC 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 ah.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   AH_TRACE_LEVEL

Definition at line 32 of file ah.c.

Function Documentation

◆ ahDumpHeader()

void ahDumpHeader ( const AhHeader ahHeader)

Dump AH header for debugging purpose.

Parameters
[in]ahHeaderPointer to the AH header

Definition at line 760 of file ah.c.

◆ ahGenerateIcv()

error_t ahGenerateIcv ( IpsecSadEntry sa,
const Ipv4Header ipv4Header,
AhHeader ahHeader,
const NetBuffer buffer,
size_t  offset 
)

ICV generation.

Parameters
[in]saPointer to the SA
[in]ipv4HeaderPointer to the IPv4 header
[in,out]ahHeaderPointer to the AH header
[in]bufferMulti-part buffer containing the payload
[in]offsetOffset to the first byte of the payload
Returns
Error code

Definition at line 275 of file ah.c.

◆ ahProcessMutableIpv4Options()

void ahProcessMutableIpv4Options ( Ipv4Header header)

Zeroize mutable IPv4 options.

Parameters
[in]headerPointer to the IPv4 header

Definition at line 694 of file ah.c.

◆ ahVerifyIcv()

error_t ahVerifyIcv ( IpsecSadEntry sa,
const Ipv4Header ipv4Header,
const AhHeader ahHeader,
const NetBuffer buffer,
size_t  offset 
)

ICV verification.

Parameters
[in]saPointer to the SA
[in]ipv4HeaderPointer to the IPv4 header
[in]ahHeaderPointer to the AH header
[in]bufferMulti-part buffer containing the payload
[in]offsetOffset to the first byte of the payload
Returns
Error code

Definition at line 447 of file ah.c.

◆ ipv4ProcessAhHeader()

error_t ipv4ProcessAhHeader ( NetInterface interface,
const Ipv4Header ipv4Header,
const NetBuffer buffer,
size_t  offset,
NetRxAncillary ancillary 
)

Process AH protected packet.

Parameters
[in]interfaceUnderlying network interface
[in]ipv4HeaderPointer to the IPv4 header
[in]bufferMulti-part buffer containing the AH protected packet
[in]offsetOffset to the first byte of the AH header
[in]ancillaryAdditional options passed to the stack along with the packet
Returns
Error code

Definition at line 60 of file ah.c.