github.com/edwarnicke/govpp@v0.0.0-20230130211138-14ef5d20b1d0/binapi/flow/flow.ba.go (about) 1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT. 2 // versions: 3 // binapi-generator: v0.4.0-dev 4 // VPP: 23.02-rc0~189-g57127b32a 5 // source: /usr/share/vpp/api/core/flow.api.json 6 7 // Package flow contains generated bindings for API file flow.api. 8 // 9 // Contents: 10 // 10 messages 11 // 12 package flow 13 14 import ( 15 api "git.fd.io/govpp.git/api" 16 codec "git.fd.io/govpp.git/codec" 17 _ "github.com/edwarnicke/govpp/binapi/ethernet_types" 18 flow_types "github.com/edwarnicke/govpp/binapi/flow_types" 19 _ "github.com/edwarnicke/govpp/binapi/interface_types" 20 _ "github.com/edwarnicke/govpp/binapi/ip_types" 21 ) 22 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 28 29 const ( 30 APIFile = "flow" 31 APIVersion = "0.0.3" 32 VersionCrc = 0xe17512 33 ) 34 35 // FlowAdd defines message 'flow_add'. 36 // InProgress: the message form may change in the future versions 37 type FlowAdd struct { 38 Flow flow_types.FlowRule `binapi:"flow_rule,name=flow" json:"flow,omitempty"` 39 } 40 41 func (m *FlowAdd) Reset() { *m = FlowAdd{} } 42 func (*FlowAdd) GetMessageName() string { return "flow_add" } 43 func (*FlowAdd) GetCrcString() string { return "f946ed84" } 44 func (*FlowAdd) GetMessageType() api.MessageType { 45 return api.RequestMessage 46 } 47 48 func (m *FlowAdd) Size() (size int) { 49 if m == nil { 50 return 0 51 } 52 size += 4 // m.Flow.Type 53 size += 4 // m.Flow.Index 54 size += 4 // m.Flow.Actions 55 size += 4 // m.Flow.MarkFlowID 56 size += 4 // m.Flow.RedirectNodeIndex 57 size += 4 // m.Flow.RedirectDeviceInputNextIndex 58 size += 4 // m.Flow.RedirectQueue 59 size += 4 // m.Flow.BufferAdvance 60 size += 1 * 82 // m.Flow.Flow 61 return size 62 } 63 func (m *FlowAdd) Marshal(b []byte) ([]byte, error) { 64 if b == nil { 65 b = make([]byte, m.Size()) 66 } 67 buf := codec.NewBuffer(b) 68 buf.EncodeUint32(uint32(m.Flow.Type)) 69 buf.EncodeUint32(m.Flow.Index) 70 buf.EncodeUint32(uint32(m.Flow.Actions)) 71 buf.EncodeUint32(m.Flow.MarkFlowID) 72 buf.EncodeUint32(m.Flow.RedirectNodeIndex) 73 buf.EncodeUint32(m.Flow.RedirectDeviceInputNextIndex) 74 buf.EncodeUint32(m.Flow.RedirectQueue) 75 buf.EncodeInt32(m.Flow.BufferAdvance) 76 buf.EncodeBytes(m.Flow.Flow.XXX_UnionData[:], 82) 77 return buf.Bytes(), nil 78 } 79 func (m *FlowAdd) Unmarshal(b []byte) error { 80 buf := codec.NewBuffer(b) 81 m.Flow.Type = flow_types.FlowType(buf.DecodeUint32()) 82 m.Flow.Index = buf.DecodeUint32() 83 m.Flow.Actions = flow_types.FlowAction(buf.DecodeUint32()) 84 m.Flow.MarkFlowID = buf.DecodeUint32() 85 m.Flow.RedirectNodeIndex = buf.DecodeUint32() 86 m.Flow.RedirectDeviceInputNextIndex = buf.DecodeUint32() 87 m.Flow.RedirectQueue = buf.DecodeUint32() 88 m.Flow.BufferAdvance = buf.DecodeInt32() 89 copy(m.Flow.Flow.XXX_UnionData[:], buf.DecodeBytes(82)) 90 return nil 91 } 92 93 // FlowAddReply defines message 'flow_add_reply'. 94 // InProgress: the message form may change in the future versions 95 type FlowAddReply struct { 96 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 97 FlowIndex uint32 `binapi:"u32,name=flow_index" json:"flow_index,omitempty"` 98 } 99 100 func (m *FlowAddReply) Reset() { *m = FlowAddReply{} } 101 func (*FlowAddReply) GetMessageName() string { return "flow_add_reply" } 102 func (*FlowAddReply) GetCrcString() string { return "8587dc85" } 103 func (*FlowAddReply) GetMessageType() api.MessageType { 104 return api.ReplyMessage 105 } 106 107 func (m *FlowAddReply) Size() (size int) { 108 if m == nil { 109 return 0 110 } 111 size += 4 // m.Retval 112 size += 4 // m.FlowIndex 113 return size 114 } 115 func (m *FlowAddReply) Marshal(b []byte) ([]byte, error) { 116 if b == nil { 117 b = make([]byte, m.Size()) 118 } 119 buf := codec.NewBuffer(b) 120 buf.EncodeInt32(m.Retval) 121 buf.EncodeUint32(m.FlowIndex) 122 return buf.Bytes(), nil 123 } 124 func (m *FlowAddReply) Unmarshal(b []byte) error { 125 buf := codec.NewBuffer(b) 126 m.Retval = buf.DecodeInt32() 127 m.FlowIndex = buf.DecodeUint32() 128 return nil 129 } 130 131 // FlowAddV2 defines message 'flow_add_v2'. 132 // InProgress: the message form may change in the future versions 133 type FlowAddV2 struct { 134 Flow flow_types.FlowRuleV2 `binapi:"flow_rule_v2,name=flow" json:"flow,omitempty"` 135 } 136 137 func (m *FlowAddV2) Reset() { *m = FlowAddV2{} } 138 func (*FlowAddV2) GetMessageName() string { return "flow_add_v2" } 139 func (*FlowAddV2) GetCrcString() string { return "5b757558" } 140 func (*FlowAddV2) GetMessageType() api.MessageType { 141 return api.RequestMessage 142 } 143 144 func (m *FlowAddV2) Size() (size int) { 145 if m == nil { 146 return 0 147 } 148 size += 4 // m.Flow.Type 149 size += 4 // m.Flow.Index 150 size += 4 // m.Flow.Actions 151 size += 4 // m.Flow.MarkFlowID 152 size += 4 // m.Flow.RedirectNodeIndex 153 size += 4 // m.Flow.RedirectDeviceInputNextIndex 154 size += 4 // m.Flow.RedirectQueue 155 size += 4 // m.Flow.QueueIndex 156 size += 4 // m.Flow.QueueNum 157 size += 4 // m.Flow.BufferAdvance 158 size += 8 // m.Flow.RssTypes 159 size += 4 // m.Flow.RssFun 160 size += 1 * 2052 // m.Flow.Flow 161 return size 162 } 163 func (m *FlowAddV2) Marshal(b []byte) ([]byte, error) { 164 if b == nil { 165 b = make([]byte, m.Size()) 166 } 167 buf := codec.NewBuffer(b) 168 buf.EncodeUint32(uint32(m.Flow.Type)) 169 buf.EncodeUint32(m.Flow.Index) 170 buf.EncodeUint32(uint32(m.Flow.Actions)) 171 buf.EncodeUint32(m.Flow.MarkFlowID) 172 buf.EncodeUint32(m.Flow.RedirectNodeIndex) 173 buf.EncodeUint32(m.Flow.RedirectDeviceInputNextIndex) 174 buf.EncodeUint32(m.Flow.RedirectQueue) 175 buf.EncodeUint32(m.Flow.QueueIndex) 176 buf.EncodeUint32(m.Flow.QueueNum) 177 buf.EncodeInt32(m.Flow.BufferAdvance) 178 buf.EncodeUint64(m.Flow.RssTypes) 179 buf.EncodeUint32(uint32(m.Flow.RssFun)) 180 buf.EncodeBytes(m.Flow.Flow.XXX_UnionData[:], 2052) 181 return buf.Bytes(), nil 182 } 183 func (m *FlowAddV2) Unmarshal(b []byte) error { 184 buf := codec.NewBuffer(b) 185 m.Flow.Type = flow_types.FlowTypeV2(buf.DecodeUint32()) 186 m.Flow.Index = buf.DecodeUint32() 187 m.Flow.Actions = flow_types.FlowActionV2(buf.DecodeUint32()) 188 m.Flow.MarkFlowID = buf.DecodeUint32() 189 m.Flow.RedirectNodeIndex = buf.DecodeUint32() 190 m.Flow.RedirectDeviceInputNextIndex = buf.DecodeUint32() 191 m.Flow.RedirectQueue = buf.DecodeUint32() 192 m.Flow.QueueIndex = buf.DecodeUint32() 193 m.Flow.QueueNum = buf.DecodeUint32() 194 m.Flow.BufferAdvance = buf.DecodeInt32() 195 m.Flow.RssTypes = buf.DecodeUint64() 196 m.Flow.RssFun = flow_types.RssFunction(buf.DecodeUint32()) 197 copy(m.Flow.Flow.XXX_UnionData[:], buf.DecodeBytes(2052)) 198 return nil 199 } 200 201 // FlowAddV2Reply defines message 'flow_add_v2_reply'. 202 // InProgress: the message form may change in the future versions 203 type FlowAddV2Reply struct { 204 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 205 FlowIndex uint32 `binapi:"u32,name=flow_index" json:"flow_index,omitempty"` 206 } 207 208 func (m *FlowAddV2Reply) Reset() { *m = FlowAddV2Reply{} } 209 func (*FlowAddV2Reply) GetMessageName() string { return "flow_add_v2_reply" } 210 func (*FlowAddV2Reply) GetCrcString() string { return "8587dc85" } 211 func (*FlowAddV2Reply) GetMessageType() api.MessageType { 212 return api.ReplyMessage 213 } 214 215 func (m *FlowAddV2Reply) Size() (size int) { 216 if m == nil { 217 return 0 218 } 219 size += 4 // m.Retval 220 size += 4 // m.FlowIndex 221 return size 222 } 223 func (m *FlowAddV2Reply) Marshal(b []byte) ([]byte, error) { 224 if b == nil { 225 b = make([]byte, m.Size()) 226 } 227 buf := codec.NewBuffer(b) 228 buf.EncodeInt32(m.Retval) 229 buf.EncodeUint32(m.FlowIndex) 230 return buf.Bytes(), nil 231 } 232 func (m *FlowAddV2Reply) Unmarshal(b []byte) error { 233 buf := codec.NewBuffer(b) 234 m.Retval = buf.DecodeInt32() 235 m.FlowIndex = buf.DecodeUint32() 236 return nil 237 } 238 239 // FlowDel defines message 'flow_del'. 240 // InProgress: the message form may change in the future versions 241 type FlowDel struct { 242 FlowIndex uint32 `binapi:"u32,name=flow_index" json:"flow_index,omitempty"` 243 } 244 245 func (m *FlowDel) Reset() { *m = FlowDel{} } 246 func (*FlowDel) GetMessageName() string { return "flow_del" } 247 func (*FlowDel) GetCrcString() string { return "b6b9b02c" } 248 func (*FlowDel) GetMessageType() api.MessageType { 249 return api.RequestMessage 250 } 251 252 func (m *FlowDel) Size() (size int) { 253 if m == nil { 254 return 0 255 } 256 size += 4 // m.FlowIndex 257 return size 258 } 259 func (m *FlowDel) Marshal(b []byte) ([]byte, error) { 260 if b == nil { 261 b = make([]byte, m.Size()) 262 } 263 buf := codec.NewBuffer(b) 264 buf.EncodeUint32(m.FlowIndex) 265 return buf.Bytes(), nil 266 } 267 func (m *FlowDel) Unmarshal(b []byte) error { 268 buf := codec.NewBuffer(b) 269 m.FlowIndex = buf.DecodeUint32() 270 return nil 271 } 272 273 // FlowDelReply defines message 'flow_del_reply'. 274 // InProgress: the message form may change in the future versions 275 type FlowDelReply struct { 276 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 277 } 278 279 func (m *FlowDelReply) Reset() { *m = FlowDelReply{} } 280 func (*FlowDelReply) GetMessageName() string { return "flow_del_reply" } 281 func (*FlowDelReply) GetCrcString() string { return "e8d4e804" } 282 func (*FlowDelReply) GetMessageType() api.MessageType { 283 return api.ReplyMessage 284 } 285 286 func (m *FlowDelReply) Size() (size int) { 287 if m == nil { 288 return 0 289 } 290 size += 4 // m.Retval 291 return size 292 } 293 func (m *FlowDelReply) Marshal(b []byte) ([]byte, error) { 294 if b == nil { 295 b = make([]byte, m.Size()) 296 } 297 buf := codec.NewBuffer(b) 298 buf.EncodeInt32(m.Retval) 299 return buf.Bytes(), nil 300 } 301 func (m *FlowDelReply) Unmarshal(b []byte) error { 302 buf := codec.NewBuffer(b) 303 m.Retval = buf.DecodeInt32() 304 return nil 305 } 306 307 // FlowDisable defines message 'flow_disable'. 308 // InProgress: the message form may change in the future versions 309 type FlowDisable struct { 310 FlowIndex uint32 `binapi:"u32,name=flow_index" json:"flow_index,omitempty"` 311 HwIfIndex uint32 `binapi:"u32,name=hw_if_index" json:"hw_if_index,omitempty"` 312 } 313 314 func (m *FlowDisable) Reset() { *m = FlowDisable{} } 315 func (*FlowDisable) GetMessageName() string { return "flow_disable" } 316 func (*FlowDisable) GetCrcString() string { return "2024be69" } 317 func (*FlowDisable) GetMessageType() api.MessageType { 318 return api.RequestMessage 319 } 320 321 func (m *FlowDisable) Size() (size int) { 322 if m == nil { 323 return 0 324 } 325 size += 4 // m.FlowIndex 326 size += 4 // m.HwIfIndex 327 return size 328 } 329 func (m *FlowDisable) Marshal(b []byte) ([]byte, error) { 330 if b == nil { 331 b = make([]byte, m.Size()) 332 } 333 buf := codec.NewBuffer(b) 334 buf.EncodeUint32(m.FlowIndex) 335 buf.EncodeUint32(m.HwIfIndex) 336 return buf.Bytes(), nil 337 } 338 func (m *FlowDisable) Unmarshal(b []byte) error { 339 buf := codec.NewBuffer(b) 340 m.FlowIndex = buf.DecodeUint32() 341 m.HwIfIndex = buf.DecodeUint32() 342 return nil 343 } 344 345 // FlowDisableReply defines message 'flow_disable_reply'. 346 // InProgress: the message form may change in the future versions 347 type FlowDisableReply struct { 348 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 349 } 350 351 func (m *FlowDisableReply) Reset() { *m = FlowDisableReply{} } 352 func (*FlowDisableReply) GetMessageName() string { return "flow_disable_reply" } 353 func (*FlowDisableReply) GetCrcString() string { return "e8d4e804" } 354 func (*FlowDisableReply) GetMessageType() api.MessageType { 355 return api.ReplyMessage 356 } 357 358 func (m *FlowDisableReply) Size() (size int) { 359 if m == nil { 360 return 0 361 } 362 size += 4 // m.Retval 363 return size 364 } 365 func (m *FlowDisableReply) Marshal(b []byte) ([]byte, error) { 366 if b == nil { 367 b = make([]byte, m.Size()) 368 } 369 buf := codec.NewBuffer(b) 370 buf.EncodeInt32(m.Retval) 371 return buf.Bytes(), nil 372 } 373 func (m *FlowDisableReply) Unmarshal(b []byte) error { 374 buf := codec.NewBuffer(b) 375 m.Retval = buf.DecodeInt32() 376 return nil 377 } 378 379 // FlowEnable defines message 'flow_enable'. 380 // InProgress: the message form may change in the future versions 381 type FlowEnable struct { 382 FlowIndex uint32 `binapi:"u32,name=flow_index" json:"flow_index,omitempty"` 383 HwIfIndex uint32 `binapi:"u32,name=hw_if_index" json:"hw_if_index,omitempty"` 384 } 385 386 func (m *FlowEnable) Reset() { *m = FlowEnable{} } 387 func (*FlowEnable) GetMessageName() string { return "flow_enable" } 388 func (*FlowEnable) GetCrcString() string { return "2024be69" } 389 func (*FlowEnable) GetMessageType() api.MessageType { 390 return api.RequestMessage 391 } 392 393 func (m *FlowEnable) Size() (size int) { 394 if m == nil { 395 return 0 396 } 397 size += 4 // m.FlowIndex 398 size += 4 // m.HwIfIndex 399 return size 400 } 401 func (m *FlowEnable) Marshal(b []byte) ([]byte, error) { 402 if b == nil { 403 b = make([]byte, m.Size()) 404 } 405 buf := codec.NewBuffer(b) 406 buf.EncodeUint32(m.FlowIndex) 407 buf.EncodeUint32(m.HwIfIndex) 408 return buf.Bytes(), nil 409 } 410 func (m *FlowEnable) Unmarshal(b []byte) error { 411 buf := codec.NewBuffer(b) 412 m.FlowIndex = buf.DecodeUint32() 413 m.HwIfIndex = buf.DecodeUint32() 414 return nil 415 } 416 417 // FlowEnableReply defines message 'flow_enable_reply'. 418 // InProgress: the message form may change in the future versions 419 type FlowEnableReply struct { 420 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 421 } 422 423 func (m *FlowEnableReply) Reset() { *m = FlowEnableReply{} } 424 func (*FlowEnableReply) GetMessageName() string { return "flow_enable_reply" } 425 func (*FlowEnableReply) GetCrcString() string { return "e8d4e804" } 426 func (*FlowEnableReply) GetMessageType() api.MessageType { 427 return api.ReplyMessage 428 } 429 430 func (m *FlowEnableReply) Size() (size int) { 431 if m == nil { 432 return 0 433 } 434 size += 4 // m.Retval 435 return size 436 } 437 func (m *FlowEnableReply) Marshal(b []byte) ([]byte, error) { 438 if b == nil { 439 b = make([]byte, m.Size()) 440 } 441 buf := codec.NewBuffer(b) 442 buf.EncodeInt32(m.Retval) 443 return buf.Bytes(), nil 444 } 445 func (m *FlowEnableReply) Unmarshal(b []byte) error { 446 buf := codec.NewBuffer(b) 447 m.Retval = buf.DecodeInt32() 448 return nil 449 } 450 451 func init() { file_flow_binapi_init() } 452 func file_flow_binapi_init() { 453 api.RegisterMessage((*FlowAdd)(nil), "flow_add_f946ed84") 454 api.RegisterMessage((*FlowAddReply)(nil), "flow_add_reply_8587dc85") 455 api.RegisterMessage((*FlowAddV2)(nil), "flow_add_v2_5b757558") 456 api.RegisterMessage((*FlowAddV2Reply)(nil), "flow_add_v2_reply_8587dc85") 457 api.RegisterMessage((*FlowDel)(nil), "flow_del_b6b9b02c") 458 api.RegisterMessage((*FlowDelReply)(nil), "flow_del_reply_e8d4e804") 459 api.RegisterMessage((*FlowDisable)(nil), "flow_disable_2024be69") 460 api.RegisterMessage((*FlowDisableReply)(nil), "flow_disable_reply_e8d4e804") 461 api.RegisterMessage((*FlowEnable)(nil), "flow_enable_2024be69") 462 api.RegisterMessage((*FlowEnableReply)(nil), "flow_enable_reply_e8d4e804") 463 } 464 465 // Messages returns list of all messages in this module. 466 func AllMessages() []api.Message { 467 return []api.Message{ 468 (*FlowAdd)(nil), 469 (*FlowAddReply)(nil), 470 (*FlowAddV2)(nil), 471 (*FlowAddV2Reply)(nil), 472 (*FlowDel)(nil), 473 (*FlowDelReply)(nil), 474 (*FlowDisable)(nil), 475 (*FlowDisableReply)(nil), 476 (*FlowEnable)(nil), 477 (*FlowEnableReply)(nil), 478 } 479 }