* indicate presence of entries with the same SPI in DIP and DIP+SIP tables.
*/
-#define IPSEC_SAD_NAMESIZE 64
#define SAD_PREFIX "SAD_"
/* "SAD_<name>" */
#define SAD_FORMAT SAD_PREFIX "%s"
};
struct rte_ipsec_sad {
- char name[IPSEC_SAD_NAMESIZE];
+ char name[RTE_IPSEC_SAD_NAMESIZE];
struct rte_hash *hash[RTE_IPSEC_SAD_KEY_TYPE_MASK];
/* Array to track number of more specific rules
* (spi_dip or spi_dip_sip). Used only in add/delete
rte_ipsec_sad_create(const char *name, const struct rte_ipsec_sad_conf *conf)
{
char hash_name[RTE_HASH_NAMESIZE];
- char sad_name[IPSEC_SAD_NAMESIZE];
+ char sad_name[RTE_IPSEC_SAD_NAMESIZE];
struct rte_tailq_entry *te;
struct rte_ipsec_sad_list *sad_list;
struct rte_ipsec_sad *sad, *tmp_sad = NULL;
return NULL;
}
- ret = snprintf(sad_name, IPSEC_SAD_NAMESIZE, SAD_FORMAT, name);
- if (ret < 0 || ret >= IPSEC_SAD_NAMESIZE) {
+ ret = snprintf(sad_name, RTE_IPSEC_SAD_NAMESIZE, SAD_FORMAT, name);
+ if (ret < 0 || ret >= RTE_IPSEC_SAD_NAMESIZE) {
rte_errno = ENAMETOOLONG;
return NULL;
}
/* guarantee there's no existing */
TAILQ_FOREACH(te, sad_list, next) {
tmp_sad = (struct rte_ipsec_sad *)te->data;
- if (strncmp(sad_name, tmp_sad->name, IPSEC_SAD_NAMESIZE) == 0)
+ if (strncmp(sad_name, tmp_sad->name,
+ RTE_IPSEC_SAD_NAMESIZE) == 0)
break;
}
if (te != NULL) {
struct rte_ipsec_sad *
rte_ipsec_sad_find_existing(const char *name)
{
- char sad_name[IPSEC_SAD_NAMESIZE];
+ char sad_name[RTE_IPSEC_SAD_NAMESIZE];
struct rte_ipsec_sad *sad = NULL;
struct rte_tailq_entry *te;
struct rte_ipsec_sad_list *sad_list;
int ret;
- ret = snprintf(sad_name, IPSEC_SAD_NAMESIZE, SAD_FORMAT, name);
- if (ret < 0 || ret >= IPSEC_SAD_NAMESIZE) {
+ ret = snprintf(sad_name, RTE_IPSEC_SAD_NAMESIZE, SAD_FORMAT, name);
+ if (ret < 0 || ret >= RTE_IPSEC_SAD_NAMESIZE) {
rte_errno = ENAMETOOLONG;
return NULL;
}
rte_mcfg_tailq_read_lock();
TAILQ_FOREACH(te, sad_list, next) {
sad = (struct rte_ipsec_sad *) te->data;
- if (strncmp(sad_name, sad->name, IPSEC_SAD_NAMESIZE) == 0)
+ if (strncmp(sad_name, sad->name, RTE_IPSEC_SAD_NAMESIZE) == 0)
break;
}
rte_mcfg_tailq_read_unlock();