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