+// PuntRedirectV2 defines type 'punt_redirect_v2'.
+type PuntRedirectV2 struct {
+ RxSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=rx_sw_if_index,default=4294967295" json:"rx_sw_if_index,omitempty"`
+ Af ip_types.AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ NPaths uint32 `binapi:"u32,name=n_paths" json:"-"`
+ Paths []fib_types.FibPath `binapi:"fib_path[n_paths],name=paths" json:"paths,omitempty"`
+}
+
+// AddDelIPPuntRedirectV2 defines message 'add_del_ip_punt_redirect_v2'.
+type AddDelIPPuntRedirectV2 struct {
+ IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
+ Punt PuntRedirectV2 `binapi:"punt_redirect_v2,name=punt" json:"punt,omitempty"`
+}
+
+func (m *AddDelIPPuntRedirectV2) Reset() { *m = AddDelIPPuntRedirectV2{} }
+func (*AddDelIPPuntRedirectV2) GetMessageName() string { return "add_del_ip_punt_redirect_v2" }
+func (*AddDelIPPuntRedirectV2) GetCrcString() string { return "9e804227" }
+func (*AddDelIPPuntRedirectV2) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *AddDelIPPuntRedirectV2) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsAdd
+ size += 4 // m.Punt.RxSwIfIndex
+ size += 1 // m.Punt.Af
+ size += 4 // m.Punt.NPaths
+ for j2 := 0; j2 < len(m.Punt.Paths); j2++ {
+ var s2 fib_types.FibPath
+ _ = s2
+ if j2 < len(m.Punt.Paths) {
+ s2 = m.Punt.Paths[j2]
+ }
+ size += 4 // s2.SwIfIndex
+ size += 4 // s2.TableID
+ size += 4 // s2.RpfID
+ size += 1 // s2.Weight
+ size += 1 // s2.Preference
+ size += 4 // s2.Type
+ size += 4 // s2.Flags
+ size += 4 // s2.Proto
+ size += 1 * 16 // s2.Nh.Address
+ size += 4 // s2.Nh.ViaLabel
+ size += 4 // s2.Nh.ObjID
+ size += 4 // s2.Nh.ClassifyTableIndex
+ size += 1 // s2.NLabels
+ for j3 := 0; j3 < 16; j3++ {
+ size += 1 // s2.LabelStack[j3].IsUniform
+ size += 4 // s2.LabelStack[j3].Label
+ size += 1 // s2.LabelStack[j3].TTL
+ size += 1 // s2.LabelStack[j3].Exp
+ }
+ }
+ return size
+}
+func (m *AddDelIPPuntRedirectV2) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint32(uint32(m.Punt.RxSwIfIndex))
+ buf.EncodeUint8(uint8(m.Punt.Af))
+ buf.EncodeUint32(uint32(len(m.Punt.Paths)))
+ for j1 := 0; j1 < len(m.Punt.Paths); j1++ {
+ var v1 fib_types.FibPath // Paths
+ if j1 < len(m.Punt.Paths) {
+ v1 = m.Punt.Paths[j1]
+ }
+ buf.EncodeUint32(v1.SwIfIndex)
+ buf.EncodeUint32(v1.TableID)
+ buf.EncodeUint32(v1.RpfID)
+ buf.EncodeUint8(v1.Weight)
+ buf.EncodeUint8(v1.Preference)
+ buf.EncodeUint32(uint32(v1.Type))
+ buf.EncodeUint32(uint32(v1.Flags))
+ buf.EncodeUint32(uint32(v1.Proto))
+ buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16)
+ buf.EncodeUint32(v1.Nh.ViaLabel)
+ buf.EncodeUint32(v1.Nh.ObjID)
+ buf.EncodeUint32(v1.Nh.ClassifyTableIndex)
+ buf.EncodeUint8(v1.NLabels)
+ for j2 := 0; j2 < 16; j2++ {
+ buf.EncodeUint8(v1.LabelStack[j2].IsUniform)
+ buf.EncodeUint32(v1.LabelStack[j2].Label)
+ buf.EncodeUint8(v1.LabelStack[j2].TTL)
+ buf.EncodeUint8(v1.LabelStack[j2].Exp)
+ }
+ }
+ return buf.Bytes(), nil
+}
+func (m *AddDelIPPuntRedirectV2) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.Punt.RxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
+ m.Punt.Af = ip_types.AddressFamily(buf.DecodeUint8())
+ m.Punt.NPaths = buf.DecodeUint32()
+ m.Punt.Paths = make([]fib_types.FibPath, m.Punt.NPaths)
+ for j1 := 0; j1 < len(m.Punt.Paths); j1++ {
+ m.Punt.Paths[j1].SwIfIndex = buf.DecodeUint32()
+ m.Punt.Paths[j1].TableID = buf.DecodeUint32()
+ m.Punt.Paths[j1].RpfID = buf.DecodeUint32()
+ m.Punt.Paths[j1].Weight = buf.DecodeUint8()
+ m.Punt.Paths[j1].Preference = buf.DecodeUint8()
+ m.Punt.Paths[j1].Type = fib_types.FibPathType(buf.DecodeUint32())
+ m.Punt.Paths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32())
+ m.Punt.Paths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32())
+ copy(m.Punt.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Punt.Paths[j1].Nh.ViaLabel = buf.DecodeUint32()
+ m.Punt.Paths[j1].Nh.ObjID = buf.DecodeUint32()
+ m.Punt.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
+ m.Punt.Paths[j1].NLabels = buf.DecodeUint8()
+ for j2 := 0; j2 < 16; j2++ {
+ m.Punt.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
+ m.Punt.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32()
+ m.Punt.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
+ m.Punt.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
+ }
+ }
+ return nil
+}
+
+// AddDelIPPuntRedirectV2Reply defines message 'add_del_ip_punt_redirect_v2_reply'.
+type AddDelIPPuntRedirectV2Reply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *AddDelIPPuntRedirectV2Reply) Reset() { *m = AddDelIPPuntRedirectV2Reply{} }
+func (*AddDelIPPuntRedirectV2Reply) GetMessageName() string {
+ return "add_del_ip_punt_redirect_v2_reply"
+}
+func (*AddDelIPPuntRedirectV2Reply) GetCrcString() string { return "e8d4e804" }
+func (*AddDelIPPuntRedirectV2Reply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *AddDelIPPuntRedirectV2Reply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *AddDelIPPuntRedirectV2Reply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *AddDelIPPuntRedirectV2Reply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ return nil
+}
+