api: af_packet - Mark old message versions as deprecated
[vpp.git] / src / plugins / af_packet / af_packet.api
1 /*
2  * Copyright (c) 2015-2016 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:
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
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.
14  */
15
16 option version = "2.0.0";
17
18 import "vnet/interface_types.api";
19 import "vnet/ethernet/ethernet_types.api";
20
21 /** \brief Create host-interface
22     @param client_index - opaque cookie to identify the sender
23     @param context - sender context, to match reply w/ request
24     @param hw_addr - interface MAC
25     @param use_random_hw_addr - use random generated MAC
26     @param host_if_name - interface name
27 */
28 define af_packet_create
29 {
30   option deprecated;
31
32   u32 client_index;
33   u32 context;
34
35   vl_api_mac_address_t hw_addr;
36   bool use_random_hw_addr;
37   string host_if_name[64];
38 };
39
40 /** \brief Create host-interface response
41     @param context - sender context, to match reply w/ request
42     @param retval - return value for request
43 */
44 define af_packet_create_reply
45 {
46   option deprecated;
47
48   u32 context;
49   i32 retval;
50   vl_api_interface_index_t sw_if_index;
51 };
52
53 /** \brief Create host-interface
54     @param client_index - opaque cookie to identify the sender
55     @param context - sender context, to match reply w/ request
56     @param hw_addr - interface MAC
57     @param use_random_hw_addr - use random generated MAC
58     @param host_if_name - interface name
59     @param rx_frame_size - frame size for RX
60     @param tx_frame_size - frame size for TX
61     @param rx_frames_per_block - frames per block for RX
62     @param tx_frames_per_block - frames per block for TX
63     @param flags - flags for the af_packet interface creation
64     @param num_rx_queues - number of rx queues
65 */
66 define af_packet_create_v2
67 {
68   option deprecated;
69
70   u32 client_index;
71   u32 context;
72
73   vl_api_mac_address_t hw_addr;
74   bool use_random_hw_addr;
75   string host_if_name[64];
76   u32 rx_frame_size;
77   u32 tx_frame_size;
78   u32 rx_frames_per_block;
79   u32 tx_frames_per_block;
80   u32 flags;
81   u16 num_rx_queues [default=1];
82 };
83
84 /** \brief Create host-interface response
85     @param context - sender context, to match reply w/ request
86     @param retval - return value for request
87 */
88 define af_packet_create_v2_reply
89 {
90   option deprecated;
91
92   u32 context;
93   i32 retval;
94   vl_api_interface_index_t sw_if_index;
95 };
96
97 enum af_packet_mode {
98   AF_PACKET_API_MODE_ETHERNET = 1, /* mode ethernet */
99   AF_PACKET_API_MODE_IP = 2, /* mode ip */
100 };
101
102 enum af_packet_flags {
103   AF_PACKET_API_FLAG_QDISC_BYPASS = 1, /* enable the qdisc bypass */
104   AF_PACKET_API_FLAG_CKSUM_GSO = 2, /* enable checksum/gso */
105   AF_PACKET_API_FLAG_VERSION_2 = 8 [backwards_compatible], /* af packet v2, default is v3 */
106 };
107
108 /** \brief Create host-interface
109     @param client_index - opaque cookie to identify the sender
110     @param context - sender context, to match reply w/ request
111     @param mode - 1 - Ethernet, 2 - IP
112     @param hw_addr - interface MAC
113     @param use_random_hw_addr - use random generated MAC
114     @param host_if_name - interface name
115     @param rx_frame_size - frame size for RX
116     @param tx_frame_size - frame size for TX
117     @param rx_frames_per_block - frames per block for RX
118     @param tx_frames_per_block - frames per block for TX
119     @param flags - flags for the af_packet interface creation
120     @param num_rx_queues - number of rx queues
121     @param num_tx_queues - number of tx queues
122 */
123 define af_packet_create_v3
124 {
125   u32 client_index;
126   u32 context;
127
128   vl_api_af_packet_mode_t mode;
129   vl_api_mac_address_t hw_addr;
130   bool use_random_hw_addr;
131   string host_if_name[64];
132   u32 rx_frame_size;
133   u32 tx_frame_size;
134   u32 rx_frames_per_block;
135   u32 tx_frames_per_block;
136   vl_api_af_packet_flags_t flags;
137   u16 num_rx_queues [default=1];
138   u16 num_tx_queues [default=1];
139 };
140
141 /** \brief Create host-interface response
142     @param context - sender context, to match reply w/ request
143     @param retval - return value for request
144 */
145 define af_packet_create_v3_reply
146 {
147   u32 context;
148   i32 retval;
149   vl_api_interface_index_t sw_if_index;
150 };
151
152 /** \brief Delete host-interface
153     @param client_index - opaque cookie to identify the sender
154     @param context - sender context, to match reply w/ request
155     @param host_if_name - interface name
156 */
157 autoreply define af_packet_delete
158 {
159   u32 client_index;
160   u32 context;
161
162   string host_if_name[64];
163 };
164
165 /** \brief Set l4 offload checksum calculation
166     @param client_index - opaque cookie to identify the sender
167     @param context - sender context, to match reply w/ request
168 */
169 autoreply define af_packet_set_l4_cksum_offload
170 {
171   u32 client_index;
172   u32 context;
173
174   vl_api_interface_index_t sw_if_index;
175   bool set;
176 };
177
178 /** \brief Dump af_packet interfaces request */
179 define af_packet_dump
180 {
181   u32 client_index;
182   u32 context;
183 };
184
185 /** \brief Reply for af_packet dump request
186     @param sw_if_index - software index of af_packet interface
187     @param host_if_name - interface name
188 */
189 define af_packet_details
190 {
191   u32 context;
192   vl_api_interface_index_t sw_if_index;
193   string host_if_name[64];
194 };
195
196 /*
197  * Local Variables:
198  * eval: (c-set-style "gnu")
199  * End:
200  */