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=1" json:"rxq_num,omitempty"`
69 RxqSize uint16 `binapi:"u16,name=rxq_size,default=1024" json:"rxq_size,omitempty"`
70 TxqSize uint16 `binapi:"u16,name=txq_size,default=1024" json:"txq_size,omitempty"`
71 Mode RdmaMode `binapi:"rdma_mode,name=mode,default=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() (size int) {
85 size += 64 // m.HostIf
88 size += 2 // m.RxqSize
89 size += 2 // m.TxqSize
93 func (m *RdmaCreate) Marshal(b []byte) ([]byte, error) {
95 b = make([]byte, m.Size())
97 buf := codec.NewBuffer(b)
98 buf.EncodeString(m.HostIf, 64)
99 buf.EncodeString(m.Name, 64)
100 buf.EncodeUint16(m.RxqNum)
101 buf.EncodeUint16(m.RxqSize)
102 buf.EncodeUint16(m.TxqSize)
103 buf.EncodeUint32(uint32(m.Mode))
104 return buf.Bytes(), nil
106 func (m *RdmaCreate) Unmarshal(b []byte) error {
107 buf := codec.NewBuffer(b)
108 m.HostIf = buf.DecodeString(64)
109 m.Name = buf.DecodeString(64)
110 m.RxqNum = buf.DecodeUint16()
111 m.RxqSize = buf.DecodeUint16()
112 m.TxqSize = buf.DecodeUint16()
113 m.Mode = RdmaMode(buf.DecodeUint32())
117 // RdmaCreateReply defines message 'rdma_create_reply'.
118 type RdmaCreateReply struct {
119 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
120 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
123 func (m *RdmaCreateReply) Reset() { *m = RdmaCreateReply{} }
124 func (*RdmaCreateReply) GetMessageName() string { return "rdma_create_reply" }
125 func (*RdmaCreateReply) GetCrcString() string { return "5383d31f" }
126 func (*RdmaCreateReply) GetMessageType() api.MessageType {
127 return api.ReplyMessage
130 func (m *RdmaCreateReply) Size() (size int) {
134 size += 4 // m.Retval
135 size += 4 // m.SwIfIndex
138 func (m *RdmaCreateReply) Marshal(b []byte) ([]byte, error) {
140 b = make([]byte, m.Size())
142 buf := codec.NewBuffer(b)
143 buf.EncodeInt32(m.Retval)
144 buf.EncodeUint32(uint32(m.SwIfIndex))
145 return buf.Bytes(), nil
147 func (m *RdmaCreateReply) Unmarshal(b []byte) error {
148 buf := codec.NewBuffer(b)
149 m.Retval = buf.DecodeInt32()
150 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
154 // RdmaDelete defines message 'rdma_delete'.
155 type RdmaDelete struct {
156 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
159 func (m *RdmaDelete) Reset() { *m = RdmaDelete{} }
160 func (*RdmaDelete) GetMessageName() string { return "rdma_delete" }
161 func (*RdmaDelete) GetCrcString() string { return "f9e6675e" }
162 func (*RdmaDelete) GetMessageType() api.MessageType {
163 return api.RequestMessage
166 func (m *RdmaDelete) Size() (size int) {
170 size += 4 // m.SwIfIndex
173 func (m *RdmaDelete) Marshal(b []byte) ([]byte, error) {
175 b = make([]byte, m.Size())
177 buf := codec.NewBuffer(b)
178 buf.EncodeUint32(uint32(m.SwIfIndex))
179 return buf.Bytes(), nil
181 func (m *RdmaDelete) Unmarshal(b []byte) error {
182 buf := codec.NewBuffer(b)
183 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
187 // RdmaDeleteReply defines message 'rdma_delete_reply'.
188 type RdmaDeleteReply struct {
189 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
192 func (m *RdmaDeleteReply) Reset() { *m = RdmaDeleteReply{} }
193 func (*RdmaDeleteReply) GetMessageName() string { return "rdma_delete_reply" }
194 func (*RdmaDeleteReply) GetCrcString() string { return "e8d4e804" }
195 func (*RdmaDeleteReply) GetMessageType() api.MessageType {
196 return api.ReplyMessage
199 func (m *RdmaDeleteReply) Size() (size int) {
203 size += 4 // m.Retval
206 func (m *RdmaDeleteReply) Marshal(b []byte) ([]byte, error) {
208 b = make([]byte, m.Size())
210 buf := codec.NewBuffer(b)
211 buf.EncodeInt32(m.Retval)
212 return buf.Bytes(), nil
214 func (m *RdmaDeleteReply) Unmarshal(b []byte) error {
215 buf := codec.NewBuffer(b)
216 m.Retval = buf.DecodeInt32()
220 func init() { file_rdma_binapi_init() }
221 func file_rdma_binapi_init() {
222 api.RegisterMessage((*RdmaCreate)(nil), "rdma_create_076fe418")
223 api.RegisterMessage((*RdmaCreateReply)(nil), "rdma_create_reply_5383d31f")
224 api.RegisterMessage((*RdmaDelete)(nil), "rdma_delete_f9e6675e")
225 api.RegisterMessage((*RdmaDeleteReply)(nil), "rdma_delete_reply_e8d4e804")
228 // Messages returns list of all messages in this module.
229 func AllMessages() []api.Message {
230 return []api.Message{
232 (*RdmaCreateReply)(nil),
234 (*RdmaDeleteReply)(nil),