1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.5.0-dev
5 // source: .vppapi/plugins/rdma.api.json
7 // Package rdma contains generated bindings for API file rdma.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 = 0x5ce233e0
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 // RdmaMode defines enum 'rdma_mode'.
184 RDMA_API_MODE_AUTO RdmaMode = 0
185 RDMA_API_MODE_IBV RdmaMode = 1
186 RDMA_API_MODE_DV RdmaMode = 2
190 RdmaMode_name = map[uint32]string{
191 0: "RDMA_API_MODE_AUTO",
192 1: "RDMA_API_MODE_IBV",
193 2: "RDMA_API_MODE_DV",
195 RdmaMode_value = map[string]uint32{
196 "RDMA_API_MODE_AUTO": 0,
197 "RDMA_API_MODE_IBV": 1,
198 "RDMA_API_MODE_DV": 2,
202 func (x RdmaMode) String() string {
203 s, ok := RdmaMode_name[uint32(x)]
207 return "RdmaMode(" + strconv.Itoa(int(x)) + ")"
210 // RxMode defines enum 'rx_mode'.
214 RX_MODE_API_UNKNOWN RxMode = 0
215 RX_MODE_API_POLLING RxMode = 1
216 RX_MODE_API_INTERRUPT RxMode = 2
217 RX_MODE_API_ADAPTIVE RxMode = 3
218 RX_MODE_API_DEFAULT RxMode = 4
222 RxMode_name = map[uint32]string{
223 0: "RX_MODE_API_UNKNOWN",
224 1: "RX_MODE_API_POLLING",
225 2: "RX_MODE_API_INTERRUPT",
226 3: "RX_MODE_API_ADAPTIVE",
227 4: "RX_MODE_API_DEFAULT",
229 RxMode_value = map[string]uint32{
230 "RX_MODE_API_UNKNOWN": 0,
231 "RX_MODE_API_POLLING": 1,
232 "RX_MODE_API_INTERRUPT": 2,
233 "RX_MODE_API_ADAPTIVE": 3,
234 "RX_MODE_API_DEFAULT": 4,
238 func (x RxMode) String() string {
239 s, ok := RxMode_name[uint32(x)]
243 return "RxMode(" + strconv.Itoa(int(x)) + ")"
246 // SubIfFlags defines enum 'sub_if_flags'.
247 type SubIfFlags uint32
250 SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
251 SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
252 SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
253 SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
254 SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
255 SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
256 SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
257 SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
258 SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
259 SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
263 SubIfFlags_name = map[uint32]string{
264 1: "SUB_IF_API_FLAG_NO_TAGS",
265 2: "SUB_IF_API_FLAG_ONE_TAG",
266 4: "SUB_IF_API_FLAG_TWO_TAGS",
267 8: "SUB_IF_API_FLAG_DOT1AD",
268 16: "SUB_IF_API_FLAG_EXACT_MATCH",
269 32: "SUB_IF_API_FLAG_DEFAULT",
270 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
271 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
272 254: "SUB_IF_API_FLAG_MASK_VNET",
273 256: "SUB_IF_API_FLAG_DOT1AH",
275 SubIfFlags_value = map[string]uint32{
276 "SUB_IF_API_FLAG_NO_TAGS": 1,
277 "SUB_IF_API_FLAG_ONE_TAG": 2,
278 "SUB_IF_API_FLAG_TWO_TAGS": 4,
279 "SUB_IF_API_FLAG_DOT1AD": 8,
280 "SUB_IF_API_FLAG_EXACT_MATCH": 16,
281 "SUB_IF_API_FLAG_DEFAULT": 32,
282 "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY": 64,
283 "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY": 128,
284 "SUB_IF_API_FLAG_MASK_VNET": 254,
285 "SUB_IF_API_FLAG_DOT1AH": 256,
289 func (x SubIfFlags) String() string {
290 s, ok := SubIfFlags_name[uint32(x)]
294 str := func(n uint32) string {
295 s, ok := SubIfFlags_name[uint32(n)]
299 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
301 for i := uint32(0); i <= 32; i++ {
311 return str(uint32(x))
316 // InterfaceIndex defines alias 'interface_index'.
317 type InterfaceIndex uint32
319 // RdmaCreate defines message 'rdma_create'.
320 type RdmaCreate struct {
321 HostIf string `binapi:"string[64],name=host_if" json:"host_if,omitempty"`
322 Name string `binapi:"string[64],name=name" json:"name,omitempty"`
323 RxqNum uint16 `binapi:"u16,name=rxq_num,default=1" json:"rxq_num,omitempty"`
324 RxqSize uint16 `binapi:"u16,name=rxq_size,default=1024" json:"rxq_size,omitempty"`
325 TxqSize uint16 `binapi:"u16,name=txq_size,default=1024" json:"txq_size,omitempty"`
326 Mode RdmaMode `binapi:"rdma_mode,name=mode,default=0" json:"mode,omitempty"`
329 func (m *RdmaCreate) Reset() { *m = RdmaCreate{} }
330 func (*RdmaCreate) GetMessageName() string { return "rdma_create" }
331 func (*RdmaCreate) GetCrcString() string { return "076fe418" }
332 func (*RdmaCreate) GetMessageType() api.MessageType {
333 return api.RequestMessage
336 func (m *RdmaCreate) Size() (size int) {
340 size += 64 // m.HostIf
342 size += 2 // m.RxqNum
343 size += 2 // m.RxqSize
344 size += 2 // m.TxqSize
348 func (m *RdmaCreate) Marshal(b []byte) ([]byte, error) {
350 b = make([]byte, m.Size())
352 buf := codec.NewBuffer(b)
353 buf.EncodeString(m.HostIf, 64)
354 buf.EncodeString(m.Name, 64)
355 buf.EncodeUint16(m.RxqNum)
356 buf.EncodeUint16(m.RxqSize)
357 buf.EncodeUint16(m.TxqSize)
358 buf.EncodeUint32(uint32(m.Mode))
359 return buf.Bytes(), nil
361 func (m *RdmaCreate) Unmarshal(b []byte) error {
362 buf := codec.NewBuffer(b)
363 m.HostIf = buf.DecodeString(64)
364 m.Name = buf.DecodeString(64)
365 m.RxqNum = buf.DecodeUint16()
366 m.RxqSize = buf.DecodeUint16()
367 m.TxqSize = buf.DecodeUint16()
368 m.Mode = RdmaMode(buf.DecodeUint32())
372 // RdmaCreateReply defines message 'rdma_create_reply'.
373 type RdmaCreateReply struct {
374 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
375 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
378 func (m *RdmaCreateReply) Reset() { *m = RdmaCreateReply{} }
379 func (*RdmaCreateReply) GetMessageName() string { return "rdma_create_reply" }
380 func (*RdmaCreateReply) GetCrcString() string { return "5383d31f" }
381 func (*RdmaCreateReply) GetMessageType() api.MessageType {
382 return api.ReplyMessage
385 func (m *RdmaCreateReply) Size() (size int) {
389 size += 4 // m.Retval
390 size += 4 // m.SwIfIndex
393 func (m *RdmaCreateReply) Marshal(b []byte) ([]byte, error) {
395 b = make([]byte, m.Size())
397 buf := codec.NewBuffer(b)
398 buf.EncodeInt32(m.Retval)
399 buf.EncodeUint32(uint32(m.SwIfIndex))
400 return buf.Bytes(), nil
402 func (m *RdmaCreateReply) Unmarshal(b []byte) error {
403 buf := codec.NewBuffer(b)
404 m.Retval = buf.DecodeInt32()
405 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
409 // RdmaDelete defines message 'rdma_delete'.
410 type RdmaDelete struct {
411 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
414 func (m *RdmaDelete) Reset() { *m = RdmaDelete{} }
415 func (*RdmaDelete) GetMessageName() string { return "rdma_delete" }
416 func (*RdmaDelete) GetCrcString() string { return "f9e6675e" }
417 func (*RdmaDelete) GetMessageType() api.MessageType {
418 return api.RequestMessage
421 func (m *RdmaDelete) Size() (size int) {
425 size += 4 // m.SwIfIndex
428 func (m *RdmaDelete) Marshal(b []byte) ([]byte, error) {
430 b = make([]byte, m.Size())
432 buf := codec.NewBuffer(b)
433 buf.EncodeUint32(uint32(m.SwIfIndex))
434 return buf.Bytes(), nil
436 func (m *RdmaDelete) Unmarshal(b []byte) error {
437 buf := codec.NewBuffer(b)
438 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
442 // RdmaDeleteReply defines message 'rdma_delete_reply'.
443 type RdmaDeleteReply struct {
444 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
447 func (m *RdmaDeleteReply) Reset() { *m = RdmaDeleteReply{} }
448 func (*RdmaDeleteReply) GetMessageName() string { return "rdma_delete_reply" }
449 func (*RdmaDeleteReply) GetCrcString() string { return "e8d4e804" }
450 func (*RdmaDeleteReply) GetMessageType() api.MessageType {
451 return api.ReplyMessage
454 func (m *RdmaDeleteReply) Size() (size int) {
458 size += 4 // m.Retval
461 func (m *RdmaDeleteReply) Marshal(b []byte) ([]byte, error) {
463 b = make([]byte, m.Size())
465 buf := codec.NewBuffer(b)
466 buf.EncodeInt32(m.Retval)
467 return buf.Bytes(), nil
469 func (m *RdmaDeleteReply) Unmarshal(b []byte) error {
470 buf := codec.NewBuffer(b)
471 m.Retval = buf.DecodeInt32()
475 func init() { file_rdma_binapi_init() }
476 func file_rdma_binapi_init() {
477 api.RegisterMessage((*RdmaCreate)(nil), "rdma_create_076fe418")
478 api.RegisterMessage((*RdmaCreateReply)(nil), "rdma_create_reply_5383d31f")
479 api.RegisterMessage((*RdmaDelete)(nil), "rdma_delete_f9e6675e")
480 api.RegisterMessage((*RdmaDeleteReply)(nil), "rdma_delete_reply_e8d4e804")
483 // Messages returns list of all messages in this module.
484 func AllMessages() []api.Message {
485 return []api.Message{
487 (*RdmaCreateReply)(nil),
489 (*RdmaDeleteReply)(nil),