1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.5.0-dev
5 // source: .vppapi/core/pipe.api.json
7 // Package pipe contains generated bindings for API file pipe.api.
19 api "git.fd.io/govpp.git/api"
20 codec "git.fd.io/govpp.git/codec"
23 // This is a compile-time assertion to ensure that this generated file
24 // is compatible with the GoVPP api package it is being compiled against.
25 // A compilation error at this line likely means your copy of the
26 // GoVPP api package needs to be updated.
27 const _ = api.GoVppAPIPackageIsVersion2
32 VersionCrc = 0x1d68f11
35 // IfStatusFlags defines enum 'if_status_flags'.
36 type IfStatusFlags uint32
39 IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
40 IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
44 IfStatusFlags_name = map[uint32]string{
45 1: "IF_STATUS_API_FLAG_ADMIN_UP",
46 2: "IF_STATUS_API_FLAG_LINK_UP",
48 IfStatusFlags_value = map[string]uint32{
49 "IF_STATUS_API_FLAG_ADMIN_UP": 1,
50 "IF_STATUS_API_FLAG_LINK_UP": 2,
54 func (x IfStatusFlags) String() string {
55 s, ok := IfStatusFlags_name[uint32(x)]
59 str := func(n uint32) string {
60 s, ok := IfStatusFlags_name[uint32(n)]
64 return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
66 for i := uint32(0); i <= 32; i++ {
81 // IfType defines enum 'if_type'.
85 IF_API_TYPE_HARDWARE IfType = 1
86 IF_API_TYPE_SUB IfType = 2
87 IF_API_TYPE_P2P IfType = 3
88 IF_API_TYPE_PIPE IfType = 4
92 IfType_name = map[uint32]string{
93 1: "IF_API_TYPE_HARDWARE",
96 4: "IF_API_TYPE_PIPE",
98 IfType_value = map[string]uint32{
99 "IF_API_TYPE_HARDWARE": 1,
100 "IF_API_TYPE_SUB": 2,
101 "IF_API_TYPE_P2P": 3,
102 "IF_API_TYPE_PIPE": 4,
106 func (x IfType) String() string {
107 s, ok := IfType_name[uint32(x)]
111 return "IfType(" + strconv.Itoa(int(x)) + ")"
114 // LinkDuplex defines enum 'link_duplex'.
115 type LinkDuplex uint32
118 LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
119 LINK_DUPLEX_API_HALF LinkDuplex = 1
120 LINK_DUPLEX_API_FULL LinkDuplex = 2
124 LinkDuplex_name = map[uint32]string{
125 0: "LINK_DUPLEX_API_UNKNOWN",
126 1: "LINK_DUPLEX_API_HALF",
127 2: "LINK_DUPLEX_API_FULL",
129 LinkDuplex_value = map[string]uint32{
130 "LINK_DUPLEX_API_UNKNOWN": 0,
131 "LINK_DUPLEX_API_HALF": 1,
132 "LINK_DUPLEX_API_FULL": 2,
136 func (x LinkDuplex) String() string {
137 s, ok := LinkDuplex_name[uint32(x)]
141 return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
144 // MtuProto defines enum 'mtu_proto'.
148 MTU_PROTO_API_L3 MtuProto = 1
149 MTU_PROTO_API_IP4 MtuProto = 2
150 MTU_PROTO_API_IP6 MtuProto = 3
151 MTU_PROTO_API_MPLS MtuProto = 4
152 MTU_PROTO_API_N MtuProto = 5
156 MtuProto_name = map[uint32]string{
157 1: "MTU_PROTO_API_L3",
158 2: "MTU_PROTO_API_IP4",
159 3: "MTU_PROTO_API_IP6",
160 4: "MTU_PROTO_API_MPLS",
161 5: "MTU_PROTO_API_N",
163 MtuProto_value = map[string]uint32{
164 "MTU_PROTO_API_L3": 1,
165 "MTU_PROTO_API_IP4": 2,
166 "MTU_PROTO_API_IP6": 3,
167 "MTU_PROTO_API_MPLS": 4,
168 "MTU_PROTO_API_N": 5,
172 func (x MtuProto) String() string {
173 s, ok := MtuProto_name[uint32(x)]
177 return "MtuProto(" + strconv.Itoa(int(x)) + ")"
180 // RxMode defines enum 'rx_mode'.
184 RX_MODE_API_UNKNOWN RxMode = 0
185 RX_MODE_API_POLLING RxMode = 1
186 RX_MODE_API_INTERRUPT RxMode = 2
187 RX_MODE_API_ADAPTIVE RxMode = 3
188 RX_MODE_API_DEFAULT RxMode = 4
192 RxMode_name = map[uint32]string{
193 0: "RX_MODE_API_UNKNOWN",
194 1: "RX_MODE_API_POLLING",
195 2: "RX_MODE_API_INTERRUPT",
196 3: "RX_MODE_API_ADAPTIVE",
197 4: "RX_MODE_API_DEFAULT",
199 RxMode_value = map[string]uint32{
200 "RX_MODE_API_UNKNOWN": 0,
201 "RX_MODE_API_POLLING": 1,
202 "RX_MODE_API_INTERRUPT": 2,
203 "RX_MODE_API_ADAPTIVE": 3,
204 "RX_MODE_API_DEFAULT": 4,
208 func (x RxMode) String() string {
209 s, ok := RxMode_name[uint32(x)]
213 return "RxMode(" + strconv.Itoa(int(x)) + ")"
216 // SubIfFlags defines enum 'sub_if_flags'.
217 type SubIfFlags uint32
220 SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
221 SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
222 SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
223 SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
224 SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
225 SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
226 SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
227 SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
228 SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
229 SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
233 SubIfFlags_name = map[uint32]string{
234 1: "SUB_IF_API_FLAG_NO_TAGS",
235 2: "SUB_IF_API_FLAG_ONE_TAG",
236 4: "SUB_IF_API_FLAG_TWO_TAGS",
237 8: "SUB_IF_API_FLAG_DOT1AD",
238 16: "SUB_IF_API_FLAG_EXACT_MATCH",
239 32: "SUB_IF_API_FLAG_DEFAULT",
240 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
241 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
242 254: "SUB_IF_API_FLAG_MASK_VNET",
243 256: "SUB_IF_API_FLAG_DOT1AH",
245 SubIfFlags_value = map[string]uint32{
246 "SUB_IF_API_FLAG_NO_TAGS": 1,
247 "SUB_IF_API_FLAG_ONE_TAG": 2,
248 "SUB_IF_API_FLAG_TWO_TAGS": 4,
249 "SUB_IF_API_FLAG_DOT1AD": 8,
250 "SUB_IF_API_FLAG_EXACT_MATCH": 16,
251 "SUB_IF_API_FLAG_DEFAULT": 32,
252 "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY": 64,
253 "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY": 128,
254 "SUB_IF_API_FLAG_MASK_VNET": 254,
255 "SUB_IF_API_FLAG_DOT1AH": 256,
259 func (x SubIfFlags) String() string {
260 s, ok := SubIfFlags_name[uint32(x)]
264 str := func(n uint32) string {
265 s, ok := SubIfFlags_name[uint32(n)]
269 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
271 for i := uint32(0); i <= 32; i++ {
281 return str(uint32(x))
286 // InterfaceIndex defines alias 'interface_index'.
287 type InterfaceIndex uint32
289 // PipeCreate defines message 'pipe_create'.
290 type PipeCreate struct {
291 IsSpecified bool `binapi:"bool,name=is_specified" json:"is_specified,omitempty"`
292 UserInstance uint32 `binapi:"u32,name=user_instance" json:"user_instance,omitempty"`
295 func (m *PipeCreate) Reset() { *m = PipeCreate{} }
296 func (*PipeCreate) GetMessageName() string { return "pipe_create" }
297 func (*PipeCreate) GetCrcString() string { return "bb263bd3" }
298 func (*PipeCreate) GetMessageType() api.MessageType {
299 return api.RequestMessage
302 func (m *PipeCreate) Size() (size int) {
306 size += 1 // m.IsSpecified
307 size += 4 // m.UserInstance
310 func (m *PipeCreate) Marshal(b []byte) ([]byte, error) {
312 b = make([]byte, m.Size())
314 buf := codec.NewBuffer(b)
315 buf.EncodeBool(m.IsSpecified)
316 buf.EncodeUint32(m.UserInstance)
317 return buf.Bytes(), nil
319 func (m *PipeCreate) Unmarshal(b []byte) error {
320 buf := codec.NewBuffer(b)
321 m.IsSpecified = buf.DecodeBool()
322 m.UserInstance = buf.DecodeUint32()
326 // PipeCreateReply defines message 'pipe_create_reply'.
327 type PipeCreateReply struct {
328 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
329 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
330 PipeSwIfIndex [2]InterfaceIndex `binapi:"interface_index[2],name=pipe_sw_if_index" json:"pipe_sw_if_index,omitempty"`
333 func (m *PipeCreateReply) Reset() { *m = PipeCreateReply{} }
334 func (*PipeCreateReply) GetMessageName() string { return "pipe_create_reply" }
335 func (*PipeCreateReply) GetCrcString() string { return "d4c2c2b3" }
336 func (*PipeCreateReply) GetMessageType() api.MessageType {
337 return api.ReplyMessage
340 func (m *PipeCreateReply) Size() (size int) {
344 size += 4 // m.Retval
345 size += 4 // m.SwIfIndex
346 for j1 := 0; j1 < 2; j1++ {
347 size += 4 // m.PipeSwIfIndex[j1]
351 func (m *PipeCreateReply) Marshal(b []byte) ([]byte, error) {
353 b = make([]byte, m.Size())
355 buf := codec.NewBuffer(b)
356 buf.EncodeInt32(m.Retval)
357 buf.EncodeUint32(uint32(m.SwIfIndex))
358 for j0 := 0; j0 < 2; j0++ {
359 buf.EncodeUint32(uint32(m.PipeSwIfIndex[j0]))
361 return buf.Bytes(), nil
363 func (m *PipeCreateReply) Unmarshal(b []byte) error {
364 buf := codec.NewBuffer(b)
365 m.Retval = buf.DecodeInt32()
366 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
367 for j0 := 0; j0 < 2; j0++ {
368 m.PipeSwIfIndex[j0] = InterfaceIndex(buf.DecodeUint32())
373 // PipeDelete defines message 'pipe_delete'.
374 type PipeDelete struct {
375 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
378 func (m *PipeDelete) Reset() { *m = PipeDelete{} }
379 func (*PipeDelete) GetMessageName() string { return "pipe_delete" }
380 func (*PipeDelete) GetCrcString() string { return "f9e6675e" }
381 func (*PipeDelete) GetMessageType() api.MessageType {
382 return api.RequestMessage
385 func (m *PipeDelete) Size() (size int) {
389 size += 4 // m.SwIfIndex
392 func (m *PipeDelete) Marshal(b []byte) ([]byte, error) {
394 b = make([]byte, m.Size())
396 buf := codec.NewBuffer(b)
397 buf.EncodeUint32(uint32(m.SwIfIndex))
398 return buf.Bytes(), nil
400 func (m *PipeDelete) Unmarshal(b []byte) error {
401 buf := codec.NewBuffer(b)
402 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
406 // PipeDeleteReply defines message 'pipe_delete_reply'.
407 type PipeDeleteReply struct {
408 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
411 func (m *PipeDeleteReply) Reset() { *m = PipeDeleteReply{} }
412 func (*PipeDeleteReply) GetMessageName() string { return "pipe_delete_reply" }
413 func (*PipeDeleteReply) GetCrcString() string { return "e8d4e804" }
414 func (*PipeDeleteReply) GetMessageType() api.MessageType {
415 return api.ReplyMessage
418 func (m *PipeDeleteReply) Size() (size int) {
422 size += 4 // m.Retval
425 func (m *PipeDeleteReply) Marshal(b []byte) ([]byte, error) {
427 b = make([]byte, m.Size())
429 buf := codec.NewBuffer(b)
430 buf.EncodeInt32(m.Retval)
431 return buf.Bytes(), nil
433 func (m *PipeDeleteReply) Unmarshal(b []byte) error {
434 buf := codec.NewBuffer(b)
435 m.Retval = buf.DecodeInt32()
439 // PipeDetails defines message 'pipe_details'.
440 type PipeDetails struct {
441 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
442 PipeSwIfIndex [2]InterfaceIndex `binapi:"interface_index[2],name=pipe_sw_if_index" json:"pipe_sw_if_index,omitempty"`
443 Instance uint32 `binapi:"u32,name=instance" json:"instance,omitempty"`
446 func (m *PipeDetails) Reset() { *m = PipeDetails{} }
447 func (*PipeDetails) GetMessageName() string { return "pipe_details" }
448 func (*PipeDetails) GetCrcString() string { return "43ac107a" }
449 func (*PipeDetails) GetMessageType() api.MessageType {
450 return api.ReplyMessage
453 func (m *PipeDetails) Size() (size int) {
457 size += 4 // m.SwIfIndex
458 for j1 := 0; j1 < 2; j1++ {
459 size += 4 // m.PipeSwIfIndex[j1]
461 size += 4 // m.Instance
464 func (m *PipeDetails) Marshal(b []byte) ([]byte, error) {
466 b = make([]byte, m.Size())
468 buf := codec.NewBuffer(b)
469 buf.EncodeUint32(uint32(m.SwIfIndex))
470 for j0 := 0; j0 < 2; j0++ {
471 buf.EncodeUint32(uint32(m.PipeSwIfIndex[j0]))
473 buf.EncodeUint32(m.Instance)
474 return buf.Bytes(), nil
476 func (m *PipeDetails) Unmarshal(b []byte) error {
477 buf := codec.NewBuffer(b)
478 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
479 for j0 := 0; j0 < 2; j0++ {
480 m.PipeSwIfIndex[j0] = InterfaceIndex(buf.DecodeUint32())
482 m.Instance = buf.DecodeUint32()
486 // PipeDump defines message 'pipe_dump'.
487 type PipeDump struct{}
489 func (m *PipeDump) Reset() { *m = PipeDump{} }
490 func (*PipeDump) GetMessageName() string { return "pipe_dump" }
491 func (*PipeDump) GetCrcString() string { return "51077d14" }
492 func (*PipeDump) GetMessageType() api.MessageType {
493 return api.RequestMessage
496 func (m *PipeDump) Size() (size int) {
502 func (m *PipeDump) Marshal(b []byte) ([]byte, error) {
504 b = make([]byte, m.Size())
506 buf := codec.NewBuffer(b)
507 return buf.Bytes(), nil
509 func (m *PipeDump) Unmarshal(b []byte) error {
513 func init() { file_pipe_binapi_init() }
514 func file_pipe_binapi_init() {
515 api.RegisterMessage((*PipeCreate)(nil), "pipe_create_bb263bd3")
516 api.RegisterMessage((*PipeCreateReply)(nil), "pipe_create_reply_d4c2c2b3")
517 api.RegisterMessage((*PipeDelete)(nil), "pipe_delete_f9e6675e")
518 api.RegisterMessage((*PipeDeleteReply)(nil), "pipe_delete_reply_e8d4e804")
519 api.RegisterMessage((*PipeDetails)(nil), "pipe_details_43ac107a")
520 api.RegisterMessage((*PipeDump)(nil), "pipe_dump_51077d14")
523 // Messages returns list of all messages in this module.
524 func AllMessages() []api.Message {
525 return []api.Message{
527 (*PipeCreateReply)(nil),
529 (*PipeDeleteReply)(nil),