1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0
4 // VPP: 20.05.1-release
5 // source: /usr/share/vpp/api/plugins/rdma.api.json
7 // Package rdma contains generated bindings for API file rdma.api.
18 api "git.fd.io/govpp.git/api"
19 interface_types "git.fd.io/govpp.git/binapi/interface_types"
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 = 0x8b33158c
35 // RdmaMode defines enum 'rdma_mode'.
39 RDMA_API_MODE_AUTO RdmaMode = 0
40 RDMA_API_MODE_IBV RdmaMode = 1
41 RDMA_API_MODE_DV RdmaMode = 2
45 RdmaMode_name = map[uint32]string{
46 0: "RDMA_API_MODE_AUTO",
47 1: "RDMA_API_MODE_IBV",
48 2: "RDMA_API_MODE_DV",
50 RdmaMode_value = map[string]uint32{
51 "RDMA_API_MODE_AUTO": 0,
52 "RDMA_API_MODE_IBV": 1,
53 "RDMA_API_MODE_DV": 2,
57 func (x RdmaMode) String() string {
58 s, ok := RdmaMode_name[uint32(x)]
62 return "RdmaMode(" + strconv.Itoa(int(x)) + ")"
65 // RdmaCreate defines message 'rdma_create'.
66 type RdmaCreate struct {
67 HostIf string `binapi:"string[64],name=host_if" json:"host_if,omitempty"`
68 Name string `binapi:"string[64],name=name" json:"name,omitempty"`
69 RxqNum uint16 `binapi:"u16,name=rxq_num,default=1" json:"rxq_num,omitempty"`
70 RxqSize uint16 `binapi:"u16,name=rxq_size,default=1024" json:"rxq_size,omitempty"`
71 TxqSize uint16 `binapi:"u16,name=txq_size,default=1024" json:"txq_size,omitempty"`
72 Mode RdmaMode `binapi:"rdma_mode,name=mode,default=0" json:"mode,omitempty"`
75 func (m *RdmaCreate) Reset() { *m = RdmaCreate{} }
76 func (*RdmaCreate) GetMessageName() string { return "rdma_create" }
77 func (*RdmaCreate) GetCrcString() string { return "076fe418" }
78 func (*RdmaCreate) GetMessageType() api.MessageType {
79 return api.RequestMessage
82 func (m *RdmaCreate) Size() (size int) {
86 size += 64 // m.HostIf
89 size += 2 // m.RxqSize
90 size += 2 // m.TxqSize
94 func (m *RdmaCreate) Marshal(b []byte) ([]byte, error) {
96 b = make([]byte, m.Size())
98 buf := codec.NewBuffer(b)
99 buf.EncodeString(m.HostIf, 64)
100 buf.EncodeString(m.Name, 64)
101 buf.EncodeUint16(m.RxqNum)
102 buf.EncodeUint16(m.RxqSize)
103 buf.EncodeUint16(m.TxqSize)
104 buf.EncodeUint32(uint32(m.Mode))
105 return buf.Bytes(), nil
107 func (m *RdmaCreate) Unmarshal(b []byte) error {
108 buf := codec.NewBuffer(b)
109 m.HostIf = buf.DecodeString(64)
110 m.Name = buf.DecodeString(64)
111 m.RxqNum = buf.DecodeUint16()
112 m.RxqSize = buf.DecodeUint16()
113 m.TxqSize = buf.DecodeUint16()
114 m.Mode = RdmaMode(buf.DecodeUint32())
118 // RdmaCreateReply defines message 'rdma_create_reply'.
119 type RdmaCreateReply struct {
120 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
121 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
124 func (m *RdmaCreateReply) Reset() { *m = RdmaCreateReply{} }
125 func (*RdmaCreateReply) GetMessageName() string { return "rdma_create_reply" }
126 func (*RdmaCreateReply) GetCrcString() string { return "5383d31f" }
127 func (*RdmaCreateReply) GetMessageType() api.MessageType {
128 return api.ReplyMessage
131 func (m *RdmaCreateReply) Size() (size int) {
135 size += 4 // m.Retval
136 size += 4 // m.SwIfIndex
139 func (m *RdmaCreateReply) Marshal(b []byte) ([]byte, error) {
141 b = make([]byte, m.Size())
143 buf := codec.NewBuffer(b)
144 buf.EncodeInt32(m.Retval)
145 buf.EncodeUint32(uint32(m.SwIfIndex))
146 return buf.Bytes(), nil
148 func (m *RdmaCreateReply) Unmarshal(b []byte) error {
149 buf := codec.NewBuffer(b)
150 m.Retval = buf.DecodeInt32()
151 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
155 // RdmaDelete defines message 'rdma_delete'.
156 type RdmaDelete struct {
157 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
160 func (m *RdmaDelete) Reset() { *m = RdmaDelete{} }
161 func (*RdmaDelete) GetMessageName() string { return "rdma_delete" }
162 func (*RdmaDelete) GetCrcString() string { return "f9e6675e" }
163 func (*RdmaDelete) GetMessageType() api.MessageType {
164 return api.RequestMessage
167 func (m *RdmaDelete) Size() (size int) {
171 size += 4 // m.SwIfIndex
174 func (m *RdmaDelete) Marshal(b []byte) ([]byte, error) {
176 b = make([]byte, m.Size())
178 buf := codec.NewBuffer(b)
179 buf.EncodeUint32(uint32(m.SwIfIndex))
180 return buf.Bytes(), nil
182 func (m *RdmaDelete) Unmarshal(b []byte) error {
183 buf := codec.NewBuffer(b)
184 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
188 // RdmaDeleteReply defines message 'rdma_delete_reply'.
189 type RdmaDeleteReply struct {
190 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
193 func (m *RdmaDeleteReply) Reset() { *m = RdmaDeleteReply{} }
194 func (*RdmaDeleteReply) GetMessageName() string { return "rdma_delete_reply" }
195 func (*RdmaDeleteReply) GetCrcString() string { return "e8d4e804" }
196 func (*RdmaDeleteReply) GetMessageType() api.MessageType {
197 return api.ReplyMessage
200 func (m *RdmaDeleteReply) Size() (size int) {
204 size += 4 // m.Retval
207 func (m *RdmaDeleteReply) Marshal(b []byte) ([]byte, error) {
209 b = make([]byte, m.Size())
211 buf := codec.NewBuffer(b)
212 buf.EncodeInt32(m.Retval)
213 return buf.Bytes(), nil
215 func (m *RdmaDeleteReply) Unmarshal(b []byte) error {
216 buf := codec.NewBuffer(b)
217 m.Retval = buf.DecodeInt32()
221 func init() { file_rdma_binapi_init() }
222 func file_rdma_binapi_init() {
223 api.RegisterMessage((*RdmaCreate)(nil), "rdma_create_076fe418")
224 api.RegisterMessage((*RdmaCreateReply)(nil), "rdma_create_reply_5383d31f")
225 api.RegisterMessage((*RdmaDelete)(nil), "rdma_delete_f9e6675e")
226 api.RegisterMessage((*RdmaDeleteReply)(nil), "rdma_delete_reply_e8d4e804")
229 // Messages returns list of all messages in this module.
230 func AllMessages() []api.Message {
231 return []api.Message{
233 (*RdmaCreateReply)(nil),
235 (*RdmaDeleteReply)(nil),