---
name: "RTE_IPSEC_SAFLAG_SQN_ATOM"
section: "3"
platform: "linux"
package: "dpdk-doc"
version: "24.11.4-0+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rte_ipsec_sa.h"
---

# RTE\_IPSEC\_SAFLAG\_SQN\_ATOM(3)

Part of [rte\_ipsec\_sa.h(3)](/rte_ipsec_sa.h/3.md).

## NAME

rte\_ipsec\_sa.h

## SYNOPSIS

`#include <rte_common.h>`\
 `#include <rte_cryptodev.h>`\
 `#include <rte_security.h>`\

### Data Structures

struct **rte\_ipsec\_sa\_prm**\

### Macros

\#define **RTE\_IPSEC\_SAFLAG\_SQN\_ATOM**   (1ULL \<\< 0)\

### Enumerations

enum \

### Functions

uint64\_t **rte\_ipsec\_sa\_type** (const struct rte\_ipsec\_sa \*sa)\
 int **rte\_ipsec\_sa\_size** (const struct **rte\_ipsec\_sa\_prm** \*prm)\
 int **rte\_ipsec\_sa\_init** (struct rte\_ipsec\_sa \*sa, const struct **rte\_ipsec\_sa\_prm** \*prm, uint32\_t size)\
 void **rte\_ipsec\_sa\_fini** (struct rte\_ipsec\_sa \*sa)\

## Detailed Description

Defines API to manage IPsec Security Association (SA) objects.

Definition in file **rte\_ipsec\_sa.h**.

## Macro Definition Documentation

### #define RTE\_IPSEC\_SAFLAG\_SQN\_ATOM (1ULL \<\< 0)

Indicates that SA will(/will not) need an 'atomic' access to sequence number and replay window. 'atomic' here means: functions:

- •

  rte\_ipsec\_pkt\_crypto\_prepare

- •

  rte\_ipsec\_pkt\_process can be safely used in MT environment, as long as the user can guarantee that they obey multiple readers/single writer model for SQN+replay\_window operations. To be more specific: for outbound SA there are no restrictions. for inbound SA the caller has to guarantee that at any given moment only one thread is executing **rte\_ipsec\_pkt\_process()** for given SA. Note that it is caller responsibility to maintain correct order of packets to be processed. In other words - it is a caller responsibility to serialize process() invocations.

Definition at line **70** of file **rte\_ipsec\_sa.h**.

## Enumeration Type Documentation

### anonymous enum

SA type is an 64-bit value that contain the following information:

- •

  IP version (IPv4/IPv6)

- •

  IPsec proto (ESP/AH)

- •

  inbound/outbound

- •

  mode (TRANSPORT/TUNNEL)

- •

  for TUNNEL outer IP version (IPv4/IPv6)

- •

  are SA SQN operations 'atomic'

- •

  ESN enabled/disabled

- •

  NAT-T UDP encapsulated (TUNNEL mode only) ...

Definition at line **85** of file **rte\_ipsec\_sa.h**.

## Function Documentation

### uint64\_t rte\_ipsec\_sa\_type (const struct rte\_ipsec\_sa \* sa)

get type of given SA

**Returns**

SA type value.

### int rte\_ipsec\_sa\_size (const struct rte\_ipsec\_sa\_prm \* prm)

Calculate required SA size based on provided input parameters.

**Parameters**

*prm* Parameters that will be used to initialise SA object.

**Returns**

- •

  Actual size required for SA with given parameters.

- •

  \-EINVAL if the parameters are invalid.

### int rte\_ipsec\_sa\_init (struct rte\_ipsec\_sa \* sa, const struct rte\_ipsec\_sa\_prm \* prm, uint32\_t size)

initialise SA based on provided input parameters.

**Parameters**

*sa* SA object to initialise. \
 *prm* Parameters used to initialise given SA object. \
 *size* size of the provided buffer for SA.

**Returns**

- •

  Actual size of SA object if operation completed successfully.

- •

  \-EINVAL if the parameters are invalid.

- •

  \-ENOSPC if the size of the provided buffer is not big enough.

### void rte\_ipsec\_sa\_fini (struct rte\_ipsec\_sa \* sa)

cleanup SA

**Parameters**

*sa* Pointer to SA object to de-initialize.

## Author

Generated automatically by Doxygen for DPDK from the source code.
