urpf: add interface dump to API
[vpp.git] / src / plugins / urpf / urpf.api
1 /* Hey Emacs use -*- mode: C -*- */
2 /*
3  * Copyright (c) 2016 Cisco and/or its affiliates.
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at:
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 /** \file
18     This file defines the vpp control-plane API messages
19     used to control the URPF plugin
20 */
21
22 option version = "1.0.0";
23 import "vnet/ip/ip_types.api";
24 import "vnet/fib/fib_types.api";
25 import "vnet/interface_types.api";
26
27 enum urpf_mode:u8
28 {
29   URPF_API_MODE_OFF,
30   URPF_API_MODE_LOOSE,
31   URPF_API_MODE_STRICT,
32 };
33
34 /**
35  * @brief Enable uRPF on a given interface in a given direction
36  * @param client_index - opaque cookie to identify the sender
37  * @param context - sender context, to match reply w/ request
38  * @param mode - Mode
39  * @param af - Address Family
40  * @param sw_if_index - Interface
41  * @param is_input - Direction.
42  */
43 autoreply define urpf_update
44 {
45   u32 client_index;
46   u32 context;
47   bool is_input[default = true];
48   vl_api_urpf_mode_t mode;
49   vl_api_address_family_t af;
50   vl_api_interface_index_t sw_if_index;
51 };
52
53 /**
54  * @brief Enable uRPF on a given interface in a given direction
55  * @param client_index - opaque cookie to identify the sender
56  * @param context - sender context, to match reply w/ request
57  * @param mode - Mode
58  * @param af - Address Family
59  * @param sw_if_index - Interface
60  * @param is_input - Direction.
61  * @param table-id - Table ID
62  */
63 autoreply define urpf_update_v2
64 {
65   u32 client_index;
66   u32 context;
67   bool is_input[default = true];
68   vl_api_urpf_mode_t mode;
69   vl_api_address_family_t af;
70   vl_api_interface_index_t sw_if_index;
71   u32 table_id [default=0xffffffff];
72 };
73
74 /** @brief Dump uRPF enabled interface(s) in zero or more urpf_interface_details replies
75     @param client_index - opaque cookie to identify the sender
76     @param sw_if_index - sw_if_index of a specific interface, or -1 (default)
77                          to return all uRPF enabled interfaces
78 */
79 define urpf_interface_dump
80 {
81   u32 client_index;
82   u32 context;
83   vl_api_interface_index_t sw_if_index [default=0xffffffff];
84 };
85
86 /** @brief uRPF enabled interface details
87 */
88 define urpf_interface_details
89 {
90   u32 context;
91   vl_api_interface_index_t sw_if_index;
92   bool is_input;
93   vl_api_urpf_mode_t mode;
94   vl_api_address_family_t af;
95   u32 table_id;
96 };
97
98 /*
99  * fd.io coding-style-patch-verification: ON
100  *
101  * Local Variables:
102  * eval: (c-set-style "gnu")
103  * End:
104  */