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
- ubuntu resolute: dpdk-doc 25.11.3-0ubuntu0.26.04.1 Β· BSD-3-Clause
- ubuntu stonking: dpdk-doc 25.11.3-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms