X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=binapi%2Fipfix_export%2Fipfix_export.ba.go;h=3a9b754f2fd21203e4c5489f663b7e531e1888bb;hb=c94a962279858fb13eaacc689f47aed358373e44;hp=7d548f2862e5b72a4db675a99121dcd932307dcc;hpb=d1f24d37bd447b64e402298bb8eb2479681facf9;p=govpp.git diff --git a/binapi/ipfix_export/ipfix_export.ba.go b/binapi/ipfix_export/ipfix_export.ba.go index 7d548f2..3a9b754 100644 --- a/binapi/ipfix_export/ipfix_export.ba.go +++ b/binapi/ipfix_export/ipfix_export.ba.go @@ -2,7 +2,6 @@ // versions: // binapi-generator: v0.4.0-dev // VPP: 20.05-release -// source: /usr/share/vpp/api/core/ipfix_export.api.json // Package ipfix_export contains generated bindings for API file ipfix_export.api. // @@ -42,24 +41,21 @@ func (*IpfixClassifyStreamDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IpfixClassifyStreamDetails) Size() int { +func (m *IpfixClassifyStreamDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.DomainID size += 2 // m.SrcPort return size } func (m *IpfixClassifyStreamDetails) 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.DomainID)) - buf.EncodeUint16(uint16(m.SrcPort)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.DomainID) + buf.EncodeUint16(m.SrcPort) return buf.Bytes(), nil } func (m *IpfixClassifyStreamDetails) Unmarshal(b []byte) error { @@ -79,20 +75,17 @@ func (*IpfixClassifyStreamDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IpfixClassifyStreamDump) Size() int { +func (m *IpfixClassifyStreamDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *IpfixClassifyStreamDump) 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 *IpfixClassifyStreamDump) Unmarshal(b []byte) error { @@ -114,11 +107,10 @@ func (*IpfixClassifyTableAddDel) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IpfixClassifyTableAddDel) Size() int { +func (m *IpfixClassifyTableAddDel) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.TableID size += 1 // m.IPVersion size += 1 // m.TransportProtocol @@ -126,13 +118,11 @@ func (m *IpfixClassifyTableAddDel) Size() int { return size } func (m *IpfixClassifyTableAddDel) 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.TableID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.TableID) buf.EncodeUint8(uint8(m.IPVersion)) buf.EncodeUint8(uint8(m.TransportProtocol)) buf.EncodeBool(m.IsAdd) @@ -161,27 +151,24 @@ func (*IpfixClassifyTableAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IpfixClassifyTableAddDelReply) Size() int { +func (m *IpfixClassifyTableAddDelReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IpfixClassifyTableAddDelReply) 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 *IpfixClassifyTableAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -199,24 +186,21 @@ func (*IpfixClassifyTableDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IpfixClassifyTableDetails) Size() int { +func (m *IpfixClassifyTableDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.TableID size += 1 // m.IPVersion size += 1 // m.TransportProtocol return size } func (m *IpfixClassifyTableDetails) 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.TableID)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.TableID) buf.EncodeUint8(uint8(m.IPVersion)) buf.EncodeUint8(uint8(m.TransportProtocol)) return buf.Bytes(), nil @@ -239,20 +223,17 @@ func (*IpfixClassifyTableDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IpfixClassifyTableDump) Size() int { +func (m *IpfixClassifyTableDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *IpfixClassifyTableDump) 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 *IpfixClassifyTableDump) Unmarshal(b []byte) error { @@ -277,11 +258,10 @@ func (*IpfixExporterDetails) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IpfixExporterDetails) Size() int { +func (m *IpfixExporterDetails) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.CollectorAddress.Af size += 1 * 16 // m.CollectorAddress.Un size += 2 // m.CollectorPort @@ -294,20 +274,18 @@ func (m *IpfixExporterDetails) Size() int { return size } func (m *IpfixExporterDetails) 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.CollectorAddress.Af)) - buf.EncodeBytes(m.CollectorAddress.Un.XXX_UnionData[:], 0) - buf.EncodeUint16(uint16(m.CollectorPort)) + buf.EncodeBytes(m.CollectorAddress.Un.XXX_UnionData[:], 16) + buf.EncodeUint16(m.CollectorPort) buf.EncodeUint8(uint8(m.SrcAddress.Af)) - buf.EncodeBytes(m.SrcAddress.Un.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(m.VrfID)) - buf.EncodeUint32(uint32(m.PathMtu)) - buf.EncodeUint32(uint32(m.TemplateInterval)) + buf.EncodeBytes(m.SrcAddress.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(m.VrfID) + buf.EncodeUint32(m.PathMtu) + buf.EncodeUint32(m.TemplateInterval) buf.EncodeBool(m.UDPChecksum) return buf.Bytes(), nil } @@ -335,20 +313,17 @@ func (*IpfixExporterDump) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IpfixExporterDump) Size() int { +func (m *IpfixExporterDump) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *IpfixExporterDump) 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 *IpfixExporterDump) Unmarshal(b []byte) error { @@ -365,20 +340,17 @@ func (*IpfixFlush) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *IpfixFlush) Size() int { +func (m *IpfixFlush) Size() (size int) { if m == nil { return 0 } - var size int return size } func (m *IpfixFlush) 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 *IpfixFlush) Unmarshal(b []byte) error { @@ -397,27 +369,24 @@ func (*IpfixFlushReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *IpfixFlushReply) Size() int { +func (m *IpfixFlushReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *IpfixFlushReply) 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 *IpfixFlushReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -434,24 +403,21 @@ func (*SetIpfixClassifyStream) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SetIpfixClassifyStream) Size() int { +func (m *SetIpfixClassifyStream) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.DomainID size += 2 // m.SrcPort return size } func (m *SetIpfixClassifyStream) 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.DomainID)) - buf.EncodeUint16(uint16(m.SrcPort)) + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.DomainID) + buf.EncodeUint16(m.SrcPort) return buf.Bytes(), nil } func (m *SetIpfixClassifyStream) Unmarshal(b []byte) error { @@ -473,27 +439,24 @@ func (*SetIpfixClassifyStreamReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SetIpfixClassifyStreamReply) Size() int { +func (m *SetIpfixClassifyStreamReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SetIpfixClassifyStreamReply) 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 *SetIpfixClassifyStreamReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } @@ -515,11 +478,10 @@ func (*SetIpfixExporter) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *SetIpfixExporter) Size() int { +func (m *SetIpfixExporter) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.CollectorAddress.Af size += 1 * 16 // m.CollectorAddress.Un size += 2 // m.CollectorPort @@ -532,20 +494,18 @@ func (m *SetIpfixExporter) Size() int { return size } func (m *SetIpfixExporter) 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.CollectorAddress.Af)) - buf.EncodeBytes(m.CollectorAddress.Un.XXX_UnionData[:], 0) - buf.EncodeUint16(uint16(m.CollectorPort)) + buf.EncodeBytes(m.CollectorAddress.Un.XXX_UnionData[:], 16) + buf.EncodeUint16(m.CollectorPort) buf.EncodeUint8(uint8(m.SrcAddress.Af)) - buf.EncodeBytes(m.SrcAddress.Un.XXX_UnionData[:], 0) - buf.EncodeUint32(uint32(m.VrfID)) - buf.EncodeUint32(uint32(m.PathMtu)) - buf.EncodeUint32(uint32(m.TemplateInterval)) + buf.EncodeBytes(m.SrcAddress.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(m.VrfID) + buf.EncodeUint32(m.PathMtu) + buf.EncodeUint32(m.TemplateInterval) buf.EncodeBool(m.UDPChecksum) return buf.Bytes(), nil } @@ -575,27 +535,24 @@ func (*SetIpfixExporterReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *SetIpfixExporterReply) Size() int { +func (m *SetIpfixExporterReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *SetIpfixExporterReply) 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 *SetIpfixExporterReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil }