example/ipsec_crypto/odp_ipsec.c
static
pkt_disposition_e do_route_fwd_db(odp_packet_t pkt, pkt_ctx_t *ctx)
{
	odph_ipv4hdr_t *ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL);
	fwd_db_entry_t *entry;

	entry = find_fwd_db_entry(odp_be_to_cpu_32(ip->dst_addr));

	if (entry) {
		odph_ethhdr_t *eth =
			(odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL);

		memcpy(&eth->dst, entry->dst_mac, ODPH_ETHADDR_LEN);
		memcpy(&eth->src, entry->src_mac, ODPH_ETHADDR_LEN);
		ctx->pktout = entry->pktout;

		return PKT_CONTINUE;
	}

	return PKT_DROP;
}
/**
 * Packet Processing - Route lookup in forwarding database
 *
 * @param pkt  Packet to route
 * @param ctx  Packet process context
 *
 * @return PKT_CONTINUE if route found else PKT_DROP
 */
Packet Processing - Route lookup in forwarding database
@param pkt  Packet to route
@param ctx  Packet process context

@return PKT_CONTINUE if route found else PKT_DROP
Packet Processing - Route lookup in forwarding database @param pkt Packet to route @param ctx Packet process context @return PKT_CONTINUE if route found else PKT_DROP
static
pkt_disposition_e do_route_fwd_db(odp_packet_t pkt, pkt_ctx_t *ctx)
{
	odph_ipv4hdr_t *ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL);
	fwd_db_entry_t *entry;
	entry = find_fwd_db_entry(odp_be_to_cpu_32(ip->dst_addr));
	if (entry) {
		odph_ethhdr_t *eth =
			(odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL);
		memcpy(&eth->dst, entry->dst_mac, ODPH_ETHADDR_LEN);
		memcpy(&eth->src, entry->src_mac, ODPH_ETHADDR_LEN);
		ctx->pktout = entry->pktout;
		return PKT_CONTINUE;
	}
	return PKT_DROP;
}
static pkt_disposition_e do_route_fwd_db ( odp_packet_t pkt , pkt_ctx_t * ctx ) { odph_ipv4hdr_t * ip = ( odph_ipv4hdr_t * ) odp_packet_l3_ptr ( pkt , NULL ) ; fwd_db_entry_t * entry ; entry = find_fwd_db_entry ( odp_be_to_cpu_32 ( ip -> dst_addr ) ) ; if ( entry ) { odph_ethhdr_t * eth = ( odph_ethhdr_t * ) odp_packet_l2_ptr ( pkt , NULL ) ; memcpy ( & eth -> dst , entry -> dst_mac , ODPH_ETHADDR_LEN ) ; memcpy ( & eth -> src , entry -> src_mac , ODPH_ETHADDR_LEN ) ; ctx -> pktout = entry -> pktout ; return PKT_CONTINUE ; } return PKT_DROP ; }
Packet Processing - Route lookup in forwarding database
 @param pkt  Packet to route
 @param ctx  Packet process context
Packet Processing - Route lookup in forwarding database @param pkt Packet to route @param ctx Packet process context