1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
5 // source: .vppapi/plugins/rdma.api.json
7 // Package rdma contains generated bindings for API file rdma.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 = 0x5ce233e0
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 // RdmaMode defines enum 'rdma_mode'.
183 RDMA_API_MODE_AUTO RdmaMode = 0
184 RDMA_API_MODE_IBV RdmaMode = 1
185 RDMA_API_MODE_DV RdmaMode = 2
189 RdmaMode_name = map[uint32]string{
190 0: "RDMA_API_MODE_AUTO",
191 1: "RDMA_API_MODE_IBV",
192 2: "RDMA_API_MODE_DV",
194 RdmaMode_value = map[string]uint32{
195 "RDMA_API_MODE_AUTO": 0,
196 "RDMA_API_MODE_IBV": 1,
197 "RDMA_API_MODE_DV": 2,
201 func (x RdmaMode) String() string {
202 s, ok := RdmaMode_name[uint32(x)]
206 return "RdmaMode(" + strconv.Itoa(int(x)) + ")"
209 // RxMode defines enum 'rx_mode'.
213 RX_MODE_API_UNKNOWN RxMode = 0
214 RX_MODE_API_POLLING RxMode = 1
215 RX_MODE_API_INTERRUPT RxMode = 2
216 RX_MODE_API_ADAPTIVE RxMode = 3
217 RX_MODE_API_DEFAULT RxMode = 4
221 RxMode_name = map[uint32]string{
222 0: "RX_MODE_API_UNKNOWN",
223 1: "RX_MODE_API_POLLING",
224 2: "RX_MODE_API_INTERRUPT",
225 3: "RX_MODE_API_ADAPTIVE",
226 4: "RX_MODE_API_DEFAULT",
228 RxMode_value = map[string]uint32{
229 "RX_MODE_API_UNKNOWN": 0,
230 "RX_MODE_API_POLLING": 1,
231 "RX_MODE_API_INTERRUPT": 2,
232 "RX_MODE_API_ADAPTIVE": 3,
233 "RX_MODE_API_DEFAULT": 4,
237 func (x RxMode) String() string {
238 s, ok := RxMode_name[uint32(x)]
242 return "RxMode(" + strconv.Itoa(int(x)) + ")"
245 // SubIfFlags defines enum 'sub_if_flags'.
246 type SubIfFlags uint32
249 SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
250 SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
251 SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
252 SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
253 SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
254 SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
255 SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
256 SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
257 SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
258 SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
262 SubIfFlags_name = map[uint32]string{
263 1: "SUB_IF_API_FLAG_NO_TAGS",
264 2: "SUB_IF_API_FLAG_ONE_TAG",
265 4: "SUB_IF_API_FLAG_TWO_TAGS",
266 8: "SUB_IF_API_FLAG_DOT1AD",
267 16: "SUB_IF_API_FLAG_EXACT_MATCH",
268 32: "SUB_IF_API_FLAG_DEFAULT",
269 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
270 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
271 254: "SUB_IF_API_FLAG_MASK_VNET",
272 256: "SUB_IF_API_FLAG_DOT1AH",
274 SubIfFlags_value = map[string]uint32{
275 "SUB_IF_API_FLAG_NO_TAGS": 1,
276 "SUB_IF_API_FLAG_ONE_TAG": 2,
277 "SUB_IF_API_FLAG_TWO_TAGS": 4,
278 "SUB_IF_API_FLAG_DOT1AD": 8,
279 "SUB_IF_API_FLAG_EXACT_MATCH": 16,
280 "SUB_IF_API_FLAG_DEFAULT": 32,
281 "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY": 64,
282 "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY": 128,
283 "SUB_IF_API_FLAG_MASK_VNET": 254,
284 "SUB_IF_API_FLAG_DOT1AH": 256,
288 func (x SubIfFlags) String() string {
289 s, ok := SubIfFlags_name[uint32(x)]
293 str := func(n uint32) string {
294 s, ok := SubIfFlags_name[uint32(n)]
298 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
300 for i := uint32(0); i <= 32; i++ {
310 return str(uint32(x))
315 // InterfaceIndex defines alias 'interface_index'.
316 type InterfaceIndex uint32
318 // RdmaCreate defines message 'rdma_create'.
319 type RdmaCreate struct {
320 HostIf string `binapi:"string[64],name=host_if" json:"host_if,omitempty"`
321 Name string `binapi:"string[64],name=name" json:"name,omitempty"`
322 RxqNum uint16 `binapi:"u16,name=rxq_num,default=1" json:"rxq_num,omitempty"`
323 RxqSize uint16 `binapi:"u16,name=rxq_size,default=1024" json:"rxq_size,omitempty"`
324 TxqSize uint16 `binapi:"u16,name=txq_size,default=1024" json:"txq_size,omitempty"`
325 Mode RdmaMode `binapi:"rdma_mode,name=mode,default=0" json:"mode,omitempty"`
328 func (m *RdmaCreate) Reset() { *m = RdmaCreate{} }
329 func (*RdmaCreate) GetMessageName() string { return "rdma_create" }
330 func (*RdmaCreate) GetCrcString() string { return "076fe418" }
331 func (*RdmaCreate) GetMessageType() api.MessageType {
332 return api.RequestMessage
335 func (m *RdmaCreate) Size() (size int) {
339 size += 64 // m.HostIf
341 size += 2 // m.RxqNum
342 size += 2 // m.RxqSize
343 size += 2 // m.TxqSize
347 func (m *RdmaCreate) Marshal(b []byte) ([]byte, error) {
349 b = make([]byte, m.Size())
351 buf := codec.NewBuffer(b)
352 buf.EncodeString(m.HostIf, 64)
353 buf.EncodeString(m.Name, 64)
354 buf.EncodeUint16(m.RxqNum)
355 buf.EncodeUint16(m.RxqSize)
356 buf.EncodeUint16(m.TxqSize)
357 buf.EncodeUint32(uint32(m.Mode))
358 return buf.Bytes(), nil
360 func (m *RdmaCreate) Unmarshal(b []byte) error {
361 buf := codec.NewBuffer(b)
362 m.HostIf = buf.DecodeString(64)
363 m.Name = buf.DecodeString(64)
364 m.RxqNum = buf.DecodeUint16()
365 m.RxqSize = buf.DecodeUint16()
366 m.TxqSize = buf.DecodeUint16()
367 m.Mode = RdmaMode(buf.DecodeUint32())
371 // RdmaCreateReply defines message 'rdma_create_reply'.
372 type RdmaCreateReply struct {
373 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
374 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
377 func (m *RdmaCreateReply) Reset() { *m = RdmaCreateReply{} }
378 func (*RdmaCreateReply) GetMessageName() string { return "rdma_create_reply" }
379 func (*RdmaCreateReply) GetCrcString() string { return "5383d31f" }
380 func (*RdmaCreateReply) GetMessageType() api.MessageType {
381 return api.ReplyMessage
384 func (m *RdmaCreateReply) Size() (size int) {
388 size += 4 // m.Retval
389 size += 4 // m.SwIfIndex
392 func (m *RdmaCreateReply) Marshal(b []byte) ([]byte, error) {
394 b = make([]byte, m.Size())
396 buf := codec.NewBuffer(b)
397 buf.EncodeInt32(m.Retval)
398 buf.EncodeUint32(uint32(m.SwIfIndex))
399 return buf.Bytes(), nil
401 func (m *RdmaCreateReply) Unmarshal(b []byte) error {
402 buf := codec.NewBuffer(b)
403 m.Retval = buf.DecodeInt32()
404 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
408 // RdmaDelete defines message 'rdma_delete'.
409 type RdmaDelete struct {
410 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
413 func (m *RdmaDelete) Reset() { *m = RdmaDelete{} }
414 func (*RdmaDelete) GetMessageName() string { return "rdma_delete" }
415 func (*RdmaDelete) GetCrcString() string { return "f9e6675e" }
416 func (*RdmaDelete) GetMessageType() api.MessageType {
417 return api.RequestMessage
420 func (m *RdmaDelete) Size() (size int) {
424 size += 4 // m.SwIfIndex
427 func (m *RdmaDelete) Marshal(b []byte) ([]byte, error) {
429 b = make([]byte, m.Size())
431 buf := codec.NewBuffer(b)
432 buf.EncodeUint32(uint32(m.SwIfIndex))
433 return buf.Bytes(), nil
435 func (m *RdmaDelete) Unmarshal(b []byte) error {
436 buf := codec.NewBuffer(b)
437 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
441 // RdmaDeleteReply defines message 'rdma_delete_reply'.
442 type RdmaDeleteReply struct {
443 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
446 func (m *RdmaDeleteReply) Reset() { *m = RdmaDeleteReply{} }
447 func (*RdmaDeleteReply) GetMessageName() string { return "rdma_delete_reply" }
448 func (*RdmaDeleteReply) GetCrcString() string { return "e8d4e804" }
449 func (*RdmaDeleteReply) GetMessageType() api.MessageType {
450 return api.ReplyMessage
453 func (m *RdmaDeleteReply) Size() (size int) {
457 size += 4 // m.Retval
460 func (m *RdmaDeleteReply) Marshal(b []byte) ([]byte, error) {
462 b = make([]byte, m.Size())
464 buf := codec.NewBuffer(b)
465 buf.EncodeInt32(m.Retval)
466 return buf.Bytes(), nil
468 func (m *RdmaDeleteReply) Unmarshal(b []byte) error {
469 buf := codec.NewBuffer(b)
470 m.Retval = buf.DecodeInt32()
474 func init() { file_rdma_binapi_init() }
475 func file_rdma_binapi_init() {
476 api.RegisterMessage((*RdmaCreate)(nil), "rdma_create_076fe418")
477 api.RegisterMessage((*RdmaCreateReply)(nil), "rdma_create_reply_5383d31f")
478 api.RegisterMessage((*RdmaDelete)(nil), "rdma_delete_f9e6675e")
479 api.RegisterMessage((*RdmaDeleteReply)(nil), "rdma_delete_reply_e8d4e804")
482 // Messages returns list of all messages in this module.
483 func AllMessages() []api.Message {
484 return []api.Message{
486 (*RdmaCreateReply)(nil),
488 (*RdmaDeleteReply)(nil),