github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/bier/bier.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/bier.api.json 6 7 // Package bier contains generated bindings for API file bier.api. 8 // 9 // Contents: 10 // - 2 structs 11 // - 22 messages 12 package bier 13 14 import ( 15 fib_types "github.com/networkservicemesh/govpp/binapi/fib_types" 16 _ "github.com/networkservicemesh/govpp/binapi/ip_types" 17 api "go.fd.io/govpp/api" 18 codec "go.fd.io/govpp/codec" 19 ) 20 21 // This is a compile-time assertion to ensure that this generated file 22 // is compatible with the GoVPP api package it is being compiled against. 23 // A compilation error at this line likely means your copy of the 24 // GoVPP api package needs to be updated. 25 const _ = api.GoVppAPIPackageIsVersion2 26 27 const ( 28 APIFile = "bier" 29 APIVersion = "1.2.1" 30 VersionCrc = 0x8d1cd497 31 ) 32 33 // BierRoute defines type 'bier_route'. 34 type BierRoute struct { 35 BrBp uint32 `binapi:"u32,name=br_bp" json:"br_bp,omitempty"` 36 BrTblID BierTableID `binapi:"bier_table_id,name=br_tbl_id" json:"br_tbl_id,omitempty"` 37 BrNPaths uint8 `binapi:"u8,name=br_n_paths" json:"-"` 38 BrPaths []fib_types.FibPath `binapi:"fib_path[br_n_paths],name=br_paths" json:"br_paths,omitempty"` 39 } 40 41 // BierTableID defines type 'bier_table_id'. 42 type BierTableID struct { 43 BtSet uint8 `binapi:"u8,name=bt_set" json:"bt_set,omitempty"` 44 BtSubDomain uint8 `binapi:"u8,name=bt_sub_domain" json:"bt_sub_domain,omitempty"` 45 BtHdrLenID uint8 `binapi:"u8,name=bt_hdr_len_id" json:"bt_hdr_len_id,omitempty"` 46 } 47 48 // BIER Disposition Entry Add / del 49 // - bde_bp - The Bit-position value for the entry, i.e. the sender's 50 // Use 0 for the default (match any source) entry. 51 // - bde_tbl_id - The BIER disposition table-id the route is added in 52 // - bde_next_hop_sw_if_index - the next hop interface 53 // - bde_is_add - Is this a route add or delete 54 // - bde_payload_proto - The payload protocol for which the next-hop 55 // is added 56 // - bde_paths - The outgoing paths for the entry 57 // 58 // BierDispEntryAddDel defines message 'bier_disp_entry_add_del'. 59 type BierDispEntryAddDel struct { 60 BdeBp uint16 `binapi:"u16,name=bde_bp" json:"bde_bp,omitempty"` 61 BdeTblID uint32 `binapi:"u32,name=bde_tbl_id" json:"bde_tbl_id,omitempty"` 62 BdeIsAdd bool `binapi:"bool,name=bde_is_add" json:"bde_is_add,omitempty"` 63 BdePayloadProto uint8 `binapi:"u8,name=bde_payload_proto" json:"bde_payload_proto,omitempty"` 64 BdeNPaths uint8 `binapi:"u8,name=bde_n_paths" json:"-"` 65 BdePaths []fib_types.FibPath `binapi:"fib_path[bde_n_paths],name=bde_paths" json:"bde_paths,omitempty"` 66 } 67 68 func (m *BierDispEntryAddDel) Reset() { *m = BierDispEntryAddDel{} } 69 func (*BierDispEntryAddDel) GetMessageName() string { return "bier_disp_entry_add_del" } 70 func (*BierDispEntryAddDel) GetCrcString() string { return "9eb80cb4" } 71 func (*BierDispEntryAddDel) GetMessageType() api.MessageType { 72 return api.RequestMessage 73 } 74 75 func (m *BierDispEntryAddDel) Size() (size int) { 76 if m == nil { 77 return 0 78 } 79 size += 2 // m.BdeBp 80 size += 4 // m.BdeTblID 81 size += 1 // m.BdeIsAdd 82 size += 1 // m.BdePayloadProto 83 size += 1 // m.BdeNPaths 84 for j1 := 0; j1 < len(m.BdePaths); j1++ { 85 var s1 fib_types.FibPath 86 _ = s1 87 if j1 < len(m.BdePaths) { 88 s1 = m.BdePaths[j1] 89 } 90 size += 4 // s1.SwIfIndex 91 size += 4 // s1.TableID 92 size += 4 // s1.RpfID 93 size += 1 // s1.Weight 94 size += 1 // s1.Preference 95 size += 4 // s1.Type 96 size += 4 // s1.Flags 97 size += 4 // s1.Proto 98 size += 1 * 16 // s1.Nh.Address 99 size += 4 // s1.Nh.ViaLabel 100 size += 4 // s1.Nh.ObjID 101 size += 4 // s1.Nh.ClassifyTableIndex 102 size += 1 // s1.NLabels 103 for j2 := 0; j2 < 16; j2++ { 104 size += 1 // s1.LabelStack[j2].IsUniform 105 size += 4 // s1.LabelStack[j2].Label 106 size += 1 // s1.LabelStack[j2].TTL 107 size += 1 // s1.LabelStack[j2].Exp 108 } 109 } 110 return size 111 } 112 func (m *BierDispEntryAddDel) Marshal(b []byte) ([]byte, error) { 113 if b == nil { 114 b = make([]byte, m.Size()) 115 } 116 buf := codec.NewBuffer(b) 117 buf.EncodeUint16(m.BdeBp) 118 buf.EncodeUint32(m.BdeTblID) 119 buf.EncodeBool(m.BdeIsAdd) 120 buf.EncodeUint8(m.BdePayloadProto) 121 buf.EncodeUint8(uint8(len(m.BdePaths))) 122 for j0 := 0; j0 < len(m.BdePaths); j0++ { 123 var v0 fib_types.FibPath // BdePaths 124 if j0 < len(m.BdePaths) { 125 v0 = m.BdePaths[j0] 126 } 127 buf.EncodeUint32(v0.SwIfIndex) 128 buf.EncodeUint32(v0.TableID) 129 buf.EncodeUint32(v0.RpfID) 130 buf.EncodeUint8(v0.Weight) 131 buf.EncodeUint8(v0.Preference) 132 buf.EncodeUint32(uint32(v0.Type)) 133 buf.EncodeUint32(uint32(v0.Flags)) 134 buf.EncodeUint32(uint32(v0.Proto)) 135 buf.EncodeBytes(v0.Nh.Address.XXX_UnionData[:], 16) 136 buf.EncodeUint32(v0.Nh.ViaLabel) 137 buf.EncodeUint32(v0.Nh.ObjID) 138 buf.EncodeUint32(v0.Nh.ClassifyTableIndex) 139 buf.EncodeUint8(v0.NLabels) 140 for j1 := 0; j1 < 16; j1++ { 141 buf.EncodeUint8(v0.LabelStack[j1].IsUniform) 142 buf.EncodeUint32(v0.LabelStack[j1].Label) 143 buf.EncodeUint8(v0.LabelStack[j1].TTL) 144 buf.EncodeUint8(v0.LabelStack[j1].Exp) 145 } 146 } 147 return buf.Bytes(), nil 148 } 149 func (m *BierDispEntryAddDel) Unmarshal(b []byte) error { 150 buf := codec.NewBuffer(b) 151 m.BdeBp = buf.DecodeUint16() 152 m.BdeTblID = buf.DecodeUint32() 153 m.BdeIsAdd = buf.DecodeBool() 154 m.BdePayloadProto = buf.DecodeUint8() 155 m.BdeNPaths = buf.DecodeUint8() 156 m.BdePaths = make([]fib_types.FibPath, m.BdeNPaths) 157 for j0 := 0; j0 < len(m.BdePaths); j0++ { 158 m.BdePaths[j0].SwIfIndex = buf.DecodeUint32() 159 m.BdePaths[j0].TableID = buf.DecodeUint32() 160 m.BdePaths[j0].RpfID = buf.DecodeUint32() 161 m.BdePaths[j0].Weight = buf.DecodeUint8() 162 m.BdePaths[j0].Preference = buf.DecodeUint8() 163 m.BdePaths[j0].Type = fib_types.FibPathType(buf.DecodeUint32()) 164 m.BdePaths[j0].Flags = fib_types.FibPathFlags(buf.DecodeUint32()) 165 m.BdePaths[j0].Proto = fib_types.FibPathNhProto(buf.DecodeUint32()) 166 copy(m.BdePaths[j0].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16)) 167 m.BdePaths[j0].Nh.ViaLabel = buf.DecodeUint32() 168 m.BdePaths[j0].Nh.ObjID = buf.DecodeUint32() 169 m.BdePaths[j0].Nh.ClassifyTableIndex = buf.DecodeUint32() 170 m.BdePaths[j0].NLabels = buf.DecodeUint8() 171 for j1 := 0; j1 < 16; j1++ { 172 m.BdePaths[j0].LabelStack[j1].IsUniform = buf.DecodeUint8() 173 m.BdePaths[j0].LabelStack[j1].Label = buf.DecodeUint32() 174 m.BdePaths[j0].LabelStack[j1].TTL = buf.DecodeUint8() 175 m.BdePaths[j0].LabelStack[j1].Exp = buf.DecodeUint8() 176 } 177 } 178 return nil 179 } 180 181 // BierDispEntryAddDelReply defines message 'bier_disp_entry_add_del_reply'. 182 type BierDispEntryAddDelReply struct { 183 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 184 } 185 186 func (m *BierDispEntryAddDelReply) Reset() { *m = BierDispEntryAddDelReply{} } 187 func (*BierDispEntryAddDelReply) GetMessageName() string { return "bier_disp_entry_add_del_reply" } 188 func (*BierDispEntryAddDelReply) GetCrcString() string { return "e8d4e804" } 189 func (*BierDispEntryAddDelReply) GetMessageType() api.MessageType { 190 return api.ReplyMessage 191 } 192 193 func (m *BierDispEntryAddDelReply) Size() (size int) { 194 if m == nil { 195 return 0 196 } 197 size += 4 // m.Retval 198 return size 199 } 200 func (m *BierDispEntryAddDelReply) Marshal(b []byte) ([]byte, error) { 201 if b == nil { 202 b = make([]byte, m.Size()) 203 } 204 buf := codec.NewBuffer(b) 205 buf.EncodeInt32(m.Retval) 206 return buf.Bytes(), nil 207 } 208 func (m *BierDispEntryAddDelReply) Unmarshal(b []byte) error { 209 buf := codec.NewBuffer(b) 210 m.Retval = buf.DecodeInt32() 211 return nil 212 } 213 214 // BierDispEntryDetails defines message 'bier_disp_entry_details'. 215 type BierDispEntryDetails struct { 216 BdeBp uint16 `binapi:"u16,name=bde_bp" json:"bde_bp,omitempty"` 217 BdeTblID uint32 `binapi:"u32,name=bde_tbl_id" json:"bde_tbl_id,omitempty"` 218 BdeIsAdd bool `binapi:"bool,name=bde_is_add" json:"bde_is_add,omitempty"` 219 BdePayloadProto uint8 `binapi:"u8,name=bde_payload_proto" json:"bde_payload_proto,omitempty"` 220 BdeNPaths uint8 `binapi:"u8,name=bde_n_paths" json:"-"` 221 BdePaths []fib_types.FibPath `binapi:"fib_path[bde_n_paths],name=bde_paths" json:"bde_paths,omitempty"` 222 } 223 224 func (m *BierDispEntryDetails) Reset() { *m = BierDispEntryDetails{} } 225 func (*BierDispEntryDetails) GetMessageName() string { return "bier_disp_entry_details" } 226 func (*BierDispEntryDetails) GetCrcString() string { return "84c218f1" } 227 func (*BierDispEntryDetails) GetMessageType() api.MessageType { 228 return api.ReplyMessage 229 } 230 231 func (m *BierDispEntryDetails) Size() (size int) { 232 if m == nil { 233 return 0 234 } 235 size += 2 // m.BdeBp 236 size += 4 // m.BdeTblID 237 size += 1 // m.BdeIsAdd 238 size += 1 // m.BdePayloadProto 239 size += 1 // m.BdeNPaths 240 for j1 := 0; j1 < len(m.BdePaths); j1++ { 241 var s1 fib_types.FibPath 242 _ = s1 243 if j1 < len(m.BdePaths) { 244 s1 = m.BdePaths[j1] 245 } 246 size += 4 // s1.SwIfIndex 247 size += 4 // s1.TableID 248 size += 4 // s1.RpfID 249 size += 1 // s1.Weight 250 size += 1 // s1.Preference 251 size += 4 // s1.Type 252 size += 4 // s1.Flags 253 size += 4 // s1.Proto 254 size += 1 * 16 // s1.Nh.Address 255 size += 4 // s1.Nh.ViaLabel 256 size += 4 // s1.Nh.ObjID 257 size += 4 // s1.Nh.ClassifyTableIndex 258 size += 1 // s1.NLabels 259 for j2 := 0; j2 < 16; j2++ { 260 size += 1 // s1.LabelStack[j2].IsUniform 261 size += 4 // s1.LabelStack[j2].Label 262 size += 1 // s1.LabelStack[j2].TTL 263 size += 1 // s1.LabelStack[j2].Exp 264 } 265 } 266 return size 267 } 268 func (m *BierDispEntryDetails) Marshal(b []byte) ([]byte, error) { 269 if b == nil { 270 b = make([]byte, m.Size()) 271 } 272 buf := codec.NewBuffer(b) 273 buf.EncodeUint16(m.BdeBp) 274 buf.EncodeUint32(m.BdeTblID) 275 buf.EncodeBool(m.BdeIsAdd) 276 buf.EncodeUint8(m.BdePayloadProto) 277 buf.EncodeUint8(uint8(len(m.BdePaths))) 278 for j0 := 0; j0 < len(m.BdePaths); j0++ { 279 var v0 fib_types.FibPath // BdePaths 280 if j0 < len(m.BdePaths) { 281 v0 = m.BdePaths[j0] 282 } 283 buf.EncodeUint32(v0.SwIfIndex) 284 buf.EncodeUint32(v0.TableID) 285 buf.EncodeUint32(v0.RpfID) 286 buf.EncodeUint8(v0.Weight) 287 buf.EncodeUint8(v0.Preference) 288 buf.EncodeUint32(uint32(v0.Type)) 289 buf.EncodeUint32(uint32(v0.Flags)) 290 buf.EncodeUint32(uint32(v0.Proto)) 291 buf.EncodeBytes(v0.Nh.Address.XXX_UnionData[:], 16) 292 buf.EncodeUint32(v0.Nh.ViaLabel) 293 buf.EncodeUint32(v0.Nh.ObjID) 294 buf.EncodeUint32(v0.Nh.ClassifyTableIndex) 295 buf.EncodeUint8(v0.NLabels) 296 for j1 := 0; j1 < 16; j1++ { 297 buf.EncodeUint8(v0.LabelStack[j1].IsUniform) 298 buf.EncodeUint32(v0.LabelStack[j1].Label) 299 buf.EncodeUint8(v0.LabelStack[j1].TTL) 300 buf.EncodeUint8(v0.LabelStack[j1].Exp) 301 } 302 } 303 return buf.Bytes(), nil 304 } 305 func (m *BierDispEntryDetails) Unmarshal(b []byte) error { 306 buf := codec.NewBuffer(b) 307 m.BdeBp = buf.DecodeUint16() 308 m.BdeTblID = buf.DecodeUint32() 309 m.BdeIsAdd = buf.DecodeBool() 310 m.BdePayloadProto = buf.DecodeUint8() 311 m.BdeNPaths = buf.DecodeUint8() 312 m.BdePaths = make([]fib_types.FibPath, m.BdeNPaths) 313 for j0 := 0; j0 < len(m.BdePaths); j0++ { 314 m.BdePaths[j0].SwIfIndex = buf.DecodeUint32() 315 m.BdePaths[j0].TableID = buf.DecodeUint32() 316 m.BdePaths[j0].RpfID = buf.DecodeUint32() 317 m.BdePaths[j0].Weight = buf.DecodeUint8() 318 m.BdePaths[j0].Preference = buf.DecodeUint8() 319 m.BdePaths[j0].Type = fib_types.FibPathType(buf.DecodeUint32()) 320 m.BdePaths[j0].Flags = fib_types.FibPathFlags(buf.DecodeUint32()) 321 m.BdePaths[j0].Proto = fib_types.FibPathNhProto(buf.DecodeUint32()) 322 copy(m.BdePaths[j0].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16)) 323 m.BdePaths[j0].Nh.ViaLabel = buf.DecodeUint32() 324 m.BdePaths[j0].Nh.ObjID = buf.DecodeUint32() 325 m.BdePaths[j0].Nh.ClassifyTableIndex = buf.DecodeUint32() 326 m.BdePaths[j0].NLabels = buf.DecodeUint8() 327 for j1 := 0; j1 < 16; j1++ { 328 m.BdePaths[j0].LabelStack[j1].IsUniform = buf.DecodeUint8() 329 m.BdePaths[j0].LabelStack[j1].Label = buf.DecodeUint32() 330 m.BdePaths[j0].LabelStack[j1].TTL = buf.DecodeUint8() 331 m.BdePaths[j0].LabelStack[j1].Exp = buf.DecodeUint8() 332 } 333 } 334 return nil 335 } 336 337 // BierDispEntryDump defines message 'bier_disp_entry_dump'. 338 type BierDispEntryDump struct { 339 BdeTblID uint32 `binapi:"u32,name=bde_tbl_id" json:"bde_tbl_id,omitempty"` 340 } 341 342 func (m *BierDispEntryDump) Reset() { *m = BierDispEntryDump{} } 343 func (*BierDispEntryDump) GetMessageName() string { return "bier_disp_entry_dump" } 344 func (*BierDispEntryDump) GetCrcString() string { return "b5fa54ad" } 345 func (*BierDispEntryDump) GetMessageType() api.MessageType { 346 return api.RequestMessage 347 } 348 349 func (m *BierDispEntryDump) Size() (size int) { 350 if m == nil { 351 return 0 352 } 353 size += 4 // m.BdeTblID 354 return size 355 } 356 func (m *BierDispEntryDump) Marshal(b []byte) ([]byte, error) { 357 if b == nil { 358 b = make([]byte, m.Size()) 359 } 360 buf := codec.NewBuffer(b) 361 buf.EncodeUint32(m.BdeTblID) 362 return buf.Bytes(), nil 363 } 364 func (m *BierDispEntryDump) Unmarshal(b []byte) error { 365 buf := codec.NewBuffer(b) 366 m.BdeTblID = buf.DecodeUint32() 367 return nil 368 } 369 370 // BIER Disposition Table Add / del route 371 // - bt_tbl_id - The BIER Disposition table-id. 372 // 373 // BierDispTableAddDel defines message 'bier_disp_table_add_del'. 374 type BierDispTableAddDel struct { 375 BdtTblID uint32 `binapi:"u32,name=bdt_tbl_id" json:"bdt_tbl_id,omitempty"` 376 BdtIsAdd bool `binapi:"bool,name=bdt_is_add" json:"bdt_is_add,omitempty"` 377 } 378 379 func (m *BierDispTableAddDel) Reset() { *m = BierDispTableAddDel{} } 380 func (*BierDispTableAddDel) GetMessageName() string { return "bier_disp_table_add_del" } 381 func (*BierDispTableAddDel) GetCrcString() string { return "889657ac" } 382 func (*BierDispTableAddDel) GetMessageType() api.MessageType { 383 return api.RequestMessage 384 } 385 386 func (m *BierDispTableAddDel) Size() (size int) { 387 if m == nil { 388 return 0 389 } 390 size += 4 // m.BdtTblID 391 size += 1 // m.BdtIsAdd 392 return size 393 } 394 func (m *BierDispTableAddDel) Marshal(b []byte) ([]byte, error) { 395 if b == nil { 396 b = make([]byte, m.Size()) 397 } 398 buf := codec.NewBuffer(b) 399 buf.EncodeUint32(m.BdtTblID) 400 buf.EncodeBool(m.BdtIsAdd) 401 return buf.Bytes(), nil 402 } 403 func (m *BierDispTableAddDel) Unmarshal(b []byte) error { 404 buf := codec.NewBuffer(b) 405 m.BdtTblID = buf.DecodeUint32() 406 m.BdtIsAdd = buf.DecodeBool() 407 return nil 408 } 409 410 // BierDispTableAddDelReply defines message 'bier_disp_table_add_del_reply'. 411 type BierDispTableAddDelReply struct { 412 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 413 } 414 415 func (m *BierDispTableAddDelReply) Reset() { *m = BierDispTableAddDelReply{} } 416 func (*BierDispTableAddDelReply) GetMessageName() string { return "bier_disp_table_add_del_reply" } 417 func (*BierDispTableAddDelReply) GetCrcString() string { return "e8d4e804" } 418 func (*BierDispTableAddDelReply) GetMessageType() api.MessageType { 419 return api.ReplyMessage 420 } 421 422 func (m *BierDispTableAddDelReply) Size() (size int) { 423 if m == nil { 424 return 0 425 } 426 size += 4 // m.Retval 427 return size 428 } 429 func (m *BierDispTableAddDelReply) Marshal(b []byte) ([]byte, error) { 430 if b == nil { 431 b = make([]byte, m.Size()) 432 } 433 buf := codec.NewBuffer(b) 434 buf.EncodeInt32(m.Retval) 435 return buf.Bytes(), nil 436 } 437 func (m *BierDispTableAddDelReply) Unmarshal(b []byte) error { 438 buf := codec.NewBuffer(b) 439 m.Retval = buf.DecodeInt32() 440 return nil 441 } 442 443 // BierDispTableDetails defines message 'bier_disp_table_details'. 444 type BierDispTableDetails struct { 445 BdtTblID uint32 `binapi:"u32,name=bdt_tbl_id" json:"bdt_tbl_id,omitempty"` 446 } 447 448 func (m *BierDispTableDetails) Reset() { *m = BierDispTableDetails{} } 449 func (*BierDispTableDetails) GetMessageName() string { return "bier_disp_table_details" } 450 func (*BierDispTableDetails) GetCrcString() string { return "d27942c0" } 451 func (*BierDispTableDetails) GetMessageType() api.MessageType { 452 return api.ReplyMessage 453 } 454 455 func (m *BierDispTableDetails) Size() (size int) { 456 if m == nil { 457 return 0 458 } 459 size += 4 // m.BdtTblID 460 return size 461 } 462 func (m *BierDispTableDetails) Marshal(b []byte) ([]byte, error) { 463 if b == nil { 464 b = make([]byte, m.Size()) 465 } 466 buf := codec.NewBuffer(b) 467 buf.EncodeUint32(m.BdtTblID) 468 return buf.Bytes(), nil 469 } 470 func (m *BierDispTableDetails) Unmarshal(b []byte) error { 471 buf := codec.NewBuffer(b) 472 m.BdtTblID = buf.DecodeUint32() 473 return nil 474 } 475 476 // BierDispTableDump defines message 'bier_disp_table_dump'. 477 type BierDispTableDump struct{} 478 479 func (m *BierDispTableDump) Reset() { *m = BierDispTableDump{} } 480 func (*BierDispTableDump) GetMessageName() string { return "bier_disp_table_dump" } 481 func (*BierDispTableDump) GetCrcString() string { return "51077d14" } 482 func (*BierDispTableDump) GetMessageType() api.MessageType { 483 return api.RequestMessage 484 } 485 486 func (m *BierDispTableDump) Size() (size int) { 487 if m == nil { 488 return 0 489 } 490 return size 491 } 492 func (m *BierDispTableDump) Marshal(b []byte) ([]byte, error) { 493 if b == nil { 494 b = make([]byte, m.Size()) 495 } 496 buf := codec.NewBuffer(b) 497 return buf.Bytes(), nil 498 } 499 func (m *BierDispTableDump) Unmarshal(b []byte) error { 500 return nil 501 } 502 503 // BIER Imposition Add 504 // - bi_tbl_id - The BIER table-id used to forward post encap 505 // - bi_src - The source Bit-position in the encap. 506 // - bi_n_bytes - The number of bytes in the following bit-string. 507 // VPP only supports BSL of 1024 and less, so this is 508 // a u8 field. 509 // - bi_bytes - The bit-string represented as a byte array (MSB first) 510 // 511 // BierImpAdd defines message 'bier_imp_add'. 512 type BierImpAdd struct { 513 BiTblID BierTableID `binapi:"bier_table_id,name=bi_tbl_id" json:"bi_tbl_id,omitempty"` 514 BiSrc uint16 `binapi:"u16,name=bi_src" json:"bi_src,omitempty"` 515 BiNBytes uint8 `binapi:"u8,name=bi_n_bytes" json:"-"` 516 BiBytes []byte `binapi:"u8[bi_n_bytes],name=bi_bytes" json:"bi_bytes,omitempty"` 517 } 518 519 func (m *BierImpAdd) Reset() { *m = BierImpAdd{} } 520 func (*BierImpAdd) GetMessageName() string { return "bier_imp_add" } 521 func (*BierImpAdd) GetCrcString() string { return "3856dc3d" } 522 func (*BierImpAdd) GetMessageType() api.MessageType { 523 return api.RequestMessage 524 } 525 526 func (m *BierImpAdd) Size() (size int) { 527 if m == nil { 528 return 0 529 } 530 size += 1 // m.BiTblID.BtSet 531 size += 1 // m.BiTblID.BtSubDomain 532 size += 1 // m.BiTblID.BtHdrLenID 533 size += 2 // m.BiSrc 534 size += 1 // m.BiNBytes 535 size += 1 * len(m.BiBytes) // m.BiBytes 536 return size 537 } 538 func (m *BierImpAdd) Marshal(b []byte) ([]byte, error) { 539 if b == nil { 540 b = make([]byte, m.Size()) 541 } 542 buf := codec.NewBuffer(b) 543 buf.EncodeUint8(m.BiTblID.BtSet) 544 buf.EncodeUint8(m.BiTblID.BtSubDomain) 545 buf.EncodeUint8(m.BiTblID.BtHdrLenID) 546 buf.EncodeUint16(m.BiSrc) 547 buf.EncodeUint8(uint8(len(m.BiBytes))) 548 buf.EncodeBytes(m.BiBytes, 0) 549 return buf.Bytes(), nil 550 } 551 func (m *BierImpAdd) Unmarshal(b []byte) error { 552 buf := codec.NewBuffer(b) 553 m.BiTblID.BtSet = buf.DecodeUint8() 554 m.BiTblID.BtSubDomain = buf.DecodeUint8() 555 m.BiTblID.BtHdrLenID = buf.DecodeUint8() 556 m.BiSrc = buf.DecodeUint16() 557 m.BiNBytes = buf.DecodeUint8() 558 m.BiBytes = make([]byte, m.BiNBytes) 559 copy(m.BiBytes, buf.DecodeBytes(len(m.BiBytes))) 560 return nil 561 } 562 563 // Reply for BIER route add / del request 564 // - retval - return code 565 // - bi_index - The index of the created imposition object. 566 // 567 // BierImpAddReply defines message 'bier_imp_add_reply'. 568 type BierImpAddReply struct { 569 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 570 BiIndex uint32 `binapi:"u32,name=bi_index" json:"bi_index,omitempty"` 571 } 572 573 func (m *BierImpAddReply) Reset() { *m = BierImpAddReply{} } 574 func (*BierImpAddReply) GetMessageName() string { return "bier_imp_add_reply" } 575 func (*BierImpAddReply) GetCrcString() string { return "d49c5793" } 576 func (*BierImpAddReply) GetMessageType() api.MessageType { 577 return api.ReplyMessage 578 } 579 580 func (m *BierImpAddReply) Size() (size int) { 581 if m == nil { 582 return 0 583 } 584 size += 4 // m.Retval 585 size += 4 // m.BiIndex 586 return size 587 } 588 func (m *BierImpAddReply) Marshal(b []byte) ([]byte, error) { 589 if b == nil { 590 b = make([]byte, m.Size()) 591 } 592 buf := codec.NewBuffer(b) 593 buf.EncodeInt32(m.Retval) 594 buf.EncodeUint32(m.BiIndex) 595 return buf.Bytes(), nil 596 } 597 func (m *BierImpAddReply) Unmarshal(b []byte) error { 598 buf := codec.NewBuffer(b) 599 m.Retval = buf.DecodeInt32() 600 m.BiIndex = buf.DecodeUint32() 601 return nil 602 } 603 604 // BIER Imposition Del 605 // - bi_index - The index of the imposition object (as returned 606 // from the ADD) 607 // 608 // BierImpDel defines message 'bier_imp_del'. 609 type BierImpDel struct { 610 BiIndex uint32 `binapi:"u32,name=bi_index" json:"bi_index,omitempty"` 611 } 612 613 func (m *BierImpDel) Reset() { *m = BierImpDel{} } 614 func (*BierImpDel) GetMessageName() string { return "bier_imp_del" } 615 func (*BierImpDel) GetCrcString() string { return "7d45edf6" } 616 func (*BierImpDel) GetMessageType() api.MessageType { 617 return api.RequestMessage 618 } 619 620 func (m *BierImpDel) Size() (size int) { 621 if m == nil { 622 return 0 623 } 624 size += 4 // m.BiIndex 625 return size 626 } 627 func (m *BierImpDel) Marshal(b []byte) ([]byte, error) { 628 if b == nil { 629 b = make([]byte, m.Size()) 630 } 631 buf := codec.NewBuffer(b) 632 buf.EncodeUint32(m.BiIndex) 633 return buf.Bytes(), nil 634 } 635 func (m *BierImpDel) Unmarshal(b []byte) error { 636 buf := codec.NewBuffer(b) 637 m.BiIndex = buf.DecodeUint32() 638 return nil 639 } 640 641 // BierImpDelReply defines message 'bier_imp_del_reply'. 642 type BierImpDelReply struct { 643 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 644 } 645 646 func (m *BierImpDelReply) Reset() { *m = BierImpDelReply{} } 647 func (*BierImpDelReply) GetMessageName() string { return "bier_imp_del_reply" } 648 func (*BierImpDelReply) GetCrcString() string { return "e8d4e804" } 649 func (*BierImpDelReply) GetMessageType() api.MessageType { 650 return api.ReplyMessage 651 } 652 653 func (m *BierImpDelReply) Size() (size int) { 654 if m == nil { 655 return 0 656 } 657 size += 4 // m.Retval 658 return size 659 } 660 func (m *BierImpDelReply) Marshal(b []byte) ([]byte, error) { 661 if b == nil { 662 b = make([]byte, m.Size()) 663 } 664 buf := codec.NewBuffer(b) 665 buf.EncodeInt32(m.Retval) 666 return buf.Bytes(), nil 667 } 668 func (m *BierImpDelReply) Unmarshal(b []byte) error { 669 buf := codec.NewBuffer(b) 670 m.Retval = buf.DecodeInt32() 671 return nil 672 } 673 674 // BierImpDetails defines message 'bier_imp_details'. 675 type BierImpDetails struct { 676 BiTblID BierTableID `binapi:"bier_table_id,name=bi_tbl_id" json:"bi_tbl_id,omitempty"` 677 BiSrc uint16 `binapi:"u16,name=bi_src" json:"bi_src,omitempty"` 678 BiNBytes uint8 `binapi:"u8,name=bi_n_bytes" json:"-"` 679 BiBytes []byte `binapi:"u8[bi_n_bytes],name=bi_bytes" json:"bi_bytes,omitempty"` 680 } 681 682 func (m *BierImpDetails) Reset() { *m = BierImpDetails{} } 683 func (*BierImpDetails) GetMessageName() string { return "bier_imp_details" } 684 func (*BierImpDetails) GetCrcString() string { return "b76192df" } 685 func (*BierImpDetails) GetMessageType() api.MessageType { 686 return api.ReplyMessage 687 } 688 689 func (m *BierImpDetails) Size() (size int) { 690 if m == nil { 691 return 0 692 } 693 size += 1 // m.BiTblID.BtSet 694 size += 1 // m.BiTblID.BtSubDomain 695 size += 1 // m.BiTblID.BtHdrLenID 696 size += 2 // m.BiSrc 697 size += 1 // m.BiNBytes 698 size += 1 * len(m.BiBytes) // m.BiBytes 699 return size 700 } 701 func (m *BierImpDetails) Marshal(b []byte) ([]byte, error) { 702 if b == nil { 703 b = make([]byte, m.Size()) 704 } 705 buf := codec.NewBuffer(b) 706 buf.EncodeUint8(m.BiTblID.BtSet) 707 buf.EncodeUint8(m.BiTblID.BtSubDomain) 708 buf.EncodeUint8(m.BiTblID.BtHdrLenID) 709 buf.EncodeUint16(m.BiSrc) 710 buf.EncodeUint8(uint8(len(m.BiBytes))) 711 buf.EncodeBytes(m.BiBytes, 0) 712 return buf.Bytes(), nil 713 } 714 func (m *BierImpDetails) Unmarshal(b []byte) error { 715 buf := codec.NewBuffer(b) 716 m.BiTblID.BtSet = buf.DecodeUint8() 717 m.BiTblID.BtSubDomain = buf.DecodeUint8() 718 m.BiTblID.BtHdrLenID = buf.DecodeUint8() 719 m.BiSrc = buf.DecodeUint16() 720 m.BiNBytes = buf.DecodeUint8() 721 m.BiBytes = make([]byte, m.BiNBytes) 722 copy(m.BiBytes, buf.DecodeBytes(len(m.BiBytes))) 723 return nil 724 } 725 726 // BierImpDump defines message 'bier_imp_dump'. 727 type BierImpDump struct{} 728 729 func (m *BierImpDump) Reset() { *m = BierImpDump{} } 730 func (*BierImpDump) GetMessageName() string { return "bier_imp_dump" } 731 func (*BierImpDump) GetCrcString() string { return "51077d14" } 732 func (*BierImpDump) GetMessageType() api.MessageType { 733 return api.RequestMessage 734 } 735 736 func (m *BierImpDump) Size() (size int) { 737 if m == nil { 738 return 0 739 } 740 return size 741 } 742 func (m *BierImpDump) Marshal(b []byte) ([]byte, error) { 743 if b == nil { 744 b = make([]byte, m.Size()) 745 } 746 buf := codec.NewBuffer(b) 747 return buf.Bytes(), nil 748 } 749 func (m *BierImpDump) Unmarshal(b []byte) error { 750 return nil 751 } 752 753 // BIER Route Add / del route 754 // - br_bp - The Bit-position value 755 // - br_tbl_id - The BIER table-id the route is added in 756 // - br_is_add - Is this a route add or delete 757 // - br_is_replace - Are the paths specified replacing those already 758 // present or are they to be combined. 759 // is_replace = 1 and n_paths=0 implies delete the 760 // route and all paths; 761 // - br_n_paths - The number of paths 762 // - br_paths - The array of paths 763 // 764 // BierRouteAddDel defines message 'bier_route_add_del'. 765 type BierRouteAddDel struct { 766 BrIsAdd bool `binapi:"bool,name=br_is_add" json:"br_is_add,omitempty"` 767 BrIsReplace bool `binapi:"bool,name=br_is_replace" json:"br_is_replace,omitempty"` 768 BrRoute BierRoute `binapi:"bier_route,name=br_route" json:"br_route,omitempty"` 769 } 770 771 func (m *BierRouteAddDel) Reset() { *m = BierRouteAddDel{} } 772 func (*BierRouteAddDel) GetMessageName() string { return "bier_route_add_del" } 773 func (*BierRouteAddDel) GetCrcString() string { return "fd02f3ea" } 774 func (*BierRouteAddDel) GetMessageType() api.MessageType { 775 return api.RequestMessage 776 } 777 778 func (m *BierRouteAddDel) Size() (size int) { 779 if m == nil { 780 return 0 781 } 782 size += 1 // m.BrIsAdd 783 size += 1 // m.BrIsReplace 784 size += 4 // m.BrRoute.BrBp 785 size += 1 // m.BrRoute.BrTblID.BtSet 786 size += 1 // m.BrRoute.BrTblID.BtSubDomain 787 size += 1 // m.BrRoute.BrTblID.BtHdrLenID 788 size += 1 // m.BrRoute.BrNPaths 789 for j2 := 0; j2 < len(m.BrRoute.BrPaths); j2++ { 790 var s2 fib_types.FibPath 791 _ = s2 792 if j2 < len(m.BrRoute.BrPaths) { 793 s2 = m.BrRoute.BrPaths[j2] 794 } 795 size += 4 // s2.SwIfIndex 796 size += 4 // s2.TableID 797 size += 4 // s2.RpfID 798 size += 1 // s2.Weight 799 size += 1 // s2.Preference 800 size += 4 // s2.Type 801 size += 4 // s2.Flags 802 size += 4 // s2.Proto 803 size += 1 * 16 // s2.Nh.Address 804 size += 4 // s2.Nh.ViaLabel 805 size += 4 // s2.Nh.ObjID 806 size += 4 // s2.Nh.ClassifyTableIndex 807 size += 1 // s2.NLabels 808 for j3 := 0; j3 < 16; j3++ { 809 size += 1 // s2.LabelStack[j3].IsUniform 810 size += 4 // s2.LabelStack[j3].Label 811 size += 1 // s2.LabelStack[j3].TTL 812 size += 1 // s2.LabelStack[j3].Exp 813 } 814 } 815 return size 816 } 817 func (m *BierRouteAddDel) Marshal(b []byte) ([]byte, error) { 818 if b == nil { 819 b = make([]byte, m.Size()) 820 } 821 buf := codec.NewBuffer(b) 822 buf.EncodeBool(m.BrIsAdd) 823 buf.EncodeBool(m.BrIsReplace) 824 buf.EncodeUint32(m.BrRoute.BrBp) 825 buf.EncodeUint8(m.BrRoute.BrTblID.BtSet) 826 buf.EncodeUint8(m.BrRoute.BrTblID.BtSubDomain) 827 buf.EncodeUint8(m.BrRoute.BrTblID.BtHdrLenID) 828 buf.EncodeUint8(uint8(len(m.BrRoute.BrPaths))) 829 for j1 := 0; j1 < len(m.BrRoute.BrPaths); j1++ { 830 var v1 fib_types.FibPath // BrPaths 831 if j1 < len(m.BrRoute.BrPaths) { 832 v1 = m.BrRoute.BrPaths[j1] 833 } 834 buf.EncodeUint32(v1.SwIfIndex) 835 buf.EncodeUint32(v1.TableID) 836 buf.EncodeUint32(v1.RpfID) 837 buf.EncodeUint8(v1.Weight) 838 buf.EncodeUint8(v1.Preference) 839 buf.EncodeUint32(uint32(v1.Type)) 840 buf.EncodeUint32(uint32(v1.Flags)) 841 buf.EncodeUint32(uint32(v1.Proto)) 842 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16) 843 buf.EncodeUint32(v1.Nh.ViaLabel) 844 buf.EncodeUint32(v1.Nh.ObjID) 845 buf.EncodeUint32(v1.Nh.ClassifyTableIndex) 846 buf.EncodeUint8(v1.NLabels) 847 for j2 := 0; j2 < 16; j2++ { 848 buf.EncodeUint8(v1.LabelStack[j2].IsUniform) 849 buf.EncodeUint32(v1.LabelStack[j2].Label) 850 buf.EncodeUint8(v1.LabelStack[j2].TTL) 851 buf.EncodeUint8(v1.LabelStack[j2].Exp) 852 } 853 } 854 return buf.Bytes(), nil 855 } 856 func (m *BierRouteAddDel) Unmarshal(b []byte) error { 857 buf := codec.NewBuffer(b) 858 m.BrIsAdd = buf.DecodeBool() 859 m.BrIsReplace = buf.DecodeBool() 860 m.BrRoute.BrBp = buf.DecodeUint32() 861 m.BrRoute.BrTblID.BtSet = buf.DecodeUint8() 862 m.BrRoute.BrTblID.BtSubDomain = buf.DecodeUint8() 863 m.BrRoute.BrTblID.BtHdrLenID = buf.DecodeUint8() 864 m.BrRoute.BrNPaths = buf.DecodeUint8() 865 m.BrRoute.BrPaths = make([]fib_types.FibPath, m.BrRoute.BrNPaths) 866 for j1 := 0; j1 < len(m.BrRoute.BrPaths); j1++ { 867 m.BrRoute.BrPaths[j1].SwIfIndex = buf.DecodeUint32() 868 m.BrRoute.BrPaths[j1].TableID = buf.DecodeUint32() 869 m.BrRoute.BrPaths[j1].RpfID = buf.DecodeUint32() 870 m.BrRoute.BrPaths[j1].Weight = buf.DecodeUint8() 871 m.BrRoute.BrPaths[j1].Preference = buf.DecodeUint8() 872 m.BrRoute.BrPaths[j1].Type = fib_types.FibPathType(buf.DecodeUint32()) 873 m.BrRoute.BrPaths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32()) 874 m.BrRoute.BrPaths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32()) 875 copy(m.BrRoute.BrPaths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16)) 876 m.BrRoute.BrPaths[j1].Nh.ViaLabel = buf.DecodeUint32() 877 m.BrRoute.BrPaths[j1].Nh.ObjID = buf.DecodeUint32() 878 m.BrRoute.BrPaths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32() 879 m.BrRoute.BrPaths[j1].NLabels = buf.DecodeUint8() 880 for j2 := 0; j2 < 16; j2++ { 881 m.BrRoute.BrPaths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8() 882 m.BrRoute.BrPaths[j1].LabelStack[j2].Label = buf.DecodeUint32() 883 m.BrRoute.BrPaths[j1].LabelStack[j2].TTL = buf.DecodeUint8() 884 m.BrRoute.BrPaths[j1].LabelStack[j2].Exp = buf.DecodeUint8() 885 } 886 } 887 return nil 888 } 889 890 // BierRouteAddDelReply defines message 'bier_route_add_del_reply'. 891 type BierRouteAddDelReply struct { 892 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 893 } 894 895 func (m *BierRouteAddDelReply) Reset() { *m = BierRouteAddDelReply{} } 896 func (*BierRouteAddDelReply) GetMessageName() string { return "bier_route_add_del_reply" } 897 func (*BierRouteAddDelReply) GetCrcString() string { return "e8d4e804" } 898 func (*BierRouteAddDelReply) GetMessageType() api.MessageType { 899 return api.ReplyMessage 900 } 901 902 func (m *BierRouteAddDelReply) Size() (size int) { 903 if m == nil { 904 return 0 905 } 906 size += 4 // m.Retval 907 return size 908 } 909 func (m *BierRouteAddDelReply) Marshal(b []byte) ([]byte, error) { 910 if b == nil { 911 b = make([]byte, m.Size()) 912 } 913 buf := codec.NewBuffer(b) 914 buf.EncodeInt32(m.Retval) 915 return buf.Bytes(), nil 916 } 917 func (m *BierRouteAddDelReply) Unmarshal(b []byte) error { 918 buf := codec.NewBuffer(b) 919 m.Retval = buf.DecodeInt32() 920 return nil 921 } 922 923 // BierRouteDetails defines message 'bier_route_details'. 924 type BierRouteDetails struct { 925 BrRoute BierRoute `binapi:"bier_route,name=br_route" json:"br_route,omitempty"` 926 } 927 928 func (m *BierRouteDetails) Reset() { *m = BierRouteDetails{} } 929 func (*BierRouteDetails) GetMessageName() string { return "bier_route_details" } 930 func (*BierRouteDetails) GetCrcString() string { return "4008caee" } 931 func (*BierRouteDetails) GetMessageType() api.MessageType { 932 return api.ReplyMessage 933 } 934 935 func (m *BierRouteDetails) Size() (size int) { 936 if m == nil { 937 return 0 938 } 939 size += 4 // m.BrRoute.BrBp 940 size += 1 // m.BrRoute.BrTblID.BtSet 941 size += 1 // m.BrRoute.BrTblID.BtSubDomain 942 size += 1 // m.BrRoute.BrTblID.BtHdrLenID 943 size += 1 // m.BrRoute.BrNPaths 944 for j2 := 0; j2 < len(m.BrRoute.BrPaths); j2++ { 945 var s2 fib_types.FibPath 946 _ = s2 947 if j2 < len(m.BrRoute.BrPaths) { 948 s2 = m.BrRoute.BrPaths[j2] 949 } 950 size += 4 // s2.SwIfIndex 951 size += 4 // s2.TableID 952 size += 4 // s2.RpfID 953 size += 1 // s2.Weight 954 size += 1 // s2.Preference 955 size += 4 // s2.Type 956 size += 4 // s2.Flags 957 size += 4 // s2.Proto 958 size += 1 * 16 // s2.Nh.Address 959 size += 4 // s2.Nh.ViaLabel 960 size += 4 // s2.Nh.ObjID 961 size += 4 // s2.Nh.ClassifyTableIndex 962 size += 1 // s2.NLabels 963 for j3 := 0; j3 < 16; j3++ { 964 size += 1 // s2.LabelStack[j3].IsUniform 965 size += 4 // s2.LabelStack[j3].Label 966 size += 1 // s2.LabelStack[j3].TTL 967 size += 1 // s2.LabelStack[j3].Exp 968 } 969 } 970 return size 971 } 972 func (m *BierRouteDetails) Marshal(b []byte) ([]byte, error) { 973 if b == nil { 974 b = make([]byte, m.Size()) 975 } 976 buf := codec.NewBuffer(b) 977 buf.EncodeUint32(m.BrRoute.BrBp) 978 buf.EncodeUint8(m.BrRoute.BrTblID.BtSet) 979 buf.EncodeUint8(m.BrRoute.BrTblID.BtSubDomain) 980 buf.EncodeUint8(m.BrRoute.BrTblID.BtHdrLenID) 981 buf.EncodeUint8(uint8(len(m.BrRoute.BrPaths))) 982 for j1 := 0; j1 < len(m.BrRoute.BrPaths); j1++ { 983 var v1 fib_types.FibPath // BrPaths 984 if j1 < len(m.BrRoute.BrPaths) { 985 v1 = m.BrRoute.BrPaths[j1] 986 } 987 buf.EncodeUint32(v1.SwIfIndex) 988 buf.EncodeUint32(v1.TableID) 989 buf.EncodeUint32(v1.RpfID) 990 buf.EncodeUint8(v1.Weight) 991 buf.EncodeUint8(v1.Preference) 992 buf.EncodeUint32(uint32(v1.Type)) 993 buf.EncodeUint32(uint32(v1.Flags)) 994 buf.EncodeUint32(uint32(v1.Proto)) 995 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16) 996 buf.EncodeUint32(v1.Nh.ViaLabel) 997 buf.EncodeUint32(v1.Nh.ObjID) 998 buf.EncodeUint32(v1.Nh.ClassifyTableIndex) 999 buf.EncodeUint8(v1.NLabels) 1000 for j2 := 0; j2 < 16; j2++ { 1001 buf.EncodeUint8(v1.LabelStack[j2].IsUniform) 1002 buf.EncodeUint32(v1.LabelStack[j2].Label) 1003 buf.EncodeUint8(v1.LabelStack[j2].TTL) 1004 buf.EncodeUint8(v1.LabelStack[j2].Exp) 1005 } 1006 } 1007 return buf.Bytes(), nil 1008 } 1009 func (m *BierRouteDetails) Unmarshal(b []byte) error { 1010 buf := codec.NewBuffer(b) 1011 m.BrRoute.BrBp = buf.DecodeUint32() 1012 m.BrRoute.BrTblID.BtSet = buf.DecodeUint8() 1013 m.BrRoute.BrTblID.BtSubDomain = buf.DecodeUint8() 1014 m.BrRoute.BrTblID.BtHdrLenID = buf.DecodeUint8() 1015 m.BrRoute.BrNPaths = buf.DecodeUint8() 1016 m.BrRoute.BrPaths = make([]fib_types.FibPath, m.BrRoute.BrNPaths) 1017 for j1 := 0; j1 < len(m.BrRoute.BrPaths); j1++ { 1018 m.BrRoute.BrPaths[j1].SwIfIndex = buf.DecodeUint32() 1019 m.BrRoute.BrPaths[j1].TableID = buf.DecodeUint32() 1020 m.BrRoute.BrPaths[j1].RpfID = buf.DecodeUint32() 1021 m.BrRoute.BrPaths[j1].Weight = buf.DecodeUint8() 1022 m.BrRoute.BrPaths[j1].Preference = buf.DecodeUint8() 1023 m.BrRoute.BrPaths[j1].Type = fib_types.FibPathType(buf.DecodeUint32()) 1024 m.BrRoute.BrPaths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32()) 1025 m.BrRoute.BrPaths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32()) 1026 copy(m.BrRoute.BrPaths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16)) 1027 m.BrRoute.BrPaths[j1].Nh.ViaLabel = buf.DecodeUint32() 1028 m.BrRoute.BrPaths[j1].Nh.ObjID = buf.DecodeUint32() 1029 m.BrRoute.BrPaths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32() 1030 m.BrRoute.BrPaths[j1].NLabels = buf.DecodeUint8() 1031 for j2 := 0; j2 < 16; j2++ { 1032 m.BrRoute.BrPaths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8() 1033 m.BrRoute.BrPaths[j1].LabelStack[j2].Label = buf.DecodeUint32() 1034 m.BrRoute.BrPaths[j1].LabelStack[j2].TTL = buf.DecodeUint8() 1035 m.BrRoute.BrPaths[j1].LabelStack[j2].Exp = buf.DecodeUint8() 1036 } 1037 } 1038 return nil 1039 } 1040 1041 // BierRouteDump defines message 'bier_route_dump'. 1042 type BierRouteDump struct { 1043 BrTblID BierTableID `binapi:"bier_table_id,name=br_tbl_id" json:"br_tbl_id,omitempty"` 1044 } 1045 1046 func (m *BierRouteDump) Reset() { *m = BierRouteDump{} } 1047 func (*BierRouteDump) GetMessageName() string { return "bier_route_dump" } 1048 func (*BierRouteDump) GetCrcString() string { return "38339846" } 1049 func (*BierRouteDump) GetMessageType() api.MessageType { 1050 return api.RequestMessage 1051 } 1052 1053 func (m *BierRouteDump) Size() (size int) { 1054 if m == nil { 1055 return 0 1056 } 1057 size += 1 // m.BrTblID.BtSet 1058 size += 1 // m.BrTblID.BtSubDomain 1059 size += 1 // m.BrTblID.BtHdrLenID 1060 return size 1061 } 1062 func (m *BierRouteDump) Marshal(b []byte) ([]byte, error) { 1063 if b == nil { 1064 b = make([]byte, m.Size()) 1065 } 1066 buf := codec.NewBuffer(b) 1067 buf.EncodeUint8(m.BrTblID.BtSet) 1068 buf.EncodeUint8(m.BrTblID.BtSubDomain) 1069 buf.EncodeUint8(m.BrTblID.BtHdrLenID) 1070 return buf.Bytes(), nil 1071 } 1072 func (m *BierRouteDump) Unmarshal(b []byte) error { 1073 buf := codec.NewBuffer(b) 1074 m.BrTblID.BtSet = buf.DecodeUint8() 1075 m.BrTblID.BtSubDomain = buf.DecodeUint8() 1076 m.BrTblID.BtHdrLenID = buf.DecodeUint8() 1077 return nil 1078 } 1079 1080 // BIER Table Add / del route 1081 // - bt_tbl_id - The BIER table-id the route is added in 1082 // - bt_label - The MPLS label for the table (0 or all ones means not set) 1083 // If the label is not set, then it is assumed that non-MPLS 1084 // encoding is used. 1085 // - bt_is_add - Is this a route add or delete 1086 // 1087 // BierTableAddDel defines message 'bier_table_add_del'. 1088 type BierTableAddDel struct { 1089 BtTblID BierTableID `binapi:"bier_table_id,name=bt_tbl_id" json:"bt_tbl_id,omitempty"` 1090 BtLabel uint32 `binapi:"u32,name=bt_label" json:"bt_label,omitempty"` 1091 BtIsAdd bool `binapi:"bool,name=bt_is_add" json:"bt_is_add,omitempty"` 1092 } 1093 1094 func (m *BierTableAddDel) Reset() { *m = BierTableAddDel{} } 1095 func (*BierTableAddDel) GetMessageName() string { return "bier_table_add_del" } 1096 func (*BierTableAddDel) GetCrcString() string { return "35e59209" } 1097 func (*BierTableAddDel) GetMessageType() api.MessageType { 1098 return api.RequestMessage 1099 } 1100 1101 func (m *BierTableAddDel) Size() (size int) { 1102 if m == nil { 1103 return 0 1104 } 1105 size += 1 // m.BtTblID.BtSet 1106 size += 1 // m.BtTblID.BtSubDomain 1107 size += 1 // m.BtTblID.BtHdrLenID 1108 size += 4 // m.BtLabel 1109 size += 1 // m.BtIsAdd 1110 return size 1111 } 1112 func (m *BierTableAddDel) Marshal(b []byte) ([]byte, error) { 1113 if b == nil { 1114 b = make([]byte, m.Size()) 1115 } 1116 buf := codec.NewBuffer(b) 1117 buf.EncodeUint8(m.BtTblID.BtSet) 1118 buf.EncodeUint8(m.BtTblID.BtSubDomain) 1119 buf.EncodeUint8(m.BtTblID.BtHdrLenID) 1120 buf.EncodeUint32(m.BtLabel) 1121 buf.EncodeBool(m.BtIsAdd) 1122 return buf.Bytes(), nil 1123 } 1124 func (m *BierTableAddDel) Unmarshal(b []byte) error { 1125 buf := codec.NewBuffer(b) 1126 m.BtTblID.BtSet = buf.DecodeUint8() 1127 m.BtTblID.BtSubDomain = buf.DecodeUint8() 1128 m.BtTblID.BtHdrLenID = buf.DecodeUint8() 1129 m.BtLabel = buf.DecodeUint32() 1130 m.BtIsAdd = buf.DecodeBool() 1131 return nil 1132 } 1133 1134 // BierTableAddDelReply defines message 'bier_table_add_del_reply'. 1135 type BierTableAddDelReply struct { 1136 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1137 } 1138 1139 func (m *BierTableAddDelReply) Reset() { *m = BierTableAddDelReply{} } 1140 func (*BierTableAddDelReply) GetMessageName() string { return "bier_table_add_del_reply" } 1141 func (*BierTableAddDelReply) GetCrcString() string { return "e8d4e804" } 1142 func (*BierTableAddDelReply) GetMessageType() api.MessageType { 1143 return api.ReplyMessage 1144 } 1145 1146 func (m *BierTableAddDelReply) Size() (size int) { 1147 if m == nil { 1148 return 0 1149 } 1150 size += 4 // m.Retval 1151 return size 1152 } 1153 func (m *BierTableAddDelReply) Marshal(b []byte) ([]byte, error) { 1154 if b == nil { 1155 b = make([]byte, m.Size()) 1156 } 1157 buf := codec.NewBuffer(b) 1158 buf.EncodeInt32(m.Retval) 1159 return buf.Bytes(), nil 1160 } 1161 func (m *BierTableAddDelReply) Unmarshal(b []byte) error { 1162 buf := codec.NewBuffer(b) 1163 m.Retval = buf.DecodeInt32() 1164 return nil 1165 } 1166 1167 // BierTableDetails defines message 'bier_table_details'. 1168 type BierTableDetails struct { 1169 BtLabel uint32 `binapi:"u32,name=bt_label" json:"bt_label,omitempty"` 1170 BtTblID BierTableID `binapi:"bier_table_id,name=bt_tbl_id" json:"bt_tbl_id,omitempty"` 1171 } 1172 1173 func (m *BierTableDetails) Reset() { *m = BierTableDetails{} } 1174 func (*BierTableDetails) GetMessageName() string { return "bier_table_details" } 1175 func (*BierTableDetails) GetCrcString() string { return "fc44a9dd" } 1176 func (*BierTableDetails) GetMessageType() api.MessageType { 1177 return api.ReplyMessage 1178 } 1179 1180 func (m *BierTableDetails) Size() (size int) { 1181 if m == nil { 1182 return 0 1183 } 1184 size += 4 // m.BtLabel 1185 size += 1 // m.BtTblID.BtSet 1186 size += 1 // m.BtTblID.BtSubDomain 1187 size += 1 // m.BtTblID.BtHdrLenID 1188 return size 1189 } 1190 func (m *BierTableDetails) Marshal(b []byte) ([]byte, error) { 1191 if b == nil { 1192 b = make([]byte, m.Size()) 1193 } 1194 buf := codec.NewBuffer(b) 1195 buf.EncodeUint32(m.BtLabel) 1196 buf.EncodeUint8(m.BtTblID.BtSet) 1197 buf.EncodeUint8(m.BtTblID.BtSubDomain) 1198 buf.EncodeUint8(m.BtTblID.BtHdrLenID) 1199 return buf.Bytes(), nil 1200 } 1201 func (m *BierTableDetails) Unmarshal(b []byte) error { 1202 buf := codec.NewBuffer(b) 1203 m.BtLabel = buf.DecodeUint32() 1204 m.BtTblID.BtSet = buf.DecodeUint8() 1205 m.BtTblID.BtSubDomain = buf.DecodeUint8() 1206 m.BtTblID.BtHdrLenID = buf.DecodeUint8() 1207 return nil 1208 } 1209 1210 // BierTableDump defines message 'bier_table_dump'. 1211 type BierTableDump struct{} 1212 1213 func (m *BierTableDump) Reset() { *m = BierTableDump{} } 1214 func (*BierTableDump) GetMessageName() string { return "bier_table_dump" } 1215 func (*BierTableDump) GetCrcString() string { return "51077d14" } 1216 func (*BierTableDump) GetMessageType() api.MessageType { 1217 return api.RequestMessage 1218 } 1219 1220 func (m *BierTableDump) Size() (size int) { 1221 if m == nil { 1222 return 0 1223 } 1224 return size 1225 } 1226 func (m *BierTableDump) Marshal(b []byte) ([]byte, error) { 1227 if b == nil { 1228 b = make([]byte, m.Size()) 1229 } 1230 buf := codec.NewBuffer(b) 1231 return buf.Bytes(), nil 1232 } 1233 func (m *BierTableDump) Unmarshal(b []byte) error { 1234 return nil 1235 } 1236 1237 func init() { file_bier_binapi_init() } 1238 func file_bier_binapi_init() { 1239 api.RegisterMessage((*BierDispEntryAddDel)(nil), "bier_disp_entry_add_del_9eb80cb4") 1240 api.RegisterMessage((*BierDispEntryAddDelReply)(nil), "bier_disp_entry_add_del_reply_e8d4e804") 1241 api.RegisterMessage((*BierDispEntryDetails)(nil), "bier_disp_entry_details_84c218f1") 1242 api.RegisterMessage((*BierDispEntryDump)(nil), "bier_disp_entry_dump_b5fa54ad") 1243 api.RegisterMessage((*BierDispTableAddDel)(nil), "bier_disp_table_add_del_889657ac") 1244 api.RegisterMessage((*BierDispTableAddDelReply)(nil), "bier_disp_table_add_del_reply_e8d4e804") 1245 api.RegisterMessage((*BierDispTableDetails)(nil), "bier_disp_table_details_d27942c0") 1246 api.RegisterMessage((*BierDispTableDump)(nil), "bier_disp_table_dump_51077d14") 1247 api.RegisterMessage((*BierImpAdd)(nil), "bier_imp_add_3856dc3d") 1248 api.RegisterMessage((*BierImpAddReply)(nil), "bier_imp_add_reply_d49c5793") 1249 api.RegisterMessage((*BierImpDel)(nil), "bier_imp_del_7d45edf6") 1250 api.RegisterMessage((*BierImpDelReply)(nil), "bier_imp_del_reply_e8d4e804") 1251 api.RegisterMessage((*BierImpDetails)(nil), "bier_imp_details_b76192df") 1252 api.RegisterMessage((*BierImpDump)(nil), "bier_imp_dump_51077d14") 1253 api.RegisterMessage((*BierRouteAddDel)(nil), "bier_route_add_del_fd02f3ea") 1254 api.RegisterMessage((*BierRouteAddDelReply)(nil), "bier_route_add_del_reply_e8d4e804") 1255 api.RegisterMessage((*BierRouteDetails)(nil), "bier_route_details_4008caee") 1256 api.RegisterMessage((*BierRouteDump)(nil), "bier_route_dump_38339846") 1257 api.RegisterMessage((*BierTableAddDel)(nil), "bier_table_add_del_35e59209") 1258 api.RegisterMessage((*BierTableAddDelReply)(nil), "bier_table_add_del_reply_e8d4e804") 1259 api.RegisterMessage((*BierTableDetails)(nil), "bier_table_details_fc44a9dd") 1260 api.RegisterMessage((*BierTableDump)(nil), "bier_table_dump_51077d14") 1261 } 1262 1263 // Messages returns list of all messages in this module. 1264 func AllMessages() []api.Message { 1265 return []api.Message{ 1266 (*BierDispEntryAddDel)(nil), 1267 (*BierDispEntryAddDelReply)(nil), 1268 (*BierDispEntryDetails)(nil), 1269 (*BierDispEntryDump)(nil), 1270 (*BierDispTableAddDel)(nil), 1271 (*BierDispTableAddDelReply)(nil), 1272 (*BierDispTableDetails)(nil), 1273 (*BierDispTableDump)(nil), 1274 (*BierImpAdd)(nil), 1275 (*BierImpAddReply)(nil), 1276 (*BierImpDel)(nil), 1277 (*BierImpDelReply)(nil), 1278 (*BierImpDetails)(nil), 1279 (*BierImpDump)(nil), 1280 (*BierRouteAddDel)(nil), 1281 (*BierRouteAddDelReply)(nil), 1282 (*BierRouteDetails)(nil), 1283 (*BierRouteDump)(nil), 1284 (*BierTableAddDel)(nil), 1285 (*BierTableAddDelReply)(nil), 1286 (*BierTableDetails)(nil), 1287 (*BierTableDump)(nil), 1288 } 1289 }