misc: add code styling for vxlan encap and vxlan_packet files

Type: style

Change-Id: Id363ccd0e51c61388fb45ef10685929f629cccbd
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
This commit is contained in:
Mohsin Kazmi
2020-06-02 15:12:30 +02:00
parent 8ddd19bf7b
commit 21a1de42b0
2 changed files with 271 additions and 245 deletions

File diff suppressed because it is too large Load Diff

View File

@ -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:
*/