aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/vxlan/vxlan_packet.h
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2020-06-02 15:12:30 +0200
committerMohsin Kazmi <sykazmi@cisco.com>2020-06-09 15:17:58 +0200
commit21a1de42b05e47bf32dda6aaa0eae0a20eb08597 (patch)
treea1385f1f5ec18fb7d0cae06e91f8c27dda5b2a8b /src/vnet/vxlan/vxlan_packet.h
parent8ddd19bf7bbb351a45be1baf6cf670b9fa3360b0 (diff)
misc: add code styling for vxlan encap and vxlan_packet files
Type: style Change-Id: Id363ccd0e51c61388fb45ef10685929f629cccbd Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vnet/vxlan/vxlan_packet.h')
-rw-r--r--src/vnet/vxlan/vxlan_packet.h33
1 files changed, 22 insertions, 11 deletions
diff --git a/src/vnet/vxlan/vxlan_packet.h b/src/vnet/vxlan/vxlan_packet.h
index e172b6f4eb9..d1d1ed813e5 100644
--- a/src/vnet/vxlan/vxlan_packet.h
+++ b/src/vnet/vxlan/vxlan_packet.h
@@ -15,33 +15,34 @@
#ifndef __included_vxlan_packet_h__
#define __included_vxlan_packet_h__ 1
-/*
+/*
* From RFC-7348
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* |R|R|R|R|I|R|R|R| Reserved |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | VXLAN Network Identifier (VNI) | Reserved |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- *
+ *
* VXLAN Header: This is an 8-byte field that has:
- *
+ *
* - Flags (8 bits): where the I flag MUST be set to 1 for a valid
* VXLAN Network ID (VNI). The other 7 bits (designated "R") are
* reserved fields and MUST be set to zero on transmission and
* ignored on receipt.
- *
+ *
* - VXLAN Segment ID/VXLAN Network Identifier (VNI): this is a
* 24-bit value used to designate the individual VXLAN overlay
* network on which the communicating VMs are situated. VMs in
* different VXLAN overlay networks cannot communicate with each
* other.
- *
+ *
* - Reserved fields (24 bits and 8 bits): MUST be set to zero on
* transmission and ignored on receipt.
- *
+ *
*/
-typedef struct {
+typedef struct
+{
u8 flags;
u8 res1;
u8 res2;
@@ -51,7 +52,8 @@ typedef struct {
#define VXLAN_FLAGS_I 0x08
-static inline u32 vnet_get_vni (vxlan_header_t * h)
+static inline u32
+vnet_get_vni (vxlan_header_t * h)
{
u32 vni_reserved_host_byte_order;
@@ -59,11 +61,20 @@ static inline u32 vnet_get_vni (vxlan_header_t * h)
return vni_reserved_host_byte_order >> 8;
}
-static inline void vnet_set_vni_and_flags (vxlan_header_t * h, u32 vni)
+static inline void
+vnet_set_vni_and_flags (vxlan_header_t * h, u32 vni)
{
- h->vni_reserved = clib_host_to_net_u32 (vni<<8);
- * (u32 *) h = 0;
+ h->vni_reserved = clib_host_to_net_u32 (vni << 8);
+ *(u32 *) h = 0;
h->flags = VXLAN_FLAGS_I;
}
#endif /* __included_vxlan_packet_h__ */
+
+/*
+ * fd.io coding-style-patch-verification: ON
+ *
+ * Local Variables:
+ * eval: (c-set-style "gnu")
+ * End:
+ */