1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
5 // source: .vppapi/core/pipe.api.json
7 // Package pipe contains generated bindings for API file pipe.api.
17 api "git.fd.io/govpp.git/api"
18 codec "git.fd.io/govpp.git/codec"
22 // This is a compile-time assertion to ensure that this generated file
23 // is compatible with the GoVPP api package it is being compiled against.
24 // A compilation error at this line likely means your copy of the
25 // GoVPP api package needs to be updated.
26 const _ = api.GoVppAPIPackageIsVersion2
31 VersionCrc = 0x1d68f11
34 // IfStatusFlags defines enum 'if_status_flags'.
35 type IfStatusFlags uint32
38 IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
39 IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
43 IfStatusFlags_name = map[uint32]string{
44 1: "IF_STATUS_API_FLAG_ADMIN_UP",
45 2: "IF_STATUS_API_FLAG_LINK_UP",
47 IfStatusFlags_value = map[string]uint32{
48 "IF_STATUS_API_FLAG_ADMIN_UP": 1,
49 "IF_STATUS_API_FLAG_LINK_UP": 2,
53 func (x IfStatusFlags) String() string {
54 s, ok := IfStatusFlags_name[uint32(x)]
58 str := func(n uint32) string {
59 s, ok := IfStatusFlags_name[uint32(n)]
63 return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
65 for i := uint32(0); i <= 32; i++ {
80 // IfType defines enum 'if_type'.
84 IF_API_TYPE_HARDWARE IfType = 1
85 IF_API_TYPE_SUB IfType = 2
86 IF_API_TYPE_P2P IfType = 3
87 IF_API_TYPE_PIPE IfType = 4
91 IfType_name = map[uint32]string{
92 1: "IF_API_TYPE_HARDWARE",
95 4: "IF_API_TYPE_PIPE",
97 IfType_value = map[string]uint32{
98 "IF_API_TYPE_HARDWARE": 1,
100 "IF_API_TYPE_P2P": 3,
101 "IF_API_TYPE_PIPE": 4,
105 func (x IfType) String() string {
106 s, ok := IfType_name[uint32(x)]
110 return "IfType(" + strconv.Itoa(int(x)) + ")"
113 // LinkDuplex defines enum 'link_duplex'.
114 type LinkDuplex uint32
117 LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
118 LINK_DUPLEX_API_HALF LinkDuplex = 1
119 LINK_DUPLEX_API_FULL LinkDuplex = 2
123 LinkDuplex_name = map[uint32]string{
124 0: "LINK_DUPLEX_API_UNKNOWN",
125 1: "LINK_DUPLEX_API_HALF",
126 2: "LINK_DUPLEX_API_FULL",
128 LinkDuplex_value = map[string]uint32{
129 "LINK_DUPLEX_API_UNKNOWN": 0,
130 "LINK_DUPLEX_API_HALF": 1,
131 "LINK_DUPLEX_API_FULL": 2,
135 func (x LinkDuplex) String() string {
136 s, ok := LinkDuplex_name[uint32(x)]
140 return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
143 // MtuProto defines enum 'mtu_proto'.
147 MTU_PROTO_API_L3 MtuProto = 1
148 MTU_PROTO_API_IP4 MtuProto = 2
149 MTU_PROTO_API_IP6 MtuProto = 3
150 MTU_PROTO_API_MPLS MtuProto = 4
151 MTU_PROTO_API_N MtuProto = 5
155 MtuProto_name = map[uint32]string{
156 1: "MTU_PROTO_API_L3",
157 2: "MTU_PROTO_API_IP4",
158 3: "MTU_PROTO_API_IP6",
159 4: "MTU_PROTO_API_MPLS",
160 5: "MTU_PROTO_API_N",
162 MtuProto_value = map[string]uint32{
163 "MTU_PROTO_API_L3": 1,
164 "MTU_PROTO_API_IP4": 2,
165 "MTU_PROTO_API_IP6": 3,
166 "MTU_PROTO_API_MPLS": 4,
167 "MTU_PROTO_API_N": 5,
171 func (x MtuProto) String() string {
172 s, ok := MtuProto_name[uint32(x)]
176 return "MtuProto(" + strconv.Itoa(int(x)) + ")"
179 // RxMode defines enum 'rx_mode'.
183 RX_MODE_API_UNKNOWN RxMode = 0
184 RX_MODE_API_POLLING RxMode = 1
185 RX_MODE_API_INTERRUPT RxMode = 2
186 RX_MODE_API_ADAPTIVE RxMode = 3
187 RX_MODE_API_DEFAULT RxMode = 4
191 RxMode_name = map[uint32]string{
192 0: "RX_MODE_API_UNKNOWN",
193 1: "RX_MODE_API_POLLING",
194 2: "RX_MODE_API_INTERRUPT",
195 3: "RX_MODE_API_ADAPTIVE",
196 4: "RX_MODE_API_DEFAULT",
198 RxMode_value = map[string]uint32{
199 "RX_MODE_API_UNKNOWN": 0,
200 "RX_MODE_API_POLLING": 1,
201 "RX_MODE_API_INTERRUPT": 2,
202 "RX_MODE_API_ADAPTIVE": 3,
203 "RX_MODE_API_DEFAULT": 4,
207 func (x RxMode) String() string {
208 s, ok := RxMode_name[uint32(x)]
212 return "RxMode(" + strconv.Itoa(int(x)) + ")"
215 // SubIfFlags defines enum 'sub_if_flags'.
216 type SubIfFlags uint32
219 SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
220 SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
221 SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
222 SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
223 SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
224 SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
225 SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
226 SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
227 SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
228 SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
232 SubIfFlags_name = map[uint32]string{
233 1: "SUB_IF_API_FLAG_NO_TAGS",
234 2: "SUB_IF_API_FLAG_ONE_TAG",
235 4: "SUB_IF_API_FLAG_TWO_TAGS",
236 8: "SUB_IF_API_FLAG_DOT1AD",
237 16: "SUB_IF_API_FLAG_EXACT_MATCH",
238 32: "SUB_IF_API_FLAG_DEFAULT",
239 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
240 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
241 254: "SUB_IF_API_FLAG_MASK_VNET",
242 256: "SUB_IF_API_FLAG_DOT1AH",
244 SubIfFlags_value = map[string]uint32{
245 "SUB_IF_API_FLAG_NO_TAGS": 1,
246 "SUB_IF_API_FLAG_ONE_TAG": 2,
247 "SUB_IF_API_FLAG_TWO_TAGS": 4,
248 "SUB_IF_API_FLAG_DOT1AD": 8,
249 "SUB_IF_API_FLAG_EXACT_MATCH": 16,
250 "SUB_IF_API_FLAG_DEFAULT": 32,
251 "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY": 64,
252 "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY": 128,
253 "SUB_IF_API_FLAG_MASK_VNET": 254,
254 "SUB_IF_API_FLAG_DOT1AH": 256,
258 func (x SubIfFlags) String() string {
259 s, ok := SubIfFlags_name[uint32(x)]
263 str := func(n uint32) string {
264 s, ok := SubIfFlags_name[uint32(n)]
268 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
270 for i := uint32(0); i <= 32; i++ {
280 return str(uint32(x))
285 // InterfaceIndex defines alias 'interface_index'.
286 type InterfaceIndex uint32
288 // PipeCreate defines message 'pipe_create'.
289 type PipeCreate struct {
290 IsSpecified bool `binapi:"bool,name=is_specified" json:"is_specified,omitempty"`
291 UserInstance uint32 `binapi:"u32,name=user_instance" json:"user_instance,omitempty"`
294 func (m *PipeCreate) Reset() { *m = PipeCreate{} }
295 func (*PipeCreate) GetMessageName() string { return "pipe_create" }
296 func (*PipeCreate) GetCrcString() string { return "bb263bd3" }
297 func (*PipeCreate) GetMessageType() api.MessageType {
298 return api.RequestMessage
301 func (m *PipeCreate) Size() (size int) {
305 size += 1 // m.IsSpecified
306 size += 4 // m.UserInstance
309 func (m *PipeCreate) Marshal(b []byte) ([]byte, error) {
311 b = make([]byte, m.Size())
313 buf := codec.NewBuffer(b)
314 buf.EncodeBool(m.IsSpecified)
315 buf.EncodeUint32(m.UserInstance)
316 return buf.Bytes(), nil
318 func (m *PipeCreate) Unmarshal(b []byte) error {
319 buf := codec.NewBuffer(b)
320 m.IsSpecified = buf.DecodeBool()
321 m.UserInstance = buf.DecodeUint32()
325 // PipeCreateReply defines message 'pipe_create_reply'.
326 type PipeCreateReply struct {
327 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
328 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
329 PipeSwIfIndex [2]InterfaceIndex `binapi:"interface_index[2],name=pipe_sw_if_index" json:"pipe_sw_if_index,omitempty"`
332 func (m *PipeCreateReply) Reset() { *m = PipeCreateReply{} }
333 func (*PipeCreateReply) GetMessageName() string { return "pipe_create_reply" }
334 func (*PipeCreateReply) GetCrcString() string { return "d4c2c2b3" }
335 func (*PipeCreateReply) GetMessageType() api.MessageType {
336 return api.ReplyMessage
339 func (m *PipeCreateReply) Size() (size int) {
343 size += 4 // m.Retval
344 size += 4 // m.SwIfIndex
345 for j1 := 0; j1 < 2; j1++ {
346 size += 4 // m.PipeSwIfIndex[j1]
350 func (m *PipeCreateReply) Marshal(b []byte) ([]byte, error) {
352 b = make([]byte, m.Size())
354 buf := codec.NewBuffer(b)
355 buf.EncodeInt32(m.Retval)
356 buf.EncodeUint32(uint32(m.SwIfIndex))
357 for j0 := 0; j0 < 2; j0++ {
358 buf.EncodeUint32(uint32(m.PipeSwIfIndex[j0]))
360 return buf.Bytes(), nil
362 func (m *PipeCreateReply) Unmarshal(b []byte) error {
363 buf := codec.NewBuffer(b)
364 m.Retval = buf.DecodeInt32()
365 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
366 for j0 := 0; j0 < 2; j0++ {
367 m.PipeSwIfIndex[j0] = InterfaceIndex(buf.DecodeUint32())
372 // PipeDelete defines message 'pipe_delete'.
373 type PipeDelete struct {
374 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
377 func (m *PipeDelete) Reset() { *m = PipeDelete{} }
378 func (*PipeDelete) GetMessageName() string { return "pipe_delete" }
379 func (*PipeDelete) GetCrcString() string { return "f9e6675e" }
380 func (*PipeDelete) GetMessageType() api.MessageType {
381 return api.RequestMessage
384 func (m *PipeDelete) Size() (size int) {
388 size += 4 // m.SwIfIndex
391 func (m *PipeDelete) Marshal(b []byte) ([]byte, error) {
393 b = make([]byte, m.Size())
395 buf := codec.NewBuffer(b)
396 buf.EncodeUint32(uint32(m.SwIfIndex))
397 return buf.Bytes(), nil
399 func (m *PipeDelete) Unmarshal(b []byte) error {
400 buf := codec.NewBuffer(b)
401 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
405 // PipeDeleteReply defines message 'pipe_delete_reply'.
406 type PipeDeleteReply struct {
407 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
410 func (m *PipeDeleteReply) Reset() { *m = PipeDeleteReply{} }
411 func (*PipeDeleteReply) GetMessageName() string { return "pipe_delete_reply" }
412 func (*PipeDeleteReply) GetCrcString() string { return "e8d4e804" }
413 func (*PipeDeleteReply) GetMessageType() api.MessageType {
414 return api.ReplyMessage
417 func (m *PipeDeleteReply) Size() (size int) {
421 size += 4 // m.Retval
424 func (m *PipeDeleteReply) Marshal(b []byte) ([]byte, error) {
426 b = make([]byte, m.Size())
428 buf := codec.NewBuffer(b)
429 buf.EncodeInt32(m.Retval)
430 return buf.Bytes(), nil
432 func (m *PipeDeleteReply) Unmarshal(b []byte) error {
433 buf := codec.NewBuffer(b)
434 m.Retval = buf.DecodeInt32()
438 // PipeDetails defines message 'pipe_details'.
439 type PipeDetails struct {
440 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
441 PipeSwIfIndex [2]InterfaceIndex `binapi:"interface_index[2],name=pipe_sw_if_index" json:"pipe_sw_if_index,omitempty"`
442 Instance uint32 `binapi:"u32,name=instance" json:"instance,omitempty"`
445 func (m *PipeDetails) Reset() { *m = PipeDetails{} }
446 func (*PipeDetails) GetMessageName() string { return "pipe_details" }
447 func (*PipeDetails) GetCrcString() string { return "43ac107a" }
448 func (*PipeDetails) GetMessageType() api.MessageType {
449 return api.ReplyMessage
452 func (m *PipeDetails) Size() (size int) {
456 size += 4 // m.SwIfIndex
457 for j1 := 0; j1 < 2; j1++ {
458 size += 4 // m.PipeSwIfIndex[j1]
460 size += 4 // m.Instance
463 func (m *PipeDetails) Marshal(b []byte) ([]byte, error) {
465 b = make([]byte, m.Size())
467 buf := codec.NewBuffer(b)
468 buf.EncodeUint32(uint32(m.SwIfIndex))
469 for j0 := 0; j0 < 2; j0++ {
470 buf.EncodeUint32(uint32(m.PipeSwIfIndex[j0]))
472 buf.EncodeUint32(m.Instance)
473 return buf.Bytes(), nil
475 func (m *PipeDetails) Unmarshal(b []byte) error {
476 buf := codec.NewBuffer(b)
477 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
478 for j0 := 0; j0 < 2; j0++ {
479 m.PipeSwIfIndex[j0] = InterfaceIndex(buf.DecodeUint32())
481 m.Instance = buf.DecodeUint32()
485 // PipeDump defines message 'pipe_dump'.
486 type PipeDump struct{}
488 func (m *PipeDump) Reset() { *m = PipeDump{} }
489 func (*PipeDump) GetMessageName() string { return "pipe_dump" }
490 func (*PipeDump) GetCrcString() string { return "51077d14" }
491 func (*PipeDump) GetMessageType() api.MessageType {
492 return api.RequestMessage
495 func (m *PipeDump) Size() (size int) {
501 func (m *PipeDump) Marshal(b []byte) ([]byte, error) {
503 b = make([]byte, m.Size())
505 buf := codec.NewBuffer(b)
506 return buf.Bytes(), nil
508 func (m *PipeDump) Unmarshal(b []byte) error {
512 func init() { file_pipe_binapi_init() }
513 func file_pipe_binapi_init() {
514 api.RegisterMessage((*PipeCreate)(nil), "pipe_create_bb263bd3")
515 api.RegisterMessage((*PipeCreateReply)(nil), "pipe_create_reply_d4c2c2b3")
516 api.RegisterMessage((*PipeDelete)(nil), "pipe_delete_f9e6675e")
517 api.RegisterMessage((*PipeDeleteReply)(nil), "pipe_delete_reply_e8d4e804")
518 api.RegisterMessage((*PipeDetails)(nil), "pipe_details_43ac107a")
519 api.RegisterMessage((*PipeDump)(nil), "pipe_dump_51077d14")
522 // Messages returns list of all messages in this module.
523 func AllMessages() []api.Message {
524 return []api.Message{
526 (*PipeCreateReply)(nil),
528 (*PipeDeleteReply)(nil),