package l2
import (
+ "strconv"
+
api "git.fd.io/govpp.git/api"
ethernet_types "git.fd.io/govpp.git/binapi/ethernet_types"
interface_types "git.fd.io/govpp.git/binapi/interface_types"
ip_types "git.fd.io/govpp.git/binapi/ip_types"
codec "git.fd.io/govpp.git/codec"
- "strconv"
)
// This is a compile-time assertion to ensure that this generated file
return api.RequestMessage
}
-func (m *BdIPMacAddDel) Size() int {
+func (m *BdIPMacAddDel) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 1 // m.IsAdd
size += 4 // m.Entry.BdID
size += 1 // m.Entry.IP.Af
return size
}
func (m *BdIPMacAddDel) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
+ buf := codec.NewBuffer(b)
buf.EncodeBool(m.IsAdd)
- buf.EncodeUint32(uint32(m.Entry.BdID))
+ buf.EncodeUint32(m.Entry.BdID)
buf.EncodeUint8(uint8(m.Entry.IP.Af))
- buf.EncodeBytes(m.Entry.IP.Un.XXX_UnionData[:], 0)
+ buf.EncodeBytes(m.Entry.IP.Un.XXX_UnionData[:], 16)
buf.EncodeBytes(m.Entry.Mac[:], 6)
return buf.Bytes(), nil
}
return api.ReplyMessage
}
-func (m *BdIPMacAddDelReply) Size() int {
+func (m *BdIPMacAddDelReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *BdIPMacAddDelReply) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.Retval))
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
return buf.Bytes(), nil
}
func (m *BdIPMacAddDelReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.ReplyMessage
}
-func (m *BdIPMacDetails) Size() int {
+func (m *BdIPMacDetails) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Entry.BdID
size += 1 // m.Entry.IP.Af
size += 1 * 16 // m.Entry.IP.Un
return size
}
func (m *BdIPMacDetails) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.Entry.BdID))
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Entry.BdID)
buf.EncodeUint8(uint8(m.Entry.IP.Af))
- buf.EncodeBytes(m.Entry.IP.Un.XXX_UnionData[:], 0)
+ buf.EncodeBytes(m.Entry.IP.Un.XXX_UnionData[:], 16)
buf.EncodeBytes(m.Entry.Mac[:], 6)
return buf.Bytes(), nil
}
return api.RequestMessage
}
-func (m *BdIPMacDump) Size() int {
+func (m *BdIPMacDump) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.BdID
return size
}
func (m *BdIPMacDump) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.BdID))
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.BdID)
return buf.Bytes(), nil
}
func (m *BdIPMacDump) Unmarshal(b []byte) error {
return api.RequestMessage
}
-func (m *BdIPMacFlush) Size() int {
+func (m *BdIPMacFlush) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.BdID
return size
}
func (m *BdIPMacFlush) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.BdID))
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.BdID)
return buf.Bytes(), nil
}
func (m *BdIPMacFlush) Unmarshal(b []byte) error {
return api.ReplyMessage
}
-func (m *BdIPMacFlushReply) Size() int {
+func (m *BdIPMacFlushReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *BdIPMacFlushReply) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.Retval))
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
return buf.Bytes(), nil
}
func (m *BdIPMacFlushReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.RequestMessage
}
-func (m *BridgeDomainAddDel) Size() int {
+func (m *BridgeDomainAddDel) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.BdID
size += 1 // m.Flood
size += 1 // m.UuFlood
return size
}
func (m *BridgeDomainAddDel) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.BdID))
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.BdID)
buf.EncodeBool(m.Flood)
buf.EncodeBool(m.UuFlood)
buf.EncodeBool(m.Forward)
buf.EncodeBool(m.Learn)
buf.EncodeBool(m.ArpTerm)
buf.EncodeBool(m.ArpUfwd)
- buf.EncodeUint8(uint8(m.MacAge))
+ buf.EncodeUint8(m.MacAge)
buf.EncodeString(m.BdTag, 64)
buf.EncodeBool(m.IsAdd)
return buf.Bytes(), nil
return api.ReplyMessage
}
-func (m *BridgeDomainAddDelReply) Size() int {
+func (m *BridgeDomainAddDelReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *BridgeDomainAddDelReply) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.Retval))
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
return buf.Bytes(), nil
}
func (m *BridgeDomainAddDelReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.ReplyMessage
}
-func (m *BridgeDomainDetails) Size() int {
+func (m *BridgeDomainDetails) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.BdID
size += 1 // m.Flood
size += 1 // m.UuFlood
return size
}
func (m *BridgeDomainDetails) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.BdID))
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.BdID)
buf.EncodeBool(m.Flood)
buf.EncodeBool(m.UuFlood)
buf.EncodeBool(m.Forward)
buf.EncodeBool(m.Learn)
buf.EncodeBool(m.ArpTerm)
buf.EncodeBool(m.ArpUfwd)
- buf.EncodeUint8(uint8(m.MacAge))
+ buf.EncodeUint8(m.MacAge)
buf.EncodeString(m.BdTag, 64)
buf.EncodeUint32(uint32(m.BviSwIfIndex))
buf.EncodeUint32(uint32(m.UuFwdSwIfIndex))
buf.EncodeUint32(uint32(len(m.SwIfDetails)))
for j0 := 0; j0 < len(m.SwIfDetails); j0++ {
- var v0 BridgeDomainSwIf
+ var v0 BridgeDomainSwIf // SwIfDetails
if j0 < len(m.SwIfDetails) {
v0 = m.SwIfDetails[j0]
}
- buf.EncodeUint32(uint32(v0.Context))
+ buf.EncodeUint32(v0.Context)
buf.EncodeUint32(uint32(v0.SwIfIndex))
- buf.EncodeUint8(uint8(v0.Shg))
+ buf.EncodeUint8(v0.Shg)
}
return buf.Bytes(), nil
}
m.BviSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
m.UuFwdSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
m.NSwIfs = buf.DecodeUint32()
- m.SwIfDetails = make([]BridgeDomainSwIf, int(m.NSwIfs))
+ m.SwIfDetails = make([]BridgeDomainSwIf, m.NSwIfs)
for j0 := 0; j0 < len(m.SwIfDetails); j0++ {
m.SwIfDetails[j0].Context = buf.DecodeUint32()
m.SwIfDetails[j0].SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
// BridgeDomainDump defines message 'bridge_domain_dump'.
type BridgeDomainDump struct {
- BdID uint32 `binapi:"u32,name=bd_id,default=%!s(float64=4.294967295e+09)" json:"bd_id,omitempty"`
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=%!s(float64=4.294967295e+09)" json:"sw_if_index,omitempty"`
+ BdID uint32 `binapi:"u32,name=bd_id,default=4294967295" json:"bd_id,omitempty"`
+ SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"`
}
func (m *BridgeDomainDump) Reset() { *m = BridgeDomainDump{} }
return api.RequestMessage
}
-func (m *BridgeDomainDump) Size() int {
+func (m *BridgeDomainDump) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.BdID
size += 4 // m.SwIfIndex
return size
}
func (m *BridgeDomainDump) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.BdID))
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.BdID)
buf.EncodeUint32(uint32(m.SwIfIndex))
return buf.Bytes(), nil
}
return api.RequestMessage
}
-func (m *BridgeDomainSetMacAge) Size() int {
+func (m *BridgeDomainSetMacAge) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.BdID
size += 1 // m.MacAge
return size
}
func (m *BridgeDomainSetMacAge) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.BdID))
- buf.EncodeUint8(uint8(m.MacAge))
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.BdID)
+ buf.EncodeUint8(m.MacAge)
return buf.Bytes(), nil
}
func (m *BridgeDomainSetMacAge) Unmarshal(b []byte) error {
return api.ReplyMessage
}
-func (m *BridgeDomainSetMacAgeReply) Size() int {
+func (m *BridgeDomainSetMacAgeReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *BridgeDomainSetMacAgeReply) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.Retval))
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
return buf.Bytes(), nil
}
func (m *BridgeDomainSetMacAgeReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.RequestMessage
}
-func (m *BridgeFlags) Size() int {
+func (m *BridgeFlags) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.BdID
size += 1 // m.IsSet
size += 4 // m.Flags
return size
}
func (m *BridgeFlags) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.BdID))
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.BdID)
buf.EncodeBool(m.IsSet)
buf.EncodeUint32(uint32(m.Flags))
return buf.Bytes(), nil
return api.ReplyMessage
}
-func (m *BridgeFlagsReply) Size() int {
+func (m *BridgeFlagsReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
size += 4 // m.ResultingFeatureBitmap
return size
}
func (m *BridgeFlagsReply) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.Retval))
- buf.EncodeUint32(uint32(m.ResultingFeatureBitmap))
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint32(m.ResultingFeatureBitmap)
return buf.Bytes(), nil
}
func (m *BridgeFlagsReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
m.ResultingFeatureBitmap = buf.DecodeUint32()
return nil
}
// BviCreate defines message 'bvi_create'.
type BviCreate struct {
Mac ethernet_types.MacAddress `binapi:"mac_address,name=mac" json:"mac,omitempty"`
- UserInstance uint32 `binapi:"u32,name=user_instance,default=%!s(float64=4.294967295e+09)" json:"user_instance,omitempty"`
+ UserInstance uint32 `binapi:"u32,name=user_instance,default=4294967295" json:"user_instance,omitempty"`
}
func (m *BviCreate) Reset() { *m = BviCreate{} }
return api.RequestMessage
}
-func (m *BviCreate) Size() int {
+func (m *BviCreate) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 1 * 6 // m.Mac
size += 4 // m.UserInstance
return size
}
func (m *BviCreate) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
+ buf := codec.NewBuffer(b)
buf.EncodeBytes(m.Mac[:], 6)
- buf.EncodeUint32(uint32(m.UserInstance))
+ buf.EncodeUint32(m.UserInstance)
return buf.Bytes(), nil
}
func (m *BviCreate) Unmarshal(b []byte) error {
return api.ReplyMessage
}
-func (m *BviCreateReply) Size() int {
+func (m *BviCreateReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
size += 4 // m.SwIfIndex
return size
}
func (m *BviCreateReply) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.Retval))
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
buf.EncodeUint32(uint32(m.SwIfIndex))
return buf.Bytes(), nil
}
func (m *BviCreateReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
return nil
}
return api.RequestMessage
}
-func (m *BviDelete) Size() int {
+func (m *BviDelete) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.SwIfIndex
return size
}
func (m *BviDelete) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
+ buf := codec.NewBuffer(b)
buf.EncodeUint32(uint32(m.SwIfIndex))
return buf.Bytes(), nil
}
return api.ReplyMessage
}
-func (m *BviDeleteReply) Size() int {
+func (m *BviDeleteReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *BviDeleteReply) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.Retval))
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
return buf.Bytes(), nil
}
func (m *BviDeleteReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.EventMessage
}
-func (m *L2ArpTermEvent) Size() int {
+func (m *L2ArpTermEvent) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.PID
size += 1 // m.IP.Af
size += 1 * 16 // m.IP.Un
return size
}
func (m *L2ArpTermEvent) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.PID))
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.PID)
buf.EncodeUint8(uint8(m.IP.Af))
- buf.EncodeBytes(m.IP.Un.XXX_UnionData[:], 0)
+ buf.EncodeBytes(m.IP.Un.XXX_UnionData[:], 16)
buf.EncodeUint32(uint32(m.SwIfIndex))
buf.EncodeBytes(m.Mac[:], 6)
return buf.Bytes(), nil
return api.RequestMessage
}
-func (m *L2FibClearTable) Size() int {
+func (m *L2FibClearTable) Size() (size int) {
if m == nil {
return 0
}
- var size int
return size
}
func (m *L2FibClearTable) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
+ buf := codec.NewBuffer(b)
return buf.Bytes(), nil
}
func (m *L2FibClearTable) Unmarshal(b []byte) error {
return api.ReplyMessage
}
-func (m *L2FibClearTableReply) Size() int {
+func (m *L2FibClearTableReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *L2FibClearTableReply) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.Retval))
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
return buf.Bytes(), nil
}
func (m *L2FibClearTableReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.ReplyMessage
}
-func (m *L2FibTableDetails) Size() int {
+func (m *L2FibTableDetails) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.BdID
size += 1 * 6 // m.Mac
size += 4 // m.SwIfIndex
return size
}
func (m *L2FibTableDetails) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.BdID))
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.BdID)
buf.EncodeBytes(m.Mac[:], 6)
buf.EncodeUint32(uint32(m.SwIfIndex))
buf.EncodeBool(m.StaticMac)
return api.RequestMessage
}
-func (m *L2FibTableDump) Size() int {
+func (m *L2FibTableDump) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.BdID
return size
}
func (m *L2FibTableDump) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.BdID))
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.BdID)
return buf.Bytes(), nil
}
func (m *L2FibTableDump) Unmarshal(b []byte) error {
return api.RequestMessage
}
-func (m *L2Flags) Size() int {
+func (m *L2Flags) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.SwIfIndex
size += 1 // m.IsSet
size += 4 // m.FeatureBitmap
return size
}
func (m *L2Flags) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
+ buf := codec.NewBuffer(b)
buf.EncodeUint32(uint32(m.SwIfIndex))
buf.EncodeBool(m.IsSet)
- buf.EncodeUint32(uint32(m.FeatureBitmap))
+ buf.EncodeUint32(m.FeatureBitmap)
return buf.Bytes(), nil
}
func (m *L2Flags) Unmarshal(b []byte) error {
return api.ReplyMessage
}
-func (m *L2FlagsReply) Size() int {
+func (m *L2FlagsReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
size += 4 // m.ResultingFeatureBitmap
return size
}
func (m *L2FlagsReply) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.Retval))
- buf.EncodeUint32(uint32(m.ResultingFeatureBitmap))
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint32(m.ResultingFeatureBitmap)
return buf.Bytes(), nil
}
func (m *L2FlagsReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
m.ResultingFeatureBitmap = buf.DecodeUint32()
return nil
}
return api.RequestMessage
}
-func (m *L2InterfaceEfpFilter) Size() int {
+func (m *L2InterfaceEfpFilter) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.SwIfIndex
size += 1 // m.EnableDisable
return size
}
func (m *L2InterfaceEfpFilter) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
+ buf := codec.NewBuffer(b)
buf.EncodeUint32(uint32(m.SwIfIndex))
buf.EncodeBool(m.EnableDisable)
return buf.Bytes(), nil
return api.ReplyMessage
}
-func (m *L2InterfaceEfpFilterReply) Size() int {
+func (m *L2InterfaceEfpFilterReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *L2InterfaceEfpFilterReply) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.Retval))
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
return buf.Bytes(), nil
}
func (m *L2InterfaceEfpFilterReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.RequestMessage
}
-func (m *L2InterfacePbbTagRewrite) Size() int {
+func (m *L2InterfacePbbTagRewrite) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.SwIfIndex
size += 4 // m.VtrOp
size += 2 // m.OuterTag
return size
}
func (m *L2InterfacePbbTagRewrite) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
+ buf := codec.NewBuffer(b)
buf.EncodeUint32(uint32(m.SwIfIndex))
- buf.EncodeUint32(uint32(m.VtrOp))
- buf.EncodeUint16(uint16(m.OuterTag))
+ buf.EncodeUint32(m.VtrOp)
+ buf.EncodeUint16(m.OuterTag)
buf.EncodeBytes(m.BDmac[:], 6)
buf.EncodeBytes(m.BSmac[:], 6)
- buf.EncodeUint16(uint16(m.BVlanid))
- buf.EncodeUint32(uint32(m.ISid))
+ buf.EncodeUint16(m.BVlanid)
+ buf.EncodeUint32(m.ISid)
return buf.Bytes(), nil
}
func (m *L2InterfacePbbTagRewrite) Unmarshal(b []byte) error {
return api.ReplyMessage
}
-func (m *L2InterfacePbbTagRewriteReply) Size() int {
+func (m *L2InterfacePbbTagRewriteReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *L2InterfacePbbTagRewriteReply) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.Retval))
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
return buf.Bytes(), nil
}
func (m *L2InterfacePbbTagRewriteReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.RequestMessage
}
-func (m *L2InterfaceVlanTagRewrite) Size() int {
+func (m *L2InterfaceVlanTagRewrite) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.SwIfIndex
size += 4 // m.VtrOp
size += 4 // m.PushDot1q
return size
}
func (m *L2InterfaceVlanTagRewrite) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
+ buf := codec.NewBuffer(b)
buf.EncodeUint32(uint32(m.SwIfIndex))
- buf.EncodeUint32(uint32(m.VtrOp))
- buf.EncodeUint32(uint32(m.PushDot1q))
- buf.EncodeUint32(uint32(m.Tag1))
- buf.EncodeUint32(uint32(m.Tag2))
+ buf.EncodeUint32(m.VtrOp)
+ buf.EncodeUint32(m.PushDot1q)
+ buf.EncodeUint32(m.Tag1)
+ buf.EncodeUint32(m.Tag2)
return buf.Bytes(), nil
}
func (m *L2InterfaceVlanTagRewrite) Unmarshal(b []byte) error {
return api.ReplyMessage
}
-func (m *L2InterfaceVlanTagRewriteReply) Size() int {
+func (m *L2InterfaceVlanTagRewriteReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *L2InterfaceVlanTagRewriteReply) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.Retval))
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
return buf.Bytes(), nil
}
func (m *L2InterfaceVlanTagRewriteReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.EventMessage
}
-func (m *L2MacsEvent) Size() int {
+func (m *L2MacsEvent) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.PID
size += 4 // m.NMacs
for j1 := 0; j1 < len(m.Mac); j1++ {
return size
}
func (m *L2MacsEvent) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.PID))
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.PID)
buf.EncodeUint32(uint32(len(m.Mac)))
for j0 := 0; j0 < len(m.Mac); j0++ {
- var v0 MacEntry
+ var v0 MacEntry // Mac
if j0 < len(m.Mac) {
v0 = m.Mac[j0]
}
buf.EncodeUint32(uint32(v0.SwIfIndex))
buf.EncodeBytes(v0.MacAddr[:], 6)
buf.EncodeUint32(uint32(v0.Action))
- buf.EncodeUint8(uint8(v0.Flags))
+ buf.EncodeUint8(v0.Flags)
}
return buf.Bytes(), nil
}
buf := codec.NewBuffer(b)
m.PID = buf.DecodeUint32()
m.NMacs = buf.DecodeUint32()
- m.Mac = make([]MacEntry, int(m.NMacs))
+ m.Mac = make([]MacEntry, m.NMacs)
for j0 := 0; j0 < len(m.Mac); j0++ {
m.Mac[j0].SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
copy(m.Mac[j0].MacAddr[:], buf.DecodeBytes(6))
return api.RequestMessage
}
-func (m *L2PatchAddDel) Size() int {
+func (m *L2PatchAddDel) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.RxSwIfIndex
size += 4 // m.TxSwIfIndex
size += 1 // m.IsAdd
return size
}
func (m *L2PatchAddDel) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
+ buf := codec.NewBuffer(b)
buf.EncodeUint32(uint32(m.RxSwIfIndex))
buf.EncodeUint32(uint32(m.TxSwIfIndex))
buf.EncodeBool(m.IsAdd)
return api.ReplyMessage
}
-func (m *L2PatchAddDelReply) Size() int {
+func (m *L2PatchAddDelReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *L2PatchAddDelReply) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.Retval))
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
return buf.Bytes(), nil
}
func (m *L2PatchAddDelReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.ReplyMessage
}
-func (m *L2XconnectDetails) Size() int {
+func (m *L2XconnectDetails) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.RxSwIfIndex
size += 4 // m.TxSwIfIndex
return size
}
func (m *L2XconnectDetails) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
+ buf := codec.NewBuffer(b)
buf.EncodeUint32(uint32(m.RxSwIfIndex))
buf.EncodeUint32(uint32(m.TxSwIfIndex))
return buf.Bytes(), nil
return api.RequestMessage
}
-func (m *L2XconnectDump) Size() int {
+func (m *L2XconnectDump) Size() (size int) {
if m == nil {
return 0
}
- var size int
return size
}
func (m *L2XconnectDump) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
+ buf := codec.NewBuffer(b)
return buf.Bytes(), nil
}
func (m *L2XconnectDump) Unmarshal(b []byte) error {
return api.RequestMessage
}
-func (m *L2fibAddDel) Size() int {
+func (m *L2fibAddDel) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 1 * 6 // m.Mac
size += 4 // m.BdID
size += 4 // m.SwIfIndex
return size
}
func (m *L2fibAddDel) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
+ buf := codec.NewBuffer(b)
buf.EncodeBytes(m.Mac[:], 6)
- buf.EncodeUint32(uint32(m.BdID))
+ buf.EncodeUint32(m.BdID)
buf.EncodeUint32(uint32(m.SwIfIndex))
buf.EncodeBool(m.IsAdd)
buf.EncodeBool(m.StaticMac)
return api.ReplyMessage
}
-func (m *L2fibAddDelReply) Size() int {
+func (m *L2fibAddDelReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *L2fibAddDelReply) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.Retval))
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
return buf.Bytes(), nil
}
func (m *L2fibAddDelReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.RequestMessage
}
-func (m *L2fibFlushAll) Size() int {
+func (m *L2fibFlushAll) Size() (size int) {
if m == nil {
return 0
}
- var size int
return size
}
func (m *L2fibFlushAll) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
+ buf := codec.NewBuffer(b)
return buf.Bytes(), nil
}
func (m *L2fibFlushAll) Unmarshal(b []byte) error {
return api.ReplyMessage
}
-func (m *L2fibFlushAllReply) Size() int {
+func (m *L2fibFlushAllReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *L2fibFlushAllReply) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.Retval))
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
return buf.Bytes(), nil
}
func (m *L2fibFlushAllReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.RequestMessage
}
-func (m *L2fibFlushBd) Size() int {
+func (m *L2fibFlushBd) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.BdID
return size
}
func (m *L2fibFlushBd) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.BdID))
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.BdID)
return buf.Bytes(), nil
}
func (m *L2fibFlushBd) Unmarshal(b []byte) error {
return api.ReplyMessage
}
-func (m *L2fibFlushBdReply) Size() int {
+func (m *L2fibFlushBdReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *L2fibFlushBdReply) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.Retval))
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
return buf.Bytes(), nil
}
func (m *L2fibFlushBdReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.RequestMessage
}
-func (m *L2fibFlushInt) Size() int {
+func (m *L2fibFlushInt) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.SwIfIndex
return size
}
func (m *L2fibFlushInt) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
+ buf := codec.NewBuffer(b)
buf.EncodeUint32(uint32(m.SwIfIndex))
return buf.Bytes(), nil
}
return api.ReplyMessage
}
-func (m *L2fibFlushIntReply) Size() int {
+func (m *L2fibFlushIntReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *L2fibFlushIntReply) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.Retval))
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
return buf.Bytes(), nil
}
func (m *L2fibFlushIntReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.RequestMessage
}
-func (m *SwInterfaceSetL2Bridge) Size() int {
+func (m *SwInterfaceSetL2Bridge) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.RxSwIfIndex
size += 4 // m.BdID
size += 4 // m.PortType
return size
}
func (m *SwInterfaceSetL2Bridge) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
+ buf := codec.NewBuffer(b)
buf.EncodeUint32(uint32(m.RxSwIfIndex))
- buf.EncodeUint32(uint32(m.BdID))
+ buf.EncodeUint32(m.BdID)
buf.EncodeUint32(uint32(m.PortType))
- buf.EncodeUint8(uint8(m.Shg))
+ buf.EncodeUint8(m.Shg)
buf.EncodeBool(m.Enable)
return buf.Bytes(), nil
}
return api.ReplyMessage
}
-func (m *SwInterfaceSetL2BridgeReply) Size() int {
+func (m *SwInterfaceSetL2BridgeReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *SwInterfaceSetL2BridgeReply) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.Retval))
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
return buf.Bytes(), nil
}
func (m *SwInterfaceSetL2BridgeReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.RequestMessage
}
-func (m *SwInterfaceSetL2Xconnect) Size() int {
+func (m *SwInterfaceSetL2Xconnect) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.RxSwIfIndex
size += 4 // m.TxSwIfIndex
size += 1 // m.Enable
return size
}
func (m *SwInterfaceSetL2Xconnect) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
+ buf := codec.NewBuffer(b)
buf.EncodeUint32(uint32(m.RxSwIfIndex))
buf.EncodeUint32(uint32(m.TxSwIfIndex))
buf.EncodeBool(m.Enable)
return api.ReplyMessage
}
-func (m *SwInterfaceSetL2XconnectReply) Size() int {
+func (m *SwInterfaceSetL2XconnectReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *SwInterfaceSetL2XconnectReply) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.Retval))
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
return buf.Bytes(), nil
}
func (m *SwInterfaceSetL2XconnectReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
// SwInterfaceSetVpath defines message 'sw_interface_set_vpath'.
type SwInterfaceSetVpath struct {
SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- Enable bool `binapi:"bool,name=enable,default=%!s(float64=4.294967295e+09)" json:"enable,omitempty"`
+ Enable bool `binapi:"bool,name=enable,default=4.294967295e+09" json:"enable,omitempty"`
}
func (m *SwInterfaceSetVpath) Reset() { *m = SwInterfaceSetVpath{} }
return api.RequestMessage
}
-func (m *SwInterfaceSetVpath) Size() int {
+func (m *SwInterfaceSetVpath) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.SwIfIndex
size += 1 // m.Enable
return size
}
func (m *SwInterfaceSetVpath) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
+ buf := codec.NewBuffer(b)
buf.EncodeUint32(uint32(m.SwIfIndex))
buf.EncodeBool(m.Enable)
return buf.Bytes(), nil
return api.ReplyMessage
}
-func (m *SwInterfaceSetVpathReply) Size() int {
+func (m *SwInterfaceSetVpathReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *SwInterfaceSetVpathReply) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.Retval))
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
return buf.Bytes(), nil
}
func (m *SwInterfaceSetVpathReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.RequestMessage
}
-func (m *WantL2ArpTermEvents) Size() int {
+func (m *WantL2ArpTermEvents) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 1 // m.Enable
size += 4 // m.PID
return size
}
func (m *WantL2ArpTermEvents) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
+ buf := codec.NewBuffer(b)
buf.EncodeBool(m.Enable)
- buf.EncodeUint32(uint32(m.PID))
+ buf.EncodeUint32(m.PID)
return buf.Bytes(), nil
}
func (m *WantL2ArpTermEvents) Unmarshal(b []byte) error {
return api.ReplyMessage
}
-func (m *WantL2ArpTermEventsReply) Size() int {
+func (m *WantL2ArpTermEventsReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *WantL2ArpTermEventsReply) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.Retval))
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
return buf.Bytes(), nil
}
func (m *WantL2ArpTermEventsReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
// WantL2MacsEvents defines message 'want_l2_macs_events'.
type WantL2MacsEvents struct {
- LearnLimit uint32 `binapi:"u32,name=learn_limit,default=%!s(float64=1000)" json:"learn_limit,omitempty"`
- ScanDelay uint8 `binapi:"u8,name=scan_delay,default=%!s(float64=10)" json:"scan_delay,omitempty"`
- MaxMacsInEvent uint8 `binapi:"u8,name=max_macs_in_event,default=%!s(float64=10)" json:"max_macs_in_event,omitempty"`
+ LearnLimit uint32 `binapi:"u32,name=learn_limit,default=1000" json:"learn_limit,omitempty"`
+ ScanDelay uint8 `binapi:"u8,name=scan_delay,default=10" json:"scan_delay,omitempty"`
+ MaxMacsInEvent uint8 `binapi:"u8,name=max_macs_in_event,default=10" json:"max_macs_in_event,omitempty"`
EnableDisable bool `binapi:"bool,name=enable_disable,default=true" json:"enable_disable,omitempty"`
PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
}
return api.RequestMessage
}
-func (m *WantL2MacsEvents) Size() int {
+func (m *WantL2MacsEvents) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.LearnLimit
size += 1 // m.ScanDelay
size += 1 // m.MaxMacsInEvent
return size
}
func (m *WantL2MacsEvents) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.LearnLimit))
- buf.EncodeUint8(uint8(m.ScanDelay))
- buf.EncodeUint8(uint8(m.MaxMacsInEvent))
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.LearnLimit)
+ buf.EncodeUint8(m.ScanDelay)
+ buf.EncodeUint8(m.MaxMacsInEvent)
buf.EncodeBool(m.EnableDisable)
- buf.EncodeUint32(uint32(m.PID))
+ buf.EncodeUint32(m.PID)
return buf.Bytes(), nil
}
func (m *WantL2MacsEvents) Unmarshal(b []byte) error {
return api.ReplyMessage
}
-func (m *WantL2MacsEventsReply) Size() int {
+func (m *WantL2MacsEventsReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *WantL2MacsEventsReply) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.Retval))
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
return buf.Bytes(), nil
}
func (m *WantL2MacsEventsReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}