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