2 * Copyright (c) 2023 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 #include <vlibapi/api.h>
17 #include <vlibmemory/api.h>
18 #include <vppinfra/error.h>
19 #include <vnet/api_errno.h>
22 #define __plugin_msg_base tracenode_test_main.msg_id_base
23 #include <vlibapi/vat_helper_macros.h>
25 /* Declare message IDs */
26 #include <tracenode/tracenode.api_enum.h>
27 #include <tracenode/tracenode.api_types.h>
31 /* API message ID base */
34 } tracenode_test_main_t;
36 tracenode_test_main_t tracenode_test_main;
39 api_tracenode_enable_disable (vat_main_t *vam)
41 unformat_input_t *i = vam->input;
42 vl_api_tracenode_enable_disable_t *mp;
50 while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
52 if (unformat (i, "disable"))
54 else if (unformat (i, "pcap"))
56 else if (unformat (i, "%U", unformat_vnet_sw_interface, vnet_get_main (),
61 clib_warning ("Local interface not supported...");
68 clib_warning ("Unknown input: %U\n", format_unformat_error, i);
73 M (TRACENODE_ENABLE_DISABLE, mp);
74 mp->sw_if_index = htonl (sw_if_index);
75 mp->is_pcap = is_pcap;
85 #include <tracenode/tracenode.api_test.c>
88 * fd.io coding-style-patch-verification: ON
91 * eval: (c-set-style "gnu")