aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/flow/ipfix_packet.h
diff options
context:
space:
mode:
authorSwarup Nayak <swarupnpvt@gmail.com>2017-11-26 23:11:40 +0530
committerDamjan Marion <dmarion.lists@gmail.com>2017-11-26 19:36:13 +0000
commit6bcac065b82ef2e48fc23db18534d9dc9a7833a1 (patch)
tree13aae9f6feb438835afd7e632b25173a1511e8f7 /src/vnet/flow/ipfix_packet.h
parent84517cfd1508f6da24937f310f7fffe752f22584 (diff)
VPP-252 Coding standards cleanup - vnet/vnet/flow
Change-Id: I288b0eeefd22f65e80634068e4b3ce0d83fb50fc Signed-off-by: Swarup Nayak <swarupnpvt@gmail.com>
Diffstat (limited to 'src/vnet/flow/ipfix_packet.h')
-rw-r--r--src/vnet/flow/ipfix_packet.h48
1 files changed, 33 insertions, 15 deletions
diff --git a/src/vnet/flow/ipfix_packet.h b/src/vnet/flow/ipfix_packet.h
index 329796191de..a50d86ea379 100644
--- a/src/vnet/flow/ipfix_packet.h
+++ b/src/vnet/flow/ipfix_packet.h
@@ -21,14 +21,16 @@
* https://tools.ietf.org/html/rfc7011
*/
-typedef struct {
+typedef struct
+{
u32 version_length;
u32 export_time;
u32 sequence_number;
u32 domain_id;
} ipfix_message_header_t;
-static inline u32 version_length (u16 length)
+static inline u32
+version_length (u16 length)
{
return clib_host_to_net_u32 (0x000a0000 | length);
}
@@ -60,23 +62,26 @@ static inline u32 version_length (u16 length)
* present.
*/
-typedef struct {
+typedef struct
+{
u32 e_id_length;
u32 enterprise;
} ipfix_enterprise_field_specifier_t;
-typedef struct {
+typedef struct
+{
u32 e_id_length;
} ipfix_field_specifier_t;
-static inline u32 ipfix_e_id_length (int e, u16 id, u16 length)
+static inline u32
+ipfix_e_id_length (int e, u16 id, u16 length)
{
u32 value;
- value = (e<<31) | ((id&0x7FFF) <<16) | length;
+ value = (e << 31) | ((id & 0x7FFF) << 16) | length;
return clib_host_to_net_u32 (value);
}
-/*
+/*
* Every Set contains a common header. This header is defined in
* Figure I.
*
@@ -107,16 +112,18 @@ static inline u32 ipfix_e_id_length (int e, u16 id, u16 length)
* determine the position of the next Set.
*/
-typedef struct {
+typedef struct
+{
u32 set_id_length;
} ipfix_set_header_t;
-static inline u32 ipfix_set_id_length (u16 set_id, u16 length)
+static inline u32
+ipfix_set_id_length (u16 set_id, u16 length)
{
- return clib_host_to_net_u32 ((set_id<<16) | length);
+ return clib_host_to_net_u32 ((set_id << 16) | length);
}
-/*
+/*
* The format of the Template Record is shown in Figure J. It consists
* of a Template Record Header and one or more Field Specifiers. Field
* Specifiers are defined in Figure G above.
@@ -168,17 +175,20 @@ static inline u32 ipfix_set_id_length (u16 set_id, u16 length)
* Number of fields in this Template Record.
*/
-typedef struct {
+typedef struct
+{
u32 id_count;
} ipfix_template_header_t;
-static inline u32 ipfix_id_count (u16 id, u16 count)
+static inline u32
+ipfix_id_count (u16 id, u16 count)
{
- return clib_host_to_net_u32 ((id<<16) | count);
+ return clib_host_to_net_u32 ((id << 16) | count);
}
/* Template packet */
-typedef struct {
+typedef struct
+{
ipfix_message_header_t h;
ipfix_set_header_t s;
ipfix_template_header_t t;
@@ -186,3 +196,11 @@ typedef struct {
} ipfix_template_packet_t;
#endif /* __included_ipfix_packet_h__ */
+
+/*
+ * fd.io coding-style-patch-verification: ON
+ *
+ * Local Variables:
+ * eval: (c-set-style "gnu")
+ * End:
+ */