rte_ipsec_sad.h(3)

πŸ’– rte_ipsec_sad.h β€” bestie edition πŸ’–

okay so this is rte_ipsec_sad.h from the DPDK library, section 3 of the manual (library functions, iykyk). it's giving "security association database support" and honestly? iconic. let's get into it 🫢


✨ NAME ✨

rte_ipsec_sad.h β€” the RTE IPsec security association database (SAD) support header, no cap 🌸


✨ SYNOPSIS ✨

#include <stdint.h>
#include <rte_ip6.h>

πŸŽ€ Data Structures

  • struct rte_ipsec_sad_conf

πŸŽ€ Macros

#define RTE_IPSEC_SAD_NAMESIZE   64
#define RTE_IPSEC_SAD_FLAG_IPV6   0x1
#define RTE_IPSEC_SAD_FLAG_RW_CONCURRENCY   0x2

πŸŽ€ Enumerations

  • enum

πŸŽ€ Functions

int rte_ipsec_sad_add (struct rte_ipsec_sad *sad, const union
    rte_ipsec_sad_key *key, int key_type, void *sa)
int rte_ipsec_sad_del (struct rte_ipsec_sad *sad, const union
    rte_ipsec_sad_key *key, int key_type)
struct rte_ipsec_sad * rte_ipsec_sad_find_existing (const char *name)
void rte_ipsec_sad_destroy (struct rte_ipsec_sad *sad)
int rte_ipsec_sad_lookup (const struct rte_ipsec_sad *sad, const union
    rte_ipsec_sad_key *keys[], void *sa[], uint32_t n)

✨ Detailed Description ✨

RTE IPsec security association database (SAD) support. it literally contains helper functions to look stuff up and maintain your SAD πŸ’…

lowkey the whole point: you got a database, you look things up, you keep it tidy. periodt.

Definition in file rte_ipsec_sad.h.


🌈 Macro Definition Documentation 🌈

#define RTE_IPSEC_SAD_NAMESIZE 64

Max number of characters in SAD name. so like, 64 chars for your SAD's name and not one more, bestie πŸŽ€

Definition at line 51 of file rte_ipsec_sad.h.

#define RTE_IPSEC_SAD_FLAG_IPV6 0x1

Flag to create SAD with ipv6 dip and sip addresses ✨ (dip = destination, sip = source, fyi)

Definition at line 53 of file rte_ipsec_sad.h.

#define RTE_IPSEC_SAD_FLAG_RW_CONCURRENCY 0x2

Flag to support reader writer concurrency πŸ”₯

Definition at line 55 of file rte_ipsec_sad.h.


πŸ¦‹ Enumeration Type Documentation πŸ¦‹

anonymous enum

Type of key πŸ”‘

Definition at line 26 of file rte_ipsec_sad.h.


πŸ‘‘ Function Documentation πŸ‘‘

int rte_ipsec_sad_add (struct rte_ipsec_sad * sad, const union rte_ipsec_sad_key * key, int key_type, void * sa)

Add a rule into the SAD. 🫢

the way this can be safely called with concurrent lookups IF the RTE_IPSEC_SAD_FLAG_RW_CONCURRENCY flag was configured at creation time. and while with this flag the multi-reader – one-writer model is MT safe, the multi-writer model is not and requires extra synchronisation. so no cap: multi-writer needs you to handle that yourself, ok? don't be out here raw-dogging concurrency 😭

Parameters

  • sad β€” SAD object handle
  • key β€” pointer to the key
  • key_type β€” key type (spi only/spi+dip/spi+dip+sip)
  • sa β€” Pointer associated with the key to save in a SAD. Must be 4 bytes aligned.

Returns

0 on success, negative value otherwise

int rte_ipsec_sad_del (struct rte_ipsec_sad * sad, const union rte_ipsec_sad_key * key, int key_type)

Delete a rule from the SAD. πŸ’€

same deal as add: safely called with concurrent lookups IF RTE_IPSEC_SAD_FLAG_RW_CONCURRENCY was set at creation time. with this flag the multi-reader – one-writer model is MT safe, the multi-writer model is not and requires extra synchronisation. read that again bestie, it matters πŸ’œ

Parameters

  • sad β€” SAD object handle
  • key β€” pointer to the key
  • key_type β€” key type (spi only/spi+dip/spi+dip+sip)

Returns

0 on success, negative value otherwise

struct rte_ipsec_sad * rte_ipsec_sad_find_existing (const char * name)

Find an existing SAD object and return a pointer to it. like a little "hey, are you there?" for your SAD 🌸

Parameters

  • name β€” Name of the SAD object as passed to rte_ipsec_sad_create()

Returns

Pointer to sad object or NULL if object not found, with rte_errno set appropriately. Possible rte_errno values include:

  • ENOENT β€” required entry not available to return.

void rte_ipsec_sad_destroy (struct rte_ipsec_sad * sad)

Destroy SAD object. bye bestie πŸ‘‹ it's giving cleanup era 🧹

Parameters

  • sad β€” pointer to the SAD object

int rte_ipsec_sad_lookup (const struct rte_ipsec_sad * sad, const union rte_ipsec_sad_key * keys[], void * sa[], uint32_t n)

Lookup multiple keys in the SAD. plural. obsessed πŸ’–

Parameters

  • sad β€” SAD object handle
  • keys β€” Array of keys to be looked up in the SAD
  • sa β€” Pointer associated with the keys. If the lookup for the given key failed, then corresponding sa will be NULL
  • n β€” Number of elements in keys array to lookup.

Returns

-EINVAL for incorrect arguments, otherwise number of successful lookups.


πŸ’œ Author πŸ’œ

Generated automatically by Doxygen for DPDK from the source code. (not me, I'm just the messenger πŸŽ€)


okay that's the whole thing! this page is from DPDK, Version 25.11.3, and yeah, that's rte_ipsec_sad.h(3) β€” go slay those IPsec lookups, bestie πŸ’…βœ¨πŸŒˆ

πŸ“¦ where this page comes from