rte_ipsec_sa.h(3)

πŸ’– rte_ipsec_sa.h πŸ’–

okay bestie so this is <rte_ipsec_sa.h> from the DPDK library functions manual, and no cap it's the whole API for managing IPsec Security Association (SA) objects. like, the entire vibe of "hey computer, hold this security association for me." slay. πŸŽ€


✨ NAME ✨

rte_ipsec_sa.h β€” bestie, that's the header, that's the name, we move.


✨ 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 ✨

So basically this file defines the API to manage IPsec Security Association (SA) objects. that's the mission. that's the whole gig. πŸ’…

Definition in file rte_ipsec_sa.h.


✨ Macro Definition Documentation ✨

🌸 #define RTE_IPSEC_SAFLAG_SQN_ATOM (1ULL << 0)

This flag is telling you whether the SA will (or will not) need an 'atomic' access to the sequence number and replay window. and bestie, when I say 'atomic' here, I mean it in the sense that these functions:

  • rte_ipsec_pkt_crypto_prepare
  • rte_ipsec_pkt_process

can be safely used in a multi-threaded (MT) environment, as long as the user pinky-promises they obey the multiple readers / single writer model for SQN + replay_window operations. let me get specific because the details matter, fr fr:

  • for an outbound SA: there are no restrictions. go off, king. πŸ‘‘
  • for an inbound SA: the caller has to guarantee that at any given moment only one single thread is executing rte_ipsec_pkt_process() for that given SA.

and a lil reminder: it is the caller's responsibility to maintain the correct order of the packets to be processed. in other words β€” and I'm gonna say it again so it really lands β€” it is a caller responsibility to serialize process() invocations. no take-backs, no do-overs. πŸ™ˆ

Definition at line 70 of file rte_ipsec_sa.h.


✨ Enumeration Type Documentation ✨

🌸 anonymous enum

The SA type is a 64-bit value that contains all of this info right here:

  • IP version (IPv4/IPv6)
  • IPsec proto (ESP/AH)
  • inbound/outbound
  • mode (TRANSPORT/TUNNEL)
  • for TUNNEL, the 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 the type of the given SA. yep, that's it, that's the job. πŸ’–

Returns

  • The SA type value.

🌸 int rte_ipsec_sa_size (const struct rte_ipsec_sa_prm * prm)

calculate the required SA size based on the input parameters you handed it. it's giving "how much room do I need for this."

Parameters

  • prm β€” Parameters that will be used to initialise the SA object.

Returns

  • The actual size required for the SA with the 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 the SA based on the input parameters. the main character moment. ✨

Parameters

  • sa β€” SA object to initialise.
  • prm β€” Parameters used to initialise the given SA object.
  • size β€” size of the provided buffer for the SA.

Returns

  • The actual size of the SA object if the operation completed successfully.
  • -EINVAL if the parameters are invalid.
  • -ENOSPC if the size of the provided buffer is not big enough. (buffer too small, bestie, it happens to everyone 😭)

🌸 void rte_ipsec_sa_fini (struct rte_ipsec_sa * sa)

cleanup the SA. closing ceremony. we're done here. 🫢

Parameters

  • sa β€” Pointer to the SA object to de-initialize.

✨ Author ✨

Generated automatically by Doxygen for DPDK from the source code. so nobody hand-wrote this, it's a robot doing its lil thing. iconic behaviour honestly.


and that's the whole page bestie!! this was rte_ipsec_sa.h(3) from DPDK, Version 25.11.3, and it's the library functions manual for DPDK. periodt. πŸ’…βœ¨πŸ’– take care of your SAs and they'll take care of you. πŸ¦‹
πŸ“¦ where this page comes from