IPsec processing of outbound IP traffic. More...
#include "ipsec/ipsec.h"
#include "ipsec/ipsec_outbound.h"
#include "ipsec/ipsec_misc.h"
#include "ike/ike.h"
#include "ah/ah.h"
#include "esp/esp_packet_encrypt.h"
#include "debug.h"
Go to the source code of this file.
Functions | |
error_t | ipsecProcessOutboundIpv4Packet (NetInterface *interface, const Ipv4PseudoHeader *pseudoHeader, uint16_t fragId, NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary) |
Outbound IPv4 traffic processing. More... | |
error_t | ipsecGetOutboundIpv4PacketSelector (const Ipv4PseudoHeader *pseudoHeader, const NetBuffer *buffer, size_t offset, IpsecSelector *selector) |
Extract packet's selector from outbound IPv4 packet. More... | |
error_t | ipsecProtectIpv4Packet (IpsecContext *context, IpsecSadEntry *sa, NetInterface *interface, const Ipv4PseudoHeader *pseudoHeader, uint16_t fragId, NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary) |
Protect an outbound IPv4 packet using AH or ESP. More... | |
error_t | ipsecSendIpv4Packet (NetInterface *interface, const Ipv4PseudoHeader *pseudoHeader, uint16_t fragId, NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary) |
Send an IPv4 packet. More... | |
Detailed Description
IPsec processing of outbound IP traffic.
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.
- Version
- 2.4.4
Definition in file ipsec_outbound.c.
Function Documentation
◆ ipsecGetOutboundIpv4PacketSelector()
error_t ipsecGetOutboundIpv4PacketSelector | ( | const Ipv4PseudoHeader * | pseudoHeader, |
const NetBuffer * | buffer, | ||
size_t | offset, | ||
IpsecSelector * | selector | ||
) |
Extract packet's selector from outbound IPv4 packet.
- Parameters
-
[in] pseudoHeader IPv4 pseudo header [in] buffer Multi-part buffer containing the IP payload [in] offset Offset from the beginning of the buffer [out] selector Pointer to the IPsec selector
- Returns
- Error code
Definition at line 152 of file ipsec_outbound.c.
◆ ipsecProcessOutboundIpv4Packet()
error_t ipsecProcessOutboundIpv4Packet | ( | NetInterface * | interface, |
const Ipv4PseudoHeader * | pseudoHeader, | ||
uint16_t | fragId, | ||
NetBuffer * | buffer, | ||
size_t | offset, | ||
NetTxAncillary * | ancillary | ||
) |
Outbound IPv4 traffic processing.
- Parameters
-
[in] interface Underlying network interface [in] pseudoHeader IPv4 pseudo header [in] fragId Fragment identification field [in] buffer Multi-part buffer containing the payload [in] offset Offset to the first byte of the payload [in] ancillary Additional options passed to the stack along with the packet
- Returns
- Error code
Definition at line 56 of file ipsec_outbound.c.
◆ ipsecProtectIpv4Packet()
error_t ipsecProtectIpv4Packet | ( | IpsecContext * | context, |
IpsecSadEntry * | sa, | ||
NetInterface * | interface, | ||
const Ipv4PseudoHeader * | pseudoHeader, | ||
uint16_t | fragId, | ||
NetBuffer * | buffer, | ||
size_t | offset, | ||
NetTxAncillary * | ancillary | ||
) |
Protect an outbound IPv4 packet using AH or ESP.
- Parameters
-
[in] context Pointer to the IPsec context [in] sa Pointer to the security association [in] interface Underlying network interface [in] pseudoHeader IPv4 pseudo header [in] fragId Fragment identification field [in] buffer Multi-part buffer containing the payload [in] offset Offset to the first byte of the payload [in] ancillary Additional options passed to the stack along with the packet
- Returns
- Error code
Definition at line 261 of file ipsec_outbound.c.
◆ ipsecSendIpv4Packet()
error_t ipsecSendIpv4Packet | ( | NetInterface * | interface, |
const Ipv4PseudoHeader * | pseudoHeader, | ||
uint16_t | fragId, | ||
NetBuffer * | buffer, | ||
size_t | offset, | ||
NetTxAncillary * | ancillary | ||
) |
Send an IPv4 packet.
- Parameters
-
[in] interface Underlying network interface [in] pseudoHeader IPv4 pseudo header [in] fragId Fragment identification field [in] buffer Multi-part buffer containing the payload [in] offset Offset to the first byte of the payload [in] ancillary Additional options passed to the stack along with the packet
- Returns
- Error code
Definition at line 444 of file ipsec_outbound.c.