example/ipsec_crypto/odp_ipsec.c
static
void ipsec_init_post(crypto_api_mode_e api_mode)
{
	sp_db_entry_t *entry;

	/* Attempt to find appropriate SA for each SP */
	for (entry = sp_db->list; NULL != entry; entry = entry->next) {
		sa_db_entry_t *cipher_sa = NULL;
		sa_db_entry_t *auth_sa = NULL;
		tun_db_entry_t *tun = NULL;

		if (entry->esp) {
			cipher_sa = find_sa_db_entry(&entry->src_subnet,
						     &entry->dst_subnet,
						     1);
			tun = find_tun_db_entry(cipher_sa->src_ip,
						cipher_sa->dst_ip);
		}
		if (entry->ah) {
			auth_sa = find_sa_db_entry(&entry->src_subnet,
						   &entry->dst_subnet,
						   0);
			tun = find_tun_db_entry(auth_sa->src_ip,
						auth_sa->dst_ip);
		}

		if (cipher_sa || auth_sa) {
			if (create_ipsec_cache_entry(cipher_sa,
						     auth_sa,
						     tun,
						     api_mode,
						     entry->input,
						     global->completionq,
						     global->out_pool)) {
				ODPH_ERR("Error: IPSec cache entry failed.\n"
						);
				exit(EXIT_FAILURE);
			}
		} else {
			printf(" WARNING: SA not found for SP\n");
			dump_sp_db_entry(entry);
		}
	}
}
/**
 * IPsec post argument processing intialization
 *
 * Resolve SP DB with SA DB and create corresponding IPsec cache entries
 *
 * @param api_mode  Mode to use when invoking per packet crypto API
 */
IPsec post argument processing intialization
Resolve SP DB with SA DB and create corresponding IPsec cache entries

@param api_mode  Mode to use when invoking per packet crypto API
IPsec post argument processing intialization Resolve SP DB with SA DB and create corresponding IPsec cache entries @param api_mode Mode to use when invoking per packet crypto API
static
void ipsec_init_post(crypto_api_mode_e api_mode)
{
	sp_db_entry_t *entry;
	for (entry = sp_db->list; NULL != entry; entry = entry->next) {
		sa_db_entry_t *cipher_sa = NULL;
		sa_db_entry_t *auth_sa = NULL;
		tun_db_entry_t *tun = NULL;
		if (entry->esp) {
			cipher_sa = find_sa_db_entry(&entry->src_subnet,
						     &entry->dst_subnet,
						     1);
			tun = find_tun_db_entry(cipher_sa->src_ip,
						cipher_sa->dst_ip);
		}
		if (entry->ah) {
			auth_sa = find_sa_db_entry(&entry->src_subnet,
						   &entry->dst_subnet,
						   0);
			tun = find_tun_db_entry(auth_sa->src_ip,
						auth_sa->dst_ip);
		}
		if (cipher_sa || auth_sa) {
			if (create_ipsec_cache_entry(cipher_sa,
						     auth_sa,
						     tun,
						     api_mode,
						     entry->input,
						     global->completionq,
						     global->out_pool)) {
				ODPH_ERR("Error: IPSec cache entry failed.\n"
						);
				exit(EXIT_FAILURE);
			}
		} else {
			printf(" WARNING: SA not found for SP\n");
			dump_sp_db_entry(entry);
		}
	}
}
static void ipsec_init_post ( crypto_api_mode_e api_mode ) { sp_db_entry_t * entry ; for ( entry = sp_db -> list ; NULL != entry ; entry = entry -> next ) { sa_db_entry_t * cipher_sa = NULL ; sa_db_entry_t * auth_sa = NULL ; tun_db_entry_t * tun = NULL ; if ( entry -> esp ) { cipher_sa = find_sa_db_entry ( & entry -> src_subnet , & entry -> dst_subnet , 1 ) ; tun = find_tun_db_entry ( cipher_sa -> src_ip , cipher_sa -> dst_ip ) ; } if ( entry -> ah ) { auth_sa = find_sa_db_entry ( & entry -> src_subnet , & entry -> dst_subnet , 0 ) ; tun = find_tun_db_entry ( auth_sa -> src_ip , auth_sa -> dst_ip ) ; } if ( cipher_sa || auth_sa ) { if ( create_ipsec_cache_entry ( cipher_sa , auth_sa , tun , api_mode , entry -> input , global -> completionq , global -> out_pool ) ) { ODPH_ERR ( " \n " ) ; exit ( EXIT_FAILURE ) ; } } else { printf ( " \n " ) ; dump_sp_db_entry ( entry ) ; } } }
IPsec post argument processing intialization
 Resolve SP DB with SA DB and create corresponding IPsec cache entries
IPsec post argument processing intialization Resolve SP DB with SA DB and create corresponding IPsec cache entries
/* Attempt to find appropriate SA for each SP */