go.ligato.io/vpp-agent/v3@v3.5.0/plugins/vpp/binapi/vpp2210/l3xc/l3xc.ba.go (about) 1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT. 2 3 // Package l3xc contains generated bindings for API file l3xc.api. 4 // 5 // Contents: 6 // - 1 struct 7 // - 8 messages 8 package l3xc 9 10 import ( 11 api "go.fd.io/govpp/api" 12 codec "go.fd.io/govpp/codec" 13 fib_types "go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2210/fib_types" 14 interface_types "go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2210/interface_types" 15 _ "go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2210/ip_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 = "l3xc" 26 APIVersion = "1.0.1" 27 VersionCrc = 0x520bfc6e 28 ) 29 30 // L3xc defines type 'l3xc'. 31 type L3xc struct { 32 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 33 IsIP6 bool `binapi:"bool,name=is_ip6" json:"is_ip6,omitempty"` 34 NPaths uint8 `binapi:"u8,name=n_paths" json:"-"` 35 Paths []fib_types.FibPath `binapi:"fib_path[n_paths],name=paths" json:"paths,omitempty"` 36 } 37 38 // L3xcDel defines message 'l3xc_del'. 39 type L3xcDel struct { 40 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 41 IsIP6 bool `binapi:"bool,name=is_ip6" json:"is_ip6,omitempty"` 42 } 43 44 func (m *L3xcDel) Reset() { *m = L3xcDel{} } 45 func (*L3xcDel) GetMessageName() string { return "l3xc_del" } 46 func (*L3xcDel) GetCrcString() string { return "e7dbef91" } 47 func (*L3xcDel) GetMessageType() api.MessageType { 48 return api.RequestMessage 49 } 50 51 func (m *L3xcDel) Size() (size int) { 52 if m == nil { 53 return 0 54 } 55 size += 4 // m.SwIfIndex 56 size += 1 // m.IsIP6 57 return size 58 } 59 func (m *L3xcDel) Marshal(b []byte) ([]byte, error) { 60 if b == nil { 61 b = make([]byte, m.Size()) 62 } 63 buf := codec.NewBuffer(b) 64 buf.EncodeUint32(uint32(m.SwIfIndex)) 65 buf.EncodeBool(m.IsIP6) 66 return buf.Bytes(), nil 67 } 68 func (m *L3xcDel) Unmarshal(b []byte) error { 69 buf := codec.NewBuffer(b) 70 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 71 m.IsIP6 = buf.DecodeBool() 72 return nil 73 } 74 75 // L3xcDelReply defines message 'l3xc_del_reply'. 76 type L3xcDelReply struct { 77 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 78 } 79 80 func (m *L3xcDelReply) Reset() { *m = L3xcDelReply{} } 81 func (*L3xcDelReply) GetMessageName() string { return "l3xc_del_reply" } 82 func (*L3xcDelReply) GetCrcString() string { return "e8d4e804" } 83 func (*L3xcDelReply) GetMessageType() api.MessageType { 84 return api.ReplyMessage 85 } 86 87 func (m *L3xcDelReply) Size() (size int) { 88 if m == nil { 89 return 0 90 } 91 size += 4 // m.Retval 92 return size 93 } 94 func (m *L3xcDelReply) Marshal(b []byte) ([]byte, error) { 95 if b == nil { 96 b = make([]byte, m.Size()) 97 } 98 buf := codec.NewBuffer(b) 99 buf.EncodeInt32(m.Retval) 100 return buf.Bytes(), nil 101 } 102 func (m *L3xcDelReply) Unmarshal(b []byte) error { 103 buf := codec.NewBuffer(b) 104 m.Retval = buf.DecodeInt32() 105 return nil 106 } 107 108 // L3xcDetails defines message 'l3xc_details'. 109 type L3xcDetails struct { 110 L3xc L3xc `binapi:"l3xc,name=l3xc" json:"l3xc,omitempty"` 111 } 112 113 func (m *L3xcDetails) Reset() { *m = L3xcDetails{} } 114 func (*L3xcDetails) GetMessageName() string { return "l3xc_details" } 115 func (*L3xcDetails) GetCrcString() string { return "bc5bf852" } 116 func (*L3xcDetails) GetMessageType() api.MessageType { 117 return api.ReplyMessage 118 } 119 120 func (m *L3xcDetails) Size() (size int) { 121 if m == nil { 122 return 0 123 } 124 size += 4 // m.L3xc.SwIfIndex 125 size += 1 // m.L3xc.IsIP6 126 size += 1 // m.L3xc.NPaths 127 for j2 := 0; j2 < len(m.L3xc.Paths); j2++ { 128 var s2 fib_types.FibPath 129 _ = s2 130 if j2 < len(m.L3xc.Paths) { 131 s2 = m.L3xc.Paths[j2] 132 } 133 size += 4 // s2.SwIfIndex 134 size += 4 // s2.TableID 135 size += 4 // s2.RpfID 136 size += 1 // s2.Weight 137 size += 1 // s2.Preference 138 size += 4 // s2.Type 139 size += 4 // s2.Flags 140 size += 4 // s2.Proto 141 size += 1 * 16 // s2.Nh.Address 142 size += 4 // s2.Nh.ViaLabel 143 size += 4 // s2.Nh.ObjID 144 size += 4 // s2.Nh.ClassifyTableIndex 145 size += 1 // s2.NLabels 146 for j3 := 0; j3 < 16; j3++ { 147 size += 1 // s2.LabelStack[j3].IsUniform 148 size += 4 // s2.LabelStack[j3].Label 149 size += 1 // s2.LabelStack[j3].TTL 150 size += 1 // s2.LabelStack[j3].Exp 151 } 152 } 153 return size 154 } 155 func (m *L3xcDetails) Marshal(b []byte) ([]byte, error) { 156 if b == nil { 157 b = make([]byte, m.Size()) 158 } 159 buf := codec.NewBuffer(b) 160 buf.EncodeUint32(uint32(m.L3xc.SwIfIndex)) 161 buf.EncodeBool(m.L3xc.IsIP6) 162 buf.EncodeUint8(uint8(len(m.L3xc.Paths))) 163 for j1 := 0; j1 < len(m.L3xc.Paths); j1++ { 164 var v1 fib_types.FibPath // Paths 165 if j1 < len(m.L3xc.Paths) { 166 v1 = m.L3xc.Paths[j1] 167 } 168 buf.EncodeUint32(v1.SwIfIndex) 169 buf.EncodeUint32(v1.TableID) 170 buf.EncodeUint32(v1.RpfID) 171 buf.EncodeUint8(v1.Weight) 172 buf.EncodeUint8(v1.Preference) 173 buf.EncodeUint32(uint32(v1.Type)) 174 buf.EncodeUint32(uint32(v1.Flags)) 175 buf.EncodeUint32(uint32(v1.Proto)) 176 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16) 177 buf.EncodeUint32(v1.Nh.ViaLabel) 178 buf.EncodeUint32(v1.Nh.ObjID) 179 buf.EncodeUint32(v1.Nh.ClassifyTableIndex) 180 buf.EncodeUint8(v1.NLabels) 181 for j2 := 0; j2 < 16; j2++ { 182 buf.EncodeUint8(v1.LabelStack[j2].IsUniform) 183 buf.EncodeUint32(v1.LabelStack[j2].Label) 184 buf.EncodeUint8(v1.LabelStack[j2].TTL) 185 buf.EncodeUint8(v1.LabelStack[j2].Exp) 186 } 187 } 188 return buf.Bytes(), nil 189 } 190 func (m *L3xcDetails) Unmarshal(b []byte) error { 191 buf := codec.NewBuffer(b) 192 m.L3xc.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 193 m.L3xc.IsIP6 = buf.DecodeBool() 194 m.L3xc.NPaths = buf.DecodeUint8() 195 m.L3xc.Paths = make([]fib_types.FibPath, m.L3xc.NPaths) 196 for j1 := 0; j1 < len(m.L3xc.Paths); j1++ { 197 m.L3xc.Paths[j1].SwIfIndex = buf.DecodeUint32() 198 m.L3xc.Paths[j1].TableID = buf.DecodeUint32() 199 m.L3xc.Paths[j1].RpfID = buf.DecodeUint32() 200 m.L3xc.Paths[j1].Weight = buf.DecodeUint8() 201 m.L3xc.Paths[j1].Preference = buf.DecodeUint8() 202 m.L3xc.Paths[j1].Type = fib_types.FibPathType(buf.DecodeUint32()) 203 m.L3xc.Paths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32()) 204 m.L3xc.Paths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32()) 205 copy(m.L3xc.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16)) 206 m.L3xc.Paths[j1].Nh.ViaLabel = buf.DecodeUint32() 207 m.L3xc.Paths[j1].Nh.ObjID = buf.DecodeUint32() 208 m.L3xc.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32() 209 m.L3xc.Paths[j1].NLabels = buf.DecodeUint8() 210 for j2 := 0; j2 < 16; j2++ { 211 m.L3xc.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8() 212 m.L3xc.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32() 213 m.L3xc.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8() 214 m.L3xc.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8() 215 } 216 } 217 return nil 218 } 219 220 // L3xcDump defines message 'l3xc_dump'. 221 type L3xcDump struct { 222 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 223 } 224 225 func (m *L3xcDump) Reset() { *m = L3xcDump{} } 226 func (*L3xcDump) GetMessageName() string { return "l3xc_dump" } 227 func (*L3xcDump) GetCrcString() string { return "f9e6675e" } 228 func (*L3xcDump) GetMessageType() api.MessageType { 229 return api.RequestMessage 230 } 231 232 func (m *L3xcDump) Size() (size int) { 233 if m == nil { 234 return 0 235 } 236 size += 4 // m.SwIfIndex 237 return size 238 } 239 func (m *L3xcDump) Marshal(b []byte) ([]byte, error) { 240 if b == nil { 241 b = make([]byte, m.Size()) 242 } 243 buf := codec.NewBuffer(b) 244 buf.EncodeUint32(uint32(m.SwIfIndex)) 245 return buf.Bytes(), nil 246 } 247 func (m *L3xcDump) Unmarshal(b []byte) error { 248 buf := codec.NewBuffer(b) 249 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 250 return nil 251 } 252 253 // L3xcPluginGetVersion defines message 'l3xc_plugin_get_version'. 254 type L3xcPluginGetVersion struct{} 255 256 func (m *L3xcPluginGetVersion) Reset() { *m = L3xcPluginGetVersion{} } 257 func (*L3xcPluginGetVersion) GetMessageName() string { return "l3xc_plugin_get_version" } 258 func (*L3xcPluginGetVersion) GetCrcString() string { return "51077d14" } 259 func (*L3xcPluginGetVersion) GetMessageType() api.MessageType { 260 return api.RequestMessage 261 } 262 263 func (m *L3xcPluginGetVersion) Size() (size int) { 264 if m == nil { 265 return 0 266 } 267 return size 268 } 269 func (m *L3xcPluginGetVersion) Marshal(b []byte) ([]byte, error) { 270 if b == nil { 271 b = make([]byte, m.Size()) 272 } 273 buf := codec.NewBuffer(b) 274 return buf.Bytes(), nil 275 } 276 func (m *L3xcPluginGetVersion) Unmarshal(b []byte) error { 277 return nil 278 } 279 280 // L3xcPluginGetVersionReply defines message 'l3xc_plugin_get_version_reply'. 281 type L3xcPluginGetVersionReply struct { 282 Major uint32 `binapi:"u32,name=major" json:"major,omitempty"` 283 Minor uint32 `binapi:"u32,name=minor" json:"minor,omitempty"` 284 } 285 286 func (m *L3xcPluginGetVersionReply) Reset() { *m = L3xcPluginGetVersionReply{} } 287 func (*L3xcPluginGetVersionReply) GetMessageName() string { return "l3xc_plugin_get_version_reply" } 288 func (*L3xcPluginGetVersionReply) GetCrcString() string { return "9b32cf86" } 289 func (*L3xcPluginGetVersionReply) GetMessageType() api.MessageType { 290 return api.ReplyMessage 291 } 292 293 func (m *L3xcPluginGetVersionReply) Size() (size int) { 294 if m == nil { 295 return 0 296 } 297 size += 4 // m.Major 298 size += 4 // m.Minor 299 return size 300 } 301 func (m *L3xcPluginGetVersionReply) Marshal(b []byte) ([]byte, error) { 302 if b == nil { 303 b = make([]byte, m.Size()) 304 } 305 buf := codec.NewBuffer(b) 306 buf.EncodeUint32(m.Major) 307 buf.EncodeUint32(m.Minor) 308 return buf.Bytes(), nil 309 } 310 func (m *L3xcPluginGetVersionReply) Unmarshal(b []byte) error { 311 buf := codec.NewBuffer(b) 312 m.Major = buf.DecodeUint32() 313 m.Minor = buf.DecodeUint32() 314 return nil 315 } 316 317 // L3xcUpdate defines message 'l3xc_update'. 318 type L3xcUpdate struct { 319 L3xc L3xc `binapi:"l3xc,name=l3xc" json:"l3xc,omitempty"` 320 } 321 322 func (m *L3xcUpdate) Reset() { *m = L3xcUpdate{} } 323 func (*L3xcUpdate) GetMessageName() string { return "l3xc_update" } 324 func (*L3xcUpdate) GetCrcString() string { return "e96aabdf" } 325 func (*L3xcUpdate) GetMessageType() api.MessageType { 326 return api.RequestMessage 327 } 328 329 func (m *L3xcUpdate) Size() (size int) { 330 if m == nil { 331 return 0 332 } 333 size += 4 // m.L3xc.SwIfIndex 334 size += 1 // m.L3xc.IsIP6 335 size += 1 // m.L3xc.NPaths 336 for j2 := 0; j2 < len(m.L3xc.Paths); j2++ { 337 var s2 fib_types.FibPath 338 _ = s2 339 if j2 < len(m.L3xc.Paths) { 340 s2 = m.L3xc.Paths[j2] 341 } 342 size += 4 // s2.SwIfIndex 343 size += 4 // s2.TableID 344 size += 4 // s2.RpfID 345 size += 1 // s2.Weight 346 size += 1 // s2.Preference 347 size += 4 // s2.Type 348 size += 4 // s2.Flags 349 size += 4 // s2.Proto 350 size += 1 * 16 // s2.Nh.Address 351 size += 4 // s2.Nh.ViaLabel 352 size += 4 // s2.Nh.ObjID 353 size += 4 // s2.Nh.ClassifyTableIndex 354 size += 1 // s2.NLabels 355 for j3 := 0; j3 < 16; j3++ { 356 size += 1 // s2.LabelStack[j3].IsUniform 357 size += 4 // s2.LabelStack[j3].Label 358 size += 1 // s2.LabelStack[j3].TTL 359 size += 1 // s2.LabelStack[j3].Exp 360 } 361 } 362 return size 363 } 364 func (m *L3xcUpdate) Marshal(b []byte) ([]byte, error) { 365 if b == nil { 366 b = make([]byte, m.Size()) 367 } 368 buf := codec.NewBuffer(b) 369 buf.EncodeUint32(uint32(m.L3xc.SwIfIndex)) 370 buf.EncodeBool(m.L3xc.IsIP6) 371 buf.EncodeUint8(uint8(len(m.L3xc.Paths))) 372 for j1 := 0; j1 < len(m.L3xc.Paths); j1++ { 373 var v1 fib_types.FibPath // Paths 374 if j1 < len(m.L3xc.Paths) { 375 v1 = m.L3xc.Paths[j1] 376 } 377 buf.EncodeUint32(v1.SwIfIndex) 378 buf.EncodeUint32(v1.TableID) 379 buf.EncodeUint32(v1.RpfID) 380 buf.EncodeUint8(v1.Weight) 381 buf.EncodeUint8(v1.Preference) 382 buf.EncodeUint32(uint32(v1.Type)) 383 buf.EncodeUint32(uint32(v1.Flags)) 384 buf.EncodeUint32(uint32(v1.Proto)) 385 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16) 386 buf.EncodeUint32(v1.Nh.ViaLabel) 387 buf.EncodeUint32(v1.Nh.ObjID) 388 buf.EncodeUint32(v1.Nh.ClassifyTableIndex) 389 buf.EncodeUint8(v1.NLabels) 390 for j2 := 0; j2 < 16; j2++ { 391 buf.EncodeUint8(v1.LabelStack[j2].IsUniform) 392 buf.EncodeUint32(v1.LabelStack[j2].Label) 393 buf.EncodeUint8(v1.LabelStack[j2].TTL) 394 buf.EncodeUint8(v1.LabelStack[j2].Exp) 395 } 396 } 397 return buf.Bytes(), nil 398 } 399 func (m *L3xcUpdate) Unmarshal(b []byte) error { 400 buf := codec.NewBuffer(b) 401 m.L3xc.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 402 m.L3xc.IsIP6 = buf.DecodeBool() 403 m.L3xc.NPaths = buf.DecodeUint8() 404 m.L3xc.Paths = make([]fib_types.FibPath, m.L3xc.NPaths) 405 for j1 := 0; j1 < len(m.L3xc.Paths); j1++ { 406 m.L3xc.Paths[j1].SwIfIndex = buf.DecodeUint32() 407 m.L3xc.Paths[j1].TableID = buf.DecodeUint32() 408 m.L3xc.Paths[j1].RpfID = buf.DecodeUint32() 409 m.L3xc.Paths[j1].Weight = buf.DecodeUint8() 410 m.L3xc.Paths[j1].Preference = buf.DecodeUint8() 411 m.L3xc.Paths[j1].Type = fib_types.FibPathType(buf.DecodeUint32()) 412 m.L3xc.Paths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32()) 413 m.L3xc.Paths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32()) 414 copy(m.L3xc.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16)) 415 m.L3xc.Paths[j1].Nh.ViaLabel = buf.DecodeUint32() 416 m.L3xc.Paths[j1].Nh.ObjID = buf.DecodeUint32() 417 m.L3xc.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32() 418 m.L3xc.Paths[j1].NLabels = buf.DecodeUint8() 419 for j2 := 0; j2 < 16; j2++ { 420 m.L3xc.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8() 421 m.L3xc.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32() 422 m.L3xc.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8() 423 m.L3xc.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8() 424 } 425 } 426 return nil 427 } 428 429 // L3xcUpdateReply defines message 'l3xc_update_reply'. 430 type L3xcUpdateReply struct { 431 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 432 StatsIndex uint32 `binapi:"u32,name=stats_index" json:"stats_index,omitempty"` 433 } 434 435 func (m *L3xcUpdateReply) Reset() { *m = L3xcUpdateReply{} } 436 func (*L3xcUpdateReply) GetMessageName() string { return "l3xc_update_reply" } 437 func (*L3xcUpdateReply) GetCrcString() string { return "1992deab" } 438 func (*L3xcUpdateReply) GetMessageType() api.MessageType { 439 return api.ReplyMessage 440 } 441 442 func (m *L3xcUpdateReply) Size() (size int) { 443 if m == nil { 444 return 0 445 } 446 size += 4 // m.Retval 447 size += 4 // m.StatsIndex 448 return size 449 } 450 func (m *L3xcUpdateReply) Marshal(b []byte) ([]byte, error) { 451 if b == nil { 452 b = make([]byte, m.Size()) 453 } 454 buf := codec.NewBuffer(b) 455 buf.EncodeInt32(m.Retval) 456 buf.EncodeUint32(m.StatsIndex) 457 return buf.Bytes(), nil 458 } 459 func (m *L3xcUpdateReply) Unmarshal(b []byte) error { 460 buf := codec.NewBuffer(b) 461 m.Retval = buf.DecodeInt32() 462 m.StatsIndex = buf.DecodeUint32() 463 return nil 464 } 465 466 func init() { file_l3xc_binapi_init() } 467 func file_l3xc_binapi_init() { 468 api.RegisterMessage((*L3xcDel)(nil), "l3xc_del_e7dbef91") 469 api.RegisterMessage((*L3xcDelReply)(nil), "l3xc_del_reply_e8d4e804") 470 api.RegisterMessage((*L3xcDetails)(nil), "l3xc_details_bc5bf852") 471 api.RegisterMessage((*L3xcDump)(nil), "l3xc_dump_f9e6675e") 472 api.RegisterMessage((*L3xcPluginGetVersion)(nil), "l3xc_plugin_get_version_51077d14") 473 api.RegisterMessage((*L3xcPluginGetVersionReply)(nil), "l3xc_plugin_get_version_reply_9b32cf86") 474 api.RegisterMessage((*L3xcUpdate)(nil), "l3xc_update_e96aabdf") 475 api.RegisterMessage((*L3xcUpdateReply)(nil), "l3xc_update_reply_1992deab") 476 } 477 478 // Messages returns list of all messages in this module. 479 func AllMessages() []api.Message { 480 return []api.Message{ 481 (*L3xcDel)(nil), 482 (*L3xcDelReply)(nil), 483 (*L3xcDetails)(nil), 484 (*L3xcDump)(nil), 485 (*L3xcPluginGetVersion)(nil), 486 (*L3xcPluginGetVersionReply)(nil), 487 (*L3xcUpdate)(nil), 488 (*L3xcUpdateReply)(nil), 489 } 490 }