example/ipsec_api/odp_ipsec.c
static
pkt_ctx_t *alloc_pkt_ctx(odp_packet_t pkt)
{
	odp_buffer_t ctx_buf = odp_buffer_alloc(global->ctx_pool);
	pkt_ctx_t *ctx;

	if (odp_unlikely(ODP_BUFFER_INVALID == ctx_buf))
		return NULL;

	ctx = odp_buffer_addr(ctx_buf);
	memset(ctx, 0, sizeof(*ctx));
	ctx->buffer = ctx_buf;
	odp_packet_user_ptr_set(pkt, ctx);

	return ctx;
}
/**
 * Allocate per packet processing context and associate it with
 * packet buffer
 *
 * @param pkt  Packet
 *
 * @return pointer to context area
 */
Allocate per packet processing context and associate it with
packet buffer

@param pkt  Packet

@return pointer to context area
Allocate per packet processing context and associate it with packet buffer @param pkt Packet @return pointer to context area
static
pkt_ctx_t *alloc_pkt_ctx(odp_packet_t pkt)
{
	odp_buffer_t ctx_buf = odp_buffer_alloc(global->ctx_pool);
	pkt_ctx_t *ctx;
	if (odp_unlikely(ODP_BUFFER_INVALID == ctx_buf))
		return NULL;
	ctx = odp_buffer_addr(ctx_buf);
	memset(ctx, 0, sizeof(*ctx));
	ctx->buffer = ctx_buf;
	odp_packet_user_ptr_set(pkt, ctx);
	return ctx;
}
static pkt_ctx_t * alloc_pkt_ctx ( odp_packet_t pkt ) { odp_buffer_t ctx_buf = odp_buffer_alloc ( global -> ctx_pool ) ; pkt_ctx_t * ctx ; if ( odp_unlikely ( ODP_BUFFER_INVALID == ctx_buf ) ) return NULL ; ctx = odp_buffer_addr ( ctx_buf ) ; memset ( ctx , 0 , sizeof ( * ctx ) ) ; ctx -> buffer = ctx_buf ; odp_packet_user_ptr_set ( pkt , ctx ) ; return ctx ; }
Allocate per packet processing context and associate it with
 packet buffer
Allocate per packet processing context and associate it with packet buffer