example/ipsec_crypto/odp_ipsec.c
static
pkt_disposition_e do_ipsec_out_finish(odp_packet_t pkt,
				      pkt_ctx_t *ctx)
{
	odph_ipv4hdr_t *ip;
	odp_crypto_packet_result_t result;

	odp_crypto_result(&result, pkt);

	/* Check crypto result */
	if (!result.ok) {
		if (!is_crypto_op_status_ok(&result.cipher_status))
			return PKT_DROP;
		if (!is_crypto_op_status_ok(&result.auth_status))
			return PKT_DROP;
	}
	ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL);

	/* Finalize the IPv4 header */
	ip->ttl = ctx->ipsec.ip_ttl;
	ip->tos = ctx->ipsec.ip_tos;
	ip->frag_offset = odp_cpu_to_be_16(ctx->ipsec.ip_frag_offset);
	ip->chksum = 0;
	odph_ipv4_csum_update(pkt);

	/* Fall through to next state */
	return PKT_CONTINUE;
}
/**
 * Packet Processing - Output IPsec packet processing cleanup
 *
 * @param pkt  Packet to handle
 * @param ctx  Packet process context
 *
 * @return PKT_CONTINUE if successful else PKT_DROP
 */
Packet Processing - Output IPsec packet processing cleanup
@param pkt  Packet to handle
@param ctx  Packet process context


Packet Processing - Output IPsec packet processing cleanup @param pkt Packet to handle @param ctx Packet process context
static
pkt_disposition_e do_ipsec_out_finish(odp_packet_t pkt,
				      pkt_ctx_t *ctx)
{
	odph_ipv4hdr_t *ip;
	odp_crypto_packet_result_t result;
	odp_crypto_result(&result, pkt);
	if (!result.ok) {
		if (!is_crypto_op_status_ok(&result.cipher_status))
			return PKT_DROP;
		if (!is_crypto_op_status_ok(&result.auth_status))
			return PKT_DROP;
	}
	ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL);
	ip->ttl = ctx->ipsec.ip_ttl;
	ip->tos = ctx->ipsec.ip_tos;
	ip->frag_offset = odp_cpu_to_be_16(ctx->ipsec.ip_frag_offset);
	ip->chksum = 0;
	odph_ipv4_csum_update(pkt);
	return PKT_CONTINUE;
}
static pkt_disposition_e do_ipsec_out_finish ( odp_packet_t pkt , pkt_ctx_t * ctx ) { odph_ipv4hdr_t * ip ; odp_crypto_packet_result_t result ; odp_crypto_result ( & result , pkt ) ; if ( ! result . ok ) { if ( ! is_crypto_op_status_ok ( & result . cipher_status ) ) return PKT_DROP ; if ( ! is_crypto_op_status_ok ( & result . auth_status ) ) return PKT_DROP ; } ip = ( odph_ipv4hdr_t * ) odp_packet_l3_ptr ( pkt , NULL ) ; ip -> ttl = ctx -> ipsec . ip_ttl ; ip -> tos = ctx -> ipsec . ip_tos ; ip -> frag_offset = odp_cpu_to_be_16 ( ctx -> ipsec . ip_frag_offset ) ; ip -> chksum = 0 ; odph_ipv4_csum_update ( pkt ) ; return PKT_CONTINUE ; }
Packet Processing - Output IPsec packet processing cleanup
 @param pkt  Packet to handle
 @param ctx  Packet process context
Packet Processing - Output IPsec packet processing cleanup @param pkt Packet to handle @param ctx Packet process context
/* Check crypto result */ /* Finalize the IPv4 header */ /* Fall through to next state */