jnx_gw_data_process_ipip_packet()
function in /src/sbin/jnx-gateway-data/jnx-gateway-data_packet.c
.
As already described, this function is branched from jnx_gw_data_process_packet()
(see Packet Processing Details).
jnx_gw_data_process_ipip_packet()
handles the incoming IP-in-IP packet as follows:
jnx_gw_data_db_ipip_sub_tunnel_lookup_with_lock()
to look up the tunnel in the application's IP-IP sub-tunnel database. This function is in the file jnx-gateway-data/jnx-gateway-data_utils
.h.
jnx_gw_data_process_ip_packet()
to process the IP layer
jnx_gw_data_update_ttl_compute_inc_checksum()
to compute the checksum of the inner IP packet, or appends a GRE and IP header that was already computed by the GRE tunnel. jnx_gw_data_update_ttl_compute_inc_checksum()
is declared in the file jnx-gateway-data/jnx-gateway-data_utils
.h.
/* Set the outgoing VRF in the PKT BUFF */ jbuf_setvrf(pkt_ctxt->pkt_buf, pkt_ctxt->ipip_sub_tunnel->egress_vrf); if (msp_data_send(pkt_ctxt->dhandle, pkt_ctxt->pkt_buf, MSP_MSG_TYPE_PACKET) != MSP_OK) { pkt_ctxt->stat_type = JNX_GW_DATA_CONG_DROP; return JNX_GW_DATA_DROP_PKT; }