github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/sr/sr.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/sr.api.json 6 7 // Package sr contains generated bindings for API file sr.api. 8 // 9 // Contents: 10 // - 1 enum 11 // - 2 structs 12 // - 30 messages 13 package sr 14 15 import ( 16 "strconv" 17 18 interface_types "github.com/networkservicemesh/govpp/binapi/interface_types" 19 ip_types "github.com/networkservicemesh/govpp/binapi/ip_types" 20 sr_types "github.com/networkservicemesh/govpp/binapi/sr_types" 21 api "go.fd.io/govpp/api" 22 codec "go.fd.io/govpp/codec" 23 ) 24 25 // This is a compile-time assertion to ensure that this generated file 26 // is compatible with the GoVPP api package it is being compiled against. 27 // A compilation error at this line likely means your copy of the 28 // GoVPP api package needs to be updated. 29 const _ = api.GoVppAPIPackageIsVersion2 30 31 const ( 32 APIFile = "sr" 33 APIVersion = "2.1.0" 34 VersionCrc = 0x1fa846d0 35 ) 36 37 // SrPolicyType defines enum 'sr_policy_type'. 38 type SrPolicyType uint8 39 40 const ( 41 SR_API_POLICY_TYPE_DEFAULT SrPolicyType = 0 42 SR_API_POLICY_TYPE_SPRAY SrPolicyType = 1 43 SR_API_POLICY_TYPE_TEF SrPolicyType = 2 44 ) 45 46 var ( 47 SrPolicyType_name = map[uint8]string{ 48 0: "SR_API_POLICY_TYPE_DEFAULT", 49 1: "SR_API_POLICY_TYPE_SPRAY", 50 2: "SR_API_POLICY_TYPE_TEF", 51 } 52 SrPolicyType_value = map[string]uint8{ 53 "SR_API_POLICY_TYPE_DEFAULT": 0, 54 "SR_API_POLICY_TYPE_SPRAY": 1, 55 "SR_API_POLICY_TYPE_TEF": 2, 56 } 57 ) 58 59 func (x SrPolicyType) String() string { 60 s, ok := SrPolicyType_name[uint8(x)] 61 if ok { 62 return s 63 } 64 return "SrPolicyType(" + strconv.Itoa(int(x)) + ")" 65 } 66 67 // Srv6SidList defines type 'srv6_sid_list'. 68 type Srv6SidList struct { 69 NumSids uint8 `binapi:"u8,name=num_sids" json:"num_sids,omitempty"` 70 Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"` 71 Sids [16]ip_types.IP6Address `binapi:"ip6_address[16],name=sids" json:"sids,omitempty"` 72 } 73 74 // Srv6SidListWithSlIndex defines type 'srv6_sid_list_with_sl_index'. 75 type Srv6SidListWithSlIndex struct { 76 NumSids uint8 `binapi:"u8,name=num_sids" json:"num_sids,omitempty"` 77 Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"` 78 SlIndex uint32 `binapi:"u32,name=sl_index" json:"sl_index,omitempty"` 79 Sids [16]ip_types.IP6Address `binapi:"ip6_address[16],name=sids" json:"sids,omitempty"` 80 } 81 82 // IPv6 SR LocalSID add/del request 83 // - is_del Boolean of whether its a delete instruction 84 // - localsid_addr IPv6 address of the localsid 85 // - end_psp Boolean of whether decapsulation is allowed in this function 86 // - behavior Type of behavior (function) for this localsid 87 // - sw_if_index Only for L2/L3 xconnect. OIF. In VRF variant the 88 // fib_table. Default:0xffffffff 89 // - vlan_index Only for L2 xconnect. Outgoing VLAN tag. 90 // - fib_table FIB table in which we should install the localsid entry 91 // - nh_addr Next Hop IPv46 address. Only for L2/L3 xconnect. 92 // 93 // SrLocalsidAddDel defines message 'sr_localsid_add_del'. 94 type SrLocalsidAddDel struct { 95 IsDel bool `binapi:"bool,name=is_del,default=false" json:"is_del,omitempty"` 96 Localsid ip_types.IP6Address `binapi:"ip6_address,name=localsid" json:"localsid,omitempty"` 97 EndPsp bool `binapi:"bool,name=end_psp" json:"end_psp,omitempty"` 98 Behavior sr_types.SrBehavior `binapi:"sr_behavior,name=behavior" json:"behavior,omitempty"` 99 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"` 100 VlanIndex uint32 `binapi:"u32,name=vlan_index" json:"vlan_index,omitempty"` 101 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"` 102 NhAddr ip_types.Address `binapi:"address,name=nh_addr" json:"nh_addr,omitempty"` 103 } 104 105 func (m *SrLocalsidAddDel) Reset() { *m = SrLocalsidAddDel{} } 106 func (*SrLocalsidAddDel) GetMessageName() string { return "sr_localsid_add_del" } 107 func (*SrLocalsidAddDel) GetCrcString() string { return "5a36c324" } 108 func (*SrLocalsidAddDel) GetMessageType() api.MessageType { 109 return api.RequestMessage 110 } 111 112 func (m *SrLocalsidAddDel) Size() (size int) { 113 if m == nil { 114 return 0 115 } 116 size += 1 // m.IsDel 117 size += 1 * 16 // m.Localsid 118 size += 1 // m.EndPsp 119 size += 1 // m.Behavior 120 size += 4 // m.SwIfIndex 121 size += 4 // m.VlanIndex 122 size += 4 // m.FibTable 123 size += 1 // m.NhAddr.Af 124 size += 1 * 16 // m.NhAddr.Un 125 return size 126 } 127 func (m *SrLocalsidAddDel) Marshal(b []byte) ([]byte, error) { 128 if b == nil { 129 b = make([]byte, m.Size()) 130 } 131 buf := codec.NewBuffer(b) 132 buf.EncodeBool(m.IsDel) 133 buf.EncodeBytes(m.Localsid[:], 16) 134 buf.EncodeBool(m.EndPsp) 135 buf.EncodeUint8(uint8(m.Behavior)) 136 buf.EncodeUint32(uint32(m.SwIfIndex)) 137 buf.EncodeUint32(m.VlanIndex) 138 buf.EncodeUint32(m.FibTable) 139 buf.EncodeUint8(uint8(m.NhAddr.Af)) 140 buf.EncodeBytes(m.NhAddr.Un.XXX_UnionData[:], 16) 141 return buf.Bytes(), nil 142 } 143 func (m *SrLocalsidAddDel) Unmarshal(b []byte) error { 144 buf := codec.NewBuffer(b) 145 m.IsDel = buf.DecodeBool() 146 copy(m.Localsid[:], buf.DecodeBytes(16)) 147 m.EndPsp = buf.DecodeBool() 148 m.Behavior = sr_types.SrBehavior(buf.DecodeUint8()) 149 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 150 m.VlanIndex = buf.DecodeUint32() 151 m.FibTable = buf.DecodeUint32() 152 m.NhAddr.Af = ip_types.AddressFamily(buf.DecodeUint8()) 153 copy(m.NhAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 154 return nil 155 } 156 157 // SrLocalsidAddDelReply defines message 'sr_localsid_add_del_reply'. 158 type SrLocalsidAddDelReply struct { 159 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 160 } 161 162 func (m *SrLocalsidAddDelReply) Reset() { *m = SrLocalsidAddDelReply{} } 163 func (*SrLocalsidAddDelReply) GetMessageName() string { return "sr_localsid_add_del_reply" } 164 func (*SrLocalsidAddDelReply) GetCrcString() string { return "e8d4e804" } 165 func (*SrLocalsidAddDelReply) GetMessageType() api.MessageType { 166 return api.ReplyMessage 167 } 168 169 func (m *SrLocalsidAddDelReply) Size() (size int) { 170 if m == nil { 171 return 0 172 } 173 size += 4 // m.Retval 174 return size 175 } 176 func (m *SrLocalsidAddDelReply) Marshal(b []byte) ([]byte, error) { 177 if b == nil { 178 b = make([]byte, m.Size()) 179 } 180 buf := codec.NewBuffer(b) 181 buf.EncodeInt32(m.Retval) 182 return buf.Bytes(), nil 183 } 184 func (m *SrLocalsidAddDelReply) Unmarshal(b []byte) error { 185 buf := codec.NewBuffer(b) 186 m.Retval = buf.DecodeInt32() 187 return nil 188 } 189 190 // SrLocalsidsDetails defines message 'sr_localsids_details'. 191 type SrLocalsidsDetails struct { 192 Addr ip_types.IP6Address `binapi:"ip6_address,name=addr" json:"addr,omitempty"` 193 EndPsp bool `binapi:"bool,name=end_psp" json:"end_psp,omitempty"` 194 Behavior sr_types.SrBehavior `binapi:"sr_behavior,name=behavior" json:"behavior,omitempty"` 195 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"` 196 VlanIndex uint32 `binapi:"u32,name=vlan_index" json:"vlan_index,omitempty"` 197 XconnectNhAddr ip_types.Address `binapi:"address,name=xconnect_nh_addr" json:"xconnect_nh_addr,omitempty"` 198 XconnectIfaceOrVrfTable uint32 `binapi:"u32,name=xconnect_iface_or_vrf_table" json:"xconnect_iface_or_vrf_table,omitempty"` 199 } 200 201 func (m *SrLocalsidsDetails) Reset() { *m = SrLocalsidsDetails{} } 202 func (*SrLocalsidsDetails) GetMessageName() string { return "sr_localsids_details" } 203 func (*SrLocalsidsDetails) GetCrcString() string { return "2e9221b9" } 204 func (*SrLocalsidsDetails) GetMessageType() api.MessageType { 205 return api.ReplyMessage 206 } 207 208 func (m *SrLocalsidsDetails) Size() (size int) { 209 if m == nil { 210 return 0 211 } 212 size += 1 * 16 // m.Addr 213 size += 1 // m.EndPsp 214 size += 1 // m.Behavior 215 size += 4 // m.FibTable 216 size += 4 // m.VlanIndex 217 size += 1 // m.XconnectNhAddr.Af 218 size += 1 * 16 // m.XconnectNhAddr.Un 219 size += 4 // m.XconnectIfaceOrVrfTable 220 return size 221 } 222 func (m *SrLocalsidsDetails) Marshal(b []byte) ([]byte, error) { 223 if b == nil { 224 b = make([]byte, m.Size()) 225 } 226 buf := codec.NewBuffer(b) 227 buf.EncodeBytes(m.Addr[:], 16) 228 buf.EncodeBool(m.EndPsp) 229 buf.EncodeUint8(uint8(m.Behavior)) 230 buf.EncodeUint32(m.FibTable) 231 buf.EncodeUint32(m.VlanIndex) 232 buf.EncodeUint8(uint8(m.XconnectNhAddr.Af)) 233 buf.EncodeBytes(m.XconnectNhAddr.Un.XXX_UnionData[:], 16) 234 buf.EncodeUint32(m.XconnectIfaceOrVrfTable) 235 return buf.Bytes(), nil 236 } 237 func (m *SrLocalsidsDetails) Unmarshal(b []byte) error { 238 buf := codec.NewBuffer(b) 239 copy(m.Addr[:], buf.DecodeBytes(16)) 240 m.EndPsp = buf.DecodeBool() 241 m.Behavior = sr_types.SrBehavior(buf.DecodeUint8()) 242 m.FibTable = buf.DecodeUint32() 243 m.VlanIndex = buf.DecodeUint32() 244 m.XconnectNhAddr.Af = ip_types.AddressFamily(buf.DecodeUint8()) 245 copy(m.XconnectNhAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 246 m.XconnectIfaceOrVrfTable = buf.DecodeUint32() 247 return nil 248 } 249 250 // Dump the list of SR LocalSIDs 251 // SrLocalsidsDump defines message 'sr_localsids_dump'. 252 type SrLocalsidsDump struct{} 253 254 func (m *SrLocalsidsDump) Reset() { *m = SrLocalsidsDump{} } 255 func (*SrLocalsidsDump) GetMessageName() string { return "sr_localsids_dump" } 256 func (*SrLocalsidsDump) GetCrcString() string { return "51077d14" } 257 func (*SrLocalsidsDump) GetMessageType() api.MessageType { 258 return api.RequestMessage 259 } 260 261 func (m *SrLocalsidsDump) Size() (size int) { 262 if m == nil { 263 return 0 264 } 265 return size 266 } 267 func (m *SrLocalsidsDump) Marshal(b []byte) ([]byte, error) { 268 if b == nil { 269 b = make([]byte, m.Size()) 270 } 271 buf := codec.NewBuffer(b) 272 return buf.Bytes(), nil 273 } 274 func (m *SrLocalsidsDump) Unmarshal(b []byte) error { 275 return nil 276 } 277 278 // SrLocalsidsWithPacketStatsDetails defines message 'sr_localsids_with_packet_stats_details'. 279 // InProgress: the message form may change in the future versions 280 type SrLocalsidsWithPacketStatsDetails struct { 281 Addr ip_types.IP6Address `binapi:"ip6_address,name=addr" json:"addr,omitempty"` 282 EndPsp bool `binapi:"bool,name=end_psp" json:"end_psp,omitempty"` 283 Behavior sr_types.SrBehavior `binapi:"sr_behavior,name=behavior" json:"behavior,omitempty"` 284 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"` 285 VlanIndex uint32 `binapi:"u32,name=vlan_index" json:"vlan_index,omitempty"` 286 XconnectNhAddr ip_types.Address `binapi:"address,name=xconnect_nh_addr" json:"xconnect_nh_addr,omitempty"` 287 XconnectIfaceOrVrfTable uint32 `binapi:"u32,name=xconnect_iface_or_vrf_table" json:"xconnect_iface_or_vrf_table,omitempty"` 288 GoodTrafficBytes uint64 `binapi:"u64,name=good_traffic_bytes" json:"good_traffic_bytes,omitempty"` 289 GoodTrafficPktCount uint64 `binapi:"u64,name=good_traffic_pkt_count" json:"good_traffic_pkt_count,omitempty"` 290 BadTrafficBytes uint64 `binapi:"u64,name=bad_traffic_bytes" json:"bad_traffic_bytes,omitempty"` 291 BadTrafficPktCount uint64 `binapi:"u64,name=bad_traffic_pkt_count" json:"bad_traffic_pkt_count,omitempty"` 292 } 293 294 func (m *SrLocalsidsWithPacketStatsDetails) Reset() { *m = SrLocalsidsWithPacketStatsDetails{} } 295 func (*SrLocalsidsWithPacketStatsDetails) GetMessageName() string { 296 return "sr_localsids_with_packet_stats_details" 297 } 298 func (*SrLocalsidsWithPacketStatsDetails) GetCrcString() string { return "ce0b1ce0" } 299 func (*SrLocalsidsWithPacketStatsDetails) GetMessageType() api.MessageType { 300 return api.ReplyMessage 301 } 302 303 func (m *SrLocalsidsWithPacketStatsDetails) Size() (size int) { 304 if m == nil { 305 return 0 306 } 307 size += 1 * 16 // m.Addr 308 size += 1 // m.EndPsp 309 size += 1 // m.Behavior 310 size += 4 // m.FibTable 311 size += 4 // m.VlanIndex 312 size += 1 // m.XconnectNhAddr.Af 313 size += 1 * 16 // m.XconnectNhAddr.Un 314 size += 4 // m.XconnectIfaceOrVrfTable 315 size += 8 // m.GoodTrafficBytes 316 size += 8 // m.GoodTrafficPktCount 317 size += 8 // m.BadTrafficBytes 318 size += 8 // m.BadTrafficPktCount 319 return size 320 } 321 func (m *SrLocalsidsWithPacketStatsDetails) Marshal(b []byte) ([]byte, error) { 322 if b == nil { 323 b = make([]byte, m.Size()) 324 } 325 buf := codec.NewBuffer(b) 326 buf.EncodeBytes(m.Addr[:], 16) 327 buf.EncodeBool(m.EndPsp) 328 buf.EncodeUint8(uint8(m.Behavior)) 329 buf.EncodeUint32(m.FibTable) 330 buf.EncodeUint32(m.VlanIndex) 331 buf.EncodeUint8(uint8(m.XconnectNhAddr.Af)) 332 buf.EncodeBytes(m.XconnectNhAddr.Un.XXX_UnionData[:], 16) 333 buf.EncodeUint32(m.XconnectIfaceOrVrfTable) 334 buf.EncodeUint64(m.GoodTrafficBytes) 335 buf.EncodeUint64(m.GoodTrafficPktCount) 336 buf.EncodeUint64(m.BadTrafficBytes) 337 buf.EncodeUint64(m.BadTrafficPktCount) 338 return buf.Bytes(), nil 339 } 340 func (m *SrLocalsidsWithPacketStatsDetails) Unmarshal(b []byte) error { 341 buf := codec.NewBuffer(b) 342 copy(m.Addr[:], buf.DecodeBytes(16)) 343 m.EndPsp = buf.DecodeBool() 344 m.Behavior = sr_types.SrBehavior(buf.DecodeUint8()) 345 m.FibTable = buf.DecodeUint32() 346 m.VlanIndex = buf.DecodeUint32() 347 m.XconnectNhAddr.Af = ip_types.AddressFamily(buf.DecodeUint8()) 348 copy(m.XconnectNhAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 349 m.XconnectIfaceOrVrfTable = buf.DecodeUint32() 350 m.GoodTrafficBytes = buf.DecodeUint64() 351 m.GoodTrafficPktCount = buf.DecodeUint64() 352 m.BadTrafficBytes = buf.DecodeUint64() 353 m.BadTrafficPktCount = buf.DecodeUint64() 354 return nil 355 } 356 357 // Dump the list of SR LocalSIDs along with packet statistics 358 // SrLocalsidsWithPacketStatsDump defines message 'sr_localsids_with_packet_stats_dump'. 359 // InProgress: the message form may change in the future versions 360 type SrLocalsidsWithPacketStatsDump struct{} 361 362 func (m *SrLocalsidsWithPacketStatsDump) Reset() { *m = SrLocalsidsWithPacketStatsDump{} } 363 func (*SrLocalsidsWithPacketStatsDump) GetMessageName() string { 364 return "sr_localsids_with_packet_stats_dump" 365 } 366 func (*SrLocalsidsWithPacketStatsDump) GetCrcString() string { return "51077d14" } 367 func (*SrLocalsidsWithPacketStatsDump) GetMessageType() api.MessageType { 368 return api.RequestMessage 369 } 370 371 func (m *SrLocalsidsWithPacketStatsDump) Size() (size int) { 372 if m == nil { 373 return 0 374 } 375 return size 376 } 377 func (m *SrLocalsidsWithPacketStatsDump) Marshal(b []byte) ([]byte, error) { 378 if b == nil { 379 b = make([]byte, m.Size()) 380 } 381 buf := codec.NewBuffer(b) 382 return buf.Bytes(), nil 383 } 384 func (m *SrLocalsidsWithPacketStatsDump) Unmarshal(b []byte) error { 385 return nil 386 } 387 388 // SrPoliciesDetails defines message 'sr_policies_details'. 389 type SrPoliciesDetails struct { 390 Bsid ip_types.IP6Address `binapi:"ip6_address,name=bsid" json:"bsid,omitempty"` 391 IsSpray bool `binapi:"bool,name=is_spray" json:"is_spray,omitempty"` 392 IsEncap bool `binapi:"bool,name=is_encap" json:"is_encap,omitempty"` 393 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"` 394 NumSidLists uint8 `binapi:"u8,name=num_sid_lists" json:"-"` 395 SidLists []Srv6SidList `binapi:"srv6_sid_list[num_sid_lists],name=sid_lists" json:"sid_lists,omitempty"` 396 } 397 398 func (m *SrPoliciesDetails) Reset() { *m = SrPoliciesDetails{} } 399 func (*SrPoliciesDetails) GetMessageName() string { return "sr_policies_details" } 400 func (*SrPoliciesDetails) GetCrcString() string { return "db6ff2a1" } 401 func (*SrPoliciesDetails) GetMessageType() api.MessageType { 402 return api.ReplyMessage 403 } 404 405 func (m *SrPoliciesDetails) Size() (size int) { 406 if m == nil { 407 return 0 408 } 409 size += 1 * 16 // m.Bsid 410 size += 1 // m.IsSpray 411 size += 1 // m.IsEncap 412 size += 4 // m.FibTable 413 size += 1 // m.NumSidLists 414 for j1 := 0; j1 < len(m.SidLists); j1++ { 415 var s1 Srv6SidList 416 _ = s1 417 if j1 < len(m.SidLists) { 418 s1 = m.SidLists[j1] 419 } 420 size += 1 // s1.NumSids 421 size += 4 // s1.Weight 422 for j2 := 0; j2 < 16; j2++ { 423 size += 1 * 16 // s1.Sids[j2] 424 } 425 } 426 return size 427 } 428 func (m *SrPoliciesDetails) Marshal(b []byte) ([]byte, error) { 429 if b == nil { 430 b = make([]byte, m.Size()) 431 } 432 buf := codec.NewBuffer(b) 433 buf.EncodeBytes(m.Bsid[:], 16) 434 buf.EncodeBool(m.IsSpray) 435 buf.EncodeBool(m.IsEncap) 436 buf.EncodeUint32(m.FibTable) 437 buf.EncodeUint8(uint8(len(m.SidLists))) 438 for j0 := 0; j0 < len(m.SidLists); j0++ { 439 var v0 Srv6SidList // SidLists 440 if j0 < len(m.SidLists) { 441 v0 = m.SidLists[j0] 442 } 443 buf.EncodeUint8(v0.NumSids) 444 buf.EncodeUint32(v0.Weight) 445 for j1 := 0; j1 < 16; j1++ { 446 buf.EncodeBytes(v0.Sids[j1][:], 16) 447 } 448 } 449 return buf.Bytes(), nil 450 } 451 func (m *SrPoliciesDetails) Unmarshal(b []byte) error { 452 buf := codec.NewBuffer(b) 453 copy(m.Bsid[:], buf.DecodeBytes(16)) 454 m.IsSpray = buf.DecodeBool() 455 m.IsEncap = buf.DecodeBool() 456 m.FibTable = buf.DecodeUint32() 457 m.NumSidLists = buf.DecodeUint8() 458 m.SidLists = make([]Srv6SidList, m.NumSidLists) 459 for j0 := 0; j0 < len(m.SidLists); j0++ { 460 m.SidLists[j0].NumSids = buf.DecodeUint8() 461 m.SidLists[j0].Weight = buf.DecodeUint32() 462 for j1 := 0; j1 < 16; j1++ { 463 copy(m.SidLists[j0].Sids[j1][:], buf.DecodeBytes(16)) 464 } 465 } 466 return nil 467 } 468 469 // Dump the list of SR policies 470 // SrPoliciesDump defines message 'sr_policies_dump'. 471 // Deprecated: the message will be removed in the future versions 472 type SrPoliciesDump struct{} 473 474 func (m *SrPoliciesDump) Reset() { *m = SrPoliciesDump{} } 475 func (*SrPoliciesDump) GetMessageName() string { return "sr_policies_dump" } 476 func (*SrPoliciesDump) GetCrcString() string { return "51077d14" } 477 func (*SrPoliciesDump) GetMessageType() api.MessageType { 478 return api.RequestMessage 479 } 480 481 func (m *SrPoliciesDump) Size() (size int) { 482 if m == nil { 483 return 0 484 } 485 return size 486 } 487 func (m *SrPoliciesDump) Marshal(b []byte) ([]byte, error) { 488 if b == nil { 489 b = make([]byte, m.Size()) 490 } 491 buf := codec.NewBuffer(b) 492 return buf.Bytes(), nil 493 } 494 func (m *SrPoliciesDump) Unmarshal(b []byte) error { 495 return nil 496 } 497 498 // SrPoliciesV2Details defines message 'sr_policies_v2_details'. 499 // InProgress: the message form may change in the future versions 500 type SrPoliciesV2Details struct { 501 Bsid ip_types.IP6Address `binapi:"ip6_address,name=bsid" json:"bsid,omitempty"` 502 EncapSrc ip_types.IP6Address `binapi:"ip6_address,name=encap_src" json:"encap_src,omitempty"` 503 Type SrPolicyType `binapi:"sr_policy_type,name=type" json:"type,omitempty"` 504 IsEncap bool `binapi:"bool,name=is_encap" json:"is_encap,omitempty"` 505 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"` 506 NumSidLists uint8 `binapi:"u8,name=num_sid_lists" json:"-"` 507 SidLists []Srv6SidList `binapi:"srv6_sid_list[num_sid_lists],name=sid_lists" json:"sid_lists,omitempty"` 508 } 509 510 func (m *SrPoliciesV2Details) Reset() { *m = SrPoliciesV2Details{} } 511 func (*SrPoliciesV2Details) GetMessageName() string { return "sr_policies_v2_details" } 512 func (*SrPoliciesV2Details) GetCrcString() string { return "96dcb699" } 513 func (*SrPoliciesV2Details) GetMessageType() api.MessageType { 514 return api.ReplyMessage 515 } 516 517 func (m *SrPoliciesV2Details) Size() (size int) { 518 if m == nil { 519 return 0 520 } 521 size += 1 * 16 // m.Bsid 522 size += 1 * 16 // m.EncapSrc 523 size += 1 // m.Type 524 size += 1 // m.IsEncap 525 size += 4 // m.FibTable 526 size += 1 // m.NumSidLists 527 for j1 := 0; j1 < len(m.SidLists); j1++ { 528 var s1 Srv6SidList 529 _ = s1 530 if j1 < len(m.SidLists) { 531 s1 = m.SidLists[j1] 532 } 533 size += 1 // s1.NumSids 534 size += 4 // s1.Weight 535 for j2 := 0; j2 < 16; j2++ { 536 size += 1 * 16 // s1.Sids[j2] 537 } 538 } 539 return size 540 } 541 func (m *SrPoliciesV2Details) Marshal(b []byte) ([]byte, error) { 542 if b == nil { 543 b = make([]byte, m.Size()) 544 } 545 buf := codec.NewBuffer(b) 546 buf.EncodeBytes(m.Bsid[:], 16) 547 buf.EncodeBytes(m.EncapSrc[:], 16) 548 buf.EncodeUint8(uint8(m.Type)) 549 buf.EncodeBool(m.IsEncap) 550 buf.EncodeUint32(m.FibTable) 551 buf.EncodeUint8(uint8(len(m.SidLists))) 552 for j0 := 0; j0 < len(m.SidLists); j0++ { 553 var v0 Srv6SidList // SidLists 554 if j0 < len(m.SidLists) { 555 v0 = m.SidLists[j0] 556 } 557 buf.EncodeUint8(v0.NumSids) 558 buf.EncodeUint32(v0.Weight) 559 for j1 := 0; j1 < 16; j1++ { 560 buf.EncodeBytes(v0.Sids[j1][:], 16) 561 } 562 } 563 return buf.Bytes(), nil 564 } 565 func (m *SrPoliciesV2Details) Unmarshal(b []byte) error { 566 buf := codec.NewBuffer(b) 567 copy(m.Bsid[:], buf.DecodeBytes(16)) 568 copy(m.EncapSrc[:], buf.DecodeBytes(16)) 569 m.Type = SrPolicyType(buf.DecodeUint8()) 570 m.IsEncap = buf.DecodeBool() 571 m.FibTable = buf.DecodeUint32() 572 m.NumSidLists = buf.DecodeUint8() 573 m.SidLists = make([]Srv6SidList, m.NumSidLists) 574 for j0 := 0; j0 < len(m.SidLists); j0++ { 575 m.SidLists[j0].NumSids = buf.DecodeUint8() 576 m.SidLists[j0].Weight = buf.DecodeUint32() 577 for j1 := 0; j1 < 16; j1++ { 578 copy(m.SidLists[j0].Sids[j1][:], buf.DecodeBytes(16)) 579 } 580 } 581 return nil 582 } 583 584 // Dump the list of SR policies v2 585 // SrPoliciesV2Dump defines message 'sr_policies_v2_dump'. 586 type SrPoliciesV2Dump struct{} 587 588 func (m *SrPoliciesV2Dump) Reset() { *m = SrPoliciesV2Dump{} } 589 func (*SrPoliciesV2Dump) GetMessageName() string { return "sr_policies_v2_dump" } 590 func (*SrPoliciesV2Dump) GetCrcString() string { return "51077d14" } 591 func (*SrPoliciesV2Dump) GetMessageType() api.MessageType { 592 return api.RequestMessage 593 } 594 595 func (m *SrPoliciesV2Dump) Size() (size int) { 596 if m == nil { 597 return 0 598 } 599 return size 600 } 601 func (m *SrPoliciesV2Dump) Marshal(b []byte) ([]byte, error) { 602 if b == nil { 603 b = make([]byte, m.Size()) 604 } 605 buf := codec.NewBuffer(b) 606 return buf.Bytes(), nil 607 } 608 func (m *SrPoliciesV2Dump) Unmarshal(b []byte) error { 609 return nil 610 } 611 612 // SrPoliciesWithSlIndexDetails defines message 'sr_policies_with_sl_index_details'. 613 // InProgress: the message form may change in the future versions 614 type SrPoliciesWithSlIndexDetails struct { 615 Bsid ip_types.IP6Address `binapi:"ip6_address,name=bsid" json:"bsid,omitempty"` 616 IsSpray bool `binapi:"bool,name=is_spray" json:"is_spray,omitempty"` 617 IsEncap bool `binapi:"bool,name=is_encap" json:"is_encap,omitempty"` 618 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"` 619 NumSidLists uint8 `binapi:"u8,name=num_sid_lists" json:"-"` 620 SidLists []Srv6SidListWithSlIndex `binapi:"srv6_sid_list_with_sl_index[num_sid_lists],name=sid_lists" json:"sid_lists,omitempty"` 621 } 622 623 func (m *SrPoliciesWithSlIndexDetails) Reset() { *m = SrPoliciesWithSlIndexDetails{} } 624 func (*SrPoliciesWithSlIndexDetails) GetMessageName() string { 625 return "sr_policies_with_sl_index_details" 626 } 627 func (*SrPoliciesWithSlIndexDetails) GetCrcString() string { return "ca2e9bc8" } 628 func (*SrPoliciesWithSlIndexDetails) GetMessageType() api.MessageType { 629 return api.ReplyMessage 630 } 631 632 func (m *SrPoliciesWithSlIndexDetails) Size() (size int) { 633 if m == nil { 634 return 0 635 } 636 size += 1 * 16 // m.Bsid 637 size += 1 // m.IsSpray 638 size += 1 // m.IsEncap 639 size += 4 // m.FibTable 640 size += 1 // m.NumSidLists 641 for j1 := 0; j1 < len(m.SidLists); j1++ { 642 var s1 Srv6SidListWithSlIndex 643 _ = s1 644 if j1 < len(m.SidLists) { 645 s1 = m.SidLists[j1] 646 } 647 size += 1 // s1.NumSids 648 size += 4 // s1.Weight 649 size += 4 // s1.SlIndex 650 for j2 := 0; j2 < 16; j2++ { 651 size += 1 * 16 // s1.Sids[j2] 652 } 653 } 654 return size 655 } 656 func (m *SrPoliciesWithSlIndexDetails) Marshal(b []byte) ([]byte, error) { 657 if b == nil { 658 b = make([]byte, m.Size()) 659 } 660 buf := codec.NewBuffer(b) 661 buf.EncodeBytes(m.Bsid[:], 16) 662 buf.EncodeBool(m.IsSpray) 663 buf.EncodeBool(m.IsEncap) 664 buf.EncodeUint32(m.FibTable) 665 buf.EncodeUint8(uint8(len(m.SidLists))) 666 for j0 := 0; j0 < len(m.SidLists); j0++ { 667 var v0 Srv6SidListWithSlIndex // SidLists 668 if j0 < len(m.SidLists) { 669 v0 = m.SidLists[j0] 670 } 671 buf.EncodeUint8(v0.NumSids) 672 buf.EncodeUint32(v0.Weight) 673 buf.EncodeUint32(v0.SlIndex) 674 for j1 := 0; j1 < 16; j1++ { 675 buf.EncodeBytes(v0.Sids[j1][:], 16) 676 } 677 } 678 return buf.Bytes(), nil 679 } 680 func (m *SrPoliciesWithSlIndexDetails) Unmarshal(b []byte) error { 681 buf := codec.NewBuffer(b) 682 copy(m.Bsid[:], buf.DecodeBytes(16)) 683 m.IsSpray = buf.DecodeBool() 684 m.IsEncap = buf.DecodeBool() 685 m.FibTable = buf.DecodeUint32() 686 m.NumSidLists = buf.DecodeUint8() 687 m.SidLists = make([]Srv6SidListWithSlIndex, m.NumSidLists) 688 for j0 := 0; j0 < len(m.SidLists); j0++ { 689 m.SidLists[j0].NumSids = buf.DecodeUint8() 690 m.SidLists[j0].Weight = buf.DecodeUint32() 691 m.SidLists[j0].SlIndex = buf.DecodeUint32() 692 for j1 := 0; j1 < 16; j1++ { 693 copy(m.SidLists[j0].Sids[j1][:], buf.DecodeBytes(16)) 694 } 695 } 696 return nil 697 } 698 699 // Dump the list of SR policies along with actual segment list index on VPP 700 // SrPoliciesWithSlIndexDump defines message 'sr_policies_with_sl_index_dump'. 701 // InProgress: the message form may change in the future versions 702 type SrPoliciesWithSlIndexDump struct{} 703 704 func (m *SrPoliciesWithSlIndexDump) Reset() { *m = SrPoliciesWithSlIndexDump{} } 705 func (*SrPoliciesWithSlIndexDump) GetMessageName() string { return "sr_policies_with_sl_index_dump" } 706 func (*SrPoliciesWithSlIndexDump) GetCrcString() string { return "51077d14" } 707 func (*SrPoliciesWithSlIndexDump) GetMessageType() api.MessageType { 708 return api.RequestMessage 709 } 710 711 func (m *SrPoliciesWithSlIndexDump) Size() (size int) { 712 if m == nil { 713 return 0 714 } 715 return size 716 } 717 func (m *SrPoliciesWithSlIndexDump) Marshal(b []byte) ([]byte, error) { 718 if b == nil { 719 b = make([]byte, m.Size()) 720 } 721 buf := codec.NewBuffer(b) 722 return buf.Bytes(), nil 723 } 724 func (m *SrPoliciesWithSlIndexDump) Unmarshal(b []byte) error { 725 return nil 726 } 727 728 // IPv6 SR policy add 729 // - bsid is the bindingSID of the SR Policy 730 // - weight is the weight of the sid list. optional. 731 // - is_encap is the behavior of the SR policy. (0.SRH insert // 1.Encapsulation) 732 // - is_spray is the type of the SR policy. (0.Default // 1.Spray) 733 // - fib_table is the VRF where to install the FIB entry for the BSID 734 // - sids is a srv6_sid_list object 735 // 736 // SrPolicyAdd defines message 'sr_policy_add'. 737 type SrPolicyAdd struct { 738 BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"` 739 Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"` 740 IsEncap bool `binapi:"bool,name=is_encap" json:"is_encap,omitempty"` 741 IsSpray bool `binapi:"bool,name=is_spray" json:"is_spray,omitempty"` 742 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"` 743 Sids Srv6SidList `binapi:"srv6_sid_list,name=sids" json:"sids,omitempty"` 744 } 745 746 func (m *SrPolicyAdd) Reset() { *m = SrPolicyAdd{} } 747 func (*SrPolicyAdd) GetMessageName() string { return "sr_policy_add" } 748 func (*SrPolicyAdd) GetCrcString() string { return "44ac92e8" } 749 func (*SrPolicyAdd) GetMessageType() api.MessageType { 750 return api.RequestMessage 751 } 752 753 func (m *SrPolicyAdd) Size() (size int) { 754 if m == nil { 755 return 0 756 } 757 size += 1 * 16 // m.BsidAddr 758 size += 4 // m.Weight 759 size += 1 // m.IsEncap 760 size += 1 // m.IsSpray 761 size += 4 // m.FibTable 762 size += 1 // m.Sids.NumSids 763 size += 4 // m.Sids.Weight 764 for j2 := 0; j2 < 16; j2++ { 765 size += 1 * 16 // m.Sids.Sids[j2] 766 } 767 return size 768 } 769 func (m *SrPolicyAdd) Marshal(b []byte) ([]byte, error) { 770 if b == nil { 771 b = make([]byte, m.Size()) 772 } 773 buf := codec.NewBuffer(b) 774 buf.EncodeBytes(m.BsidAddr[:], 16) 775 buf.EncodeUint32(m.Weight) 776 buf.EncodeBool(m.IsEncap) 777 buf.EncodeBool(m.IsSpray) 778 buf.EncodeUint32(m.FibTable) 779 buf.EncodeUint8(m.Sids.NumSids) 780 buf.EncodeUint32(m.Sids.Weight) 781 for j1 := 0; j1 < 16; j1++ { 782 buf.EncodeBytes(m.Sids.Sids[j1][:], 16) 783 } 784 return buf.Bytes(), nil 785 } 786 func (m *SrPolicyAdd) Unmarshal(b []byte) error { 787 buf := codec.NewBuffer(b) 788 copy(m.BsidAddr[:], buf.DecodeBytes(16)) 789 m.Weight = buf.DecodeUint32() 790 m.IsEncap = buf.DecodeBool() 791 m.IsSpray = buf.DecodeBool() 792 m.FibTable = buf.DecodeUint32() 793 m.Sids.NumSids = buf.DecodeUint8() 794 m.Sids.Weight = buf.DecodeUint32() 795 for j1 := 0; j1 < 16; j1++ { 796 copy(m.Sids.Sids[j1][:], buf.DecodeBytes(16)) 797 } 798 return nil 799 } 800 801 // SrPolicyAddReply defines message 'sr_policy_add_reply'. 802 type SrPolicyAddReply struct { 803 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 804 } 805 806 func (m *SrPolicyAddReply) Reset() { *m = SrPolicyAddReply{} } 807 func (*SrPolicyAddReply) GetMessageName() string { return "sr_policy_add_reply" } 808 func (*SrPolicyAddReply) GetCrcString() string { return "e8d4e804" } 809 func (*SrPolicyAddReply) GetMessageType() api.MessageType { 810 return api.ReplyMessage 811 } 812 813 func (m *SrPolicyAddReply) Size() (size int) { 814 if m == nil { 815 return 0 816 } 817 size += 4 // m.Retval 818 return size 819 } 820 func (m *SrPolicyAddReply) Marshal(b []byte) ([]byte, error) { 821 if b == nil { 822 b = make([]byte, m.Size()) 823 } 824 buf := codec.NewBuffer(b) 825 buf.EncodeInt32(m.Retval) 826 return buf.Bytes(), nil 827 } 828 func (m *SrPolicyAddReply) Unmarshal(b []byte) error { 829 buf := codec.NewBuffer(b) 830 m.Retval = buf.DecodeInt32() 831 return nil 832 } 833 834 // IPv6 SR policy add 835 // - bsid is the bindingSID of the SR Policy 836 // - weight is the weight of the sid list. optional. 837 // - is_encap is the behavior of the SR policy. (0.SRH insert // 1.Encapsulation) 838 // - type is the SR policy param. (0.Default // 1.Spray // 2.Tef) 839 // - fib_table is the VRF where to install the FIB entry for the BSID 840 // - sids is a srv6_sid_list object 841 // - encap_src is a encaps IPv6 source addr. optional. 842 // 843 // SrPolicyAddV2 defines message 'sr_policy_add_v2'. 844 // InProgress: the message form may change in the future versions 845 type SrPolicyAddV2 struct { 846 BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"` 847 Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"` 848 IsEncap bool `binapi:"bool,name=is_encap" json:"is_encap,omitempty"` 849 Type SrPolicyType `binapi:"sr_policy_type,name=type,default=0" json:"type,omitempty"` 850 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"` 851 Sids Srv6SidList `binapi:"srv6_sid_list,name=sids" json:"sids,omitempty"` 852 EncapSrc ip_types.IP6Address `binapi:"ip6_address,name=encap_src" json:"encap_src,omitempty"` 853 } 854 855 func (m *SrPolicyAddV2) Reset() { *m = SrPolicyAddV2{} } 856 func (*SrPolicyAddV2) GetMessageName() string { return "sr_policy_add_v2" } 857 func (*SrPolicyAddV2) GetCrcString() string { return "f6297f36" } 858 func (*SrPolicyAddV2) GetMessageType() api.MessageType { 859 return api.RequestMessage 860 } 861 862 func (m *SrPolicyAddV2) Size() (size int) { 863 if m == nil { 864 return 0 865 } 866 size += 1 * 16 // m.BsidAddr 867 size += 4 // m.Weight 868 size += 1 // m.IsEncap 869 size += 1 // m.Type 870 size += 4 // m.FibTable 871 size += 1 // m.Sids.NumSids 872 size += 4 // m.Sids.Weight 873 for j2 := 0; j2 < 16; j2++ { 874 size += 1 * 16 // m.Sids.Sids[j2] 875 } 876 size += 1 * 16 // m.EncapSrc 877 return size 878 } 879 func (m *SrPolicyAddV2) Marshal(b []byte) ([]byte, error) { 880 if b == nil { 881 b = make([]byte, m.Size()) 882 } 883 buf := codec.NewBuffer(b) 884 buf.EncodeBytes(m.BsidAddr[:], 16) 885 buf.EncodeUint32(m.Weight) 886 buf.EncodeBool(m.IsEncap) 887 buf.EncodeUint8(uint8(m.Type)) 888 buf.EncodeUint32(m.FibTable) 889 buf.EncodeUint8(m.Sids.NumSids) 890 buf.EncodeUint32(m.Sids.Weight) 891 for j1 := 0; j1 < 16; j1++ { 892 buf.EncodeBytes(m.Sids.Sids[j1][:], 16) 893 } 894 buf.EncodeBytes(m.EncapSrc[:], 16) 895 return buf.Bytes(), nil 896 } 897 func (m *SrPolicyAddV2) Unmarshal(b []byte) error { 898 buf := codec.NewBuffer(b) 899 copy(m.BsidAddr[:], buf.DecodeBytes(16)) 900 m.Weight = buf.DecodeUint32() 901 m.IsEncap = buf.DecodeBool() 902 m.Type = SrPolicyType(buf.DecodeUint8()) 903 m.FibTable = buf.DecodeUint32() 904 m.Sids.NumSids = buf.DecodeUint8() 905 m.Sids.Weight = buf.DecodeUint32() 906 for j1 := 0; j1 < 16; j1++ { 907 copy(m.Sids.Sids[j1][:], buf.DecodeBytes(16)) 908 } 909 copy(m.EncapSrc[:], buf.DecodeBytes(16)) 910 return nil 911 } 912 913 // SrPolicyAddV2Reply defines message 'sr_policy_add_v2_reply'. 914 // InProgress: the message form may change in the future versions 915 type SrPolicyAddV2Reply struct { 916 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 917 } 918 919 func (m *SrPolicyAddV2Reply) Reset() { *m = SrPolicyAddV2Reply{} } 920 func (*SrPolicyAddV2Reply) GetMessageName() string { return "sr_policy_add_v2_reply" } 921 func (*SrPolicyAddV2Reply) GetCrcString() string { return "e8d4e804" } 922 func (*SrPolicyAddV2Reply) GetMessageType() api.MessageType { 923 return api.ReplyMessage 924 } 925 926 func (m *SrPolicyAddV2Reply) Size() (size int) { 927 if m == nil { 928 return 0 929 } 930 size += 4 // m.Retval 931 return size 932 } 933 func (m *SrPolicyAddV2Reply) Marshal(b []byte) ([]byte, error) { 934 if b == nil { 935 b = make([]byte, m.Size()) 936 } 937 buf := codec.NewBuffer(b) 938 buf.EncodeInt32(m.Retval) 939 return buf.Bytes(), nil 940 } 941 func (m *SrPolicyAddV2Reply) Unmarshal(b []byte) error { 942 buf := codec.NewBuffer(b) 943 m.Retval = buf.DecodeInt32() 944 return nil 945 } 946 947 // IPv6 SR policy deletion 948 // - bsid is the bindingSID of the SR Policy 949 // - index is the index of the SR policy 950 // 951 // SrPolicyDel defines message 'sr_policy_del'. 952 type SrPolicyDel struct { 953 BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"` 954 SrPolicyIndex uint32 `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"` 955 } 956 957 func (m *SrPolicyDel) Reset() { *m = SrPolicyDel{} } 958 func (*SrPolicyDel) GetMessageName() string { return "sr_policy_del" } 959 func (*SrPolicyDel) GetCrcString() string { return "cb4d48d5" } 960 func (*SrPolicyDel) GetMessageType() api.MessageType { 961 return api.RequestMessage 962 } 963 964 func (m *SrPolicyDel) Size() (size int) { 965 if m == nil { 966 return 0 967 } 968 size += 1 * 16 // m.BsidAddr 969 size += 4 // m.SrPolicyIndex 970 return size 971 } 972 func (m *SrPolicyDel) Marshal(b []byte) ([]byte, error) { 973 if b == nil { 974 b = make([]byte, m.Size()) 975 } 976 buf := codec.NewBuffer(b) 977 buf.EncodeBytes(m.BsidAddr[:], 16) 978 buf.EncodeUint32(m.SrPolicyIndex) 979 return buf.Bytes(), nil 980 } 981 func (m *SrPolicyDel) Unmarshal(b []byte) error { 982 buf := codec.NewBuffer(b) 983 copy(m.BsidAddr[:], buf.DecodeBytes(16)) 984 m.SrPolicyIndex = buf.DecodeUint32() 985 return nil 986 } 987 988 // SrPolicyDelReply defines message 'sr_policy_del_reply'. 989 type SrPolicyDelReply struct { 990 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 991 } 992 993 func (m *SrPolicyDelReply) Reset() { *m = SrPolicyDelReply{} } 994 func (*SrPolicyDelReply) GetMessageName() string { return "sr_policy_del_reply" } 995 func (*SrPolicyDelReply) GetCrcString() string { return "e8d4e804" } 996 func (*SrPolicyDelReply) GetMessageType() api.MessageType { 997 return api.ReplyMessage 998 } 999 1000 func (m *SrPolicyDelReply) Size() (size int) { 1001 if m == nil { 1002 return 0 1003 } 1004 size += 4 // m.Retval 1005 return size 1006 } 1007 func (m *SrPolicyDelReply) Marshal(b []byte) ([]byte, error) { 1008 if b == nil { 1009 b = make([]byte, m.Size()) 1010 } 1011 buf := codec.NewBuffer(b) 1012 buf.EncodeInt32(m.Retval) 1013 return buf.Bytes(), nil 1014 } 1015 func (m *SrPolicyDelReply) Unmarshal(b []byte) error { 1016 buf := codec.NewBuffer(b) 1017 m.Retval = buf.DecodeInt32() 1018 return nil 1019 } 1020 1021 // IPv6 SR policy modification 1022 // - bsid is the bindingSID of the SR Policy 1023 // - sr_policy_index is the index of the SR policy 1024 // - fib_table is the VRF where to install the FIB entry for the BSID 1025 // - operation is the operation to perform (among the top ones) 1026 // - sl_index is the index of the Segment List to modify/delete 1027 // - weight is the weight of the sid list. optional. 1028 // - sids is a srv6_sid_list object 1029 // 1030 // SrPolicyMod defines message 'sr_policy_mod'. 1031 type SrPolicyMod struct { 1032 BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"` 1033 SrPolicyIndex uint32 `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"` 1034 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"` 1035 Operation sr_types.SrPolicyOp `binapi:"sr_policy_op,name=operation" json:"operation,omitempty"` 1036 SlIndex uint32 `binapi:"u32,name=sl_index" json:"sl_index,omitempty"` 1037 Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"` 1038 Sids Srv6SidList `binapi:"srv6_sid_list,name=sids" json:"sids,omitempty"` 1039 } 1040 1041 func (m *SrPolicyMod) Reset() { *m = SrPolicyMod{} } 1042 func (*SrPolicyMod) GetMessageName() string { return "sr_policy_mod" } 1043 func (*SrPolicyMod) GetCrcString() string { return "b97bb56e" } 1044 func (*SrPolicyMod) GetMessageType() api.MessageType { 1045 return api.RequestMessage 1046 } 1047 1048 func (m *SrPolicyMod) Size() (size int) { 1049 if m == nil { 1050 return 0 1051 } 1052 size += 1 * 16 // m.BsidAddr 1053 size += 4 // m.SrPolicyIndex 1054 size += 4 // m.FibTable 1055 size += 1 // m.Operation 1056 size += 4 // m.SlIndex 1057 size += 4 // m.Weight 1058 size += 1 // m.Sids.NumSids 1059 size += 4 // m.Sids.Weight 1060 for j2 := 0; j2 < 16; j2++ { 1061 size += 1 * 16 // m.Sids.Sids[j2] 1062 } 1063 return size 1064 } 1065 func (m *SrPolicyMod) Marshal(b []byte) ([]byte, error) { 1066 if b == nil { 1067 b = make([]byte, m.Size()) 1068 } 1069 buf := codec.NewBuffer(b) 1070 buf.EncodeBytes(m.BsidAddr[:], 16) 1071 buf.EncodeUint32(m.SrPolicyIndex) 1072 buf.EncodeUint32(m.FibTable) 1073 buf.EncodeUint8(uint8(m.Operation)) 1074 buf.EncodeUint32(m.SlIndex) 1075 buf.EncodeUint32(m.Weight) 1076 buf.EncodeUint8(m.Sids.NumSids) 1077 buf.EncodeUint32(m.Sids.Weight) 1078 for j1 := 0; j1 < 16; j1++ { 1079 buf.EncodeBytes(m.Sids.Sids[j1][:], 16) 1080 } 1081 return buf.Bytes(), nil 1082 } 1083 func (m *SrPolicyMod) Unmarshal(b []byte) error { 1084 buf := codec.NewBuffer(b) 1085 copy(m.BsidAddr[:], buf.DecodeBytes(16)) 1086 m.SrPolicyIndex = buf.DecodeUint32() 1087 m.FibTable = buf.DecodeUint32() 1088 m.Operation = sr_types.SrPolicyOp(buf.DecodeUint8()) 1089 m.SlIndex = buf.DecodeUint32() 1090 m.Weight = buf.DecodeUint32() 1091 m.Sids.NumSids = buf.DecodeUint8() 1092 m.Sids.Weight = buf.DecodeUint32() 1093 for j1 := 0; j1 < 16; j1++ { 1094 copy(m.Sids.Sids[j1][:], buf.DecodeBytes(16)) 1095 } 1096 return nil 1097 } 1098 1099 // SrPolicyModReply defines message 'sr_policy_mod_reply'. 1100 type SrPolicyModReply struct { 1101 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1102 } 1103 1104 func (m *SrPolicyModReply) Reset() { *m = SrPolicyModReply{} } 1105 func (*SrPolicyModReply) GetMessageName() string { return "sr_policy_mod_reply" } 1106 func (*SrPolicyModReply) GetCrcString() string { return "e8d4e804" } 1107 func (*SrPolicyModReply) GetMessageType() api.MessageType { 1108 return api.ReplyMessage 1109 } 1110 1111 func (m *SrPolicyModReply) Size() (size int) { 1112 if m == nil { 1113 return 0 1114 } 1115 size += 4 // m.Retval 1116 return size 1117 } 1118 func (m *SrPolicyModReply) Marshal(b []byte) ([]byte, error) { 1119 if b == nil { 1120 b = make([]byte, m.Size()) 1121 } 1122 buf := codec.NewBuffer(b) 1123 buf.EncodeInt32(m.Retval) 1124 return buf.Bytes(), nil 1125 } 1126 func (m *SrPolicyModReply) Unmarshal(b []byte) error { 1127 buf := codec.NewBuffer(b) 1128 m.Retval = buf.DecodeInt32() 1129 return nil 1130 } 1131 1132 // IPv6 SR policy modification 1133 // - bsid is the bindingSID of the SR Policy 1134 // - sr_policy_index is the index of the SR policy 1135 // - fib_table is the VRF where to install the FIB entry for the BSID 1136 // - operation is the operation to perform (among the top ones) 1137 // - sl_index is the index of the Segment List to modify/delete 1138 // - weight is the weight of the sid list. optional. 1139 // - sids is a srv6_sid_list object 1140 // - encap_src is a encaps IPv6 source addr. optional. 1141 // 1142 // SrPolicyModV2 defines message 'sr_policy_mod_v2'. 1143 // InProgress: the message form may change in the future versions 1144 type SrPolicyModV2 struct { 1145 BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"` 1146 SrPolicyIndex uint32 `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"` 1147 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"` 1148 Operation sr_types.SrPolicyOp `binapi:"sr_policy_op,name=operation" json:"operation,omitempty"` 1149 SlIndex uint32 `binapi:"u32,name=sl_index" json:"sl_index,omitempty"` 1150 Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"` 1151 Sids Srv6SidList `binapi:"srv6_sid_list,name=sids" json:"sids,omitempty"` 1152 EncapSrc ip_types.IP6Address `binapi:"ip6_address,name=encap_src" json:"encap_src,omitempty"` 1153 } 1154 1155 func (m *SrPolicyModV2) Reset() { *m = SrPolicyModV2{} } 1156 func (*SrPolicyModV2) GetMessageName() string { return "sr_policy_mod_v2" } 1157 func (*SrPolicyModV2) GetCrcString() string { return "c0544823" } 1158 func (*SrPolicyModV2) GetMessageType() api.MessageType { 1159 return api.RequestMessage 1160 } 1161 1162 func (m *SrPolicyModV2) Size() (size int) { 1163 if m == nil { 1164 return 0 1165 } 1166 size += 1 * 16 // m.BsidAddr 1167 size += 4 // m.SrPolicyIndex 1168 size += 4 // m.FibTable 1169 size += 1 // m.Operation 1170 size += 4 // m.SlIndex 1171 size += 4 // m.Weight 1172 size += 1 // m.Sids.NumSids 1173 size += 4 // m.Sids.Weight 1174 for j2 := 0; j2 < 16; j2++ { 1175 size += 1 * 16 // m.Sids.Sids[j2] 1176 } 1177 size += 1 * 16 // m.EncapSrc 1178 return size 1179 } 1180 func (m *SrPolicyModV2) Marshal(b []byte) ([]byte, error) { 1181 if b == nil { 1182 b = make([]byte, m.Size()) 1183 } 1184 buf := codec.NewBuffer(b) 1185 buf.EncodeBytes(m.BsidAddr[:], 16) 1186 buf.EncodeUint32(m.SrPolicyIndex) 1187 buf.EncodeUint32(m.FibTable) 1188 buf.EncodeUint8(uint8(m.Operation)) 1189 buf.EncodeUint32(m.SlIndex) 1190 buf.EncodeUint32(m.Weight) 1191 buf.EncodeUint8(m.Sids.NumSids) 1192 buf.EncodeUint32(m.Sids.Weight) 1193 for j1 := 0; j1 < 16; j1++ { 1194 buf.EncodeBytes(m.Sids.Sids[j1][:], 16) 1195 } 1196 buf.EncodeBytes(m.EncapSrc[:], 16) 1197 return buf.Bytes(), nil 1198 } 1199 func (m *SrPolicyModV2) Unmarshal(b []byte) error { 1200 buf := codec.NewBuffer(b) 1201 copy(m.BsidAddr[:], buf.DecodeBytes(16)) 1202 m.SrPolicyIndex = buf.DecodeUint32() 1203 m.FibTable = buf.DecodeUint32() 1204 m.Operation = sr_types.SrPolicyOp(buf.DecodeUint8()) 1205 m.SlIndex = buf.DecodeUint32() 1206 m.Weight = buf.DecodeUint32() 1207 m.Sids.NumSids = buf.DecodeUint8() 1208 m.Sids.Weight = buf.DecodeUint32() 1209 for j1 := 0; j1 < 16; j1++ { 1210 copy(m.Sids.Sids[j1][:], buf.DecodeBytes(16)) 1211 } 1212 copy(m.EncapSrc[:], buf.DecodeBytes(16)) 1213 return nil 1214 } 1215 1216 // SrPolicyModV2Reply defines message 'sr_policy_mod_v2_reply'. 1217 // InProgress: the message form may change in the future versions 1218 type SrPolicyModV2Reply struct { 1219 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1220 } 1221 1222 func (m *SrPolicyModV2Reply) Reset() { *m = SrPolicyModV2Reply{} } 1223 func (*SrPolicyModV2Reply) GetMessageName() string { return "sr_policy_mod_v2_reply" } 1224 func (*SrPolicyModV2Reply) GetCrcString() string { return "e8d4e804" } 1225 func (*SrPolicyModV2Reply) GetMessageType() api.MessageType { 1226 return api.ReplyMessage 1227 } 1228 1229 func (m *SrPolicyModV2Reply) Size() (size int) { 1230 if m == nil { 1231 return 0 1232 } 1233 size += 4 // m.Retval 1234 return size 1235 } 1236 func (m *SrPolicyModV2Reply) Marshal(b []byte) ([]byte, error) { 1237 if b == nil { 1238 b = make([]byte, m.Size()) 1239 } 1240 buf := codec.NewBuffer(b) 1241 buf.EncodeInt32(m.Retval) 1242 return buf.Bytes(), nil 1243 } 1244 func (m *SrPolicyModV2Reply) Unmarshal(b []byte) error { 1245 buf := codec.NewBuffer(b) 1246 m.Retval = buf.DecodeInt32() 1247 return nil 1248 } 1249 1250 // IPv6 SR Set SRv6 encapsulation hop-limit 1251 // - hop_limit is the hop-limit value to set 1252 // 1253 // SrSetEncapHopLimit defines message 'sr_set_encap_hop_limit'. 1254 type SrSetEncapHopLimit struct { 1255 HopLimit uint8 `binapi:"u8,name=hop_limit" json:"hop_limit,omitempty"` 1256 } 1257 1258 func (m *SrSetEncapHopLimit) Reset() { *m = SrSetEncapHopLimit{} } 1259 func (*SrSetEncapHopLimit) GetMessageName() string { return "sr_set_encap_hop_limit" } 1260 func (*SrSetEncapHopLimit) GetCrcString() string { return "aa75d7d0" } 1261 func (*SrSetEncapHopLimit) GetMessageType() api.MessageType { 1262 return api.RequestMessage 1263 } 1264 1265 func (m *SrSetEncapHopLimit) Size() (size int) { 1266 if m == nil { 1267 return 0 1268 } 1269 size += 1 // m.HopLimit 1270 return size 1271 } 1272 func (m *SrSetEncapHopLimit) Marshal(b []byte) ([]byte, error) { 1273 if b == nil { 1274 b = make([]byte, m.Size()) 1275 } 1276 buf := codec.NewBuffer(b) 1277 buf.EncodeUint8(m.HopLimit) 1278 return buf.Bytes(), nil 1279 } 1280 func (m *SrSetEncapHopLimit) Unmarshal(b []byte) error { 1281 buf := codec.NewBuffer(b) 1282 m.HopLimit = buf.DecodeUint8() 1283 return nil 1284 } 1285 1286 // SrSetEncapHopLimitReply defines message 'sr_set_encap_hop_limit_reply'. 1287 type SrSetEncapHopLimitReply struct { 1288 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1289 } 1290 1291 func (m *SrSetEncapHopLimitReply) Reset() { *m = SrSetEncapHopLimitReply{} } 1292 func (*SrSetEncapHopLimitReply) GetMessageName() string { return "sr_set_encap_hop_limit_reply" } 1293 func (*SrSetEncapHopLimitReply) GetCrcString() string { return "e8d4e804" } 1294 func (*SrSetEncapHopLimitReply) GetMessageType() api.MessageType { 1295 return api.ReplyMessage 1296 } 1297 1298 func (m *SrSetEncapHopLimitReply) Size() (size int) { 1299 if m == nil { 1300 return 0 1301 } 1302 size += 4 // m.Retval 1303 return size 1304 } 1305 func (m *SrSetEncapHopLimitReply) Marshal(b []byte) ([]byte, error) { 1306 if b == nil { 1307 b = make([]byte, m.Size()) 1308 } 1309 buf := codec.NewBuffer(b) 1310 buf.EncodeInt32(m.Retval) 1311 return buf.Bytes(), nil 1312 } 1313 func (m *SrSetEncapHopLimitReply) Unmarshal(b []byte) error { 1314 buf := codec.NewBuffer(b) 1315 m.Retval = buf.DecodeInt32() 1316 return nil 1317 } 1318 1319 // IPv6 SR Set SRv6 encapsulation source 1320 // - bsid is the bindingSID of the SR Policy 1321 // - index is the index of the SR policy 1322 // 1323 // SrSetEncapSource defines message 'sr_set_encap_source'. 1324 type SrSetEncapSource struct { 1325 EncapsSource ip_types.IP6Address `binapi:"ip6_address,name=encaps_source" json:"encaps_source,omitempty"` 1326 } 1327 1328 func (m *SrSetEncapSource) Reset() { *m = SrSetEncapSource{} } 1329 func (*SrSetEncapSource) GetMessageName() string { return "sr_set_encap_source" } 1330 func (*SrSetEncapSource) GetCrcString() string { return "d3bad5e1" } 1331 func (*SrSetEncapSource) GetMessageType() api.MessageType { 1332 return api.RequestMessage 1333 } 1334 1335 func (m *SrSetEncapSource) Size() (size int) { 1336 if m == nil { 1337 return 0 1338 } 1339 size += 1 * 16 // m.EncapsSource 1340 return size 1341 } 1342 func (m *SrSetEncapSource) Marshal(b []byte) ([]byte, error) { 1343 if b == nil { 1344 b = make([]byte, m.Size()) 1345 } 1346 buf := codec.NewBuffer(b) 1347 buf.EncodeBytes(m.EncapsSource[:], 16) 1348 return buf.Bytes(), nil 1349 } 1350 func (m *SrSetEncapSource) Unmarshal(b []byte) error { 1351 buf := codec.NewBuffer(b) 1352 copy(m.EncapsSource[:], buf.DecodeBytes(16)) 1353 return nil 1354 } 1355 1356 // SrSetEncapSourceReply defines message 'sr_set_encap_source_reply'. 1357 type SrSetEncapSourceReply struct { 1358 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1359 } 1360 1361 func (m *SrSetEncapSourceReply) Reset() { *m = SrSetEncapSourceReply{} } 1362 func (*SrSetEncapSourceReply) GetMessageName() string { return "sr_set_encap_source_reply" } 1363 func (*SrSetEncapSourceReply) GetCrcString() string { return "e8d4e804" } 1364 func (*SrSetEncapSourceReply) GetMessageType() api.MessageType { 1365 return api.ReplyMessage 1366 } 1367 1368 func (m *SrSetEncapSourceReply) Size() (size int) { 1369 if m == nil { 1370 return 0 1371 } 1372 size += 4 // m.Retval 1373 return size 1374 } 1375 func (m *SrSetEncapSourceReply) Marshal(b []byte) ([]byte, error) { 1376 if b == nil { 1377 b = make([]byte, m.Size()) 1378 } 1379 buf := codec.NewBuffer(b) 1380 buf.EncodeInt32(m.Retval) 1381 return buf.Bytes(), nil 1382 } 1383 func (m *SrSetEncapSourceReply) Unmarshal(b []byte) error { 1384 buf := codec.NewBuffer(b) 1385 m.Retval = buf.DecodeInt32() 1386 return nil 1387 } 1388 1389 // IPv6 SR steering add/del 1390 // - is_del 1391 // - bsid is the bindingSID of the SR Policy (alt to sr_policy_index) 1392 // - sr_policy is the index of the SR Policy (alt to bsid) 1393 // - table_id is the VRF where to install the FIB entry for the BSID 1394 // - prefix is the IPv4/v6 address for L3 traffic type 1395 // - mask_width is the mask for L3 traffic type 1396 // - sw_if_index is the incoming interface for L2 traffic 1397 // - traffic_type describes the type of traffic 1398 // 1399 // SrSteeringAddDel defines message 'sr_steering_add_del'. 1400 type SrSteeringAddDel struct { 1401 IsDel bool `binapi:"bool,name=is_del,default=false" json:"is_del,omitempty"` 1402 BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"` 1403 SrPolicyIndex uint32 `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"` 1404 TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"` 1405 Prefix ip_types.Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"` 1406 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 1407 TrafficType sr_types.SrSteer `binapi:"sr_steer,name=traffic_type" json:"traffic_type,omitempty"` 1408 } 1409 1410 func (m *SrSteeringAddDel) Reset() { *m = SrSteeringAddDel{} } 1411 func (*SrSteeringAddDel) GetMessageName() string { return "sr_steering_add_del" } 1412 func (*SrSteeringAddDel) GetCrcString() string { return "e46b0a0f" } 1413 func (*SrSteeringAddDel) GetMessageType() api.MessageType { 1414 return api.RequestMessage 1415 } 1416 1417 func (m *SrSteeringAddDel) Size() (size int) { 1418 if m == nil { 1419 return 0 1420 } 1421 size += 1 // m.IsDel 1422 size += 1 * 16 // m.BsidAddr 1423 size += 4 // m.SrPolicyIndex 1424 size += 4 // m.TableID 1425 size += 1 // m.Prefix.Address.Af 1426 size += 1 * 16 // m.Prefix.Address.Un 1427 size += 1 // m.Prefix.Len 1428 size += 4 // m.SwIfIndex 1429 size += 1 // m.TrafficType 1430 return size 1431 } 1432 func (m *SrSteeringAddDel) Marshal(b []byte) ([]byte, error) { 1433 if b == nil { 1434 b = make([]byte, m.Size()) 1435 } 1436 buf := codec.NewBuffer(b) 1437 buf.EncodeBool(m.IsDel) 1438 buf.EncodeBytes(m.BsidAddr[:], 16) 1439 buf.EncodeUint32(m.SrPolicyIndex) 1440 buf.EncodeUint32(m.TableID) 1441 buf.EncodeUint8(uint8(m.Prefix.Address.Af)) 1442 buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16) 1443 buf.EncodeUint8(m.Prefix.Len) 1444 buf.EncodeUint32(uint32(m.SwIfIndex)) 1445 buf.EncodeUint8(uint8(m.TrafficType)) 1446 return buf.Bytes(), nil 1447 } 1448 func (m *SrSteeringAddDel) Unmarshal(b []byte) error { 1449 buf := codec.NewBuffer(b) 1450 m.IsDel = buf.DecodeBool() 1451 copy(m.BsidAddr[:], buf.DecodeBytes(16)) 1452 m.SrPolicyIndex = buf.DecodeUint32() 1453 m.TableID = buf.DecodeUint32() 1454 m.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) 1455 copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 1456 m.Prefix.Len = buf.DecodeUint8() 1457 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1458 m.TrafficType = sr_types.SrSteer(buf.DecodeUint8()) 1459 return nil 1460 } 1461 1462 // SrSteeringAddDelReply defines message 'sr_steering_add_del_reply'. 1463 type SrSteeringAddDelReply struct { 1464 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1465 } 1466 1467 func (m *SrSteeringAddDelReply) Reset() { *m = SrSteeringAddDelReply{} } 1468 func (*SrSteeringAddDelReply) GetMessageName() string { return "sr_steering_add_del_reply" } 1469 func (*SrSteeringAddDelReply) GetCrcString() string { return "e8d4e804" } 1470 func (*SrSteeringAddDelReply) GetMessageType() api.MessageType { 1471 return api.ReplyMessage 1472 } 1473 1474 func (m *SrSteeringAddDelReply) Size() (size int) { 1475 if m == nil { 1476 return 0 1477 } 1478 size += 4 // m.Retval 1479 return size 1480 } 1481 func (m *SrSteeringAddDelReply) Marshal(b []byte) ([]byte, error) { 1482 if b == nil { 1483 b = make([]byte, m.Size()) 1484 } 1485 buf := codec.NewBuffer(b) 1486 buf.EncodeInt32(m.Retval) 1487 return buf.Bytes(), nil 1488 } 1489 func (m *SrSteeringAddDelReply) Unmarshal(b []byte) error { 1490 buf := codec.NewBuffer(b) 1491 m.Retval = buf.DecodeInt32() 1492 return nil 1493 } 1494 1495 // SrSteeringPolDetails defines message 'sr_steering_pol_details'. 1496 type SrSteeringPolDetails struct { 1497 TrafficType sr_types.SrSteer `binapi:"sr_steer,name=traffic_type" json:"traffic_type,omitempty"` 1498 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"` 1499 Prefix ip_types.Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"` 1500 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 1501 Bsid ip_types.IP6Address `binapi:"ip6_address,name=bsid" json:"bsid,omitempty"` 1502 } 1503 1504 func (m *SrSteeringPolDetails) Reset() { *m = SrSteeringPolDetails{} } 1505 func (*SrSteeringPolDetails) GetMessageName() string { return "sr_steering_pol_details" } 1506 func (*SrSteeringPolDetails) GetCrcString() string { return "d41258c9" } 1507 func (*SrSteeringPolDetails) GetMessageType() api.MessageType { 1508 return api.ReplyMessage 1509 } 1510 1511 func (m *SrSteeringPolDetails) Size() (size int) { 1512 if m == nil { 1513 return 0 1514 } 1515 size += 1 // m.TrafficType 1516 size += 4 // m.FibTable 1517 size += 1 // m.Prefix.Address.Af 1518 size += 1 * 16 // m.Prefix.Address.Un 1519 size += 1 // m.Prefix.Len 1520 size += 4 // m.SwIfIndex 1521 size += 1 * 16 // m.Bsid 1522 return size 1523 } 1524 func (m *SrSteeringPolDetails) Marshal(b []byte) ([]byte, error) { 1525 if b == nil { 1526 b = make([]byte, m.Size()) 1527 } 1528 buf := codec.NewBuffer(b) 1529 buf.EncodeUint8(uint8(m.TrafficType)) 1530 buf.EncodeUint32(m.FibTable) 1531 buf.EncodeUint8(uint8(m.Prefix.Address.Af)) 1532 buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16) 1533 buf.EncodeUint8(m.Prefix.Len) 1534 buf.EncodeUint32(uint32(m.SwIfIndex)) 1535 buf.EncodeBytes(m.Bsid[:], 16) 1536 return buf.Bytes(), nil 1537 } 1538 func (m *SrSteeringPolDetails) Unmarshal(b []byte) error { 1539 buf := codec.NewBuffer(b) 1540 m.TrafficType = sr_types.SrSteer(buf.DecodeUint8()) 1541 m.FibTable = buf.DecodeUint32() 1542 m.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) 1543 copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 1544 m.Prefix.Len = buf.DecodeUint8() 1545 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1546 copy(m.Bsid[:], buf.DecodeBytes(16)) 1547 return nil 1548 } 1549 1550 // Dump the steering policies 1551 // SrSteeringPolDump defines message 'sr_steering_pol_dump'. 1552 type SrSteeringPolDump struct{} 1553 1554 func (m *SrSteeringPolDump) Reset() { *m = SrSteeringPolDump{} } 1555 func (*SrSteeringPolDump) GetMessageName() string { return "sr_steering_pol_dump" } 1556 func (*SrSteeringPolDump) GetCrcString() string { return "51077d14" } 1557 func (*SrSteeringPolDump) GetMessageType() api.MessageType { 1558 return api.RequestMessage 1559 } 1560 1561 func (m *SrSteeringPolDump) Size() (size int) { 1562 if m == nil { 1563 return 0 1564 } 1565 return size 1566 } 1567 func (m *SrSteeringPolDump) Marshal(b []byte) ([]byte, error) { 1568 if b == nil { 1569 b = make([]byte, m.Size()) 1570 } 1571 buf := codec.NewBuffer(b) 1572 return buf.Bytes(), nil 1573 } 1574 func (m *SrSteeringPolDump) Unmarshal(b []byte) error { 1575 return nil 1576 } 1577 1578 func init() { file_sr_binapi_init() } 1579 func file_sr_binapi_init() { 1580 api.RegisterMessage((*SrLocalsidAddDel)(nil), "sr_localsid_add_del_5a36c324") 1581 api.RegisterMessage((*SrLocalsidAddDelReply)(nil), "sr_localsid_add_del_reply_e8d4e804") 1582 api.RegisterMessage((*SrLocalsidsDetails)(nil), "sr_localsids_details_2e9221b9") 1583 api.RegisterMessage((*SrLocalsidsDump)(nil), "sr_localsids_dump_51077d14") 1584 api.RegisterMessage((*SrLocalsidsWithPacketStatsDetails)(nil), "sr_localsids_with_packet_stats_details_ce0b1ce0") 1585 api.RegisterMessage((*SrLocalsidsWithPacketStatsDump)(nil), "sr_localsids_with_packet_stats_dump_51077d14") 1586 api.RegisterMessage((*SrPoliciesDetails)(nil), "sr_policies_details_db6ff2a1") 1587 api.RegisterMessage((*SrPoliciesDump)(nil), "sr_policies_dump_51077d14") 1588 api.RegisterMessage((*SrPoliciesV2Details)(nil), "sr_policies_v2_details_96dcb699") 1589 api.RegisterMessage((*SrPoliciesV2Dump)(nil), "sr_policies_v2_dump_51077d14") 1590 api.RegisterMessage((*SrPoliciesWithSlIndexDetails)(nil), "sr_policies_with_sl_index_details_ca2e9bc8") 1591 api.RegisterMessage((*SrPoliciesWithSlIndexDump)(nil), "sr_policies_with_sl_index_dump_51077d14") 1592 api.RegisterMessage((*SrPolicyAdd)(nil), "sr_policy_add_44ac92e8") 1593 api.RegisterMessage((*SrPolicyAddReply)(nil), "sr_policy_add_reply_e8d4e804") 1594 api.RegisterMessage((*SrPolicyAddV2)(nil), "sr_policy_add_v2_f6297f36") 1595 api.RegisterMessage((*SrPolicyAddV2Reply)(nil), "sr_policy_add_v2_reply_e8d4e804") 1596 api.RegisterMessage((*SrPolicyDel)(nil), "sr_policy_del_cb4d48d5") 1597 api.RegisterMessage((*SrPolicyDelReply)(nil), "sr_policy_del_reply_e8d4e804") 1598 api.RegisterMessage((*SrPolicyMod)(nil), "sr_policy_mod_b97bb56e") 1599 api.RegisterMessage((*SrPolicyModReply)(nil), "sr_policy_mod_reply_e8d4e804") 1600 api.RegisterMessage((*SrPolicyModV2)(nil), "sr_policy_mod_v2_c0544823") 1601 api.RegisterMessage((*SrPolicyModV2Reply)(nil), "sr_policy_mod_v2_reply_e8d4e804") 1602 api.RegisterMessage((*SrSetEncapHopLimit)(nil), "sr_set_encap_hop_limit_aa75d7d0") 1603 api.RegisterMessage((*SrSetEncapHopLimitReply)(nil), "sr_set_encap_hop_limit_reply_e8d4e804") 1604 api.RegisterMessage((*SrSetEncapSource)(nil), "sr_set_encap_source_d3bad5e1") 1605 api.RegisterMessage((*SrSetEncapSourceReply)(nil), "sr_set_encap_source_reply_e8d4e804") 1606 api.RegisterMessage((*SrSteeringAddDel)(nil), "sr_steering_add_del_e46b0a0f") 1607 api.RegisterMessage((*SrSteeringAddDelReply)(nil), "sr_steering_add_del_reply_e8d4e804") 1608 api.RegisterMessage((*SrSteeringPolDetails)(nil), "sr_steering_pol_details_d41258c9") 1609 api.RegisterMessage((*SrSteeringPolDump)(nil), "sr_steering_pol_dump_51077d14") 1610 } 1611 1612 // Messages returns list of all messages in this module. 1613 func AllMessages() []api.Message { 1614 return []api.Message{ 1615 (*SrLocalsidAddDel)(nil), 1616 (*SrLocalsidAddDelReply)(nil), 1617 (*SrLocalsidsDetails)(nil), 1618 (*SrLocalsidsDump)(nil), 1619 (*SrLocalsidsWithPacketStatsDetails)(nil), 1620 (*SrLocalsidsWithPacketStatsDump)(nil), 1621 (*SrPoliciesDetails)(nil), 1622 (*SrPoliciesDump)(nil), 1623 (*SrPoliciesV2Details)(nil), 1624 (*SrPoliciesV2Dump)(nil), 1625 (*SrPoliciesWithSlIndexDetails)(nil), 1626 (*SrPoliciesWithSlIndexDump)(nil), 1627 (*SrPolicyAdd)(nil), 1628 (*SrPolicyAddReply)(nil), 1629 (*SrPolicyAddV2)(nil), 1630 (*SrPolicyAddV2Reply)(nil), 1631 (*SrPolicyDel)(nil), 1632 (*SrPolicyDelReply)(nil), 1633 (*SrPolicyMod)(nil), 1634 (*SrPolicyModReply)(nil), 1635 (*SrPolicyModV2)(nil), 1636 (*SrPolicyModV2Reply)(nil), 1637 (*SrSetEncapHopLimit)(nil), 1638 (*SrSetEncapHopLimitReply)(nil), 1639 (*SrSetEncapSource)(nil), 1640 (*SrSetEncapSourceReply)(nil), 1641 (*SrSteeringAddDel)(nil), 1642 (*SrSteeringAddDelReply)(nil), 1643 (*SrSteeringPolDetails)(nil), 1644 (*SrSteeringPolDump)(nil), 1645 } 1646 }