Change module name to go.fd.io/govpp
[govpp.git] / binapi / nsh / nsh.ba.go
index a918c98..00a28a0 100644 (file)
@@ -1,7 +1,7 @@
 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
 // versions:
-//  binapi-generator: v0.4.0-dev
-//  VPP:              20.05-release
+//  binapi-generator: v0.6.0-dev
+//  VPP:              22.02-release
 // source: /usr/share/vpp/api/plugins/nsh.api.json
 
 // Package nsh contains generated bindings for API file nsh.api.
@@ -12,9 +12,9 @@
 package nsh
 
 import (
-       api "git.fd.io/govpp.git/api"
-       interface_types "git.fd.io/govpp.git/binapi/interface_types"
-       codec "git.fd.io/govpp.git/codec"
+       api "go.fd.io/govpp/api"
+       interface_types "go.fd.io/govpp/binapi/interface_types"
+       codec "go.fd.io/govpp/codec"
 )
 
 // This is a compile-time assertion to ensure that this generated file
@@ -26,7 +26,7 @@ const _ = api.GoVppAPIPackageIsVersion2
 const (
        APIFile    = "nsh"
        APIVersion = "1.0.0"
-       VersionCrc = 0x43be6707
+       VersionCrc = 0xc2f3127d
 )
 
 // NshAddDelEntry defines message 'nsh_add_del_entry'.
@@ -53,11 +53,10 @@ func (*NshAddDelEntry) GetMessageType() api.MessageType {
        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
@@ -74,25 +73,23 @@ func (m *NshAddDelEntry) Size() int {
        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 {
@@ -109,7 +106,8 @@ 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
 }
 
@@ -126,29 +124,26 @@ func (*NshAddDelEntryReply) GetMessageType() api.MessageType {
        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
 }
@@ -166,16 +161,15 @@ type NshAddDelMap struct {
 
 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
@@ -186,19 +180,17 @@ func (m *NshAddDelMap) Size() int {
        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 {
@@ -226,29 +218,26 @@ func (*NshAddDelMapReply) GetMessageType() api.MessageType {
        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
 }
@@ -277,11 +266,10 @@ func (*NshEntryDetails) GetMessageType() api.MessageType {
        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
@@ -298,25 +286,23 @@ func (m *NshEntryDetails) Size() int {
        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 {
@@ -333,7 +319,8 @@ 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
 }
 
@@ -349,22 +336,19 @@ func (*NshEntryDump) GetMessageType() api.MessageType {
        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 {
@@ -386,16 +370,15 @@ type NshMapDetails struct {
 
 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
@@ -406,19 +389,17 @@ func (m *NshMapDetails) Size() int {
        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 {
@@ -445,22 +426,19 @@ func (*NshMapDump) GetMessageType() api.MessageType {
        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 {
@@ -473,11 +451,11 @@ func init() { file_nsh_binapi_init() }
 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")
 }