Reorganize source tree to use single autotools instance
[vpp.git] / src / vnet / interface.api
1 /** \brief Set flags on the interface
2     @param client_index - opaque cookie to identify the sender
3     @param context - sender context, to match reply w/ request
4     @param sw_if_index - index of the interface to set flags on
5     @param admin_up_down - set the admin state, 1 = up, 0 = down
6     @param link_up_down - Oper state sent on change event, not used in config.
7     @param deleted - interface was deleted
8 */
9 define sw_interface_set_flags
10 {
11   u32 client_index;
12   u32 context;
13   u32 sw_if_index;
14   /* 1 = up, 0 = down */
15   u8 admin_up_down;
16   u8 link_up_down;
17   u8 deleted;
18 };
19
20 /** \brief Reply to sw_interface_set_flags 
21     @param context - sender context which was passed in the request
22     @param retval - return code of the set flags request
23 */
24 define sw_interface_set_flags_reply
25 {
26   u32 context;
27   i32 retval;
28 };
29
30 /** \brief Set interface MTU
31     @param client_index - opaque cookie to identify the sender
32     @param context - sender context, to match reply w/ request
33     @param sw_if_index - index of the interface to set MTU on
34     @param mtu - MTU
35 */
36 define sw_interface_set_mtu
37 {
38   u32 client_index;
39   u32 context;
40   u32 sw_if_index;
41   u16 mtu;
42 };
43
44 /** \brief Reply to sw_interface_set_mtu
45     @param context - sender context which was passed in the request
46     @param retval - return code of the set flags request
47 */
48 define sw_interface_set_mtu_reply
49 {
50   u32 context;
51   i32 retval;
52 };
53
54 /** \brief Register for interface events
55     @param client_index - opaque cookie to identify the sender
56     @param context - sender context, to match reply w/ request
57     @param enable_disable - 1 => register for events, 0 => cancel registration
58     @param pid - sender's pid
59 */
60 define want_interface_events
61 {
62   u32 client_index;
63   u32 context;
64   u32 enable_disable;
65   u32 pid;
66 };
67
68 /** \brief Reply for interface events registration
69     @param context - returned sender context, to match reply w/ request
70     @param retval - return code
71 */
72 define want_interface_events_reply
73 {
74   u32 context;
75   i32 retval;
76 };
77
78 /** \brief Interface details structure (fix this) 
79     @param sw_if_index - index of the interface
80     @param sup_sw_if_index - index of parent interface if any, else same as sw_if_index  
81     @param l2_address_length - length of the interface's l2 address
82     @param pid - the interface's l2 address
83     @param interface_name - name of the interface
84     @param link_duplex - 1 if half duplex, 2 if full duplex
85     @param link_speed - 1 = 10M, 2 = 100M, 4 = 1G, 8 = 10G, 16 = 40G, 32 = 100G
86     @param link_MTU - max. transmittion unit 
87     @param sub_if_id - A number 0-N to uniquely identify this subif on super if
88     @param sub_dot1ad -  0 = dot1q, 1=dot1ad
89     @param sub_number_of_tags - Number of tags (0 - 2)
90     @param sub_outer_vlan_id
91     @param sub_inner_vlan_id
92     @param sub_exact_match
93     @param sub_default
94     @param sub_outer_vlan_id_any
95     @param sub_inner_vlan_id_any
96     @param vtr_op - vlan tag rewrite operation
97     @param vtr_push_dot1q
98     @param vtr_tag1
99     @param vtr_tag2
100 */
101 define sw_interface_details
102 {
103   u32 context;
104   u32 sw_if_index;
105
106   /* index of sup interface (e.g. hw interface).
107      equal to sw_if_index for super hw interface. */
108   u32 sup_sw_if_index;
109
110   /* Layer 2 address, if applicable */
111   u32 l2_address_length;
112   u8 l2_address[8];
113
114   /* Interface name */
115   u8 interface_name[64];
116
117   /* 1 = up, 0 = down */
118   u8 admin_up_down;
119   u8 link_up_down;
120
121   /* 1 = half duplex, 2 = full duplex */
122   u8 link_duplex;
123
124   /* 1 = 10M, 2 = 100M, 4 = 1G, 8 = 10G, 16 = 40G, 32 = 100G */
125   u8 link_speed;
126
127   /* MTU */
128   u16 link_mtu;
129
130   /* Subinterface ID. A number 0-N to uniquely identify this subinterface under the super interface */
131   u32 sub_id;
132
133   /* 0 = dot1q, 1=dot1ad */
134   u8 sub_dot1ad;
135
136   /* Number of tags 0-2 */
137   u8 sub_number_of_tags;
138   u16 sub_outer_vlan_id;
139   u16 sub_inner_vlan_id;
140   u8 sub_exact_match;
141   u8 sub_default;
142   u8 sub_outer_vlan_id_any;
143   u8 sub_inner_vlan_id_any;
144
145   /* vlan tag rewrite state */
146   u32 vtr_op;
147   u32 vtr_push_dot1q;           // ethertype of first pushed tag is dot1q/dot1ad
148   u32 vtr_tag1;                 // first pushed tag
149   u32 vtr_tag2;                 // second pushed tag
150   u8 tag[64];
151 };
152
153 /* works */
154 define sw_interface_dump
155 {
156   u32 client_index;
157   u32 context;
158   u8 name_filter_valid;
159   u8 name_filter[49];
160 };
161
162 /** \brief Set or delete one or all ip addresses on a specified interface
163     @param client_index - opaque cookie to identify the sender
164     @param context - sender context, to match reply w/ request
165     @param sw_if_index - index of the interface to add/del addresses 
166     @param is_add - add address if non-zero, else delete
167     @param is_ipv6 - if non-zero the address is ipv6, else ipv4
168     @param del_all - if non-zero delete all addresses on the interface
169     @param address_length - address length in bytes, 4 for ip4, 16 for ip6
170     @param address - array of address bytes
171 */
172 define sw_interface_add_del_address
173 {
174   u32 client_index;
175   u32 context;
176   u32 sw_if_index;
177   u8 is_add;
178   u8 is_ipv6;
179   u8 del_all;
180   u8 address_length;
181   u8 address[16];
182 };
183
184 /** \brief Reply to sw_interface_add_del_address
185     @param context - returned sender context, to match reply w/ request
186     @param retval - return code
187 */
188 define sw_interface_add_del_address_reply
189 {
190   u32 context;
191   i32 retval;
192 };
193
194 /** \brief Associate the specified interface with a fib table
195     @param client_index - opaque cookie to identify the sender
196     @param context - sender context, to match reply w/ request
197     @param sw_if_index - index of the interface
198     @param is_ipv6 - if non-zero ipv6, else ipv4
199     @param vrf_id - fib table/vrd id to associate the interface with
200 */
201 define sw_interface_set_table
202 {
203   u32 client_index;
204   u32 context;
205   u32 sw_if_index;
206   u8 is_ipv6;
207   u32 vrf_id;
208 };
209
210 /** \brief Reply to sw_interface_set_table
211     @param context - returned sender context, to match reply w/ request
212     @param retval - return code
213 */
214 define sw_interface_set_table_reply
215 {
216   u32 context;
217   i32 retval;
218 };
219
220 /** \brief Get VRF id assigned to interface
221     @param client_index - opaque cookie to identify the sender
222     @param context - sender context, to match reply w/ request
223     @param sw_if_index - index of the interface
224 */
225 define sw_interface_get_table
226 {
227   u32 client_index;
228   u32 context;
229   u32 sw_if_index;
230   u8 is_ipv6;
231 };
232
233 /** \brief Reply to get_sw_interface_vrf
234     @param context - sender context which was passed in the request
235     @param vrf_id - VRF id assigned to the interface
236 */
237 define sw_interface_get_table_reply
238 {
239   u32 context;
240   i32 retval;
241   u32 vrf_id;
242 };
243
244 /** \brief Stats counters structure 
245     @param vnet_counter_type- such as ip4, ip6, punts, etc
246     @param is_combined - rx & tx total (all types) counts   
247     @param first_sw_if_index - first sw index in block of index, counts
248     @param count - number of interfaces this stats block includes counters for
249     @param data - contiguous block of vlib_counter_t structures 
250 */
251 define vnet_interface_counters
252 {
253   /* enums - plural - in vnet/interface.h */
254   u8 vnet_counter_type;
255   u8 is_combined;
256   u32 first_sw_if_index;
257   u32 count;
258   u8 data[count];
259 };
260
261 /** \brief Set unnumbered interface add / del request
262     @param client_index - opaque cookie to identify the sender
263     @param context - sender context, to match reply w/ request
264     @param sw_if_index - interface with an IP address
265     @param unnumbered_sw_if_index - interface which will use the address
266     @param is_add - if non-zero set the association, else unset it
267 */
268 define sw_interface_set_unnumbered
269 {
270   u32 client_index;
271   u32 context;
272   u32 sw_if_index;              /* use this intfc address */
273   u32 unnumbered_sw_if_index;   /* on this interface */
274   u8 is_add;
275 };
276
277 /** \brief Set unnumbered interface add / del response
278     @param context - sender context, to match reply w/ request
279     @param retval - return code for the request
280 */
281 define sw_interface_set_unnumbered_reply
282 {
283   u32 context;
284   i32 retval;
285 };
286
287 /** \brief Clear interface statistics
288     @param client_index - opaque cookie to identify the sender
289     @param context - sender context, to match reply w/ request
290     @param sw_if_index - index of the interface to clear statistics
291 */
292 define sw_interface_clear_stats
293 {
294   u32 client_index;
295   u32 context;
296   u32 sw_if_index;
297 };
298
299 /** \brief Reply to sw_interface_clear_stats 
300     @param context - sender context which was passed in the request
301     @param retval - return code of the set flags request
302 */
303 define sw_interface_clear_stats_reply
304 {
305   u32 context;
306   i32 retval;
307 };
308
309 /** \brief Set / clear software interface tag
310     @param client_index - opaque cookie to identify the sender
311     @param context - sender context, to match reply w/ request
312     @param sw_if_index - the interface
313     @param add_del - 1 = add, 0 = delete
314     @param tag - an ascii tag
315 */
316 define sw_interface_tag_add_del 
317 {
318     u32 client_index;
319     u32 context;
320     u8 is_add;
321     u32 sw_if_index;
322     u8 tag[64];
323 };
324
325 /** \brief Reply to set / clear software interface tag
326     @param context - sender context which was passed in the request
327     @param retval - return code for the request
328 */
329 define sw_interface_tag_add_del_reply
330 {
331     u32 context;
332     i32 retval;
333 };
334 /*
335  * Local Variables:
336  * eval: (c-set-style "gnu")
337  * End:
338  */
339