X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=binapi%2Fstn%2Fstn.ba.go;h=035a819d4e4b82ed2a8ef30f340f3f45aa183177;hb=c94a962279858fb13eaacc689f47aed358373e44;hp=34cb419a0250c8397ce738ecf1f54205da0ff3b7;hpb=d1f24d37bd447b64e402298bb8eb2479681facf9;p=govpp.git diff --git a/binapi/stn/stn.ba.go b/binapi/stn/stn.ba.go index 34cb419..035a819 100644 --- a/binapi/stn/stn.ba.go +++ b/binapi/stn/stn.ba.go @@ -2,7 +2,6 @@ // versions: // binapi-generator: v0.4.0-dev // VPP: 20.05-release -// source: /usr/share/vpp/api/plugins/stn.api.json // Package stn contains generated bindings for API file stn.api. // @@ -44,11 +43,10 @@ func (*StnAddDelRule) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *StnAddDelRule) Size() int { +func (m *StnAddDelRule) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IPAddress.Af size += 1 * 16 // m.IPAddress.Un size += 4 // m.SwIfIndex @@ -56,14 +54,12 @@ func (m *StnAddDelRule) Size() int { return size } func (m *StnAddDelRule) 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.IPAddress.Af)) - buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 16) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeBool(m.IsAdd) return buf.Bytes(), nil @@ -89,27 +85,24 @@ func (*StnAddDelRuleReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *StnAddDelRuleReply) Size() int { +func (m *StnAddDelRuleReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *StnAddDelRuleReply) 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 *StnAddDelRuleReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -126,25 +119,22 @@ func (*StnRulesDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *StnRulesDetails) Size() int { +func (m *StnRulesDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.IPAddress.Af size += 1 * 16 // m.IPAddress.Un size += 4 // m.SwIfIndex return size } func (m *StnRulesDetails) 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.IPAddress.Af)) - buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 16) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } @@ -166,20 +156,17 @@ func (*StnRulesDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *StnRulesDump) Size() int { +func (m *StnRulesDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *StnRulesDump) 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 *StnRulesDump) Unmarshal(b []byte) error {