diff options
author | Keith Burns (alagalah) <alagalah@gmail.com> | 2016-08-15 18:33:19 -0700 |
---|---|---|
committer | Keith Burns (alagalah) <alagalah@gmail.com> | 2016-08-15 20:23:10 -0700 |
commit | e70dcc8676b6b2db74989e43f116bbb200239bf8 (patch) | |
tree | 4a582b7d9b2247111dfbc5d4179e3fc6e154f32f /vnet/vnet/ethernet/packet.h | |
parent | 81b52c5506ad3ded98dc82fbe4603eec7ad72b8a (diff) |
VPP251 - Code style vnet/vnet/ethernet
Change-Id: I3e51ca70a8e1ac7f6584bc5b0271ee4daacc1084
Signed-off-by: Keith Burns (alagalah) <alagalah@gmail.com>
Diffstat (limited to 'vnet/vnet/ethernet/packet.h')
-rw-r--r-- | vnet/vnet/ethernet/packet.h | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/vnet/vnet/ethernet/packet.h b/vnet/vnet/ethernet/packet.h index b5d1dcba931..b50f9303f23 100644 --- a/vnet/vnet/ethernet/packet.h +++ b/vnet/vnet/ethernet/packet.h @@ -40,13 +40,15 @@ #ifndef included_ethernet_packet_h #define included_ethernet_packet_h -typedef enum { +typedef enum +{ #define ethernet_type(n,s) ETHERNET_TYPE_##s = n, #include <vnet/ethernet/types.def> #undef ethernet_type } ethernet_type_t; -typedef struct { +typedef struct +{ /* Source/destination address. */ u8 dst_address[6]; u8 src_address[6]; @@ -61,18 +63,25 @@ typedef struct { /* I/G bit: individual (unicast)/group (broadcast/multicast). */ always_inline uword ethernet_address_cast (u8 * a) -{ return (a[0] >> 0) & 1; } +{ + return (a[0] >> 0) & 1; +} always_inline uword ethernet_address_is_locally_administered (u8 * a) -{ return (a[0] >> 1) & 1; } +{ + return (a[0] >> 1) & 1; +} always_inline void ethernet_address_set_locally_administered (u8 * a) -{ a[0] |= 1 << 1; } +{ + a[0] |= 1 << 1; +} /* For VLAN ethernet type. */ -typedef struct { +typedef struct +{ /* 3 bit priority, 1 bit CFI and 12 bit vlan id. */ u16 priority_cfi_and_id; @@ -84,7 +93,8 @@ typedef struct { /* VLAN with ethertype first and vlan id second */ -typedef struct { +typedef struct +{ /* vlan type */ u16 type; @@ -93,3 +103,11 @@ typedef struct { } ethernet_vlan_header_tv_t; #endif /* included_ethernet_packet_h */ + +/* + * fd.io coding-style-patch-verification: ON + * + * Local Variables: + * eval: (c-set-style "gnu") + * End: + */ |