+func (m *SwInterfaceClearStatsReply) Reset() { *m = SwInterfaceClearStatsReply{} }
+func (*SwInterfaceClearStatsReply) GetMessageName() string { return "sw_interface_clear_stats_reply" }
+func (*SwInterfaceClearStatsReply) GetCrcString() string { return "e8d4e804" }
+func (*SwInterfaceClearStatsReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+
+func (m *SwInterfaceClearStatsReply) Size() int {
+ if m == nil {
+ return 0
+ }
+ var size int
+ // field[1] m.Retval
+ size += 4
+ return size
+}
+func (m *SwInterfaceClearStatsReply) Marshal(b []byte) ([]byte, error) {
+ o := binary.BigEndian
+ _ = o
+ pos := 0
+ _ = pos
+ var buf []byte
+ if b == nil {
+ buf = make([]byte, m.Size())
+ } else {
+ buf = b
+ }
+ // field[1] m.Retval
+ o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
+ pos += 4
+ return buf, nil
+}
+func (m *SwInterfaceClearStatsReply) Unmarshal(tmp []byte) error {
+ o := binary.BigEndian
+ _ = o
+ pos := 0
+ _ = pos
+ // field[1] m.Retval
+ m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
+ pos += 4
+ return nil
+}
+
+// SwInterfaceDetails represents VPP binary API message 'sw_interface_details'.
+type SwInterfaceDetails struct {
+ SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ SupSwIfIndex uint32 `binapi:"u32,name=sup_sw_if_index" json:"sup_sw_if_index,omitempty"`
+ L2Address MacAddress `binapi:"mac_address,name=l2_address" json:"l2_address,omitempty"`
+ Flags interface_types.IfStatusFlags `binapi:"if_status_flags,name=flags" json:"flags,omitempty"`
+ Type interface_types.IfType `binapi:"if_type,name=type" json:"type,omitempty"`
+ LinkDuplex interface_types.LinkDuplex `binapi:"link_duplex,name=link_duplex" json:"link_duplex,omitempty"`
+ LinkSpeed uint32 `binapi:"u32,name=link_speed" json:"link_speed,omitempty"`
+ LinkMtu uint16 `binapi:"u16,name=link_mtu" json:"link_mtu,omitempty"`
+ Mtu []uint32 `binapi:"u32[4],name=mtu" json:"mtu,omitempty" struc:"[4]uint32"`
+ SubID uint32 `binapi:"u32,name=sub_id" json:"sub_id,omitempty"`
+ SubNumberOfTags uint8 `binapi:"u8,name=sub_number_of_tags" json:"sub_number_of_tags,omitempty"`
+ SubOuterVlanID uint16 `binapi:"u16,name=sub_outer_vlan_id" json:"sub_outer_vlan_id,omitempty"`
+ SubInnerVlanID uint16 `binapi:"u16,name=sub_inner_vlan_id" json:"sub_inner_vlan_id,omitempty"`
+ SubIfFlags interface_types.SubIfFlags `binapi:"sub_if_flags,name=sub_if_flags" json:"sub_if_flags,omitempty"`
+ VtrOp uint32 `binapi:"u32,name=vtr_op" json:"vtr_op,omitempty"`
+ VtrPushDot1q uint32 `binapi:"u32,name=vtr_push_dot1q" json:"vtr_push_dot1q,omitempty"`
+ VtrTag1 uint32 `binapi:"u32,name=vtr_tag1" json:"vtr_tag1,omitempty"`
+ VtrTag2 uint32 `binapi:"u32,name=vtr_tag2" json:"vtr_tag2,omitempty"`
+ OuterTag uint16 `binapi:"u16,name=outer_tag" json:"outer_tag,omitempty"`
+ BDmac MacAddress `binapi:"mac_address,name=b_dmac" json:"b_dmac,omitempty"`
+ BSmac MacAddress `binapi:"mac_address,name=b_smac" json:"b_smac,omitempty"`
+ BVlanid uint16 `binapi:"u16,name=b_vlanid" json:"b_vlanid,omitempty"`
+ ISid uint32 `binapi:"u32,name=i_sid" json:"i_sid,omitempty"`
+ InterfaceName string `binapi:"string[64],name=interface_name" json:"interface_name,omitempty" struc:"[64]byte"`
+ InterfaceDevType string `binapi:"string[64],name=interface_dev_type" json:"interface_dev_type,omitempty" struc:"[64]byte"`
+ Tag string `binapi:"string[64],name=tag" json:"tag,omitempty" struc:"[64]byte"`
+}
+
+func (m *SwInterfaceDetails) Reset() { *m = SwInterfaceDetails{} }
+func (*SwInterfaceDetails) GetMessageName() string { return "sw_interface_details" }
+func (*SwInterfaceDetails) GetCrcString() string { return "17b69fa2" }
+func (*SwInterfaceDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
+
+func (m *SwInterfaceDetails) Size() int {
+ if m == nil {
+ return 0
+ }
+ var size int
+ // field[1] m.SwIfIndex
+ size += 4
+ // field[1] m.SupSwIfIndex
+ size += 4
+ // field[1] m.L2Address
+ size += 6
+ // field[1] m.Flags
+ size += 4
+ // field[1] m.Type
+ size += 4
+ // field[1] m.LinkDuplex
+ size += 4
+ // field[1] m.LinkSpeed
+ size += 4
+ // field[1] m.LinkMtu
+ size += 2
+ // field[1] m.Mtu
+ size += 16
+ // field[1] m.SubID
+ size += 4
+ // field[1] m.SubNumberOfTags
+ size += 1
+ // field[1] m.SubOuterVlanID
+ size += 2
+ // field[1] m.SubInnerVlanID
+ size += 2
+ // field[1] m.SubIfFlags
+ size += 4
+ // field[1] m.VtrOp
+ size += 4
+ // field[1] m.VtrPushDot1q
+ size += 4
+ // field[1] m.VtrTag1
+ size += 4
+ // field[1] m.VtrTag2
+ size += 4
+ // field[1] m.OuterTag
+ size += 2
+ // field[1] m.BDmac
+ size += 6
+ // field[1] m.BSmac
+ size += 6
+ // field[1] m.BVlanid
+ size += 2
+ // field[1] m.ISid
+ size += 4
+ // field[1] m.InterfaceName
+ size += 64
+ // field[1] m.InterfaceDevType
+ size += 64
+ // field[1] m.Tag
+ size += 64
+ return size
+}
+func (m *SwInterfaceDetails) Marshal(b []byte) ([]byte, error) {
+ o := binary.BigEndian
+ _ = o
+ pos := 0
+ _ = pos
+ var buf []byte
+ if b == nil {
+ buf = make([]byte, m.Size())
+ } else {
+ buf = b
+ }
+ // field[1] m.SwIfIndex
+ o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
+ pos += 4
+ // field[1] m.SupSwIfIndex
+ o.PutUint32(buf[pos:pos+4], uint32(m.SupSwIfIndex))
+ pos += 4
+ // field[1] m.L2Address
+ for i := 0; i < 6; i++ {
+ var x uint8
+ if i < len(m.L2Address) {
+ x = uint8(m.L2Address[i])
+ }
+ buf[pos] = uint8(x)
+ pos += 1
+ }
+ // field[1] m.Flags
+ o.PutUint32(buf[pos:pos+4], uint32(m.Flags))
+ pos += 4
+ // field[1] m.Type
+ o.PutUint32(buf[pos:pos+4], uint32(m.Type))
+ pos += 4
+ // field[1] m.LinkDuplex
+ o.PutUint32(buf[pos:pos+4], uint32(m.LinkDuplex))
+ pos += 4
+ // field[1] m.LinkSpeed
+ o.PutUint32(buf[pos:pos+4], uint32(m.LinkSpeed))
+ pos += 4
+ // field[1] m.LinkMtu
+ o.PutUint16(buf[pos:pos+2], uint16(m.LinkMtu))
+ pos += 2
+ // field[1] m.Mtu
+ for i := 0; i < 4; i++ {
+ var x uint32
+ if i < len(m.Mtu) {
+ x = uint32(m.Mtu[i])
+ }
+ o.PutUint32(buf[pos:pos+4], uint32(x))
+ pos += 4
+ }
+ // field[1] m.SubID
+ o.PutUint32(buf[pos:pos+4], uint32(m.SubID))
+ pos += 4
+ // field[1] m.SubNumberOfTags
+ buf[pos] = uint8(m.SubNumberOfTags)
+ pos += 1
+ // field[1] m.SubOuterVlanID
+ o.PutUint16(buf[pos:pos+2], uint16(m.SubOuterVlanID))
+ pos += 2
+ // field[1] m.SubInnerVlanID
+ o.PutUint16(buf[pos:pos+2], uint16(m.SubInnerVlanID))
+ pos += 2
+ // field[1] m.SubIfFlags
+ o.PutUint32(buf[pos:pos+4], uint32(m.SubIfFlags))
+ pos += 4
+ // field[1] m.VtrOp
+ o.PutUint32(buf[pos:pos+4], uint32(m.VtrOp))
+ pos += 4
+ // field[1] m.VtrPushDot1q
+ o.PutUint32(buf[pos:pos+4], uint32(m.VtrPushDot1q))
+ pos += 4
+ // field[1] m.VtrTag1
+ o.PutUint32(buf[pos:pos+4], uint32(m.VtrTag1))
+ pos += 4
+ // field[1] m.VtrTag2
+ o.PutUint32(buf[pos:pos+4], uint32(m.VtrTag2))
+ pos += 4
+ // field[1] m.OuterTag
+ o.PutUint16(buf[pos:pos+2], uint16(m.OuterTag))
+ pos += 2
+ // field[1] m.BDmac
+ for i := 0; i < 6; i++ {
+ var x uint8
+ if i < len(m.BDmac) {
+ x = uint8(m.BDmac[i])
+ }
+ buf[pos] = uint8(x)
+ pos += 1
+ }
+ // field[1] m.BSmac
+ for i := 0; i < 6; i++ {
+ var x uint8
+ if i < len(m.BSmac) {
+ x = uint8(m.BSmac[i])
+ }
+ buf[pos] = uint8(x)
+ pos += 1
+ }
+ // field[1] m.BVlanid
+ o.PutUint16(buf[pos:pos+2], uint16(m.BVlanid))
+ pos += 2
+ // field[1] m.ISid
+ o.PutUint32(buf[pos:pos+4], uint32(m.ISid))
+ pos += 4
+ // field[1] m.InterfaceName
+ copy(buf[pos:pos+64], m.InterfaceName)
+ pos += 64
+ // field[1] m.InterfaceDevType
+ copy(buf[pos:pos+64], m.InterfaceDevType)
+ pos += 64
+ // field[1] m.Tag
+ copy(buf[pos:pos+64], m.Tag)
+ pos += 64
+ return buf, nil
+}
+func (m *SwInterfaceDetails) Unmarshal(tmp []byte) error {
+ o := binary.BigEndian
+ _ = o
+ pos := 0
+ _ = pos
+ // field[1] m.SwIfIndex
+ m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
+ pos += 4
+ // field[1] m.SupSwIfIndex
+ m.SupSwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
+ pos += 4
+ // field[1] m.L2Address
+ for i := 0; i < len(m.L2Address); i++ {
+ m.L2Address[i] = uint8(tmp[pos])
+ pos += 1
+ }
+ // field[1] m.Flags
+ m.Flags = interface_types.IfStatusFlags(o.Uint32(tmp[pos : pos+4]))
+ pos += 4
+ // field[1] m.Type
+ m.Type = interface_types.IfType(o.Uint32(tmp[pos : pos+4]))
+ pos += 4
+ // field[1] m.LinkDuplex
+ m.LinkDuplex = interface_types.LinkDuplex(o.Uint32(tmp[pos : pos+4]))
+ pos += 4
+ // field[1] m.LinkSpeed
+ m.LinkSpeed = uint32(o.Uint32(tmp[pos : pos+4]))
+ pos += 4
+ // field[1] m.LinkMtu
+ m.LinkMtu = uint16(o.Uint16(tmp[pos : pos+2]))
+ pos += 2
+ // field[1] m.Mtu
+ m.Mtu = make([]uint32, 4)
+ for i := 0; i < len(m.Mtu); i++ {
+ m.Mtu[i] = uint32(o.Uint32(tmp[pos : pos+4]))
+ pos += 4
+ }
+ // field[1] m.SubID
+ m.SubID = uint32(o.Uint32(tmp[pos : pos+4]))
+ pos += 4
+ // field[1] m.SubNumberOfTags
+ m.SubNumberOfTags = uint8(tmp[pos])
+ pos += 1
+ // field[1] m.SubOuterVlanID
+ m.SubOuterVlanID = uint16(o.Uint16(tmp[pos : pos+2]))
+ pos += 2
+ // field[1] m.SubInnerVlanID
+ m.SubInnerVlanID = uint16(o.Uint16(tmp[pos : pos+2]))
+ pos += 2
+ // field[1] m.SubIfFlags
+ m.SubIfFlags = interface_types.SubIfFlags(o.Uint32(tmp[pos : pos+4]))
+ pos += 4
+ // field[1] m.VtrOp
+ m.VtrOp = uint32(o.Uint32(tmp[pos : pos+4]))
+ pos += 4
+ // field[1] m.VtrPushDot1q
+ m.VtrPushDot1q = uint32(o.Uint32(tmp[pos : pos+4]))
+ pos += 4
+ // field[1] m.VtrTag1
+ m.VtrTag1 = uint32(o.Uint32(tmp[pos : pos+4]))
+ pos += 4
+ // field[1] m.VtrTag2
+ m.VtrTag2 = uint32(o.Uint32(tmp[pos : pos+4]))
+ pos += 4
+ // field[1] m.OuterTag
+ m.OuterTag = uint16(o.Uint16(tmp[pos : pos+2]))
+ pos += 2
+ // field[1] m.BDmac
+ for i := 0; i < len(m.BDmac); i++ {
+ m.BDmac[i] = uint8(tmp[pos])
+ pos += 1
+ }
+ // field[1] m.BSmac
+ for i := 0; i < len(m.BSmac); i++ {
+ m.BSmac[i] = uint8(tmp[pos])
+ pos += 1
+ }
+ // field[1] m.BVlanid
+ m.BVlanid = uint16(o.Uint16(tmp[pos : pos+2]))
+ pos += 2
+ // field[1] m.ISid
+ m.ISid = uint32(o.Uint32(tmp[pos : pos+4]))
+ pos += 4
+ // field[1] m.InterfaceName
+ {
+ nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
+ m.InterfaceName = codec.DecodeString(tmp[pos : pos+nul])
+ pos += 64
+ }
+ // field[1] m.InterfaceDevType
+ {
+ nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
+ m.InterfaceDevType = codec.DecodeString(tmp[pos : pos+nul])
+ pos += 64
+ }
+ // field[1] m.Tag
+ {
+ nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
+ m.Tag = codec.DecodeString(tmp[pos : pos+nul])
+ pos += 64
+ }
+ return nil