misc: fix coverity warning in the oddbuf plugin 45/21945/1
authorDave Barach <dave@barachs.net>
Mon, 9 Sep 2019 20:56:53 +0000 (16:56 -0400)
committerDave Barach <dave@barachs.net>
Mon, 9 Sep 2019 20:58:40 +0000 (16:58 -0400)
Clean up license / copyright headers

Type: fix
Ticket: VPP-1771

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ibfc2a46632e17578fd74357b83f417987b8447be

src/plugins/oddbuf/CMakeLists.txt
src/plugins/oddbuf/node.c
src/plugins/oddbuf/oddbuf.api
src/plugins/oddbuf/oddbuf.c
src/plugins/oddbuf/oddbuf.h
src/plugins/oddbuf/oddbuf_all_api_h.h
src/plugins/oddbuf/oddbuf_msg_enum.h
src/plugins/oddbuf/oddbuf_periodic.c [deleted file]
src/plugins/oddbuf/oddbuf_test.c

index 06f8e6f..cee0524 100644 (file)
@@ -1,5 +1,5 @@
 
-# Copyright (c) <current-year> <your-organization>
+# Copyright (c) 2019 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
index d495aba..d26ee44 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * node.c - skeleton vpp engine plug-in dual-loop node skeleton
+ * node.c - - awkward chained buffer geometry test tool
  *
- * Copyright (c) <current-year> <your-organization>
+ * Copyright (c) 2019 by Cisco and/or its affiliates.
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at:
index 32f9154..b63dc5d 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * oddbuf.api - binary API skeleton
+ * oddbuf.api - awkward chained buffer geometry test tool
  *
- * Copyright (c) <current-year> <your-organization>
+ * Copyright (c) 2019 by Cisco and/or its affiliates.
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at:
index db2e682..9b95fcc 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * oddbuf.c - skeleton vpp engine plug-in
+ * oddbuf.c - awkward chained buffer geometry test tool
  *
- * Copyright (c) <current-year> <your-organization>
+ * Copyright (c) 2019 by Cisco and/or its affiliates.
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at:
@@ -147,11 +147,15 @@ static void vl_api_oddbuf_enable_disable_t_handler
 {
   vl_api_oddbuf_enable_disable_reply_t *rmp;
   oddbuf_main_t *omp = &oddbuf_main;
+  u32 sw_if_index;
   int rv;
 
-  rv = oddbuf_enable_disable (omp, ntohl (mp->sw_if_index),
-                             (int) (mp->enable_disable));
+  VALIDATE_SW_IF_INDEX (mp);
 
+  sw_if_index = clib_net_to_host_u32 (mp->sw_if_index);
+  rv = oddbuf_enable_disable (omp, sw_if_index, (int) (mp->enable_disable));
+
+  BAD_SW_IF_INDEX_LABEL;
   REPLY_MACRO (VL_API_ODDBUF_ENABLE_DISABLE_REPLY);
 }
 
index 1aa51e4..c2c07e7 100644 (file)
@@ -1,8 +1,8 @@
 
 /*
- * oddbuf.h - skeleton vpp engine plug-in header file
+ * oddbuf.h - awkward chained buffer geometry test tool
  *
- * Copyright (c) <current-year> <your-organization>
+ * Copyright (c) 2019 by Cisco and/or its affiliates.
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at:
index 64a1a6b..3aac2a0 100644 (file)
@@ -1,8 +1,8 @@
 
 /*
- * oddbuf_all_api_h.h - skeleton vpp engine plug-in api #include file
+ * oddbuf_all_api_h.h awkward chained buffer geometry test tool
  *
- * Copyright (c) <current-year> <your-organization>
+ * Copyright (c) 2019 by Cisco and/or its affiliates.
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at:
index 8e324d6..084c049 100644 (file)
@@ -1,8 +1,8 @@
 
 /*
- * oddbuf_msg_enum.h - skeleton vpp engine plug-in message enumeration
+ * oddbuf_msg_enum.h - awkward chained buffer geometry test tool
  *
- * Copyright (c) <current-year> <your-organization>
+ * Copyright (c) 2019 by Cisco and/or its affiliates.
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at:
diff --git a/src/plugins/oddbuf/oddbuf_periodic.c b/src/plugins/oddbuf/oddbuf_periodic.c
deleted file mode 100644 (file)
index c88e749..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * oddbuf_periodic.c - skeleton plug-in periodic function
- *
- * Copyright (c) <current-year> <your-organization>
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at:
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <vlib/vlib.h>
-#include <vppinfra/error.h>
-#include <oddbuf/oddbuf.h>
-
-static void
-handle_event1 (oddbuf_main_t * pm, f64 now, uword event_data)
-{
-  clib_warning ("received ODDBUF_EVENT1");
-}
-
-static void
-handle_event2 (oddbuf_main_t * pm, f64 now, uword event_data)
-{
-  clib_warning ("received ODDBUF_EVENT2");
-}
-
-static void
-handle_periodic_enable_disable (oddbuf_main_t * pm, f64 now, uword event_data)
-{
-  clib_warning ("Periodic timeouts now %s",
-               event_data ? "enabled" : "disabled");
-  pm->periodic_timer_enabled = event_data;
-}
-
-static void
-handle_timeout (oddbuf_main_t * pm, f64 now)
-{
-  clib_warning ("timeout at %.2f", now);
-}
-
-static uword
-oddbuf_periodic_process (vlib_main_t * vm,
-                        vlib_node_runtime_t * rt, vlib_frame_t * f)
-{
-  oddbuf_main_t *pm = &oddbuf_main;
-  f64 now;
-  f64 timeout = 10.0;
-  uword *event_data = 0;
-  uword event_type;
-  int i;
-
-  while (1)
-    {
-      if (pm->periodic_timer_enabled)
-       vlib_process_wait_for_event_or_clock (vm, timeout);
-      else
-       vlib_process_wait_for_event (vm);
-
-      now = vlib_time_now (vm);
-
-      event_type = vlib_process_get_events (vm, (uword **) & event_data);
-
-      switch (event_type)
-       {
-         /* Handle ODDBUF_EVENT1 */
-       case ODDBUF_EVENT1:
-         for (i = 0; i < vec_len (event_data); i++)
-           handle_event1 (pm, now, event_data[i]);
-         break;
-
-         /* Handle ODDBUF_EVENT2 */
-       case ODDBUF_EVENT2:
-         for (i = 0; i < vec_len (event_data); i++)
-           handle_event2 (pm, now, event_data[i]);
-         break;
-         /* Handle the periodic timer on/off event */
-       case ODDBUF_EVENT_PERIODIC_ENABLE_DISABLE:
-         for (i = 0; i < vec_len (event_data); i++)
-           handle_periodic_enable_disable (pm, now, event_data[i]);
-         break;
-
-         /* Handle periodic timeouts */
-       case ~0:
-         handle_timeout (pm, now);
-         break;
-       }
-      vec_reset_length (event_data);
-    }
-  return 0;                    /* or not */
-}
-
-void
-oddbuf_create_periodic_process (oddbuf_main_t * omp)
-{
-  /* Already created the process node? */
-  if (omp->periodic_node_index > 0)
-    return;
-
-  /* No, create it now and make a note of the node index */
-  omp->periodic_node_index = vlib_process_create (omp->vlib_main, "oddbuf-periodic-process", oddbuf_periodic_process, 16       /* log2_n_stack_bytes */
-    );
-}
-
-/*
- * fd.io coding-style-patch-verification: ON
- *
- * Local Variables:
- * eval: (c-set-style "gnu")
- * End:
- */
index a9c8465..25c0bc0 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * oddbuf.c - skeleton vpp-api-test plug-in
+ * oddbuf.c - awkward chained buffer geometry test tool
  *
- * Copyright (c) <current-year> <your-organization>
+ * Copyright (c) 2019 by Cisco and/or its affiliates.
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at: