package ip_neighbor
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 *IPNeighborAddDel) Size() int {
+func (m *IPNeighborAddDel) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 1 // m.IsAdd
size += 4 // m.Neighbor.SwIfIndex
size += 1 // m.Neighbor.Flags
return size
}
func (m *IPNeighborAddDel) 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.Neighbor.SwIfIndex))
buf.EncodeUint8(uint8(m.Neighbor.Flags))
buf.EncodeBytes(m.Neighbor.MacAddress[:], 6)
buf.EncodeUint8(uint8(m.Neighbor.IPAddress.Af))
- buf.EncodeBytes(m.Neighbor.IPAddress.Un.XXX_UnionData[:], 0)
+ buf.EncodeBytes(m.Neighbor.IPAddress.Un.XXX_UnionData[:], 16)
return buf.Bytes(), nil
}
func (m *IPNeighborAddDel) Unmarshal(b []byte) error {
return api.ReplyMessage
}
-func (m *IPNeighborAddDelReply) Size() int {
+func (m *IPNeighborAddDelReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
size += 4 // m.StatsIndex
return size
}
func (m *IPNeighborAddDelReply) 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.StatsIndex))
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint32(m.StatsIndex)
return buf.Bytes(), nil
}
func (m *IPNeighborAddDelReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
m.StatsIndex = buf.DecodeUint32()
return nil
}
return api.RequestMessage
}
-func (m *IPNeighborConfig) Size() int {
+func (m *IPNeighborConfig) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 1 // m.Af
size += 4 // m.MaxNumber
size += 4 // m.MaxAge
return size
}
func (m *IPNeighborConfig) 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.EncodeUint8(uint8(m.Af))
- buf.EncodeUint32(uint32(m.MaxNumber))
- buf.EncodeUint32(uint32(m.MaxAge))
+ buf.EncodeUint32(m.MaxNumber)
+ buf.EncodeUint32(m.MaxAge)
buf.EncodeBool(m.Recycle)
return buf.Bytes(), nil
}
return api.ReplyMessage
}
-func (m *IPNeighborConfigReply) Size() int {
+func (m *IPNeighborConfigReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *IPNeighborConfigReply) 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 *IPNeighborConfigReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.ReplyMessage
}
-func (m *IPNeighborDetails) Size() int {
+func (m *IPNeighborDetails) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 8 // m.Age
size += 4 // m.Neighbor.SwIfIndex
size += 1 // m.Neighbor.Flags
return size
}
func (m *IPNeighborDetails) 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.EncodeFloat64(float64(m.Age))
+ buf := codec.NewBuffer(b)
+ buf.EncodeFloat64(m.Age)
buf.EncodeUint32(uint32(m.Neighbor.SwIfIndex))
buf.EncodeUint8(uint8(m.Neighbor.Flags))
buf.EncodeBytes(m.Neighbor.MacAddress[:], 6)
buf.EncodeUint8(uint8(m.Neighbor.IPAddress.Af))
- buf.EncodeBytes(m.Neighbor.IPAddress.Un.XXX_UnionData[:], 0)
+ buf.EncodeBytes(m.Neighbor.IPAddress.Un.XXX_UnionData[:], 16)
return buf.Bytes(), nil
}
func (m *IPNeighborDetails) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Age = float64(buf.DecodeFloat64())
+ m.Age = buf.DecodeFloat64()
m.Neighbor.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
m.Neighbor.Flags = IPNeighborFlags(buf.DecodeUint8())
copy(m.Neighbor.MacAddress[:], buf.DecodeBytes(6))
// IPNeighborDump defines message 'ip_neighbor_dump'.
type IPNeighborDump struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=%!s(float64=4.294967295e+09)" json:"sw_if_index,omitempty"`
+ SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"`
Af ip_types.AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
}
return api.RequestMessage
}
-func (m *IPNeighborDump) Size() int {
+func (m *IPNeighborDump) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.SwIfIndex
size += 1 // m.Af
return size
}
func (m *IPNeighborDump) 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.EncodeUint8(uint8(m.Af))
return buf.Bytes(), nil
return api.EventMessage
}
-func (m *IPNeighborEvent) Size() int {
+func (m *IPNeighborEvent) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.PID
size += 4 // m.Neighbor.SwIfIndex
size += 1 // m.Neighbor.Flags
return size
}
func (m *IPNeighborEvent) 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(m.Neighbor.SwIfIndex))
buf.EncodeUint8(uint8(m.Neighbor.Flags))
buf.EncodeBytes(m.Neighbor.MacAddress[:], 6)
buf.EncodeUint8(uint8(m.Neighbor.IPAddress.Af))
- buf.EncodeBytes(m.Neighbor.IPAddress.Un.XXX_UnionData[:], 0)
+ buf.EncodeBytes(m.Neighbor.IPAddress.Un.XXX_UnionData[:], 16)
return buf.Bytes(), nil
}
func (m *IPNeighborEvent) Unmarshal(b []byte) error {
// IPNeighborFlush defines message 'ip_neighbor_flush'.
type IPNeighborFlush struct {
Af ip_types.AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=%!s(float64=4.294967295e+09)" json:"sw_if_index,omitempty"`
+ SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"`
}
func (m *IPNeighborFlush) Reset() { *m = IPNeighborFlush{} }
return api.RequestMessage
}
-func (m *IPNeighborFlush) Size() int {
+func (m *IPNeighborFlush) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 1 // m.Af
size += 4 // m.SwIfIndex
return size
}
func (m *IPNeighborFlush) 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.EncodeUint8(uint8(m.Af))
buf.EncodeUint32(uint32(m.SwIfIndex))
return buf.Bytes(), nil
return api.ReplyMessage
}
-func (m *IPNeighborFlushReply) Size() int {
+func (m *IPNeighborFlushReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *IPNeighborFlushReply) 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 *IPNeighborFlushReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.RequestMessage
}
-func (m *IPNeighborReplaceBegin) Size() int {
+func (m *IPNeighborReplaceBegin) Size() (size int) {
if m == nil {
return 0
}
- var size int
return size
}
func (m *IPNeighborReplaceBegin) 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 *IPNeighborReplaceBegin) Unmarshal(b []byte) error {
return api.ReplyMessage
}
-func (m *IPNeighborReplaceBeginReply) Size() int {
+func (m *IPNeighborReplaceBeginReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *IPNeighborReplaceBeginReply) 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 *IPNeighborReplaceBeginReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
return api.RequestMessage
}
-func (m *IPNeighborReplaceEnd) Size() int {
+func (m *IPNeighborReplaceEnd) Size() (size int) {
if m == nil {
return 0
}
- var size int
return size
}
func (m *IPNeighborReplaceEnd) 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 *IPNeighborReplaceEnd) Unmarshal(b []byte) error {
return api.ReplyMessage
}
-func (m *IPNeighborReplaceEndReply) Size() int {
+func (m *IPNeighborReplaceEndReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *IPNeighborReplaceEndReply) 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 *IPNeighborReplaceEndReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
IP ip_types.Address `binapi:"address,name=ip" json:"ip,omitempty"`
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=%!s(float64=4.294967295e+09)" json:"sw_if_index,omitempty"`
+ SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"`
}
func (m *WantIPNeighborEvents) Reset() { *m = WantIPNeighborEvents{} }
return api.RequestMessage
}
-func (m *WantIPNeighborEvents) Size() int {
+func (m *WantIPNeighborEvents) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 1 // m.Enable
size += 4 // m.PID
size += 1 // m.IP.Af
return size
}
func (m *WantIPNeighborEvents) 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)
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))
return buf.Bytes(), nil
}
return api.ReplyMessage
}
-func (m *WantIPNeighborEventsReply) Size() int {
+func (m *WantIPNeighborEventsReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *WantIPNeighborEventsReply) 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 *WantIPNeighborEventsReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}