aboutsummaryrefslogtreecommitdiffstats
path: root/vnet/vnet/snap/pg.c
diff options
context:
space:
mode:
Diffstat (limited to 'vnet/vnet/snap/pg.c')
-rw-r--r--vnet/vnet/snap/pg.c40
1 files changed, 24 insertions, 16 deletions
diff --git a/vnet/vnet/snap/pg.c b/vnet/vnet/snap/pg.c
index 74c363fcc69..aad125f35b6 100644
--- a/vnet/vnet/snap/pg.c
+++ b/vnet/vnet/snap/pg.c
@@ -41,7 +41,8 @@
#include <vnet/pg/pg.h>
#include <vnet/snap/snap.h>
-typedef struct {
+typedef struct
+{
pg_edit_t oui;
pg_edit_t protocol;
} pg_snap_header_t;
@@ -56,30 +57,29 @@ pg_snap_header_init (pg_snap_header_t * e)
uword
unformat_pg_snap_header (unformat_input_t * input, va_list * args)
{
- pg_stream_t * s = va_arg (*args, pg_stream_t *);
- pg_snap_header_t * h;
+ pg_stream_t *s = va_arg (*args, pg_stream_t *);
+ pg_snap_header_t *h;
u32 group_index, error;
-
+
h = pg_create_edit_group (s, sizeof (h[0]), sizeof (snap_header_t),
&group_index);
pg_snap_header_init (h);
error = 1;
- if (! unformat (input, "%U -> %U",
- unformat_pg_edit,
- unformat_snap_protocol, &h->oui, &h->protocol))
+ if (!unformat (input, "%U -> %U",
+ unformat_pg_edit,
+ unformat_snap_protocol, &h->oui, &h->protocol))
goto done;
{
- snap_main_t * pm = &snap_main;
- snap_protocol_info_t * pi = 0;
- pg_node_t * pg_node = 0;
+ snap_main_t *pm = &snap_main;
+ snap_protocol_info_t *pi = 0;
+ pg_node_t *pg_node = 0;
- if (h->oui.type == PG_EDIT_FIXED
- && h->protocol.type == PG_EDIT_FIXED)
+ if (h->oui.type == PG_EDIT_FIXED && h->protocol.type == PG_EDIT_FIXED)
{
- u8 * o = h->oui.values[PG_EDIT_LO];
- u8 * p = h->protocol.values[PG_EDIT_LO];
+ u8 *o = h->oui.values[PG_EDIT_LO];
+ u8 *p = h->protocol.values[PG_EDIT_LO];
snap_header_t h;
h.oui[0] = o[0];
@@ -95,14 +95,22 @@ unformat_pg_snap_header (unformat_input_t * input, va_list * args)
&& unformat_user (input, pg_node->unformat_edit, s))
;
- else if (! unformat_user (input, unformat_pg_payload, s))
+ else if (!unformat_user (input, unformat_pg_payload, s))
goto done;
}
error = 0;
- done:
+done:
if (error)
pg_free_edit_group (s);
return error == 0;
}
+
+/*
+ * fd.io coding-style-patch-verification: ON
+ *
+ * Local Variables:
+ * eval: (c-set-style "gnu")
+ * End:
+ */