go.ligato.io/vpp-agent/v3@v3.5.0/plugins/vpp/binapi/vpp2101/rdma/rdma.ba.go (about) 1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT. 2 3 // Package rdma contains generated bindings for API file rdma.api. 4 // 5 // Contents: 6 // - 1 enum 7 // - 6 messages 8 package rdma 9 10 import ( 11 "strconv" 12 13 api "go.fd.io/govpp/api" 14 codec "go.fd.io/govpp/codec" 15 interface_types "go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2101/interface_types" 16 ) 17 18 // This is a compile-time assertion to ensure that this generated file 19 // is compatible with the GoVPP api package it is being compiled against. 20 // A compilation error at this line likely means your copy of the 21 // GoVPP api package needs to be updated. 22 const _ = api.GoVppAPIPackageIsVersion2 23 24 const ( 25 APIFile = "rdma" 26 APIVersion = "2.0.0" 27 VersionCrc = 0xaece7cc3 28 ) 29 30 // RdmaMode defines enum 'rdma_mode'. 31 type RdmaMode uint32 32 33 const ( 34 RDMA_API_MODE_AUTO RdmaMode = 0 35 RDMA_API_MODE_IBV RdmaMode = 1 36 RDMA_API_MODE_DV RdmaMode = 2 37 ) 38 39 var ( 40 RdmaMode_name = map[uint32]string{ 41 0: "RDMA_API_MODE_AUTO", 42 1: "RDMA_API_MODE_IBV", 43 2: "RDMA_API_MODE_DV", 44 } 45 RdmaMode_value = map[string]uint32{ 46 "RDMA_API_MODE_AUTO": 0, 47 "RDMA_API_MODE_IBV": 1, 48 "RDMA_API_MODE_DV": 2, 49 } 50 ) 51 52 func (x RdmaMode) String() string { 53 s, ok := RdmaMode_name[uint32(x)] 54 if ok { 55 return s 56 } 57 return "RdmaMode(" + strconv.Itoa(int(x)) + ")" 58 } 59 60 // RdmaCreate defines message 'rdma_create'. 61 type RdmaCreate struct { 62 HostIf string `binapi:"string[64],name=host_if" json:"host_if,omitempty"` 63 Name string `binapi:"string[64],name=name" json:"name,omitempty"` 64 RxqNum uint16 `binapi:"u16,name=rxq_num,default=1" json:"rxq_num,omitempty"` 65 RxqSize uint16 `binapi:"u16,name=rxq_size,default=1024" json:"rxq_size,omitempty"` 66 TxqSize uint16 `binapi:"u16,name=txq_size,default=1024" json:"txq_size,omitempty"` 67 Mode RdmaMode `binapi:"rdma_mode,name=mode,default=0" json:"mode,omitempty"` 68 } 69 70 func (m *RdmaCreate) Reset() { *m = RdmaCreate{} } 71 func (*RdmaCreate) GetMessageName() string { return "rdma_create" } 72 func (*RdmaCreate) GetCrcString() string { return "076fe418" } 73 func (*RdmaCreate) GetMessageType() api.MessageType { 74 return api.RequestMessage 75 } 76 77 func (m *RdmaCreate) Size() (size int) { 78 if m == nil { 79 return 0 80 } 81 size += 64 // m.HostIf 82 size += 64 // m.Name 83 size += 2 // m.RxqNum 84 size += 2 // m.RxqSize 85 size += 2 // m.TxqSize 86 size += 4 // m.Mode 87 return size 88 } 89 func (m *RdmaCreate) Marshal(b []byte) ([]byte, error) { 90 if b == nil { 91 b = make([]byte, m.Size()) 92 } 93 buf := codec.NewBuffer(b) 94 buf.EncodeString(m.HostIf, 64) 95 buf.EncodeString(m.Name, 64) 96 buf.EncodeUint16(m.RxqNum) 97 buf.EncodeUint16(m.RxqSize) 98 buf.EncodeUint16(m.TxqSize) 99 buf.EncodeUint32(uint32(m.Mode)) 100 return buf.Bytes(), nil 101 } 102 func (m *RdmaCreate) Unmarshal(b []byte) error { 103 buf := codec.NewBuffer(b) 104 m.HostIf = buf.DecodeString(64) 105 m.Name = buf.DecodeString(64) 106 m.RxqNum = buf.DecodeUint16() 107 m.RxqSize = buf.DecodeUint16() 108 m.TxqSize = buf.DecodeUint16() 109 m.Mode = RdmaMode(buf.DecodeUint32()) 110 return nil 111 } 112 113 // RdmaCreateReply defines message 'rdma_create_reply'. 114 type RdmaCreateReply struct { 115 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 116 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 117 } 118 119 func (m *RdmaCreateReply) Reset() { *m = RdmaCreateReply{} } 120 func (*RdmaCreateReply) GetMessageName() string { return "rdma_create_reply" } 121 func (*RdmaCreateReply) GetCrcString() string { return "5383d31f" } 122 func (*RdmaCreateReply) GetMessageType() api.MessageType { 123 return api.ReplyMessage 124 } 125 126 func (m *RdmaCreateReply) Size() (size int) { 127 if m == nil { 128 return 0 129 } 130 size += 4 // m.Retval 131 size += 4 // m.SwIfIndex 132 return size 133 } 134 func (m *RdmaCreateReply) Marshal(b []byte) ([]byte, error) { 135 if b == nil { 136 b = make([]byte, m.Size()) 137 } 138 buf := codec.NewBuffer(b) 139 buf.EncodeInt32(m.Retval) 140 buf.EncodeUint32(uint32(m.SwIfIndex)) 141 return buf.Bytes(), nil 142 } 143 func (m *RdmaCreateReply) Unmarshal(b []byte) error { 144 buf := codec.NewBuffer(b) 145 m.Retval = buf.DecodeInt32() 146 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 147 return nil 148 } 149 150 // RdmaCreateV2 defines message 'rdma_create_v2'. 151 type RdmaCreateV2 struct { 152 HostIf string `binapi:"string[64],name=host_if" json:"host_if,omitempty"` 153 Name string `binapi:"string[64],name=name" json:"name,omitempty"` 154 RxqNum uint16 `binapi:"u16,name=rxq_num,default=1" json:"rxq_num,omitempty"` 155 RxqSize uint16 `binapi:"u16,name=rxq_size,default=1024" json:"rxq_size,omitempty"` 156 TxqSize uint16 `binapi:"u16,name=txq_size,default=1024" json:"txq_size,omitempty"` 157 Mode RdmaMode `binapi:"rdma_mode,name=mode,default=0" json:"mode,omitempty"` 158 NoMultiSeg bool `binapi:"bool,name=no_multi_seg,default=0" json:"no_multi_seg,omitempty"` 159 MaxPktlen uint16 `binapi:"u16,name=max_pktlen,default=0" json:"max_pktlen,omitempty"` 160 } 161 162 func (m *RdmaCreateV2) Reset() { *m = RdmaCreateV2{} } 163 func (*RdmaCreateV2) GetMessageName() string { return "rdma_create_v2" } 164 func (*RdmaCreateV2) GetCrcString() string { return "5826a4f3" } 165 func (*RdmaCreateV2) GetMessageType() api.MessageType { 166 return api.RequestMessage 167 } 168 169 func (m *RdmaCreateV2) Size() (size int) { 170 if m == nil { 171 return 0 172 } 173 size += 64 // m.HostIf 174 size += 64 // m.Name 175 size += 2 // m.RxqNum 176 size += 2 // m.RxqSize 177 size += 2 // m.TxqSize 178 size += 4 // m.Mode 179 size += 1 // m.NoMultiSeg 180 size += 2 // m.MaxPktlen 181 return size 182 } 183 func (m *RdmaCreateV2) Marshal(b []byte) ([]byte, error) { 184 if b == nil { 185 b = make([]byte, m.Size()) 186 } 187 buf := codec.NewBuffer(b) 188 buf.EncodeString(m.HostIf, 64) 189 buf.EncodeString(m.Name, 64) 190 buf.EncodeUint16(m.RxqNum) 191 buf.EncodeUint16(m.RxqSize) 192 buf.EncodeUint16(m.TxqSize) 193 buf.EncodeUint32(uint32(m.Mode)) 194 buf.EncodeBool(m.NoMultiSeg) 195 buf.EncodeUint16(m.MaxPktlen) 196 return buf.Bytes(), nil 197 } 198 func (m *RdmaCreateV2) Unmarshal(b []byte) error { 199 buf := codec.NewBuffer(b) 200 m.HostIf = buf.DecodeString(64) 201 m.Name = buf.DecodeString(64) 202 m.RxqNum = buf.DecodeUint16() 203 m.RxqSize = buf.DecodeUint16() 204 m.TxqSize = buf.DecodeUint16() 205 m.Mode = RdmaMode(buf.DecodeUint32()) 206 m.NoMultiSeg = buf.DecodeBool() 207 m.MaxPktlen = buf.DecodeUint16() 208 return nil 209 } 210 211 // RdmaCreateV2Reply defines message 'rdma_create_v2_reply'. 212 type RdmaCreateV2Reply struct { 213 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 214 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 215 } 216 217 func (m *RdmaCreateV2Reply) Reset() { *m = RdmaCreateV2Reply{} } 218 func (*RdmaCreateV2Reply) GetMessageName() string { return "rdma_create_v2_reply" } 219 func (*RdmaCreateV2Reply) GetCrcString() string { return "5383d31f" } 220 func (*RdmaCreateV2Reply) GetMessageType() api.MessageType { 221 return api.ReplyMessage 222 } 223 224 func (m *RdmaCreateV2Reply) Size() (size int) { 225 if m == nil { 226 return 0 227 } 228 size += 4 // m.Retval 229 size += 4 // m.SwIfIndex 230 return size 231 } 232 func (m *RdmaCreateV2Reply) Marshal(b []byte) ([]byte, error) { 233 if b == nil { 234 b = make([]byte, m.Size()) 235 } 236 buf := codec.NewBuffer(b) 237 buf.EncodeInt32(m.Retval) 238 buf.EncodeUint32(uint32(m.SwIfIndex)) 239 return buf.Bytes(), nil 240 } 241 func (m *RdmaCreateV2Reply) Unmarshal(b []byte) error { 242 buf := codec.NewBuffer(b) 243 m.Retval = buf.DecodeInt32() 244 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 245 return nil 246 } 247 248 // RdmaDelete defines message 'rdma_delete'. 249 type RdmaDelete struct { 250 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 251 } 252 253 func (m *RdmaDelete) Reset() { *m = RdmaDelete{} } 254 func (*RdmaDelete) GetMessageName() string { return "rdma_delete" } 255 func (*RdmaDelete) GetCrcString() string { return "f9e6675e" } 256 func (*RdmaDelete) GetMessageType() api.MessageType { 257 return api.RequestMessage 258 } 259 260 func (m *RdmaDelete) Size() (size int) { 261 if m == nil { 262 return 0 263 } 264 size += 4 // m.SwIfIndex 265 return size 266 } 267 func (m *RdmaDelete) Marshal(b []byte) ([]byte, error) { 268 if b == nil { 269 b = make([]byte, m.Size()) 270 } 271 buf := codec.NewBuffer(b) 272 buf.EncodeUint32(uint32(m.SwIfIndex)) 273 return buf.Bytes(), nil 274 } 275 func (m *RdmaDelete) Unmarshal(b []byte) error { 276 buf := codec.NewBuffer(b) 277 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 278 return nil 279 } 280 281 // RdmaDeleteReply defines message 'rdma_delete_reply'. 282 type RdmaDeleteReply struct { 283 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 284 } 285 286 func (m *RdmaDeleteReply) Reset() { *m = RdmaDeleteReply{} } 287 func (*RdmaDeleteReply) GetMessageName() string { return "rdma_delete_reply" } 288 func (*RdmaDeleteReply) GetCrcString() string { return "e8d4e804" } 289 func (*RdmaDeleteReply) GetMessageType() api.MessageType { 290 return api.ReplyMessage 291 } 292 293 func (m *RdmaDeleteReply) Size() (size int) { 294 if m == nil { 295 return 0 296 } 297 size += 4 // m.Retval 298 return size 299 } 300 func (m *RdmaDeleteReply) Marshal(b []byte) ([]byte, error) { 301 if b == nil { 302 b = make([]byte, m.Size()) 303 } 304 buf := codec.NewBuffer(b) 305 buf.EncodeInt32(m.Retval) 306 return buf.Bytes(), nil 307 } 308 func (m *RdmaDeleteReply) Unmarshal(b []byte) error { 309 buf := codec.NewBuffer(b) 310 m.Retval = buf.DecodeInt32() 311 return nil 312 } 313 314 func init() { file_rdma_binapi_init() } 315 func file_rdma_binapi_init() { 316 api.RegisterMessage((*RdmaCreate)(nil), "rdma_create_076fe418") 317 api.RegisterMessage((*RdmaCreateReply)(nil), "rdma_create_reply_5383d31f") 318 api.RegisterMessage((*RdmaCreateV2)(nil), "rdma_create_v2_5826a4f3") 319 api.RegisterMessage((*RdmaCreateV2Reply)(nil), "rdma_create_v2_reply_5383d31f") 320 api.RegisterMessage((*RdmaDelete)(nil), "rdma_delete_f9e6675e") 321 api.RegisterMessage((*RdmaDeleteReply)(nil), "rdma_delete_reply_e8d4e804") 322 } 323 324 // Messages returns list of all messages in this module. 325 func AllMessages() []api.Message { 326 return []api.Message{ 327 (*RdmaCreate)(nil), 328 (*RdmaCreateReply)(nil), 329 (*RdmaCreateV2)(nil), 330 (*RdmaCreateV2Reply)(nil), 331 (*RdmaDelete)(nil), 332 (*RdmaDeleteReply)(nil), 333 } 334 }