Improve binapi generator
[govpp.git] / binapi / ioam_export / ioam_export.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.4.0-dev
4 //  VPP:              20.05-release
5 // source: /usr/share/vpp/api/plugins/ioam_export.api.json
6
7 // Package ioam_export contains generated bindings for API file ioam_export.api.
8 //
9 // Contents:
10 //   2 messages
11 //
12 package ioam_export
13
14 import (
15         api "git.fd.io/govpp.git/api"
16         ip_types "git.fd.io/govpp.git/binapi/ip_types"
17         codec "git.fd.io/govpp.git/codec"
18 )
19
20 // This is a compile-time assertion to ensure that this generated file
21 // is compatible with the GoVPP api package it is being compiled against.
22 // A compilation error at this line likely means your copy of the
23 // GoVPP api package needs to be updated.
24 const _ = api.GoVppAPIPackageIsVersion2
25
26 const (
27         APIFile    = "ioam_export"
28         APIVersion = "1.0.0"
29         VersionCrc = 0x56bd3b73
30 )
31
32 // IoamExportIP6EnableDisable defines message 'ioam_export_ip6_enable_disable'.
33 type IoamExportIP6EnableDisable struct {
34         IsDisable        bool                `binapi:"bool,name=is_disable" json:"is_disable,omitempty"`
35         CollectorAddress ip_types.IP4Address `binapi:"ip4_address,name=collector_address" json:"collector_address,omitempty"`
36         SrcAddress       ip_types.IP4Address `binapi:"ip4_address,name=src_address" json:"src_address,omitempty"`
37 }
38
39 func (m *IoamExportIP6EnableDisable) Reset()               { *m = IoamExportIP6EnableDisable{} }
40 func (*IoamExportIP6EnableDisable) GetMessageName() string { return "ioam_export_ip6_enable_disable" }
41 func (*IoamExportIP6EnableDisable) GetCrcString() string   { return "e4d4ebfa" }
42 func (*IoamExportIP6EnableDisable) GetMessageType() api.MessageType {
43         return api.RequestMessage
44 }
45
46 func (m *IoamExportIP6EnableDisable) Size() int {
47         if m == nil {
48                 return 0
49         }
50         var size int
51         size += 1     // m.IsDisable
52         size += 1 * 4 // m.CollectorAddress
53         size += 1 * 4 // m.SrcAddress
54         return size
55 }
56 func (m *IoamExportIP6EnableDisable) Marshal(b []byte) ([]byte, error) {
57         var buf *codec.Buffer
58         if b == nil {
59                 buf = codec.NewBuffer(make([]byte, m.Size()))
60         } else {
61                 buf = codec.NewBuffer(b)
62         }
63         buf.EncodeBool(m.IsDisable)
64         buf.EncodeBytes(m.CollectorAddress[:], 4)
65         buf.EncodeBytes(m.SrcAddress[:], 4)
66         return buf.Bytes(), nil
67 }
68 func (m *IoamExportIP6EnableDisable) Unmarshal(b []byte) error {
69         buf := codec.NewBuffer(b)
70         m.IsDisable = buf.DecodeBool()
71         copy(m.CollectorAddress[:], buf.DecodeBytes(4))
72         copy(m.SrcAddress[:], buf.DecodeBytes(4))
73         return nil
74 }
75
76 // IoamExportIP6EnableDisableReply defines message 'ioam_export_ip6_enable_disable_reply'.
77 type IoamExportIP6EnableDisableReply struct {
78         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
79 }
80
81 func (m *IoamExportIP6EnableDisableReply) Reset() { *m = IoamExportIP6EnableDisableReply{} }
82 func (*IoamExportIP6EnableDisableReply) GetMessageName() string {
83         return "ioam_export_ip6_enable_disable_reply"
84 }
85 func (*IoamExportIP6EnableDisableReply) GetCrcString() string { return "e8d4e804" }
86 func (*IoamExportIP6EnableDisableReply) GetMessageType() api.MessageType {
87         return api.ReplyMessage
88 }
89
90 func (m *IoamExportIP6EnableDisableReply) Size() int {
91         if m == nil {
92                 return 0
93         }
94         var size int
95         size += 4 // m.Retval
96         return size
97 }
98 func (m *IoamExportIP6EnableDisableReply) Marshal(b []byte) ([]byte, error) {
99         var buf *codec.Buffer
100         if b == nil {
101                 buf = codec.NewBuffer(make([]byte, m.Size()))
102         } else {
103                 buf = codec.NewBuffer(b)
104         }
105         buf.EncodeUint32(uint32(m.Retval))
106         return buf.Bytes(), nil
107 }
108 func (m *IoamExportIP6EnableDisableReply) Unmarshal(b []byte) error {
109         buf := codec.NewBuffer(b)
110         m.Retval = int32(buf.DecodeUint32())
111         return nil
112 }
113
114 func init() { file_ioam_export_binapi_init() }
115 func file_ioam_export_binapi_init() {
116         api.RegisterMessage((*IoamExportIP6EnableDisable)(nil), "ioam_export_ip6_enable_disable_e4d4ebfa")
117         api.RegisterMessage((*IoamExportIP6EnableDisableReply)(nil), "ioam_export_ip6_enable_disable_reply_e8d4e804")
118 }
119
120 // Messages returns list of all messages in this module.
121 func AllMessages() []api.Message {
122         return []api.Message{
123                 (*IoamExportIP6EnableDisable)(nil),
124                 (*IoamExportIP6EnableDisableReply)(nil),
125         }
126 }