1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
5 // source: /usr/share/vpp/api/plugins/rdma.api.json
7 // Package rdma contains generated bindings for API file rdma.api.
16 api "git.fd.io/govpp.git/api"
17 interface_types "git.fd.io/govpp.git/binapi/interface_types"
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 = 0x8b33158c
34 // RdmaMode defines enum 'rdma_mode'.
38 RDMA_API_MODE_AUTO RdmaMode = 0
39 RDMA_API_MODE_IBV RdmaMode = 1
40 RDMA_API_MODE_DV RdmaMode = 2
44 RdmaMode_name = map[uint32]string{
45 0: "RDMA_API_MODE_AUTO",
46 1: "RDMA_API_MODE_IBV",
47 2: "RDMA_API_MODE_DV",
49 RdmaMode_value = map[string]uint32{
50 "RDMA_API_MODE_AUTO": 0,
51 "RDMA_API_MODE_IBV": 1,
52 "RDMA_API_MODE_DV": 2,
56 func (x RdmaMode) String() string {
57 s, ok := RdmaMode_name[uint32(x)]
61 return "RdmaMode(" + strconv.Itoa(int(x)) + ")"
64 // RdmaCreate defines message 'rdma_create'.
65 type RdmaCreate struct {
66 HostIf string `binapi:"string[64],name=host_if" json:"host_if,omitempty"`
67 Name string `binapi:"string[64],name=name" json:"name,omitempty"`
68 RxqNum uint16 `binapi:"u16,name=rxq_num,default=%!s(float64=1)" json:"rxq_num,omitempty"`
69 RxqSize uint16 `binapi:"u16,name=rxq_size,default=%!s(float64=1024)" json:"rxq_size,omitempty"`
70 TxqSize uint16 `binapi:"u16,name=txq_size,default=%!s(float64=1024)" json:"txq_size,omitempty"`
71 Mode RdmaMode `binapi:"rdma_mode,name=mode,default=%!s(float64=0)" json:"mode,omitempty"`
74 func (m *RdmaCreate) Reset() { *m = RdmaCreate{} }
75 func (*RdmaCreate) GetMessageName() string { return "rdma_create" }
76 func (*RdmaCreate) GetCrcString() string { return "076fe418" }
77 func (*RdmaCreate) GetMessageType() api.MessageType {
78 return api.RequestMessage
81 func (m *RdmaCreate) 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) {
97 buf = codec.NewBuffer(make([]byte, m.Size()))
99 buf = codec.NewBuffer(b)
101 buf.EncodeString(m.HostIf, 64)
102 buf.EncodeString(m.Name, 64)
103 buf.EncodeUint16(uint16(m.RxqNum))
104 buf.EncodeUint16(uint16(m.RxqSize))
105 buf.EncodeUint16(uint16(m.TxqSize))
106 buf.EncodeUint32(uint32(m.Mode))
107 return buf.Bytes(), nil
109 func (m *RdmaCreate) Unmarshal(b []byte) error {
110 buf := codec.NewBuffer(b)
111 m.HostIf = buf.DecodeString(64)
112 m.Name = buf.DecodeString(64)
113 m.RxqNum = buf.DecodeUint16()
114 m.RxqSize = buf.DecodeUint16()
115 m.TxqSize = buf.DecodeUint16()
116 m.Mode = RdmaMode(buf.DecodeUint32())
120 // RdmaCreateReply defines message 'rdma_create_reply'.
121 type RdmaCreateReply struct {
122 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
123 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
126 func (m *RdmaCreateReply) Reset() { *m = RdmaCreateReply{} }
127 func (*RdmaCreateReply) GetMessageName() string { return "rdma_create_reply" }
128 func (*RdmaCreateReply) GetCrcString() string { return "5383d31f" }
129 func (*RdmaCreateReply) GetMessageType() api.MessageType {
130 return api.ReplyMessage
133 func (m *RdmaCreateReply) Size() int {
138 size += 4 // m.Retval
139 size += 4 // m.SwIfIndex
142 func (m *RdmaCreateReply) Marshal(b []byte) ([]byte, error) {
143 var buf *codec.Buffer
145 buf = codec.NewBuffer(make([]byte, m.Size()))
147 buf = codec.NewBuffer(b)
149 buf.EncodeUint32(uint32(m.Retval))
150 buf.EncodeUint32(uint32(m.SwIfIndex))
151 return buf.Bytes(), nil
153 func (m *RdmaCreateReply) Unmarshal(b []byte) error {
154 buf := codec.NewBuffer(b)
155 m.Retval = int32(buf.DecodeUint32())
156 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
160 // RdmaDelete defines message 'rdma_delete'.
161 type RdmaDelete struct {
162 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
165 func (m *RdmaDelete) Reset() { *m = RdmaDelete{} }
166 func (*RdmaDelete) GetMessageName() string { return "rdma_delete" }
167 func (*RdmaDelete) GetCrcString() string { return "f9e6675e" }
168 func (*RdmaDelete) GetMessageType() api.MessageType {
169 return api.RequestMessage
172 func (m *RdmaDelete) Size() int {
177 size += 4 // m.SwIfIndex
180 func (m *RdmaDelete) Marshal(b []byte) ([]byte, error) {
181 var buf *codec.Buffer
183 buf = codec.NewBuffer(make([]byte, m.Size()))
185 buf = codec.NewBuffer(b)
187 buf.EncodeUint32(uint32(m.SwIfIndex))
188 return buf.Bytes(), nil
190 func (m *RdmaDelete) Unmarshal(b []byte) error {
191 buf := codec.NewBuffer(b)
192 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
196 // RdmaDeleteReply defines message 'rdma_delete_reply'.
197 type RdmaDeleteReply struct {
198 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
201 func (m *RdmaDeleteReply) Reset() { *m = RdmaDeleteReply{} }
202 func (*RdmaDeleteReply) GetMessageName() string { return "rdma_delete_reply" }
203 func (*RdmaDeleteReply) GetCrcString() string { return "e8d4e804" }
204 func (*RdmaDeleteReply) GetMessageType() api.MessageType {
205 return api.ReplyMessage
208 func (m *RdmaDeleteReply) Size() int {
213 size += 4 // m.Retval
216 func (m *RdmaDeleteReply) Marshal(b []byte) ([]byte, error) {
217 var buf *codec.Buffer
219 buf = codec.NewBuffer(make([]byte, m.Size()))
221 buf = codec.NewBuffer(b)
223 buf.EncodeUint32(uint32(m.Retval))
224 return buf.Bytes(), nil
226 func (m *RdmaDeleteReply) Unmarshal(b []byte) error {
227 buf := codec.NewBuffer(b)
228 m.Retval = int32(buf.DecodeUint32())
232 func init() { file_rdma_binapi_init() }
233 func file_rdma_binapi_init() {
234 api.RegisterMessage((*RdmaCreate)(nil), "rdma_create_076fe418")
235 api.RegisterMessage((*RdmaCreateReply)(nil), "rdma_create_reply_5383d31f")
236 api.RegisterMessage((*RdmaDelete)(nil), "rdma_delete_f9e6675e")
237 api.RegisterMessage((*RdmaDeleteReply)(nil), "rdma_delete_reply_e8d4e804")
240 // Messages returns list of all messages in this module.
241 func AllMessages() []api.Message {
242 return []api.Message{
244 (*RdmaCreateReply)(nil),
246 (*RdmaDeleteReply)(nil),