// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
// versions:
-// binapi-generator: v0.4.0-dev
-// VPP: 20.05-release
+// binapi-generator: v0.3.5-56-gc0da1f2-dirty
+// VPP: 21.06-release
// source: /usr/share/vpp/api/plugins/nsh.api.json
// Package nsh contains generated bindings for API file nsh.api.
const (
APIFile = "nsh"
APIVersion = "1.0.0"
- VersionCrc = 0x43be6707
+ VersionCrc = 0xc2f3127d
)
// NshAddDelEntry defines message 'nsh_add_del_entry'.
return api.RequestMessage
}
-func (m *NshAddDelEntry) Size() int {
+func (m *NshAddDelEntry) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 1 // m.IsAdd
size += 4 // m.NspNsi
size += 1 // m.MdType
return size
}
func (m *NshAddDelEntry) 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.NspNsi))
- buf.EncodeUint8(uint8(m.MdType))
- buf.EncodeUint8(uint8(m.VerOC))
- buf.EncodeUint8(uint8(m.TTL))
- buf.EncodeUint8(uint8(m.Length))
- buf.EncodeUint8(uint8(m.NextProtocol))
- buf.EncodeUint32(uint32(m.C1))
- buf.EncodeUint32(uint32(m.C2))
- buf.EncodeUint32(uint32(m.C3))
- buf.EncodeUint32(uint32(m.C4))
- buf.EncodeUint8(uint8(m.TlvLength))
- buf.EncodeBytes(m.Tlv[:], 248)
+ buf.EncodeUint32(m.NspNsi)
+ buf.EncodeUint8(m.MdType)
+ buf.EncodeUint8(m.VerOC)
+ buf.EncodeUint8(m.TTL)
+ buf.EncodeUint8(m.Length)
+ buf.EncodeUint8(m.NextProtocol)
+ buf.EncodeUint32(m.C1)
+ buf.EncodeUint32(m.C2)
+ buf.EncodeUint32(m.C3)
+ buf.EncodeUint32(m.C4)
+ buf.EncodeUint8(m.TlvLength)
+ buf.EncodeBytes(m.Tlv, 248)
return buf.Bytes(), nil
}
func (m *NshAddDelEntry) Unmarshal(b []byte) error {
m.C3 = buf.DecodeUint32()
m.C4 = buf.DecodeUint32()
m.TlvLength = buf.DecodeUint8()
- copy(m.Tlv[:], buf.DecodeBytes(248))
+ m.Tlv = make([]byte, 248)
+ copy(m.Tlv, buf.DecodeBytes(len(m.Tlv)))
return nil
}
return api.ReplyMessage
}
-func (m *NshAddDelEntryReply) Size() int {
+func (m *NshAddDelEntryReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
size += 4 // m.EntryIndex
return size
}
func (m *NshAddDelEntryReply) 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.EntryIndex))
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint32(m.EntryIndex)
return buf.Bytes(), nil
}
func (m *NshAddDelEntryReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
m.EntryIndex = buf.DecodeUint32()
return nil
}
func (m *NshAddDelMap) Reset() { *m = NshAddDelMap{} }
func (*NshAddDelMap) GetMessageName() string { return "nsh_add_del_map" }
-func (*NshAddDelMap) GetCrcString() string { return "898d857d" }
+func (*NshAddDelMap) GetCrcString() string { return "0a0f42b0" }
func (*NshAddDelMap) GetMessageType() api.MessageType {
return api.RequestMessage
}
-func (m *NshAddDelMap) Size() int {
+func (m *NshAddDelMap) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 1 // m.IsAdd
size += 4 // m.NspNsi
size += 4 // m.MappedNspNsi
return size
}
func (m *NshAddDelMap) 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.NspNsi))
- buf.EncodeUint32(uint32(m.MappedNspNsi))
- buf.EncodeUint32(uint32(m.NshAction))
+ buf.EncodeUint32(m.NspNsi)
+ buf.EncodeUint32(m.MappedNspNsi)
+ buf.EncodeUint32(m.NshAction)
buf.EncodeUint32(uint32(m.SwIfIndex))
buf.EncodeUint32(uint32(m.RxSwIfIndex))
- buf.EncodeUint32(uint32(m.NextNode))
+ buf.EncodeUint32(m.NextNode)
return buf.Bytes(), nil
}
func (m *NshAddDelMap) Unmarshal(b []byte) error {
return api.ReplyMessage
}
-func (m *NshAddDelMapReply) Size() int {
+func (m *NshAddDelMapReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
size += 4 // m.MapIndex
return size
}
func (m *NshAddDelMapReply) 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.MapIndex))
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint32(m.MapIndex)
return buf.Bytes(), nil
}
func (m *NshAddDelMapReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
m.MapIndex = buf.DecodeUint32()
return nil
}
return api.ReplyMessage
}
-func (m *NshEntryDetails) Size() int {
+func (m *NshEntryDetails) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.EntryIndex
size += 4 // m.NspNsi
size += 1 // m.MdType
return size
}
func (m *NshEntryDetails) 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.EntryIndex))
- buf.EncodeUint32(uint32(m.NspNsi))
- buf.EncodeUint8(uint8(m.MdType))
- buf.EncodeUint8(uint8(m.VerOC))
- buf.EncodeUint8(uint8(m.TTL))
- buf.EncodeUint8(uint8(m.Length))
- buf.EncodeUint8(uint8(m.NextProtocol))
- buf.EncodeUint32(uint32(m.C1))
- buf.EncodeUint32(uint32(m.C2))
- buf.EncodeUint32(uint32(m.C3))
- buf.EncodeUint32(uint32(m.C4))
- buf.EncodeUint8(uint8(m.TlvLength))
- buf.EncodeBytes(m.Tlv[:], 248)
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.EntryIndex)
+ buf.EncodeUint32(m.NspNsi)
+ buf.EncodeUint8(m.MdType)
+ buf.EncodeUint8(m.VerOC)
+ buf.EncodeUint8(m.TTL)
+ buf.EncodeUint8(m.Length)
+ buf.EncodeUint8(m.NextProtocol)
+ buf.EncodeUint32(m.C1)
+ buf.EncodeUint32(m.C2)
+ buf.EncodeUint32(m.C3)
+ buf.EncodeUint32(m.C4)
+ buf.EncodeUint8(m.TlvLength)
+ buf.EncodeBytes(m.Tlv, 248)
return buf.Bytes(), nil
}
func (m *NshEntryDetails) Unmarshal(b []byte) error {
m.C3 = buf.DecodeUint32()
m.C4 = buf.DecodeUint32()
m.TlvLength = buf.DecodeUint8()
- copy(m.Tlv[:], buf.DecodeBytes(248))
+ m.Tlv = make([]byte, 248)
+ copy(m.Tlv, buf.DecodeBytes(len(m.Tlv)))
return nil
}
return api.RequestMessage
}
-func (m *NshEntryDump) Size() int {
+func (m *NshEntryDump) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.EntryIndex
return size
}
func (m *NshEntryDump) 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.EntryIndex))
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.EntryIndex)
return buf.Bytes(), nil
}
func (m *NshEntryDump) Unmarshal(b []byte) error {
func (m *NshMapDetails) Reset() { *m = NshMapDetails{} }
func (*NshMapDetails) GetMessageName() string { return "nsh_map_details" }
-func (*NshMapDetails) GetCrcString() string { return "b34ac8a1" }
+func (*NshMapDetails) GetCrcString() string { return "2fefcf49" }
func (*NshMapDetails) GetMessageType() api.MessageType {
return api.ReplyMessage
}
-func (m *NshMapDetails) Size() int {
+func (m *NshMapDetails) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.MapIndex
size += 4 // m.NspNsi
size += 4 // m.MappedNspNsi
return size
}
func (m *NshMapDetails) 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.MapIndex))
- buf.EncodeUint32(uint32(m.NspNsi))
- buf.EncodeUint32(uint32(m.MappedNspNsi))
- buf.EncodeUint32(uint32(m.NshAction))
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.MapIndex)
+ buf.EncodeUint32(m.NspNsi)
+ buf.EncodeUint32(m.MappedNspNsi)
+ buf.EncodeUint32(m.NshAction)
buf.EncodeUint32(uint32(m.SwIfIndex))
buf.EncodeUint32(uint32(m.RxSwIfIndex))
- buf.EncodeUint32(uint32(m.NextNode))
+ buf.EncodeUint32(m.NextNode)
return buf.Bytes(), nil
}
func (m *NshMapDetails) Unmarshal(b []byte) error {
return api.RequestMessage
}
-func (m *NshMapDump) Size() int {
+func (m *NshMapDump) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.MapIndex
return size
}
func (m *NshMapDump) 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.MapIndex))
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.MapIndex)
return buf.Bytes(), nil
}
func (m *NshMapDump) Unmarshal(b []byte) error {
func file_nsh_binapi_init() {
api.RegisterMessage((*NshAddDelEntry)(nil), "nsh_add_del_entry_7dea480b")
api.RegisterMessage((*NshAddDelEntryReply)(nil), "nsh_add_del_entry_reply_6296a9eb")
- api.RegisterMessage((*NshAddDelMap)(nil), "nsh_add_del_map_898d857d")
+ api.RegisterMessage((*NshAddDelMap)(nil), "nsh_add_del_map_0a0f42b0")
api.RegisterMessage((*NshAddDelMapReply)(nil), "nsh_add_del_map_reply_b2b127ef")
api.RegisterMessage((*NshEntryDetails)(nil), "nsh_entry_details_046fb556")
api.RegisterMessage((*NshEntryDump)(nil), "nsh_entry_dump_cdaf8ccb")
- api.RegisterMessage((*NshMapDetails)(nil), "nsh_map_details_b34ac8a1")
+ api.RegisterMessage((*NshMapDetails)(nil), "nsh_map_details_2fefcf49")
api.RegisterMessage((*NshMapDump)(nil), "nsh_map_dump_8fc06b82")
}