X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fudp%2Fudp_encap.h;h=888efa8c37c0e377bd9e2114dd519de3ade7e6a1;hb=c5df8c71c;hp=e20edec7be56dd85c5c65f70a8c749d1b1360c3f;hpb=586479a73162426a02b2bbc8ab724e0dfb9921e0;p=vpp.git diff --git a/src/vnet/udp/udp_encap.h b/src/vnet/udp/udp_encap.h index e20edec7be5..888efa8c37c 100644 --- a/src/vnet/udp/udp_encap.h +++ b/src/vnet/udp/udp_encap.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Cisco and/or its affiliates. + * Copyright (c) 2016-2019 Cisco and/or its affiliates. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: @@ -21,7 +21,7 @@ #include /** - * UDP encapsualtion. + * UDP encapsulation. * A representation of the encapsulation of packets in UDP-over-IP. * This is encapsulation only, there is no tunnel interface, hence * it is uni-directional. For decap register a handler with the UDP port @@ -29,30 +29,30 @@ */ /** - * Fixup behaviour. Actions performed on the encap in the data-plance + * Fixup behaviour. Actions performed on the encap in the data-plane */ typedef enum udp_encap_fixup_flags_t_ { UDP_ENCAP_FIXUP_NONE = 0, - /** - * UDP source port contains an entropy/hash value for load-balancing by downstream peers. - */ + /** + * UDP source port contains an entropy/hash value for load-balancing by downstream peers. + */ UDP_ENCAP_FIXUP_UDP_SRC_PORT_ENTROPY = (1 << 0), } udp_encap_fixup_flags_t; /** - * The UDP encap represenation + * The UDP encap representation */ typedef struct udp_encap_t_ { - /** - * The first cacheline contains the data used in the data-plane - */ + /** + * The first cacheline contains the data used in the data-plane + */ CLIB_CACHE_LINE_ALIGN_MARK (cacheline0); - /** - * The headers to paint, in packet painting order - */ + /** + * The headers to paint, in packet painting order + */ union { struct @@ -67,48 +67,44 @@ typedef struct udp_encap_t_ } __attribute__ ((packed)) ip6; } __attribute__ ((packed)) ue_hdrs; - /** - * Flags controlling fixup behaviour - */ + /** + * Flags controlling fixup behaviour + */ udp_encap_fixup_flags_t ue_flags; - /** - * The DPO used to forward to the next node in the VLIB graph - */ + /** + * The DPO used to forward to the next node in the VLIB graph + */ dpo_id_t ue_dpo; - /** - * the protocol of the IP header imposed - */ + /** + * the protocol of the IP header imposed + */ fib_protocol_t ue_ip_proto; + /** + * The second cacheline contains control-plane data + */ CLIB_CACHE_LINE_ALIGN_MARK (cacheline1); - /** - * linkage into the FIB graph - */ + /** + * linkage into the FIB graph + */ fib_node_t ue_fib_node; - /** - * The ID given by the user/client. - * This ID is used by the client for modifications. - */ - u32 ue_id; - - /** - * Tracking information for the IP destination - */ + /** + * Tracking information for the IP destination + */ fib_node_index_t ue_fib_entry_index; u32 ue_fib_sibling; - /** - * The FIB index in which the encap destination resides - */ + /** + * The FIB index in which the encap destination resides + */ index_t ue_fib_index; } udp_encap_t; -extern index_t udp_encap_add_and_lock (u32 id, - fib_protocol_t proto, +extern index_t udp_encap_add_and_lock (fib_protocol_t proto, index_t fib_index, const ip46_address_t * src_ip, const ip46_address_t * dst_ip, @@ -116,12 +112,10 @@ extern index_t udp_encap_add_and_lock (u32 id, u16 dst_port, udp_encap_fixup_flags_t flags); -extern index_t udp_encap_find (u32 id); -extern void udp_encap_lock (u32 id); -extern void udp_encap_unlock (u32 id); +extern void udp_encap_lock (index_t uei); +extern void udp_encap_unlock (index_t uei); extern u8 *format_udp_encap (u8 * s, va_list * args); -extern void udp_encap_unlock_w_index (index_t uei); -extern void udp_encap_contribute_forwarding (u32 id, +extern void udp_encap_contribute_forwarding (index_t uei, dpo_proto_t proto, dpo_id_t * dpo);