X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=examples%2Fbinapi%2Fsr%2Fsr.ba.go;h=180358531631e35e2268a91c7dfbda8188cd8703;hb=c7ae74a95d1bd6fefcbb061f5f045c60c11e32fc;hp=b870456971991fd4ca362307a23f33a8302ef508;hpb=94620e85f0bdbb054af07ce3670fadc1f76cfdf0;p=govpp.git diff --git a/examples/binapi/sr/sr.ba.go b/examples/binapi/sr/sr.ba.go index b870456..1803585 100644 --- a/examples/binapi/sr/sr.ba.go +++ b/examples/binapi/sr/sr.ba.go @@ -1,15 +1,18 @@ // Code generated by GoVPP's binapi-generator. DO NOT EDIT. // versions: -// binapi-generator: v0.4.0-alpha-1-g435c3f4-dirty -// VPP: 20.01-45~g7a071e370~b63 +// binapi-generator: v0.4.0-dev +// VPP: 20.05-release // source: /usr/share/vpp/api/core/sr.api.json /* -Package sr contains generated code for VPP binary API defined by sr.api (version 1.2.0). +Package sr contains generated code for VPP API file sr.api (2.0.0). It consists of: + 6 aliases + 13 enums 20 messages - 3 types + 7 types + 1 union */ package sr @@ -17,13 +20,19 @@ import ( "bytes" "context" "encoding/binary" + "fmt" "io" "math" + "net" "strconv" + "strings" api "git.fd.io/govpp.git/api" codec "git.fd.io/govpp.git/codec" struc "github.com/lunixbochs/struc" + + interface_types "git.fd.io/govpp.git/examples/binapi/interface_types" + ip_types "git.fd.io/govpp.git/examples/binapi/ip_types" ) // This is a compile-time assertion to ensure that this generated file @@ -36,50 +45,149 @@ const ( // ModuleName is the name of this module. ModuleName = "sr" // APIVersion is the API version of this module. - APIVersion = "1.2.0" + APIVersion = "2.0.0" // VersionCrc is the CRC of this module. - VersionCrc = 0xbf277f96 + VersionCrc = 0xd85c77ca +) + +// SrBehavior represents VPP binary API enum 'sr_behavior'. +type SrBehavior uint8 + +const ( + SR_BEHAVIOR_API_END SrBehavior = 1 + SR_BEHAVIOR_API_X SrBehavior = 2 + SR_BEHAVIOR_API_T SrBehavior = 3 + SR_BEHAVIOR_API_D_FIRST SrBehavior = 4 + SR_BEHAVIOR_API_DX2 SrBehavior = 5 + SR_BEHAVIOR_API_DX6 SrBehavior = 6 + SR_BEHAVIOR_API_DX4 SrBehavior = 7 + SR_BEHAVIOR_API_DT6 SrBehavior = 8 + SR_BEHAVIOR_API_DT4 SrBehavior = 9 + SR_BEHAVIOR_API_LAST SrBehavior = 10 +) + +var ( + SrBehavior_name = map[uint8]string{ + 1: "SR_BEHAVIOR_API_END", + 2: "SR_BEHAVIOR_API_X", + 3: "SR_BEHAVIOR_API_T", + 4: "SR_BEHAVIOR_API_D_FIRST", + 5: "SR_BEHAVIOR_API_DX2", + 6: "SR_BEHAVIOR_API_DX6", + 7: "SR_BEHAVIOR_API_DX4", + 8: "SR_BEHAVIOR_API_DT6", + 9: "SR_BEHAVIOR_API_DT4", + 10: "SR_BEHAVIOR_API_LAST", + } + SrBehavior_value = map[string]uint8{ + "SR_BEHAVIOR_API_END": 1, + "SR_BEHAVIOR_API_X": 2, + "SR_BEHAVIOR_API_T": 3, + "SR_BEHAVIOR_API_D_FIRST": 4, + "SR_BEHAVIOR_API_DX2": 5, + "SR_BEHAVIOR_API_DX6": 6, + "SR_BEHAVIOR_API_DX4": 7, + "SR_BEHAVIOR_API_DT6": 8, + "SR_BEHAVIOR_API_DT4": 9, + "SR_BEHAVIOR_API_LAST": 10, + } ) -// SrIP6Address represents VPP binary API type 'sr_ip6_address'. -type SrIP6Address struct { - Data []byte `binapi:"u8[16],name=data" json:"data,omitempty" struc:"[16]byte"` +func (x SrBehavior) String() string { + s, ok := SrBehavior_name[uint8(x)] + if ok { + return s + } + return "SrBehavior(" + strconv.Itoa(int(x)) + ")" } -func (*SrIP6Address) GetTypeName() string { return "sr_ip6_address" } +// SrPolicyOp represents VPP binary API enum 'sr_policy_op'. +type SrPolicyOp uint8 + +const ( + SR_POLICY_OP_API_NONE SrPolicyOp = 0 + SR_POLICY_OP_API_ADD SrPolicyOp = 1 + SR_POLICY_OP_API_DEL SrPolicyOp = 2 + SR_POLICY_OP_API_MOD SrPolicyOp = 3 +) -// Srv6Sid represents VPP binary API type 'srv6_sid'. -type Srv6Sid struct { - Addr []byte `binapi:"u8[16],name=addr" json:"addr,omitempty" struc:"[16]byte"` +var ( + SrPolicyOp_name = map[uint8]string{ + 0: "SR_POLICY_OP_API_NONE", + 1: "SR_POLICY_OP_API_ADD", + 2: "SR_POLICY_OP_API_DEL", + 3: "SR_POLICY_OP_API_MOD", + } + SrPolicyOp_value = map[string]uint8{ + "SR_POLICY_OP_API_NONE": 0, + "SR_POLICY_OP_API_ADD": 1, + "SR_POLICY_OP_API_DEL": 2, + "SR_POLICY_OP_API_MOD": 3, + } +) + +func (x SrPolicyOp) String() string { + s, ok := SrPolicyOp_name[uint8(x)] + if ok { + return s + } + return "SrPolicyOp(" + strconv.Itoa(int(x)) + ")" } -func (*Srv6Sid) GetTypeName() string { return "srv6_sid" } +// SrSteer represents VPP binary API enum 'sr_steer'. +type SrSteer uint8 + +const ( + SR_STEER_API_L2 SrSteer = 2 + SR_STEER_API_IPV4 SrSteer = 4 + SR_STEER_API_IPV6 SrSteer = 6 +) + +var ( + SrSteer_name = map[uint8]string{ + 2: "SR_STEER_API_L2", + 4: "SR_STEER_API_IPV4", + 6: "SR_STEER_API_IPV6", + } + SrSteer_value = map[string]uint8{ + "SR_STEER_API_L2": 2, + "SR_STEER_API_IPV4": 4, + "SR_STEER_API_IPV6": 6, + } +) + +func (x SrSteer) String() string { + s, ok := SrSteer_name[uint8(x)] + if ok { + return s + } + return "SrSteer(" + strconv.Itoa(int(x)) + ")" +} // Srv6SidList represents VPP binary API type 'srv6_sid_list'. type Srv6SidList struct { - NumSids uint8 `binapi:"u8,name=num_sids" json:"num_sids,omitempty"` - Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"` - Sids [16]Srv6Sid `binapi:"srv6_sid[16],name=sids" json:"sids,omitempty" struc:"[16]Srv6Sid"` + NumSids uint8 `binapi:"u8,name=num_sids" json:"num_sids,omitempty"` + Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"` + Sids [16]ip_types.IP6Address `binapi:"ip6_address[16],name=sids" json:"sids,omitempty" struc:"[16]ip_types.IP6Address"` } func (*Srv6SidList) GetTypeName() string { return "srv6_sid_list" } // SrLocalsidAddDel represents VPP binary API message 'sr_localsid_add_del'. type SrLocalsidAddDel struct { - IsDel uint8 `binapi:"u8,name=is_del" json:"is_del,omitempty"` - Localsid Srv6Sid `binapi:"srv6_sid,name=localsid" json:"localsid,omitempty"` - EndPsp uint8 `binapi:"u8,name=end_psp" json:"end_psp,omitempty"` - Behavior uint8 `binapi:"u8,name=behavior" json:"behavior,omitempty"` - SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"` - VlanIndex uint32 `binapi:"u32,name=vlan_index" json:"vlan_index,omitempty"` - FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"` - NhAddr6 []byte `binapi:"u8[16],name=nh_addr6" json:"nh_addr6,omitempty" struc:"[16]byte"` - NhAddr4 []byte `binapi:"u8[4],name=nh_addr4" json:"nh_addr4,omitempty" struc:"[4]byte"` + IsDel bool `binapi:"bool,name=is_del,default=false" json:"is_del,omitempty"` + Localsid ip_types.IP6Address `binapi:"ip6_address,name=localsid" json:"localsid,omitempty"` + EndPsp bool `binapi:"bool,name=end_psp" json:"end_psp,omitempty"` + Behavior SrBehavior `binapi:"sr_behavior,name=behavior" json:"behavior,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4.294967295e+09" json:"sw_if_index,omitempty"` + VlanIndex uint32 `binapi:"u32,name=vlan_index" json:"vlan_index,omitempty"` + FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"` + NhAddr ip_types.Address `binapi:"address,name=nh_addr" json:"nh_addr,omitempty"` } func (m *SrLocalsidAddDel) Reset() { *m = SrLocalsidAddDel{} } func (*SrLocalsidAddDel) GetMessageName() string { return "sr_localsid_add_del" } -func (*SrLocalsidAddDel) GetCrcString() string { return "b30489eb" } +func (*SrLocalsidAddDel) GetCrcString() string { return "26fa3309" } func (*SrLocalsidAddDel) GetMessageType() api.MessageType { return api.RequestMessage } func (m *SrLocalsidAddDel) Size() int { @@ -90,7 +198,6 @@ func (m *SrLocalsidAddDel) Size() int { // field[1] m.IsDel size += 1 // field[1] m.Localsid - // field[2] m.Localsid.Addr size += 16 // field[1] m.EndPsp size += 1 @@ -102,10 +209,11 @@ func (m *SrLocalsidAddDel) Size() int { size += 4 // field[1] m.FibTable size += 4 - // field[1] m.NhAddr6 + // field[1] m.NhAddr + // field[2] m.NhAddr.Af + size += 1 + // field[2] m.NhAddr.Un size += 16 - // field[1] m.NhAddr4 - size += 4 return size } func (m *SrLocalsidAddDel) Marshal(b []byte) ([]byte, error) { @@ -120,20 +228,23 @@ func (m *SrLocalsidAddDel) Marshal(b []byte) ([]byte, error) { buf = b } // field[1] m.IsDel - buf[pos] = uint8(m.IsDel) + if m.IsDel { + buf[pos] = 1 + } pos += 1 // field[1] m.Localsid - // field[2] m.Localsid.Addr for i := 0; i < 16; i++ { var x uint8 - if i < len(m.Localsid.Addr) { - x = uint8(m.Localsid.Addr[i]) + if i < len(m.Localsid) { + x = uint8(m.Localsid[i]) } buf[pos] = uint8(x) pos += 1 } // field[1] m.EndPsp - buf[pos] = uint8(m.EndPsp) + if m.EndPsp { + buf[pos] = 1 + } pos += 1 // field[1] m.Behavior buf[pos] = uint8(m.Behavior) @@ -147,24 +258,13 @@ func (m *SrLocalsidAddDel) Marshal(b []byte) ([]byte, error) { // field[1] m.FibTable o.PutUint32(buf[pos:pos+4], uint32(m.FibTable)) pos += 4 - // field[1] m.NhAddr6 - for i := 0; i < 16; i++ { - var x uint8 - if i < len(m.NhAddr6) { - x = uint8(m.NhAddr6[i]) - } - buf[pos] = uint8(x) - pos += 1 - } - // field[1] m.NhAddr4 - for i := 0; i < 4; i++ { - var x uint8 - if i < len(m.NhAddr4) { - x = uint8(m.NhAddr4[i]) - } - buf[pos] = uint8(x) - pos += 1 - } + // field[1] m.NhAddr + // field[2] m.NhAddr.Af + buf[pos] = uint8(m.NhAddr.Af) + pos += 1 + // field[2] m.NhAddr.Un + copy(buf[pos:pos+16], m.NhAddr.Un.XXX_UnionData[:]) + pos += 16 return buf, nil } func (m *SrLocalsidAddDel) Unmarshal(tmp []byte) error { @@ -173,23 +273,21 @@ func (m *SrLocalsidAddDel) Unmarshal(tmp []byte) error { pos := 0 _ = pos // field[1] m.IsDel - m.IsDel = uint8(tmp[pos]) + m.IsDel = tmp[pos] != 0 pos += 1 // field[1] m.Localsid - // field[2] m.Localsid.Addr - m.Localsid.Addr = make([]uint8, 16) - for i := 0; i < len(m.Localsid.Addr); i++ { - m.Localsid.Addr[i] = uint8(tmp[pos]) + for i := 0; i < len(m.Localsid); i++ { + m.Localsid[i] = uint8(tmp[pos]) pos += 1 } // field[1] m.EndPsp - m.EndPsp = uint8(tmp[pos]) + m.EndPsp = tmp[pos] != 0 pos += 1 // field[1] m.Behavior - m.Behavior = uint8(tmp[pos]) + m.Behavior = SrBehavior(tmp[pos]) pos += 1 // field[1] m.SwIfIndex - m.SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4])) + m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4])) pos += 4 // field[1] m.VlanIndex m.VlanIndex = uint32(o.Uint32(tmp[pos : pos+4])) @@ -197,18 +295,13 @@ func (m *SrLocalsidAddDel) Unmarshal(tmp []byte) error { // field[1] m.FibTable m.FibTable = uint32(o.Uint32(tmp[pos : pos+4])) pos += 4 - // field[1] m.NhAddr6 - m.NhAddr6 = make([]uint8, 16) - for i := 0; i < len(m.NhAddr6); i++ { - m.NhAddr6[i] = uint8(tmp[pos]) - pos += 1 - } - // field[1] m.NhAddr4 - m.NhAddr4 = make([]uint8, 4) - for i := 0; i < len(m.NhAddr4); i++ { - m.NhAddr4[i] = uint8(tmp[pos]) - pos += 1 - } + // field[1] m.NhAddr + // field[2] m.NhAddr.Af + m.NhAddr.Af = ip_types.AddressFamily(tmp[pos]) + pos += 1 + // field[2] m.NhAddr.Un + copy(m.NhAddr.Un.XXX_UnionData[:], tmp[pos:pos+16]) + pos += 16 return nil } @@ -260,19 +353,18 @@ func (m *SrLocalsidAddDelReply) Unmarshal(tmp []byte) error { // SrLocalsidsDetails represents VPP binary API message 'sr_localsids_details'. type SrLocalsidsDetails struct { - Addr Srv6Sid `binapi:"srv6_sid,name=addr" json:"addr,omitempty"` - EndPsp uint8 `binapi:"u8,name=end_psp" json:"end_psp,omitempty"` - Behavior uint16 `binapi:"u16,name=behavior" json:"behavior,omitempty"` - FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"` - VlanIndex uint32 `binapi:"u32,name=vlan_index" json:"vlan_index,omitempty"` - XconnectNhAddr6 []byte `binapi:"u8[16],name=xconnect_nh_addr6" json:"xconnect_nh_addr6,omitempty" struc:"[16]byte"` - XconnectNhAddr4 []byte `binapi:"u8[4],name=xconnect_nh_addr4" json:"xconnect_nh_addr4,omitempty" struc:"[4]byte"` - XconnectIfaceOrVrfTable uint32 `binapi:"u32,name=xconnect_iface_or_vrf_table" json:"xconnect_iface_or_vrf_table,omitempty"` + Addr ip_types.IP6Address `binapi:"ip6_address,name=addr" json:"addr,omitempty"` + EndPsp bool `binapi:"bool,name=end_psp" json:"end_psp,omitempty"` + Behavior SrBehavior `binapi:"sr_behavior,name=behavior" json:"behavior,omitempty"` + FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"` + VlanIndex uint32 `binapi:"u32,name=vlan_index" json:"vlan_index,omitempty"` + XconnectNhAddr ip_types.Address `binapi:"address,name=xconnect_nh_addr" json:"xconnect_nh_addr,omitempty"` + XconnectIfaceOrVrfTable uint32 `binapi:"u32,name=xconnect_iface_or_vrf_table" json:"xconnect_iface_or_vrf_table,omitempty"` } func (m *SrLocalsidsDetails) Reset() { *m = SrLocalsidsDetails{} } func (*SrLocalsidsDetails) GetMessageName() string { return "sr_localsids_details" } -func (*SrLocalsidsDetails) GetCrcString() string { return "0791babc" } +func (*SrLocalsidsDetails) GetCrcString() string { return "6a6c0265" } func (*SrLocalsidsDetails) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SrLocalsidsDetails) Size() int { @@ -281,20 +373,20 @@ func (m *SrLocalsidsDetails) Size() int { } var size int // field[1] m.Addr - // field[2] m.Addr.Addr size += 16 // field[1] m.EndPsp size += 1 // field[1] m.Behavior - size += 2 + size += 1 // field[1] m.FibTable size += 4 // field[1] m.VlanIndex size += 4 - // field[1] m.XconnectNhAddr6 + // field[1] m.XconnectNhAddr + // field[2] m.XconnectNhAddr.Af + size += 1 + // field[2] m.XconnectNhAddr.Un size += 16 - // field[1] m.XconnectNhAddr4 - size += 4 // field[1] m.XconnectIfaceOrVrfTable size += 4 return size @@ -311,45 +403,35 @@ func (m *SrLocalsidsDetails) Marshal(b []byte) ([]byte, error) { buf = b } // field[1] m.Addr - // field[2] m.Addr.Addr for i := 0; i < 16; i++ { var x uint8 - if i < len(m.Addr.Addr) { - x = uint8(m.Addr.Addr[i]) + if i < len(m.Addr) { + x = uint8(m.Addr[i]) } buf[pos] = uint8(x) pos += 1 } // field[1] m.EndPsp - buf[pos] = uint8(m.EndPsp) + if m.EndPsp { + buf[pos] = 1 + } pos += 1 // field[1] m.Behavior - o.PutUint16(buf[pos:pos+2], uint16(m.Behavior)) - pos += 2 + buf[pos] = uint8(m.Behavior) + pos += 1 // field[1] m.FibTable o.PutUint32(buf[pos:pos+4], uint32(m.FibTable)) pos += 4 // field[1] m.VlanIndex o.PutUint32(buf[pos:pos+4], uint32(m.VlanIndex)) pos += 4 - // field[1] m.XconnectNhAddr6 - for i := 0; i < 16; i++ { - var x uint8 - if i < len(m.XconnectNhAddr6) { - x = uint8(m.XconnectNhAddr6[i]) - } - buf[pos] = uint8(x) - pos += 1 - } - // field[1] m.XconnectNhAddr4 - for i := 0; i < 4; i++ { - var x uint8 - if i < len(m.XconnectNhAddr4) { - x = uint8(m.XconnectNhAddr4[i]) - } - buf[pos] = uint8(x) - pos += 1 - } + // field[1] m.XconnectNhAddr + // field[2] m.XconnectNhAddr.Af + buf[pos] = uint8(m.XconnectNhAddr.Af) + pos += 1 + // field[2] m.XconnectNhAddr.Un + copy(buf[pos:pos+16], m.XconnectNhAddr.Un.XXX_UnionData[:]) + pos += 16 // field[1] m.XconnectIfaceOrVrfTable o.PutUint32(buf[pos:pos+4], uint32(m.XconnectIfaceOrVrfTable)) pos += 4 @@ -361,36 +443,29 @@ func (m *SrLocalsidsDetails) Unmarshal(tmp []byte) error { pos := 0 _ = pos // field[1] m.Addr - // field[2] m.Addr.Addr - m.Addr.Addr = make([]uint8, 16) - for i := 0; i < len(m.Addr.Addr); i++ { - m.Addr.Addr[i] = uint8(tmp[pos]) + for i := 0; i < len(m.Addr); i++ { + m.Addr[i] = uint8(tmp[pos]) pos += 1 } // field[1] m.EndPsp - m.EndPsp = uint8(tmp[pos]) + m.EndPsp = tmp[pos] != 0 pos += 1 // field[1] m.Behavior - m.Behavior = uint16(o.Uint16(tmp[pos : pos+2])) - pos += 2 + m.Behavior = SrBehavior(tmp[pos]) + pos += 1 // field[1] m.FibTable m.FibTable = uint32(o.Uint32(tmp[pos : pos+4])) pos += 4 // field[1] m.VlanIndex m.VlanIndex = uint32(o.Uint32(tmp[pos : pos+4])) pos += 4 - // field[1] m.XconnectNhAddr6 - m.XconnectNhAddr6 = make([]uint8, 16) - for i := 0; i < len(m.XconnectNhAddr6); i++ { - m.XconnectNhAddr6[i] = uint8(tmp[pos]) - pos += 1 - } - // field[1] m.XconnectNhAddr4 - m.XconnectNhAddr4 = make([]uint8, 4) - for i := 0; i < len(m.XconnectNhAddr4); i++ { - m.XconnectNhAddr4[i] = uint8(tmp[pos]) - pos += 1 - } + // field[1] m.XconnectNhAddr + // field[2] m.XconnectNhAddr.Af + m.XconnectNhAddr.Af = ip_types.AddressFamily(tmp[pos]) + pos += 1 + // field[2] m.XconnectNhAddr.Un + copy(m.XconnectNhAddr.Un.XXX_UnionData[:], tmp[pos:pos+16]) + pos += 16 // field[1] m.XconnectIfaceOrVrfTable m.XconnectIfaceOrVrfTable = uint32(o.Uint32(tmp[pos : pos+4])) pos += 4 @@ -435,17 +510,17 @@ func (m *SrLocalsidsDump) Unmarshal(tmp []byte) error { // SrPoliciesDetails represents VPP binary API message 'sr_policies_details'. type SrPoliciesDetails struct { - Bsid Srv6Sid `binapi:"srv6_sid,name=bsid" json:"bsid,omitempty"` - Type uint8 `binapi:"u8,name=type" json:"type,omitempty"` - IsEncap uint8 `binapi:"u8,name=is_encap" json:"is_encap,omitempty"` - FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"` - NumSidLists uint8 `binapi:"u8,name=num_sid_lists" json:"num_sid_lists,omitempty" struc:"sizeof=SidLists"` - SidLists []Srv6SidList `binapi:"srv6_sid_list[num_sid_lists],name=sid_lists" json:"sid_lists,omitempty"` + Bsid ip_types.IP6Address `binapi:"ip6_address,name=bsid" json:"bsid,omitempty"` + IsSpray bool `binapi:"bool,name=is_spray" json:"is_spray,omitempty"` + IsEncap bool `binapi:"bool,name=is_encap" json:"is_encap,omitempty"` + FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"` + NumSidLists uint8 `binapi:"u8,name=num_sid_lists" json:"num_sid_lists,omitempty" struc:"sizeof=SidLists"` + SidLists []Srv6SidList `binapi:"srv6_sid_list[num_sid_lists],name=sid_lists" json:"sid_lists,omitempty"` } func (m *SrPoliciesDetails) Reset() { *m = SrPoliciesDetails{} } func (*SrPoliciesDetails) GetMessageName() string { return "sr_policies_details" } -func (*SrPoliciesDetails) GetCrcString() string { return "5087f460" } +func (*SrPoliciesDetails) GetCrcString() string { return "07ec2d93" } func (*SrPoliciesDetails) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SrPoliciesDetails) Size() int { @@ -454,9 +529,8 @@ func (m *SrPoliciesDetails) Size() int { } var size int // field[1] m.Bsid - // field[2] m.Bsid.Addr size += 16 - // field[1] m.Type + // field[1] m.IsSpray size += 1 // field[1] m.IsEncap size += 1 @@ -477,12 +551,11 @@ func (m *SrPoliciesDetails) Size() int { size += 4 // field[2] s1.Sids for j2 := 0; j2 < 16; j2++ { - var s2 Srv6Sid + var s2 ip_types.IP6Address _ = s2 if j2 < len(s1.Sids) { s2 = s1.Sids[j2] } - // field[3] s2.Addr size += 16 } } @@ -500,20 +573,23 @@ func (m *SrPoliciesDetails) Marshal(b []byte) ([]byte, error) { buf = b } // field[1] m.Bsid - // field[2] m.Bsid.Addr for i := 0; i < 16; i++ { var x uint8 - if i < len(m.Bsid.Addr) { - x = uint8(m.Bsid.Addr[i]) + if i < len(m.Bsid) { + x = uint8(m.Bsid[i]) } buf[pos] = uint8(x) pos += 1 } - // field[1] m.Type - buf[pos] = uint8(m.Type) + // field[1] m.IsSpray + if m.IsSpray { + buf[pos] = 1 + } pos += 1 // field[1] m.IsEncap - buf[pos] = uint8(m.IsEncap) + if m.IsEncap { + buf[pos] = 1 + } pos += 1 // field[1] m.FibTable o.PutUint32(buf[pos:pos+4], uint32(m.FibTable)) @@ -535,15 +611,14 @@ func (m *SrPoliciesDetails) Marshal(b []byte) ([]byte, error) { pos += 4 // field[2] v1.Sids for j2 := 0; j2 < 16; j2++ { - var v2 Srv6Sid + var v2 ip_types.IP6Address if j2 < len(v1.Sids) { v2 = v1.Sids[j2] } - // field[3] v2.Addr for i := 0; i < 16; i++ { var x uint8 - if i < len(v2.Addr) { - x = uint8(v2.Addr[i]) + if i < len(v2) { + x = uint8(v2[i]) } buf[pos] = uint8(x) pos += 1 @@ -558,17 +633,15 @@ func (m *SrPoliciesDetails) Unmarshal(tmp []byte) error { pos := 0 _ = pos // field[1] m.Bsid - // field[2] m.Bsid.Addr - m.Bsid.Addr = make([]uint8, 16) - for i := 0; i < len(m.Bsid.Addr); i++ { - m.Bsid.Addr[i] = uint8(tmp[pos]) + for i := 0; i < len(m.Bsid); i++ { + m.Bsid[i] = uint8(tmp[pos]) pos += 1 } - // field[1] m.Type - m.Type = uint8(tmp[pos]) + // field[1] m.IsSpray + m.IsSpray = tmp[pos] != 0 pos += 1 // field[1] m.IsEncap - m.IsEncap = uint8(tmp[pos]) + m.IsEncap = tmp[pos] != 0 pos += 1 // field[1] m.FibTable m.FibTable = uint32(o.Uint32(tmp[pos : pos+4])) @@ -587,10 +660,8 @@ func (m *SrPoliciesDetails) Unmarshal(tmp []byte) error { pos += 4 // field[2] m.SidLists[j1].Sids for j2 := 0; j2 < 16; j2++ { - // field[3] m.SidLists[j1].Sids[j2].Addr - m.SidLists[j1].Sids[j2].Addr = make([]uint8, 16) - for i := 0; i < len(m.SidLists[j1].Sids[j2].Addr); i++ { - m.SidLists[j1].Sids[j2].Addr[i] = uint8(tmp[pos]) + for i := 0; i < len(m.SidLists[j1].Sids[j2]); i++ { + m.SidLists[j1].Sids[j2][i] = uint8(tmp[pos]) pos += 1 } } @@ -636,17 +707,17 @@ func (m *SrPoliciesDump) Unmarshal(tmp []byte) error { // SrPolicyAdd represents VPP binary API message 'sr_policy_add'. type SrPolicyAdd struct { - BsidAddr []byte `binapi:"u8[16],name=bsid_addr" json:"bsid_addr,omitempty" struc:"[16]byte"` - Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"` - IsEncap uint8 `binapi:"u8,name=is_encap" json:"is_encap,omitempty"` - Type uint8 `binapi:"u8,name=type" json:"type,omitempty"` - FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"` - Sids Srv6SidList `binapi:"srv6_sid_list,name=sids" json:"sids,omitempty"` + BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"` + Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"` + IsEncap bool `binapi:"bool,name=is_encap" json:"is_encap,omitempty"` + IsSpray bool `binapi:"bool,name=is_spray" json:"is_spray,omitempty"` + FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"` + Sids Srv6SidList `binapi:"srv6_sid_list,name=sids" json:"sids,omitempty"` } func (m *SrPolicyAdd) Reset() { *m = SrPolicyAdd{} } func (*SrPolicyAdd) GetMessageName() string { return "sr_policy_add" } -func (*SrPolicyAdd) GetCrcString() string { return "4b6e2484" } +func (*SrPolicyAdd) GetCrcString() string { return "ec79ee6a" } func (*SrPolicyAdd) GetMessageType() api.MessageType { return api.RequestMessage } func (m *SrPolicyAdd) Size() int { @@ -660,7 +731,7 @@ func (m *SrPolicyAdd) Size() int { size += 4 // field[1] m.IsEncap size += 1 - // field[1] m.Type + // field[1] m.IsSpray size += 1 // field[1] m.FibTable size += 4 @@ -671,12 +742,11 @@ func (m *SrPolicyAdd) Size() int { size += 4 // field[2] m.Sids.Sids for j2 := 0; j2 < 16; j2++ { - var s2 Srv6Sid + var s2 ip_types.IP6Address _ = s2 if j2 < len(m.Sids.Sids) { s2 = m.Sids.Sids[j2] } - // field[3] s2.Addr size += 16 } return size @@ -705,10 +775,14 @@ func (m *SrPolicyAdd) Marshal(b []byte) ([]byte, error) { o.PutUint32(buf[pos:pos+4], uint32(m.Weight)) pos += 4 // field[1] m.IsEncap - buf[pos] = uint8(m.IsEncap) + if m.IsEncap { + buf[pos] = 1 + } pos += 1 - // field[1] m.Type - buf[pos] = uint8(m.Type) + // field[1] m.IsSpray + if m.IsSpray { + buf[pos] = 1 + } pos += 1 // field[1] m.FibTable o.PutUint32(buf[pos:pos+4], uint32(m.FibTable)) @@ -722,15 +796,14 @@ func (m *SrPolicyAdd) Marshal(b []byte) ([]byte, error) { pos += 4 // field[2] m.Sids.Sids for j2 := 0; j2 < 16; j2++ { - var v2 Srv6Sid + var v2 ip_types.IP6Address if j2 < len(m.Sids.Sids) { v2 = m.Sids.Sids[j2] } - // field[3] v2.Addr for i := 0; i < 16; i++ { var x uint8 - if i < len(v2.Addr) { - x = uint8(v2.Addr[i]) + if i < len(v2) { + x = uint8(v2[i]) } buf[pos] = uint8(x) pos += 1 @@ -744,7 +817,6 @@ func (m *SrPolicyAdd) Unmarshal(tmp []byte) error { pos := 0 _ = pos // field[1] m.BsidAddr - m.BsidAddr = make([]uint8, 16) for i := 0; i < len(m.BsidAddr); i++ { m.BsidAddr[i] = uint8(tmp[pos]) pos += 1 @@ -753,10 +825,10 @@ func (m *SrPolicyAdd) Unmarshal(tmp []byte) error { m.Weight = uint32(o.Uint32(tmp[pos : pos+4])) pos += 4 // field[1] m.IsEncap - m.IsEncap = uint8(tmp[pos]) + m.IsEncap = tmp[pos] != 0 pos += 1 - // field[1] m.Type - m.Type = uint8(tmp[pos]) + // field[1] m.IsSpray + m.IsSpray = tmp[pos] != 0 pos += 1 // field[1] m.FibTable m.FibTable = uint32(o.Uint32(tmp[pos : pos+4])) @@ -770,10 +842,8 @@ func (m *SrPolicyAdd) Unmarshal(tmp []byte) error { pos += 4 // field[2] m.Sids.Sids for j2 := 0; j2 < 16; j2++ { - // field[3] m.Sids.Sids[j2].Addr - m.Sids.Sids[j2].Addr = make([]uint8, 16) - for i := 0; i < len(m.Sids.Sids[j2].Addr); i++ { - m.Sids.Sids[j2].Addr[i] = uint8(tmp[pos]) + for i := 0; i < len(m.Sids.Sids[j2]); i++ { + m.Sids.Sids[j2][i] = uint8(tmp[pos]) pos += 1 } } @@ -828,13 +898,13 @@ func (m *SrPolicyAddReply) Unmarshal(tmp []byte) error { // SrPolicyDel represents VPP binary API message 'sr_policy_del'. type SrPolicyDel struct { - BsidAddr Srv6Sid `binapi:"srv6_sid,name=bsid_addr" json:"bsid_addr,omitempty"` - SrPolicyIndex uint32 `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"` + BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"` + SrPolicyIndex uint32 `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"` } func (m *SrPolicyDel) Reset() { *m = SrPolicyDel{} } func (*SrPolicyDel) GetMessageName() string { return "sr_policy_del" } -func (*SrPolicyDel) GetCrcString() string { return "e4133171" } +func (*SrPolicyDel) GetCrcString() string { return "cb4d48d5" } func (*SrPolicyDel) GetMessageType() api.MessageType { return api.RequestMessage } func (m *SrPolicyDel) Size() int { @@ -843,7 +913,6 @@ func (m *SrPolicyDel) Size() int { } var size int // field[1] m.BsidAddr - // field[2] m.BsidAddr.Addr size += 16 // field[1] m.SrPolicyIndex size += 4 @@ -861,11 +930,10 @@ func (m *SrPolicyDel) Marshal(b []byte) ([]byte, error) { buf = b } // field[1] m.BsidAddr - // field[2] m.BsidAddr.Addr for i := 0; i < 16; i++ { var x uint8 - if i < len(m.BsidAddr.Addr) { - x = uint8(m.BsidAddr.Addr[i]) + if i < len(m.BsidAddr) { + x = uint8(m.BsidAddr[i]) } buf[pos] = uint8(x) pos += 1 @@ -881,10 +949,8 @@ func (m *SrPolicyDel) Unmarshal(tmp []byte) error { pos := 0 _ = pos // field[1] m.BsidAddr - // field[2] m.BsidAddr.Addr - m.BsidAddr.Addr = make([]uint8, 16) - for i := 0; i < len(m.BsidAddr.Addr); i++ { - m.BsidAddr.Addr[i] = uint8(tmp[pos]) + for i := 0; i < len(m.BsidAddr); i++ { + m.BsidAddr[i] = uint8(tmp[pos]) pos += 1 } // field[1] m.SrPolicyIndex @@ -941,18 +1007,18 @@ func (m *SrPolicyDelReply) Unmarshal(tmp []byte) error { // SrPolicyMod represents VPP binary API message 'sr_policy_mod'. type SrPolicyMod struct { - BsidAddr []byte `binapi:"u8[16],name=bsid_addr" json:"bsid_addr,omitempty" struc:"[16]byte"` - SrPolicyIndex uint32 `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"` - FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"` - Operation uint8 `binapi:"u8,name=operation" json:"operation,omitempty"` - SlIndex uint32 `binapi:"u32,name=sl_index" json:"sl_index,omitempty"` - Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"` - Sids Srv6SidList `binapi:"srv6_sid_list,name=sids" json:"sids,omitempty"` + BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"` + SrPolicyIndex uint32 `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"` + FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"` + Operation SrPolicyOp `binapi:"sr_policy_op,name=operation" json:"operation,omitempty"` + SlIndex uint32 `binapi:"u32,name=sl_index" json:"sl_index,omitempty"` + Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"` + Sids Srv6SidList `binapi:"srv6_sid_list,name=sids" json:"sids,omitempty"` } func (m *SrPolicyMod) Reset() { *m = SrPolicyMod{} } func (*SrPolicyMod) GetMessageName() string { return "sr_policy_mod" } -func (*SrPolicyMod) GetCrcString() string { return "c1dfaee0" } +func (*SrPolicyMod) GetCrcString() string { return "e531a102" } func (*SrPolicyMod) GetMessageType() api.MessageType { return api.RequestMessage } func (m *SrPolicyMod) Size() int { @@ -979,12 +1045,11 @@ func (m *SrPolicyMod) Size() int { size += 4 // field[2] m.Sids.Sids for j2 := 0; j2 < 16; j2++ { - var s2 Srv6Sid + var s2 ip_types.IP6Address _ = s2 if j2 < len(m.Sids.Sids) { s2 = m.Sids.Sids[j2] } - // field[3] s2.Addr size += 16 } return size @@ -1033,15 +1098,14 @@ func (m *SrPolicyMod) Marshal(b []byte) ([]byte, error) { pos += 4 // field[2] m.Sids.Sids for j2 := 0; j2 < 16; j2++ { - var v2 Srv6Sid + var v2 ip_types.IP6Address if j2 < len(m.Sids.Sids) { v2 = m.Sids.Sids[j2] } - // field[3] v2.Addr for i := 0; i < 16; i++ { var x uint8 - if i < len(v2.Addr) { - x = uint8(v2.Addr[i]) + if i < len(v2) { + x = uint8(v2[i]) } buf[pos] = uint8(x) pos += 1 @@ -1055,7 +1119,6 @@ func (m *SrPolicyMod) Unmarshal(tmp []byte) error { pos := 0 _ = pos // field[1] m.BsidAddr - m.BsidAddr = make([]uint8, 16) for i := 0; i < len(m.BsidAddr); i++ { m.BsidAddr[i] = uint8(tmp[pos]) pos += 1 @@ -1067,7 +1130,7 @@ func (m *SrPolicyMod) Unmarshal(tmp []byte) error { m.FibTable = uint32(o.Uint32(tmp[pos : pos+4])) pos += 4 // field[1] m.Operation - m.Operation = uint8(tmp[pos]) + m.Operation = SrPolicyOp(tmp[pos]) pos += 1 // field[1] m.SlIndex m.SlIndex = uint32(o.Uint32(tmp[pos : pos+4])) @@ -1084,10 +1147,8 @@ func (m *SrPolicyMod) Unmarshal(tmp []byte) error { pos += 4 // field[2] m.Sids.Sids for j2 := 0; j2 < 16; j2++ { - // field[3] m.Sids.Sids[j2].Addr - m.Sids.Sids[j2].Addr = make([]uint8, 16) - for i := 0; i < len(m.Sids.Sids[j2].Addr); i++ { - m.Sids.Sids[j2].Addr[i] = uint8(tmp[pos]) + for i := 0; i < len(m.Sids.Sids[j2]); i++ { + m.Sids.Sids[j2][i] = uint8(tmp[pos]) pos += 1 } } @@ -1234,12 +1295,12 @@ func (m *SrSetEncapHopLimitReply) Unmarshal(tmp []byte) error { // SrSetEncapSource represents VPP binary API message 'sr_set_encap_source'. type SrSetEncapSource struct { - EncapsSource []byte `binapi:"u8[16],name=encaps_source" json:"encaps_source,omitempty" struc:"[16]byte"` + EncapsSource ip_types.IP6Address `binapi:"ip6_address,name=encaps_source" json:"encaps_source,omitempty"` } func (m *SrSetEncapSource) Reset() { *m = SrSetEncapSource{} } func (*SrSetEncapSource) GetMessageName() string { return "sr_set_encap_source" } -func (*SrSetEncapSource) GetCrcString() string { return "d05bb4de" } +func (*SrSetEncapSource) GetCrcString() string { return "d3bad5e1" } func (*SrSetEncapSource) GetMessageType() api.MessageType { return api.RequestMessage } func (m *SrSetEncapSource) Size() int { @@ -1279,7 +1340,6 @@ func (m *SrSetEncapSource) Unmarshal(tmp []byte) error { pos := 0 _ = pos // field[1] m.EncapsSource - m.EncapsSource = make([]uint8, 16) for i := 0; i < len(m.EncapsSource); i++ { m.EncapsSource[i] = uint8(tmp[pos]) pos += 1 @@ -1335,19 +1395,18 @@ func (m *SrSetEncapSourceReply) Unmarshal(tmp []byte) error { // SrSteeringAddDel represents VPP binary API message 'sr_steering_add_del'. type SrSteeringAddDel struct { - IsDel uint8 `binapi:"u8,name=is_del" json:"is_del,omitempty"` - BsidAddr []byte `binapi:"u8[16],name=bsid_addr" json:"bsid_addr,omitempty" struc:"[16]byte"` - SrPolicyIndex uint32 `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"` - TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"` - PrefixAddr []byte `binapi:"u8[16],name=prefix_addr" json:"prefix_addr,omitempty" struc:"[16]byte"` - MaskWidth uint32 `binapi:"u32,name=mask_width" json:"mask_width,omitempty"` - SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"` - TrafficType uint8 `binapi:"u8,name=traffic_type" json:"traffic_type,omitempty"` + IsDel bool `binapi:"bool,name=is_del,default=false" json:"is_del,omitempty"` + BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"` + SrPolicyIndex uint32 `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"` + TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"` + Prefix ip_types.Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + TrafficType SrSteer `binapi:"sr_steer,name=traffic_type" json:"traffic_type,omitempty"` } func (m *SrSteeringAddDel) Reset() { *m = SrSteeringAddDel{} } func (*SrSteeringAddDel) GetMessageName() string { return "sr_steering_add_del" } -func (*SrSteeringAddDel) GetCrcString() string { return "28b5dcab" } +func (*SrSteeringAddDel) GetCrcString() string { return "3711dace" } func (*SrSteeringAddDel) GetMessageType() api.MessageType { return api.RequestMessage } func (m *SrSteeringAddDel) Size() int { @@ -1363,10 +1422,14 @@ func (m *SrSteeringAddDel) Size() int { size += 4 // field[1] m.TableID size += 4 - // field[1] m.PrefixAddr + // field[1] m.Prefix + // field[2] m.Prefix.Address + // field[3] m.Prefix.Address.Af + size += 1 + // field[3] m.Prefix.Address.Un size += 16 - // field[1] m.MaskWidth - size += 4 + // field[2] m.Prefix.Len + size += 1 // field[1] m.SwIfIndex size += 4 // field[1] m.TrafficType @@ -1385,7 +1448,9 @@ func (m *SrSteeringAddDel) Marshal(b []byte) ([]byte, error) { buf = b } // field[1] m.IsDel - buf[pos] = uint8(m.IsDel) + if m.IsDel { + buf[pos] = 1 + } pos += 1 // field[1] m.BsidAddr for i := 0; i < 16; i++ { @@ -1402,18 +1467,17 @@ func (m *SrSteeringAddDel) Marshal(b []byte) ([]byte, error) { // field[1] m.TableID o.PutUint32(buf[pos:pos+4], uint32(m.TableID)) pos += 4 - // field[1] m.PrefixAddr - for i := 0; i < 16; i++ { - var x uint8 - if i < len(m.PrefixAddr) { - x = uint8(m.PrefixAddr[i]) - } - buf[pos] = uint8(x) - pos += 1 - } - // field[1] m.MaskWidth - o.PutUint32(buf[pos:pos+4], uint32(m.MaskWidth)) - pos += 4 + // field[1] m.Prefix + // field[2] m.Prefix.Address + // field[3] m.Prefix.Address.Af + buf[pos] = uint8(m.Prefix.Address.Af) + pos += 1 + // field[3] m.Prefix.Address.Un + copy(buf[pos:pos+16], m.Prefix.Address.Un.XXX_UnionData[:]) + pos += 16 + // field[2] m.Prefix.Len + buf[pos] = uint8(m.Prefix.Len) + pos += 1 // field[1] m.SwIfIndex o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex)) pos += 4 @@ -1428,10 +1492,9 @@ func (m *SrSteeringAddDel) Unmarshal(tmp []byte) error { pos := 0 _ = pos // field[1] m.IsDel - m.IsDel = uint8(tmp[pos]) + m.IsDel = tmp[pos] != 0 pos += 1 // field[1] m.BsidAddr - m.BsidAddr = make([]uint8, 16) for i := 0; i < len(m.BsidAddr); i++ { m.BsidAddr[i] = uint8(tmp[pos]) pos += 1 @@ -1442,20 +1505,22 @@ func (m *SrSteeringAddDel) Unmarshal(tmp []byte) error { // field[1] m.TableID m.TableID = uint32(o.Uint32(tmp[pos : pos+4])) pos += 4 - // field[1] m.PrefixAddr - m.PrefixAddr = make([]uint8, 16) - for i := 0; i < len(m.PrefixAddr); i++ { - m.PrefixAddr[i] = uint8(tmp[pos]) - pos += 1 - } - // field[1] m.MaskWidth - m.MaskWidth = uint32(o.Uint32(tmp[pos : pos+4])) - pos += 4 + // field[1] m.Prefix + // field[2] m.Prefix.Address + // field[3] m.Prefix.Address.Af + m.Prefix.Address.Af = ip_types.AddressFamily(tmp[pos]) + pos += 1 + // field[3] m.Prefix.Address.Un + copy(m.Prefix.Address.Un.XXX_UnionData[:], tmp[pos:pos+16]) + pos += 16 + // field[2] m.Prefix.Len + m.Prefix.Len = uint8(tmp[pos]) + pos += 1 // field[1] m.SwIfIndex - m.SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4])) + m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4])) pos += 4 // field[1] m.TrafficType - m.TrafficType = uint8(tmp[pos]) + m.TrafficType = SrSteer(tmp[pos]) pos += 1 return nil } @@ -1508,17 +1573,16 @@ func (m *SrSteeringAddDelReply) Unmarshal(tmp []byte) error { // SrSteeringPolDetails represents VPP binary API message 'sr_steering_pol_details'. type SrSteeringPolDetails struct { - TrafficType uint8 `binapi:"u8,name=traffic_type" json:"traffic_type,omitempty"` - FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"` - PrefixAddr []byte `binapi:"u8[16],name=prefix_addr" json:"prefix_addr,omitempty" struc:"[16]byte"` - MaskWidth uint32 `binapi:"u32,name=mask_width" json:"mask_width,omitempty"` - SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"` - Bsid Srv6Sid `binapi:"srv6_sid,name=bsid" json:"bsid,omitempty"` + TrafficType SrSteer `binapi:"sr_steer,name=traffic_type" json:"traffic_type,omitempty"` + FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"` + Prefix ip_types.Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + Bsid ip_types.IP6Address `binapi:"ip6_address,name=bsid" json:"bsid,omitempty"` } func (m *SrSteeringPolDetails) Reset() { *m = SrSteeringPolDetails{} } func (*SrSteeringPolDetails) GetMessageName() string { return "sr_steering_pol_details" } -func (*SrSteeringPolDetails) GetCrcString() string { return "5627d483" } +func (*SrSteeringPolDetails) GetCrcString() string { return "1c1ee786" } func (*SrSteeringPolDetails) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SrSteeringPolDetails) Size() int { @@ -1530,14 +1594,17 @@ func (m *SrSteeringPolDetails) Size() int { size += 1 // field[1] m.FibTable size += 4 - // field[1] m.PrefixAddr + // field[1] m.Prefix + // field[2] m.Prefix.Address + // field[3] m.Prefix.Address.Af + size += 1 + // field[3] m.Prefix.Address.Un size += 16 - // field[1] m.MaskWidth - size += 4 + // field[2] m.Prefix.Len + size += 1 // field[1] m.SwIfIndex size += 4 // field[1] m.Bsid - // field[2] m.Bsid.Addr size += 16 return size } @@ -1558,27 +1625,25 @@ func (m *SrSteeringPolDetails) Marshal(b []byte) ([]byte, error) { // field[1] m.FibTable o.PutUint32(buf[pos:pos+4], uint32(m.FibTable)) pos += 4 - // field[1] m.PrefixAddr - for i := 0; i < 16; i++ { - var x uint8 - if i < len(m.PrefixAddr) { - x = uint8(m.PrefixAddr[i]) - } - buf[pos] = uint8(x) - pos += 1 - } - // field[1] m.MaskWidth - o.PutUint32(buf[pos:pos+4], uint32(m.MaskWidth)) - pos += 4 + // field[1] m.Prefix + // field[2] m.Prefix.Address + // field[3] m.Prefix.Address.Af + buf[pos] = uint8(m.Prefix.Address.Af) + pos += 1 + // field[3] m.Prefix.Address.Un + copy(buf[pos:pos+16], m.Prefix.Address.Un.XXX_UnionData[:]) + pos += 16 + // field[2] m.Prefix.Len + buf[pos] = uint8(m.Prefix.Len) + pos += 1 // field[1] m.SwIfIndex o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex)) pos += 4 // field[1] m.Bsid - // field[2] m.Bsid.Addr for i := 0; i < 16; i++ { var x uint8 - if i < len(m.Bsid.Addr) { - x = uint8(m.Bsid.Addr[i]) + if i < len(m.Bsid) { + x = uint8(m.Bsid[i]) } buf[pos] = uint8(x) pos += 1 @@ -1591,28 +1656,28 @@ func (m *SrSteeringPolDetails) Unmarshal(tmp []byte) error { pos := 0 _ = pos // field[1] m.TrafficType - m.TrafficType = uint8(tmp[pos]) + m.TrafficType = SrSteer(tmp[pos]) pos += 1 // field[1] m.FibTable m.FibTable = uint32(o.Uint32(tmp[pos : pos+4])) pos += 4 - // field[1] m.PrefixAddr - m.PrefixAddr = make([]uint8, 16) - for i := 0; i < len(m.PrefixAddr); i++ { - m.PrefixAddr[i] = uint8(tmp[pos]) - pos += 1 - } - // field[1] m.MaskWidth - m.MaskWidth = uint32(o.Uint32(tmp[pos : pos+4])) - pos += 4 + // field[1] m.Prefix + // field[2] m.Prefix.Address + // field[3] m.Prefix.Address.Af + m.Prefix.Address.Af = ip_types.AddressFamily(tmp[pos]) + pos += 1 + // field[3] m.Prefix.Address.Un + copy(m.Prefix.Address.Un.XXX_UnionData[:], tmp[pos:pos+16]) + pos += 16 + // field[2] m.Prefix.Len + m.Prefix.Len = uint8(tmp[pos]) + pos += 1 // field[1] m.SwIfIndex - m.SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4])) + m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4])) pos += 4 // field[1] m.Bsid - // field[2] m.Bsid.Addr - m.Bsid.Addr = make([]uint8, 16) - for i := 0; i < len(m.Bsid.Addr); i++ { - m.Bsid.Addr[i] = uint8(tmp[pos]) + for i := 0; i < len(m.Bsid); i++ { + m.Bsid[i] = uint8(tmp[pos]) pos += 1 } return nil @@ -1711,6 +1776,9 @@ var _ = bytes.NewBuffer var _ = context.Background var _ = io.Copy var _ = strconv.Itoa +var _ = strings.Contains var _ = struc.Pack var _ = binary.BigEndian var _ = math.Float32bits +var _ = net.ParseIP +var _ = fmt.Errorf