Simplify subscribing to events and fix events
[govpp.git] / examples / bin_api / tap / tap.ba.go
1 // Code generated by GoVPP binapi-generator. DO NOT EDIT.
2 // source: tap.api.json
3
4 /*
5 Package tap is a generated VPP binary API of the 'tap' VPP module.
6
7 It is generated from this file:
8         tap.api.json
9
10 It contains these VPP binary API objects:
11         8 messages
12         4 services
13 */
14 package tap
15
16 import "git.fd.io/govpp.git/api"
17 import "github.com/lunixbochs/struc"
18 import "bytes"
19
20 // Reference imports to suppress errors if they are not otherwise used.
21 var _ = api.RegisterMessage
22 var _ = struc.Pack
23 var _ = bytes.NewBuffer
24
25 /* Messages */
26
27 // TapConnect represents the VPP binary API message 'tap_connect'.
28 // Generated from 'tap.api.json', line 4:
29 //
30 //            "tap_connect",
31 //            [
32 //                "u16",
33 //                "_vl_msg_id"
34 //            ],
35 //            [
36 //                "u32",
37 //                "client_index"
38 //            ],
39 //            [
40 //                "u32",
41 //                "context"
42 //            ],
43 //            [
44 //                "u8",
45 //                "use_random_mac"
46 //            ],
47 //            [
48 //                "u8",
49 //                "tap_name",
50 //                64
51 //            ],
52 //            [
53 //                "u8",
54 //                "mac_address",
55 //                6
56 //            ],
57 //            [
58 //                "u8",
59 //                "renumber"
60 //            ],
61 //            [
62 //                "u32",
63 //                "custom_dev_instance"
64 //            ],
65 //            [
66 //                "u8",
67 //                "ip4_address_set"
68 //            ],
69 //            [
70 //                "u8",
71 //                "ip4_address",
72 //                4
73 //            ],
74 //            [
75 //                "u8",
76 //                "ip4_mask_width"
77 //            ],
78 //            [
79 //                "u8",
80 //                "ip6_address_set"
81 //            ],
82 //            [
83 //                "u8",
84 //                "ip6_address",
85 //                16
86 //            ],
87 //            [
88 //                "u8",
89 //                "ip6_mask_width"
90 //            ],
91 //            [
92 //                "u8",
93 //                "tag",
94 //                64
95 //            ],
96 //            {
97 //                "crc": "0x9b9c396f"
98 //            }
99 //
100 type TapConnect struct {
101         UseRandomMac      uint8
102         TapName           []byte `struc:"[64]byte"`
103         MacAddress        []byte `struc:"[6]byte"`
104         Renumber          uint8
105         CustomDevInstance uint32
106         IP4AddressSet     uint8
107         IP4Address        []byte `struc:"[4]byte"`
108         IP4MaskWidth      uint8
109         IP6AddressSet     uint8
110         IP6Address        []byte `struc:"[16]byte"`
111         IP6MaskWidth      uint8
112         Tag               []byte `struc:"[64]byte"`
113 }
114
115 func (*TapConnect) GetMessageName() string {
116         return "tap_connect"
117 }
118 func (*TapConnect) GetCrcString() string {
119         return "9b9c396f"
120 }
121 func (*TapConnect) GetMessageType() api.MessageType {
122         return api.RequestMessage
123 }
124 func NewTapConnect() api.Message {
125         return &TapConnect{}
126 }
127
128 // TapConnectReply represents the VPP binary API message 'tap_connect_reply'.
129 // Generated from 'tap.api.json', line 75:
130 //
131 //            "tap_connect_reply",
132 //            [
133 //                "u16",
134 //                "_vl_msg_id"
135 //            ],
136 //            [
137 //                "u32",
138 //                "context"
139 //            ],
140 //            [
141 //                "i32",
142 //                "retval"
143 //            ],
144 //            [
145 //                "u32",
146 //                "sw_if_index"
147 //            ],
148 //            {
149 //                "crc": "0xfda5941f"
150 //            }
151 //
152 type TapConnectReply struct {
153         Retval    int32
154         SwIfIndex uint32
155 }
156
157 func (*TapConnectReply) GetMessageName() string {
158         return "tap_connect_reply"
159 }
160 func (*TapConnectReply) GetCrcString() string {
161         return "fda5941f"
162 }
163 func (*TapConnectReply) GetMessageType() api.MessageType {
164         return api.ReplyMessage
165 }
166 func NewTapConnectReply() api.Message {
167         return &TapConnectReply{}
168 }
169
170 // TapModify represents the VPP binary API message 'tap_modify'.
171 // Generated from 'tap.api.json', line 97:
172 //
173 //            "tap_modify",
174 //            [
175 //                "u16",
176 //                "_vl_msg_id"
177 //            ],
178 //            [
179 //                "u32",
180 //                "client_index"
181 //            ],
182 //            [
183 //                "u32",
184 //                "context"
185 //            ],
186 //            [
187 //                "u32",
188 //                "sw_if_index"
189 //            ],
190 //            [
191 //                "u8",
192 //                "use_random_mac"
193 //            ],
194 //            [
195 //                "u8",
196 //                "tap_name",
197 //                64
198 //            ],
199 //            [
200 //                "u8",
201 //                "mac_address",
202 //                6
203 //            ],
204 //            [
205 //                "u8",
206 //                "renumber"
207 //            ],
208 //            [
209 //                "u32",
210 //                "custom_dev_instance"
211 //            ],
212 //            {
213 //                "crc": "0x8047ae5c"
214 //            }
215 //
216 type TapModify struct {
217         SwIfIndex         uint32
218         UseRandomMac      uint8
219         TapName           []byte `struc:"[64]byte"`
220         MacAddress        []byte `struc:"[6]byte"`
221         Renumber          uint8
222         CustomDevInstance uint32
223 }
224
225 func (*TapModify) GetMessageName() string {
226         return "tap_modify"
227 }
228 func (*TapModify) GetCrcString() string {
229         return "8047ae5c"
230 }
231 func (*TapModify) GetMessageType() api.MessageType {
232         return api.RequestMessage
233 }
234 func NewTapModify() api.Message {
235         return &TapModify{}
236 }
237
238 // TapModifyReply represents the VPP binary API message 'tap_modify_reply'.
239 // Generated from 'tap.api.json', line 141:
240 //
241 //            "tap_modify_reply",
242 //            [
243 //                "u16",
244 //                "_vl_msg_id"
245 //            ],
246 //            [
247 //                "u32",
248 //                "context"
249 //            ],
250 //            [
251 //                "i32",
252 //                "retval"
253 //            ],
254 //            [
255 //                "u32",
256 //                "sw_if_index"
257 //            ],
258 //            {
259 //                "crc": "0xfda5941f"
260 //            }
261 //
262 type TapModifyReply struct {
263         Retval    int32
264         SwIfIndex uint32
265 }
266
267 func (*TapModifyReply) GetMessageName() string {
268         return "tap_modify_reply"
269 }
270 func (*TapModifyReply) GetCrcString() string {
271         return "fda5941f"
272 }
273 func (*TapModifyReply) GetMessageType() api.MessageType {
274         return api.ReplyMessage
275 }
276 func NewTapModifyReply() api.Message {
277         return &TapModifyReply{}
278 }
279
280 // TapDelete represents the VPP binary API message 'tap_delete'.
281 // Generated from 'tap.api.json', line 163:
282 //
283 //            "tap_delete",
284 //            [
285 //                "u16",
286 //                "_vl_msg_id"
287 //            ],
288 //            [
289 //                "u32",
290 //                "client_index"
291 //            ],
292 //            [
293 //                "u32",
294 //                "context"
295 //            ],
296 //            [
297 //                "u32",
298 //                "sw_if_index"
299 //            ],
300 //            {
301 //                "crc": "0x529cb13f"
302 //            }
303 //
304 type TapDelete struct {
305         SwIfIndex uint32
306 }
307
308 func (*TapDelete) GetMessageName() string {
309         return "tap_delete"
310 }
311 func (*TapDelete) GetCrcString() string {
312         return "529cb13f"
313 }
314 func (*TapDelete) GetMessageType() api.MessageType {
315         return api.RequestMessage
316 }
317 func NewTapDelete() api.Message {
318         return &TapDelete{}
319 }
320
321 // TapDeleteReply represents the VPP binary API message 'tap_delete_reply'.
322 // Generated from 'tap.api.json', line 185:
323 //
324 //            "tap_delete_reply",
325 //            [
326 //                "u16",
327 //                "_vl_msg_id"
328 //            ],
329 //            [
330 //                "u32",
331 //                "context"
332 //            ],
333 //            [
334 //                "i32",
335 //                "retval"
336 //            ],
337 //            {
338 //                "crc": "0xe8d4e804"
339 //            }
340 //
341 type TapDeleteReply struct {
342         Retval int32
343 }
344
345 func (*TapDeleteReply) GetMessageName() string {
346         return "tap_delete_reply"
347 }
348 func (*TapDeleteReply) GetCrcString() string {
349         return "e8d4e804"
350 }
351 func (*TapDeleteReply) GetMessageType() api.MessageType {
352         return api.ReplyMessage
353 }
354 func NewTapDeleteReply() api.Message {
355         return &TapDeleteReply{}
356 }
357
358 // SwInterfaceTapDump represents the VPP binary API message 'sw_interface_tap_dump'.
359 // Generated from 'tap.api.json', line 203:
360 //
361 //            "sw_interface_tap_dump",
362 //            [
363 //                "u16",
364 //                "_vl_msg_id"
365 //            ],
366 //            [
367 //                "u32",
368 //                "client_index"
369 //            ],
370 //            [
371 //                "u32",
372 //                "context"
373 //            ],
374 //            {
375 //                "crc": "0x51077d14"
376 //            }
377 //
378 type SwInterfaceTapDump struct{}
379
380 func (*SwInterfaceTapDump) GetMessageName() string {
381         return "sw_interface_tap_dump"
382 }
383 func (*SwInterfaceTapDump) GetCrcString() string {
384         return "51077d14"
385 }
386 func (*SwInterfaceTapDump) GetMessageType() api.MessageType {
387         return api.RequestMessage
388 }
389 func NewSwInterfaceTapDump() api.Message {
390         return &SwInterfaceTapDump{}
391 }
392
393 // SwInterfaceTapDetails represents the VPP binary API message 'sw_interface_tap_details'.
394 // Generated from 'tap.api.json', line 221:
395 //
396 //            "sw_interface_tap_details",
397 //            [
398 //                "u16",
399 //                "_vl_msg_id"
400 //            ],
401 //            [
402 //                "u32",
403 //                "context"
404 //            ],
405 //            [
406 //                "u32",
407 //                "sw_if_index"
408 //            ],
409 //            [
410 //                "u8",
411 //                "dev_name",
412 //                64
413 //            ],
414 //            {
415 //                "crc": "0x76229a57"
416 //            }
417 //
418 type SwInterfaceTapDetails struct {
419         SwIfIndex uint32
420         DevName   []byte `struc:"[64]byte"`
421 }
422
423 func (*SwInterfaceTapDetails) GetMessageName() string {
424         return "sw_interface_tap_details"
425 }
426 func (*SwInterfaceTapDetails) GetCrcString() string {
427         return "76229a57"
428 }
429 func (*SwInterfaceTapDetails) GetMessageType() api.MessageType {
430         return api.ReplyMessage
431 }
432 func NewSwInterfaceTapDetails() api.Message {
433         return &SwInterfaceTapDetails{}
434 }
435
436 /* Services */
437
438 type Services interface {
439         DumpSwInterfaceTap(*SwInterfaceTapDump) (*SwInterfaceTapDetails, error)
440         TapConnect(*TapConnect) (*TapConnectReply, error)
441         TapDelete(*TapDelete) (*TapDeleteReply, error)
442         TapModify(*TapModify) (*TapModifyReply, error)
443 }
444
445 func init() {
446         api.RegisterMessage((*TapConnect)(nil), "tap.TapConnect")
447         api.RegisterMessage((*TapConnectReply)(nil), "tap.TapConnectReply")
448         api.RegisterMessage((*TapModify)(nil), "tap.TapModify")
449         api.RegisterMessage((*TapModifyReply)(nil), "tap.TapModifyReply")
450         api.RegisterMessage((*TapDelete)(nil), "tap.TapDelete")
451         api.RegisterMessage((*TapDeleteReply)(nil), "tap.TapDeleteReply")
452         api.RegisterMessage((*SwInterfaceTapDump)(nil), "tap.SwInterfaceTapDump")
453         api.RegisterMessage((*SwInterfaceTapDetails)(nil), "tap.SwInterfaceTapDetails")
454 }