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