blob: 9df63f18b37c7f85654ca3937938a49a55101e50 [file] [log] [blame]
Dave Barachaff70772016-10-31 11:59:07 -04001/** \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*/
Dave Barach11b8dbf2017-04-24 10:46:54 -04009autoreply define sw_interface_set_flags
Dave Barachaff70772016-10-31 11:59:07 -040010{
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
Matus Fabiand162f3d2016-12-05 01:05:35 -080020/** \brief Set interface MTU
21 @param client_index - opaque cookie to identify the sender
22 @param context - sender context, to match reply w/ request
23 @param sw_if_index - index of the interface to set MTU on
24 @param mtu - MTU
25*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040026autoreply define sw_interface_set_mtu
Matus Fabiand162f3d2016-12-05 01:05:35 -080027{
28 u32 client_index;
29 u32 context;
30 u32 sw_if_index;
31 u16 mtu;
32};
33
Dave Barach6d963c22016-12-05 09:50:05 -050034/** \brief Register for interface events
35 @param client_index - opaque cookie to identify the sender
36 @param context - sender context, to match reply w/ request
37 @param enable_disable - 1 => register for events, 0 => cancel registration
38 @param pid - sender's pid
39*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040040autoreply define want_interface_events
Dave Barach6d963c22016-12-05 09:50:05 -050041{
42 u32 client_index;
43 u32 context;
44 u32 enable_disable;
45 u32 pid;
46};
47
Dave Barach6d963c22016-12-05 09:50:05 -050048/** \brief Interface details structure (fix this)
49 @param sw_if_index - index of the interface
50 @param sup_sw_if_index - index of parent interface if any, else same as sw_if_index
51 @param l2_address_length - length of the interface's l2 address
52 @param pid - the interface's l2 address
53 @param interface_name - name of the interface
54 @param link_duplex - 1 if half duplex, 2 if full duplex
55 @param link_speed - 1 = 10M, 2 = 100M, 4 = 1G, 8 = 10G, 16 = 40G, 32 = 100G
Pavel Kotucek65e84572017-01-16 17:01:56 +010056 @param link_MTU - max. transmittion unit
Dave Barach6d963c22016-12-05 09:50:05 -050057 @param sub_if_id - A number 0-N to uniquely identify this subif on super if
Pavel Kotucek65e84572017-01-16 17:01:56 +010058 @param sub_dot1ad - 0 = dot1q, 1 = dot1ad
59 @param sub_dot1ah - 1 = dot1ah, 0 = otherwise
Dave Barach6d963c22016-12-05 09:50:05 -050060 @param sub_number_of_tags - Number of tags (0 - 2)
61 @param sub_outer_vlan_id
62 @param sub_inner_vlan_id
63 @param sub_exact_match
64 @param sub_default
65 @param sub_outer_vlan_id_any
66 @param sub_inner_vlan_id_any
67 @param vtr_op - vlan tag rewrite operation
68 @param vtr_push_dot1q
69 @param vtr_tag1
70 @param vtr_tag2
Pavel Kotucek65e84572017-01-16 17:01:56 +010071 @param pbb_outer_tag - translate pbb s-tag
72 @param pbb_b_dmac[6] - B-tag remote mac address
73 @param pbb_b_smac[6] - B-tag local mac address
74 @param pbb_b_vlanid - B-tag vlanid
75 @param pbb_i_sid - I-tag service id
Dave Barach6d963c22016-12-05 09:50:05 -050076*/
77define sw_interface_details
78{
79 u32 context;
80 u32 sw_if_index;
81
82 /* index of sup interface (e.g. hw interface).
83 equal to sw_if_index for super hw interface. */
84 u32 sup_sw_if_index;
85
86 /* Layer 2 address, if applicable */
87 u32 l2_address_length;
88 u8 l2_address[8];
89
90 /* Interface name */
91 u8 interface_name[64];
92
93 /* 1 = up, 0 = down */
94 u8 admin_up_down;
95 u8 link_up_down;
96
97 /* 1 = half duplex, 2 = full duplex */
98 u8 link_duplex;
99
100 /* 1 = 10M, 2 = 100M, 4 = 1G, 8 = 10G, 16 = 40G, 32 = 100G */
101 u8 link_speed;
102
103 /* MTU */
104 u16 link_mtu;
105
106 /* Subinterface ID. A number 0-N to uniquely identify this subinterface under the super interface */
107 u32 sub_id;
108
109 /* 0 = dot1q, 1=dot1ad */
110 u8 sub_dot1ad;
Pavel Kotucek65e84572017-01-16 17:01:56 +0100111 /* 1 = dot1h, 1=otherwise */
112 u8 sub_dot1ah;
Dave Barach6d963c22016-12-05 09:50:05 -0500113
114 /* Number of tags 0-2 */
115 u8 sub_number_of_tags;
116 u16 sub_outer_vlan_id;
117 u16 sub_inner_vlan_id;
118 u8 sub_exact_match;
119 u8 sub_default;
120 u8 sub_outer_vlan_id_any;
121 u8 sub_inner_vlan_id_any;
122
123 /* vlan tag rewrite state */
124 u32 vtr_op;
125 u32 vtr_push_dot1q; // ethertype of first pushed tag is dot1q/dot1ad
126 u32 vtr_tag1; // first pushed tag
127 u32 vtr_tag2; // second pushed tag
128 u8 tag[64];
Pavel Kotucek65e84572017-01-16 17:01:56 +0100129
130 /* pbb tag rewrite info */
131 u16 outer_tag;
132 u8 b_dmac[6];
133 u8 b_smac[6];
134 u16 b_vlanid;
135 u32 i_sid;
Dave Barach6d963c22016-12-05 09:50:05 -0500136};
137
138/* works */
139define sw_interface_dump
140{
141 u32 client_index;
142 u32 context;
143 u8 name_filter_valid;
144 u8 name_filter[49];
145};
146
147/** \brief Set or delete one or all ip addresses on a specified interface
148 @param client_index - opaque cookie to identify the sender
149 @param context - sender context, to match reply w/ request
150 @param sw_if_index - index of the interface to add/del addresses
151 @param is_add - add address if non-zero, else delete
152 @param is_ipv6 - if non-zero the address is ipv6, else ipv4
153 @param del_all - if non-zero delete all addresses on the interface
154 @param address_length - address length in bytes, 4 for ip4, 16 for ip6
155 @param address - array of address bytes
156*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400157autoreply define sw_interface_add_del_address
Dave Barach6d963c22016-12-05 09:50:05 -0500158{
159 u32 client_index;
160 u32 context;
161 u32 sw_if_index;
162 u8 is_add;
163 u8 is_ipv6;
164 u8 del_all;
165 u8 address_length;
166 u8 address[16];
167};
168
Dave Barach6d963c22016-12-05 09:50:05 -0500169/** \brief Associate the specified interface with a fib table
170 @param client_index - opaque cookie to identify the sender
171 @param context - sender context, to match reply w/ request
172 @param sw_if_index - index of the interface
173 @param is_ipv6 - if non-zero ipv6, else ipv4
174 @param vrf_id - fib table/vrd id to associate the interface with
175*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400176autoreply define sw_interface_set_table
Dave Barach6d963c22016-12-05 09:50:05 -0500177{
178 u32 client_index;
179 u32 context;
180 u32 sw_if_index;
181 u8 is_ipv6;
182 u32 vrf_id;
183};
184
Juraj Slobodadfc19232016-12-05 13:20:37 +0100185/** \brief Get VRF id assigned to interface
186 @param client_index - opaque cookie to identify the sender
187 @param context - sender context, to match reply w/ request
188 @param sw_if_index - index of the interface
189*/
190define sw_interface_get_table
191{
192 u32 client_index;
193 u32 context;
194 u32 sw_if_index;
195 u8 is_ipv6;
196};
197
198/** \brief Reply to get_sw_interface_vrf
199 @param context - sender context which was passed in the request
200 @param vrf_id - VRF id assigned to the interface
201*/
202define sw_interface_get_table_reply
203{
204 u32 context;
205 i32 retval;
206 u32 vrf_id;
207};
208
Dave Barach6d963c22016-12-05 09:50:05 -0500209/** \brief Stats counters structure
210 @param vnet_counter_type- such as ip4, ip6, punts, etc
211 @param is_combined - rx & tx total (all types) counts
212 @param first_sw_if_index - first sw index in block of index, counts
213 @param count - number of interfaces this stats block includes counters for
214 @param data - contiguous block of vlib_counter_t structures
215*/
216define vnet_interface_counters
217{
218 /* enums - plural - in vnet/interface.h */
219 u8 vnet_counter_type;
220 u8 is_combined;
221 u32 first_sw_if_index;
222 u32 count;
223 u8 data[count];
224};
225
226/** \brief Set unnumbered interface add / del request
227 @param client_index - opaque cookie to identify the sender
228 @param context - sender context, to match reply w/ request
229 @param sw_if_index - interface with an IP address
230 @param unnumbered_sw_if_index - interface which will use the address
231 @param is_add - if non-zero set the association, else unset it
232*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400233autoreply define sw_interface_set_unnumbered
Dave Barach6d963c22016-12-05 09:50:05 -0500234{
235 u32 client_index;
236 u32 context;
237 u32 sw_if_index; /* use this intfc address */
238 u32 unnumbered_sw_if_index; /* on this interface */
239 u8 is_add;
240};
241
Dave Barach6d963c22016-12-05 09:50:05 -0500242/** \brief Clear interface statistics
243 @param client_index - opaque cookie to identify the sender
244 @param context - sender context, to match reply w/ request
245 @param sw_if_index - index of the interface to clear statistics
246*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400247autoreply define sw_interface_clear_stats
Dave Barach6d963c22016-12-05 09:50:05 -0500248{
249 u32 client_index;
250 u32 context;
251 u32 sw_if_index;
252};
253
Dave Barach6d963c22016-12-05 09:50:05 -0500254/** \brief Set / clear software interface tag
255 @param client_index - opaque cookie to identify the sender
256 @param context - sender context, to match reply w/ request
257 @param sw_if_index - the interface
258 @param add_del - 1 = add, 0 = delete
259 @param tag - an ascii tag
260*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400261autoreply define sw_interface_tag_add_del
Dave Barach6d963c22016-12-05 09:50:05 -0500262{
263 u32 client_index;
264 u32 context;
265 u8 is_add;
266 u32 sw_if_index;
267 u8 tag[64];
268};
269
Jon Loeliger10c273b2017-03-30 08:39:33 -0500270/** \brief Set an interface's MAC address
271 @param client_index - opaque cookie to identify the sender
272 @param context - sender context, to match reply w/ request
273 @param sw_if_index - the interface whose MAC will be set
274 @param mac_addr - the new MAC address
275*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400276autoreply define sw_interface_set_mac_address
Jon Loeliger10c273b2017-03-30 08:39:33 -0500277{
278 u32 client_index;
279 u32 context;
280 u32 sw_if_index;
281 u8 mac_address[6];
282};
283
Dave Barach6d963c22016-12-05 09:50:05 -0500284/*
285 * Local Variables:
286 * eval: (c-set-style "gnu")
287 * End:
288 */