Encapsulating and Sending the Packet

Encapsulating the Packet

As the next step in packet processing, the application encapsulates the packet for the receiving tunnel. This involves the following operations:

If (pkt_ctxt->gre_tunnel->tunnel_type == JNX_GW_TUNNEL_TYPE_IPIP):

If (pkt_ctxt->gre_tunnel->tunnel_type == JNX_GW_TUNNEL_TYPE_IPIP) is not true, do nothing; The packet should go out as a plain IP packet.

Sending the Packet

The following code sends the packet.

 /* Set the outgoing VRF in the packet buffer */
    jbuf_setvrf(pkt_ctxt->pkt_buf, pkt_ctxt->gre_tunnel->egress_vrf);

    /* Send the packet out */
    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;

Processing Reverse Bound Traffic

2007-2009 Juniper Networks, Inc. All rights reserved. The information contained herein is confidential information of Juniper Networks, Inc., and may not be used, disclosed, distributed, modified, or copied without the prior written consent of Juniper Networks, Inc. in an express license. This information is subject to change by Juniper Networks, Inc. Juniper Networks, the Juniper Networks logo, and JUNOS are registered trademarks of Juniper Networks, Inc. in the United States and other countries. All other trademarks, service marks, registered trademarks, or registered service marks are the property of their respective owners.
Generated on Sun May 30 20:26:47 2010 for Juniper Networks Partner Solution Development Platform JUNOS SDK 10.2R1 by Doxygen 1.4.5