FD.io VPP  v17.10-9-gd594711
Vector Packet Processing
interface.api
Go to the documentation of this file.
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 */
8 autoreply define sw_interface_set_flags
9 {
13  /* 1 = up, 0 = down */
15 };
16 
17 /** \brief Set interface MTU
18  @param client_index - opaque cookie to identify the sender
19  @param context - sender context, to match reply w/ request
20  @param sw_if_index - index of the interface to set MTU on
21  @param mtu - MTU
22 */
23 autoreply define sw_interface_set_mtu
24 {
29 };
30 
31 /** \brief Interface Event generated by want_interface_events
32  @param client_index - opaque cookie to identify the sender
33  @param pid - client pid registered to receive notification
34  @param sw_if_index - index of the interface of the event
35  @param admin_up_down - The administrative state; 1 = up, 0 = down
36  @param link_up_down - The operational state; 1 = up, 0 = down
37  @param deleted - interface was deleted
38 */
39 define sw_interface_event
40 {
47 };
48 
49 /** \brief Register for interface events
50  @param client_index - opaque cookie to identify the sender
51  @param context - sender context, to match reply w/ request
52  @param enable_disable - 1 => register for events, 0 => cancel registration
53  @param pid - sender's pid
54 */
55 autoreply define want_interface_events
56 {
61 };
62 
63 /** \brief Interface details structure (fix this)
64  @param sw_if_index - index of the interface
65  @param sup_sw_if_index - index of parent interface if any, else same as sw_if_index
66  @param l2_address_length - length of the interface's l2 address
67  @param pid - the interface's l2 address
68  @param interface_name - name of the interface
69  @param link_duplex - 1 if half duplex, 2 if full duplex
70  @param link_speed - 1 = 10M, 2 = 100M, 4 = 1G, 8 = 10G, 16 = 40G, 32 = 100G
71  @param link_MTU - max. transmittion unit
72  @param sub_if_id - A number 0-N to uniquely identify this subif on super if
73  @param sub_dot1ad - 0 = dot1q, 1 = dot1ad
74  @param sub_dot1ah - 1 = dot1ah, 0 = otherwise
75  @param sub_number_of_tags - Number of tags (0 - 2)
76  @param sub_outer_vlan_id
77  @param sub_inner_vlan_id
78  @param sub_exact_match
79  @param sub_default
80  @param sub_outer_vlan_id_any
81  @param sub_inner_vlan_id_any
82  @param vtr_op - vlan tag rewrite operation
83  @param vtr_push_dot1q
84  @param vtr_tag1
85  @param vtr_tag2
86  @param pbb_outer_tag - translate pbb s-tag
87  @param pbb_b_dmac[6] - B-tag remote mac address
88  @param pbb_b_smac[6] - B-tag local mac address
89  @param pbb_b_vlanid - B-tag vlanid
90  @param pbb_i_sid - I-tag service id
91 */
92 define sw_interface_details
93 {
96 
97  /* index of sup interface (e.g. hw interface).
98  equal to sw_if_index for super hw interface. */
100 
101  /* Layer 2 address, if applicable */
103  u8 l2_address[8];
104 
105  /* Interface name */
106  u8 interface_name[64];
107 
108  /* 1 = up, 0 = down */
111 
112  /* 1 = half duplex, 2 = full duplex */
114 
115  /* 1 = 10M, 2 = 100M, 4 = 1G, 8 = 10G, 16 = 40G, 32 = 100G */
117 
118  /* MTU */
120 
121  /* Subinterface ID. A number 0-N to uniquely identify this subinterface under the super interface */
123 
124  /* 0 = dot1q, 1=dot1ad */
126  /* 1 = dot1h, 1=otherwise */
128 
129  /* Number of tags 0-2 */
137 
138  /* vlan tag rewrite state */
140  u32 vtr_push_dot1q; // ethertype of first pushed tag is dot1q/dot1ad
141  u32 vtr_tag1; // first pushed tag
142  u32 vtr_tag2; // second pushed tag
143  u8 tag[64];
144 
145  /* pbb tag rewrite info */
147  u8 b_dmac[6];
148  u8 b_smac[6];
151 };
152 
153 /* works */
154 define sw_interface_dump
155 {
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 autoreply define sw_interface_add_del_address
173 {
181  u8 address[16];
182 };
183 
184 /** \brief Associate the specified interface with a fib table
185  @param client_index - opaque cookie to identify the sender
186  @param context - sender context, to match reply w/ request
187  @param sw_if_index - index of the interface
188  @param is_ipv6 - if non-zero ipv6, else ipv4
189  @param vrf_id - fib table/vrd id to associate the interface with
190 */
191 autoreply define sw_interface_set_table
192 {
198 };
199 
200 /** \brief Get VRF id assigned to interface
201  @param client_index - opaque cookie to identify the sender
202  @param context - sender context, to match reply w/ request
203  @param sw_if_index - index of the interface
204 */
205 define sw_interface_get_table
206 {
211 };
212 
213 /** \brief Reply to get_sw_interface_vrf
214  @param context - sender context which was passed in the request
215  @param vrf_id - VRF id assigned to the interface
216 */
217 define sw_interface_get_table_reply
218 {
222 };
223 
224 typeonly manual_print manual_endian define vlib_counter
225 {
226  u64 packets; /**< packet counter */
227  u64 bytes; /**< byte counter */
228 };
229 
230 /** \brief Combined interface counter data type for vnet_interface_combined_counters
231  @param sw_if_index - interface indexes for counters
232  @param rx_packets - received packet count
233  @param rx_bytes - received byte count
234  @param tx_packets - transmitted packet count
235  @param tx_bytes - transmitted byte count
236 
237 */
238 typeonly manual_print manual_endian define vnet_combined_counter
239 {
241  u64 rx_packets; /**< packet counter */
242  u64 rx_bytes; /**< byte counter */
243  u64 tx_packets; /**< packet counter */
244  u64 tx_bytes; /**< byte counter */
245 };
246 
247 /** \brief Simple interface counter data type for vnet_interface_simple_counters
248  @param sw_if_index - interface indexes for counters
249  @param drop - RX or TX drops due to buffer starvation
250  @param punt - used with VNET "punt" disposition
251  @param rx_ip4 - received IP4 packets
252  @param rx_ip6 - received IP6 packets
253  @param rx_no_buffer - no RX buffers available
254  @param rx_miss - receive misses
255  @param rx_error - receive errors
256  @param tx_error - transmit errors
257  @param rx_mpls - received MPLS packet
258 
259 */
260 typeonly manual_print manual_endian define vnet_simple_counter
261 {
272 };
273 
274 /** \brief Simple stats counters structure
275  @param vnet_counter_type- such as ip4, ip6, punts, etc
276  @param first_sw_if_index - first sw index in block of index, counts
277  @param count - number of counters, equal to the number of interfaces in
278  this stats block
279  @param data - contiguous block of u64 counters
280 
281  vnet_counter_type defined in enums - plural - in vnet/interface.h
282 */
283 manual_print manual_endian define vnet_interface_simple_counters
284 {
288  u64 data[count];
289 };
290 
291 /** \brief Combined stats counters structure
292  @param vnet_counter_type- such as ip4, ip6, punts, etc
293  @param first_sw_if_index - first sw index in block of index, counts
294  @param count - number of counters, equal to the number of interfaces in
295  this stats block
296  @param data - contiguous block of vlib_counter_t structures
297 
298  vnet_counter_type defined in enums - plural - in vnet/interface.h
299 */
300 manual_print manual_endian define vnet_interface_combined_counters
301 {
306 };
307 
308 
309 /** \brief Simple per interface stats counters structure
310  @param count - number of elements in message
311  @param timestamp - u32 vlib timestamp for control plane
312  @param data[count] - vl_api_vnet_simple_counter_t
313 
314 */
315 manual_print manual_endian define vnet_per_interface_simple_counters
316 {
320 };
321 
322 /** \brief Combined stats counters structure per interface
323  @param count - number of elements in message
324  @param timestamp - u32 vlib timestamp for control plane
325  @param data[count] - vl_api_vnet_combined_counter_t
326 */
327 manual_print manual_endian define vnet_per_interface_combined_counters
328 {
332 };
333 
334 /** \brief Set unnumbered interface add / del request
335  @param client_index - opaque cookie to identify the sender
336  @param context - sender context, to match reply w/ request
337  @param sw_if_index - interface with an IP address
338  @param unnumbered_sw_if_index - interface which will use the address
339  @param is_add - if non-zero set the association, else unset it
340 */
341 autoreply define sw_interface_set_unnumbered
342 {
345  u32 sw_if_index; /* use this intfc address */
346  u32 unnumbered_sw_if_index; /* on this interface */
348 };
349 
350 /** \brief Clear interface statistics
351  @param client_index - opaque cookie to identify the sender
352  @param context - sender context, to match reply w/ request
353  @param sw_if_index - index of the interface to clear statistics
354 */
355 autoreply define sw_interface_clear_stats
356 {
360 };
361 
362 /** \brief Set / clear software interface tag
363  @param client_index - opaque cookie to identify the sender
364  @param context - sender context, to match reply w/ request
365  @param sw_if_index - the interface
366  @param add_del - 1 = add, 0 = delete
367  @param tag - an ascii tag
368 */
369 autoreply define sw_interface_tag_add_del
370 {
375  u8 tag[64];
376 };
377 
378 /** \brief Set an interface's MAC address
379  @param client_index - opaque cookie to identify the sender
380  @param context - sender context, to match reply w/ request
381  @param sw_if_index - the interface whose MAC will be set
382  @param mac_addr - the new MAC address
383 */
384 autoreply define sw_interface_set_mac_address
385 {
389  u8 mac_address[6];
390 };
391 
392 /*
393  * Local Variables:
394  * eval: (c-set-style "gnu")
395  * End:
396  */
int i32
Definition: types.h:81
u64 bytes
byte counter
Definition: interface.api:227
unsigned long u64
Definition: types.h:89
u64 tx_packets
packet counter
Definition: interface.api:243
u64 packets
packet counter
Definition: interface.api:226
unsigned int u32
Definition: types.h:88
Combined interface counter data type for vnet_interface_combined_counters.
Definition: interface.api:238
size_t count
Definition: vapi.c:40
unsigned short u16
Definition: types.h:57
u64 rx_packets
packet counter
Definition: interface.api:241
unsigned char u8
Definition: types.h:56
Simple interface counter data type for vnet_interface_simple_counters.
Definition: interface.api:260