Improve binapi generator
[govpp.git] / binapi / nsim / nsim.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/nsim.api.json
6
7 // Package nsim contains generated bindings for API file nsim.api.
8 //
9 // Contents:
10 //   6 messages
11 //
12 package nsim
13
14 import (
15         api "git.fd.io/govpp.git/api"
16         interface_types "git.fd.io/govpp.git/binapi/interface_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    = "nsim"
28         APIVersion = "2.1.1"
29         VersionCrc = 0xcd5b42e8
30 )
31
32 // NsimConfigure defines message 'nsim_configure'.
33 type NsimConfigure struct {
34         DelayInUsec              uint32 `binapi:"u32,name=delay_in_usec" json:"delay_in_usec,omitempty"`
35         AveragePacketSize        uint32 `binapi:"u32,name=average_packet_size" json:"average_packet_size,omitempty"`
36         BandwidthInBitsPerSecond uint64 `binapi:"u64,name=bandwidth_in_bits_per_second" json:"bandwidth_in_bits_per_second,omitempty"`
37         PacketsPerDrop           uint32 `binapi:"u32,name=packets_per_drop" json:"packets_per_drop,omitempty"`
38 }
39
40 func (m *NsimConfigure) Reset()               { *m = NsimConfigure{} }
41 func (*NsimConfigure) GetMessageName() string { return "nsim_configure" }
42 func (*NsimConfigure) GetCrcString() string   { return "16ed400f" }
43 func (*NsimConfigure) GetMessageType() api.MessageType {
44         return api.RequestMessage
45 }
46
47 func (m *NsimConfigure) Size() int {
48         if m == nil {
49                 return 0
50         }
51         var size int
52         size += 4 // m.DelayInUsec
53         size += 4 // m.AveragePacketSize
54         size += 8 // m.BandwidthInBitsPerSecond
55         size += 4 // m.PacketsPerDrop
56         return size
57 }
58 func (m *NsimConfigure) Marshal(b []byte) ([]byte, error) {
59         var buf *codec.Buffer
60         if b == nil {
61                 buf = codec.NewBuffer(make([]byte, m.Size()))
62         } else {
63                 buf = codec.NewBuffer(b)
64         }
65         buf.EncodeUint32(uint32(m.DelayInUsec))
66         buf.EncodeUint32(uint32(m.AveragePacketSize))
67         buf.EncodeUint64(uint64(m.BandwidthInBitsPerSecond))
68         buf.EncodeUint32(uint32(m.PacketsPerDrop))
69         return buf.Bytes(), nil
70 }
71 func (m *NsimConfigure) Unmarshal(b []byte) error {
72         buf := codec.NewBuffer(b)
73         m.DelayInUsec = buf.DecodeUint32()
74         m.AveragePacketSize = buf.DecodeUint32()
75         m.BandwidthInBitsPerSecond = buf.DecodeUint64()
76         m.PacketsPerDrop = buf.DecodeUint32()
77         return nil
78 }
79
80 // NsimConfigureReply defines message 'nsim_configure_reply'.
81 type NsimConfigureReply struct {
82         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
83 }
84
85 func (m *NsimConfigureReply) Reset()               { *m = NsimConfigureReply{} }
86 func (*NsimConfigureReply) GetMessageName() string { return "nsim_configure_reply" }
87 func (*NsimConfigureReply) GetCrcString() string   { return "e8d4e804" }
88 func (*NsimConfigureReply) GetMessageType() api.MessageType {
89         return api.ReplyMessage
90 }
91
92 func (m *NsimConfigureReply) Size() int {
93         if m == nil {
94                 return 0
95         }
96         var size int
97         size += 4 // m.Retval
98         return size
99 }
100 func (m *NsimConfigureReply) Marshal(b []byte) ([]byte, error) {
101         var buf *codec.Buffer
102         if b == nil {
103                 buf = codec.NewBuffer(make([]byte, m.Size()))
104         } else {
105                 buf = codec.NewBuffer(b)
106         }
107         buf.EncodeUint32(uint32(m.Retval))
108         return buf.Bytes(), nil
109 }
110 func (m *NsimConfigureReply) Unmarshal(b []byte) error {
111         buf := codec.NewBuffer(b)
112         m.Retval = int32(buf.DecodeUint32())
113         return nil
114 }
115
116 // NsimCrossConnectEnableDisable defines message 'nsim_cross_connect_enable_disable'.
117 type NsimCrossConnectEnableDisable struct {
118         EnableDisable bool                           `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
119         SwIfIndex0    interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index0" json:"sw_if_index0,omitempty"`
120         SwIfIndex1    interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index1" json:"sw_if_index1,omitempty"`
121 }
122
123 func (m *NsimCrossConnectEnableDisable) Reset() { *m = NsimCrossConnectEnableDisable{} }
124 func (*NsimCrossConnectEnableDisable) GetMessageName() string {
125         return "nsim_cross_connect_enable_disable"
126 }
127 func (*NsimCrossConnectEnableDisable) GetCrcString() string { return "16f70bdf" }
128 func (*NsimCrossConnectEnableDisable) GetMessageType() api.MessageType {
129         return api.RequestMessage
130 }
131
132 func (m *NsimCrossConnectEnableDisable) Size() int {
133         if m == nil {
134                 return 0
135         }
136         var size int
137         size += 1 // m.EnableDisable
138         size += 4 // m.SwIfIndex0
139         size += 4 // m.SwIfIndex1
140         return size
141 }
142 func (m *NsimCrossConnectEnableDisable) Marshal(b []byte) ([]byte, error) {
143         var buf *codec.Buffer
144         if b == nil {
145                 buf = codec.NewBuffer(make([]byte, m.Size()))
146         } else {
147                 buf = codec.NewBuffer(b)
148         }
149         buf.EncodeBool(m.EnableDisable)
150         buf.EncodeUint32(uint32(m.SwIfIndex0))
151         buf.EncodeUint32(uint32(m.SwIfIndex1))
152         return buf.Bytes(), nil
153 }
154 func (m *NsimCrossConnectEnableDisable) Unmarshal(b []byte) error {
155         buf := codec.NewBuffer(b)
156         m.EnableDisable = buf.DecodeBool()
157         m.SwIfIndex0 = interface_types.InterfaceIndex(buf.DecodeUint32())
158         m.SwIfIndex1 = interface_types.InterfaceIndex(buf.DecodeUint32())
159         return nil
160 }
161
162 // NsimCrossConnectEnableDisableReply defines message 'nsim_cross_connect_enable_disable_reply'.
163 type NsimCrossConnectEnableDisableReply struct {
164         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
165 }
166
167 func (m *NsimCrossConnectEnableDisableReply) Reset() { *m = NsimCrossConnectEnableDisableReply{} }
168 func (*NsimCrossConnectEnableDisableReply) GetMessageName() string {
169         return "nsim_cross_connect_enable_disable_reply"
170 }
171 func (*NsimCrossConnectEnableDisableReply) GetCrcString() string { return "e8d4e804" }
172 func (*NsimCrossConnectEnableDisableReply) GetMessageType() api.MessageType {
173         return api.ReplyMessage
174 }
175
176 func (m *NsimCrossConnectEnableDisableReply) Size() int {
177         if m == nil {
178                 return 0
179         }
180         var size int
181         size += 4 // m.Retval
182         return size
183 }
184 func (m *NsimCrossConnectEnableDisableReply) Marshal(b []byte) ([]byte, error) {
185         var buf *codec.Buffer
186         if b == nil {
187                 buf = codec.NewBuffer(make([]byte, m.Size()))
188         } else {
189                 buf = codec.NewBuffer(b)
190         }
191         buf.EncodeUint32(uint32(m.Retval))
192         return buf.Bytes(), nil
193 }
194 func (m *NsimCrossConnectEnableDisableReply) Unmarshal(b []byte) error {
195         buf := codec.NewBuffer(b)
196         m.Retval = int32(buf.DecodeUint32())
197         return nil
198 }
199
200 // NsimOutputFeatureEnableDisable defines message 'nsim_output_feature_enable_disable'.
201 type NsimOutputFeatureEnableDisable struct {
202         EnableDisable bool                           `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
203         SwIfIndex     interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
204 }
205
206 func (m *NsimOutputFeatureEnableDisable) Reset() { *m = NsimOutputFeatureEnableDisable{} }
207 func (*NsimOutputFeatureEnableDisable) GetMessageName() string {
208         return "nsim_output_feature_enable_disable"
209 }
210 func (*NsimOutputFeatureEnableDisable) GetCrcString() string { return "3865946c" }
211 func (*NsimOutputFeatureEnableDisable) GetMessageType() api.MessageType {
212         return api.RequestMessage
213 }
214
215 func (m *NsimOutputFeatureEnableDisable) Size() int {
216         if m == nil {
217                 return 0
218         }
219         var size int
220         size += 1 // m.EnableDisable
221         size += 4 // m.SwIfIndex
222         return size
223 }
224 func (m *NsimOutputFeatureEnableDisable) Marshal(b []byte) ([]byte, error) {
225         var buf *codec.Buffer
226         if b == nil {
227                 buf = codec.NewBuffer(make([]byte, m.Size()))
228         } else {
229                 buf = codec.NewBuffer(b)
230         }
231         buf.EncodeBool(m.EnableDisable)
232         buf.EncodeUint32(uint32(m.SwIfIndex))
233         return buf.Bytes(), nil
234 }
235 func (m *NsimOutputFeatureEnableDisable) Unmarshal(b []byte) error {
236         buf := codec.NewBuffer(b)
237         m.EnableDisable = buf.DecodeBool()
238         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
239         return nil
240 }
241
242 // NsimOutputFeatureEnableDisableReply defines message 'nsim_output_feature_enable_disable_reply'.
243 type NsimOutputFeatureEnableDisableReply struct {
244         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
245 }
246
247 func (m *NsimOutputFeatureEnableDisableReply) Reset() { *m = NsimOutputFeatureEnableDisableReply{} }
248 func (*NsimOutputFeatureEnableDisableReply) GetMessageName() string {
249         return "nsim_output_feature_enable_disable_reply"
250 }
251 func (*NsimOutputFeatureEnableDisableReply) GetCrcString() string { return "e8d4e804" }
252 func (*NsimOutputFeatureEnableDisableReply) GetMessageType() api.MessageType {
253         return api.ReplyMessage
254 }
255
256 func (m *NsimOutputFeatureEnableDisableReply) Size() int {
257         if m == nil {
258                 return 0
259         }
260         var size int
261         size += 4 // m.Retval
262         return size
263 }
264 func (m *NsimOutputFeatureEnableDisableReply) Marshal(b []byte) ([]byte, error) {
265         var buf *codec.Buffer
266         if b == nil {
267                 buf = codec.NewBuffer(make([]byte, m.Size()))
268         } else {
269                 buf = codec.NewBuffer(b)
270         }
271         buf.EncodeUint32(uint32(m.Retval))
272         return buf.Bytes(), nil
273 }
274 func (m *NsimOutputFeatureEnableDisableReply) Unmarshal(b []byte) error {
275         buf := codec.NewBuffer(b)
276         m.Retval = int32(buf.DecodeUint32())
277         return nil
278 }
279
280 func init() { file_nsim_binapi_init() }
281 func file_nsim_binapi_init() {
282         api.RegisterMessage((*NsimConfigure)(nil), "nsim_configure_16ed400f")
283         api.RegisterMessage((*NsimConfigureReply)(nil), "nsim_configure_reply_e8d4e804")
284         api.RegisterMessage((*NsimCrossConnectEnableDisable)(nil), "nsim_cross_connect_enable_disable_16f70bdf")
285         api.RegisterMessage((*NsimCrossConnectEnableDisableReply)(nil), "nsim_cross_connect_enable_disable_reply_e8d4e804")
286         api.RegisterMessage((*NsimOutputFeatureEnableDisable)(nil), "nsim_output_feature_enable_disable_3865946c")
287         api.RegisterMessage((*NsimOutputFeatureEnableDisableReply)(nil), "nsim_output_feature_enable_disable_reply_e8d4e804")
288 }
289
290 // Messages returns list of all messages in this module.
291 func AllMessages() []api.Message {
292         return []api.Message{
293                 (*NsimConfigure)(nil),
294                 (*NsimConfigureReply)(nil),
295                 (*NsimCrossConnectEnableDisable)(nil),
296                 (*NsimCrossConnectEnableDisableReply)(nil),
297                 (*NsimOutputFeatureEnableDisable)(nil),
298                 (*NsimOutputFeatureEnableDisableReply)(nil),
299         }
300 }