bfc8da4d79239e70ba3b26b82596b943275570e4
[govpp.git] / binapi / mactime / mactime.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
6 // Package mactime contains generated bindings for API file mactime.api.
7 //
8 // Contents:
9 //   2 structs
10 //   7 messages
11 //
12 package mactime
13
14 import (
15         api "git.fd.io/govpp.git/api"
16         ethernet_types "git.fd.io/govpp.git/binapi/ethernet_types"
17         interface_types "git.fd.io/govpp.git/binapi/interface_types"
18         codec "git.fd.io/govpp.git/codec"
19 )
20
21 // This is a compile-time assertion to ensure that this generated file
22 // is compatible with the GoVPP api package it is being compiled against.
23 // A compilation error at this line likely means your copy of the
24 // GoVPP api package needs to be updated.
25 const _ = api.GoVppAPIPackageIsVersion2
26
27 const (
28         APIFile    = "mactime"
29         APIVersion = "2.0.0"
30         VersionCrc = 0x9283d3e
31 )
32
33 // MactimeTimeRange defines type 'mactime_time_range'.
34 type MactimeTimeRange struct {
35         Start float64 `binapi:"f64,name=start" json:"start,omitempty"`
36         End   float64 `binapi:"f64,name=end" json:"end,omitempty"`
37 }
38
39 // TimeRange defines type 'time_range'.
40 type TimeRange struct {
41         Start float64 `binapi:"f64,name=start" json:"start,omitempty"`
42         End   float64 `binapi:"f64,name=end" json:"end,omitempty"`
43 }
44
45 // MactimeAddDelRange defines message 'mactime_add_del_range'.
46 type MactimeAddDelRange struct {
47         IsAdd      bool                      `binapi:"bool,name=is_add" json:"is_add,omitempty"`
48         Drop       bool                      `binapi:"bool,name=drop" json:"drop,omitempty"`
49         Allow      bool                      `binapi:"bool,name=allow" json:"allow,omitempty"`
50         AllowQuota uint8                     `binapi:"u8,name=allow_quota" json:"allow_quota,omitempty"`
51         NoUDP10001 bool                      `binapi:"bool,name=no_udp_10001" json:"no_udp_10001,omitempty"`
52         DataQuota  uint64                    `binapi:"u64,name=data_quota" json:"data_quota,omitempty"`
53         MacAddress ethernet_types.MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
54         DeviceName string                    `binapi:"string[64],name=device_name" json:"device_name,omitempty"`
55         Count      uint32                    `binapi:"u32,name=count" json:"-"`
56         Ranges     []TimeRange               `binapi:"time_range[count],name=ranges" json:"ranges,omitempty"`
57 }
58
59 func (m *MactimeAddDelRange) Reset()               { *m = MactimeAddDelRange{} }
60 func (*MactimeAddDelRange) GetMessageName() string { return "mactime_add_del_range" }
61 func (*MactimeAddDelRange) GetCrcString() string   { return "101858ef" }
62 func (*MactimeAddDelRange) GetMessageType() api.MessageType {
63         return api.RequestMessage
64 }
65
66 func (m *MactimeAddDelRange) Size() (size int) {
67         if m == nil {
68                 return 0
69         }
70         size += 1     // m.IsAdd
71         size += 1     // m.Drop
72         size += 1     // m.Allow
73         size += 1     // m.AllowQuota
74         size += 1     // m.NoUDP10001
75         size += 8     // m.DataQuota
76         size += 1 * 6 // m.MacAddress
77         size += 64    // m.DeviceName
78         size += 4     // m.Count
79         for j1 := 0; j1 < len(m.Ranges); j1++ {
80                 var s1 TimeRange
81                 _ = s1
82                 if j1 < len(m.Ranges) {
83                         s1 = m.Ranges[j1]
84                 }
85                 size += 8 // s1.Start
86                 size += 8 // s1.End
87         }
88         return size
89 }
90 func (m *MactimeAddDelRange) Marshal(b []byte) ([]byte, error) {
91         if b == nil {
92                 b = make([]byte, m.Size())
93         }
94         buf := codec.NewBuffer(b)
95         buf.EncodeBool(m.IsAdd)
96         buf.EncodeBool(m.Drop)
97         buf.EncodeBool(m.Allow)
98         buf.EncodeUint8(m.AllowQuota)
99         buf.EncodeBool(m.NoUDP10001)
100         buf.EncodeUint64(m.DataQuota)
101         buf.EncodeBytes(m.MacAddress[:], 6)
102         buf.EncodeString(m.DeviceName, 64)
103         buf.EncodeUint32(uint32(len(m.Ranges)))
104         for j0 := 0; j0 < len(m.Ranges); j0++ {
105                 var v0 TimeRange // Ranges
106                 if j0 < len(m.Ranges) {
107                         v0 = m.Ranges[j0]
108                 }
109                 buf.EncodeFloat64(v0.Start)
110                 buf.EncodeFloat64(v0.End)
111         }
112         return buf.Bytes(), nil
113 }
114 func (m *MactimeAddDelRange) Unmarshal(b []byte) error {
115         buf := codec.NewBuffer(b)
116         m.IsAdd = buf.DecodeBool()
117         m.Drop = buf.DecodeBool()
118         m.Allow = buf.DecodeBool()
119         m.AllowQuota = buf.DecodeUint8()
120         m.NoUDP10001 = buf.DecodeBool()
121         m.DataQuota = buf.DecodeUint64()
122         copy(m.MacAddress[:], buf.DecodeBytes(6))
123         m.DeviceName = buf.DecodeString(64)
124         m.Count = buf.DecodeUint32()
125         m.Ranges = make([]TimeRange, m.Count)
126         for j0 := 0; j0 < len(m.Ranges); j0++ {
127                 m.Ranges[j0].Start = buf.DecodeFloat64()
128                 m.Ranges[j0].End = buf.DecodeFloat64()
129         }
130         return nil
131 }
132
133 // MactimeAddDelRangeReply defines message 'mactime_add_del_range_reply'.
134 type MactimeAddDelRangeReply struct {
135         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
136 }
137
138 func (m *MactimeAddDelRangeReply) Reset()               { *m = MactimeAddDelRangeReply{} }
139 func (*MactimeAddDelRangeReply) GetMessageName() string { return "mactime_add_del_range_reply" }
140 func (*MactimeAddDelRangeReply) GetCrcString() string   { return "e8d4e804" }
141 func (*MactimeAddDelRangeReply) GetMessageType() api.MessageType {
142         return api.ReplyMessage
143 }
144
145 func (m *MactimeAddDelRangeReply) Size() (size int) {
146         if m == nil {
147                 return 0
148         }
149         size += 4 // m.Retval
150         return size
151 }
152 func (m *MactimeAddDelRangeReply) Marshal(b []byte) ([]byte, error) {
153         if b == nil {
154                 b = make([]byte, m.Size())
155         }
156         buf := codec.NewBuffer(b)
157         buf.EncodeInt32(m.Retval)
158         return buf.Bytes(), nil
159 }
160 func (m *MactimeAddDelRangeReply) Unmarshal(b []byte) error {
161         buf := codec.NewBuffer(b)
162         m.Retval = buf.DecodeInt32()
163         return nil
164 }
165
166 // MactimeDetails defines message 'mactime_details'.
167 type MactimeDetails struct {
168         PoolIndex       uint32                    `binapi:"u32,name=pool_index" json:"pool_index,omitempty"`
169         MacAddress      ethernet_types.MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
170         DataQuota       uint64                    `binapi:"u64,name=data_quota" json:"data_quota,omitempty"`
171         DataUsedInRange uint64                    `binapi:"u64,name=data_used_in_range" json:"data_used_in_range,omitempty"`
172         Flags           uint32                    `binapi:"u32,name=flags" json:"flags,omitempty"`
173         DeviceName      string                    `binapi:"string[64],name=device_name" json:"device_name,omitempty"`
174         Nranges         uint32                    `binapi:"u32,name=nranges" json:"-"`
175         Ranges          []MactimeTimeRange        `binapi:"mactime_time_range[nranges],name=ranges" json:"ranges,omitempty"`
176 }
177
178 func (m *MactimeDetails) Reset()               { *m = MactimeDetails{} }
179 func (*MactimeDetails) GetMessageName() string { return "mactime_details" }
180 func (*MactimeDetails) GetCrcString() string   { return "44921c06" }
181 func (*MactimeDetails) GetMessageType() api.MessageType {
182         return api.ReplyMessage
183 }
184
185 func (m *MactimeDetails) Size() (size int) {
186         if m == nil {
187                 return 0
188         }
189         size += 4     // m.PoolIndex
190         size += 1 * 6 // m.MacAddress
191         size += 8     // m.DataQuota
192         size += 8     // m.DataUsedInRange
193         size += 4     // m.Flags
194         size += 64    // m.DeviceName
195         size += 4     // m.Nranges
196         for j1 := 0; j1 < len(m.Ranges); j1++ {
197                 var s1 MactimeTimeRange
198                 _ = s1
199                 if j1 < len(m.Ranges) {
200                         s1 = m.Ranges[j1]
201                 }
202                 size += 8 // s1.Start
203                 size += 8 // s1.End
204         }
205         return size
206 }
207 func (m *MactimeDetails) Marshal(b []byte) ([]byte, error) {
208         if b == nil {
209                 b = make([]byte, m.Size())
210         }
211         buf := codec.NewBuffer(b)
212         buf.EncodeUint32(m.PoolIndex)
213         buf.EncodeBytes(m.MacAddress[:], 6)
214         buf.EncodeUint64(m.DataQuota)
215         buf.EncodeUint64(m.DataUsedInRange)
216         buf.EncodeUint32(m.Flags)
217         buf.EncodeString(m.DeviceName, 64)
218         buf.EncodeUint32(uint32(len(m.Ranges)))
219         for j0 := 0; j0 < len(m.Ranges); j0++ {
220                 var v0 MactimeTimeRange // Ranges
221                 if j0 < len(m.Ranges) {
222                         v0 = m.Ranges[j0]
223                 }
224                 buf.EncodeFloat64(v0.Start)
225                 buf.EncodeFloat64(v0.End)
226         }
227         return buf.Bytes(), nil
228 }
229 func (m *MactimeDetails) Unmarshal(b []byte) error {
230         buf := codec.NewBuffer(b)
231         m.PoolIndex = buf.DecodeUint32()
232         copy(m.MacAddress[:], buf.DecodeBytes(6))
233         m.DataQuota = buf.DecodeUint64()
234         m.DataUsedInRange = buf.DecodeUint64()
235         m.Flags = buf.DecodeUint32()
236         m.DeviceName = buf.DecodeString(64)
237         m.Nranges = buf.DecodeUint32()
238         m.Ranges = make([]MactimeTimeRange, m.Nranges)
239         for j0 := 0; j0 < len(m.Ranges); j0++ {
240                 m.Ranges[j0].Start = buf.DecodeFloat64()
241                 m.Ranges[j0].End = buf.DecodeFloat64()
242         }
243         return nil
244 }
245
246 // MactimeDump defines message 'mactime_dump'.
247 type MactimeDump struct {
248         MyTableEpoch uint32 `binapi:"u32,name=my_table_epoch" json:"my_table_epoch,omitempty"`
249 }
250
251 func (m *MactimeDump) Reset()               { *m = MactimeDump{} }
252 func (*MactimeDump) GetMessageName() string { return "mactime_dump" }
253 func (*MactimeDump) GetCrcString() string   { return "8f454e23" }
254 func (*MactimeDump) GetMessageType() api.MessageType {
255         return api.RequestMessage
256 }
257
258 func (m *MactimeDump) Size() (size int) {
259         if m == nil {
260                 return 0
261         }
262         size += 4 // m.MyTableEpoch
263         return size
264 }
265 func (m *MactimeDump) Marshal(b []byte) ([]byte, error) {
266         if b == nil {
267                 b = make([]byte, m.Size())
268         }
269         buf := codec.NewBuffer(b)
270         buf.EncodeUint32(m.MyTableEpoch)
271         return buf.Bytes(), nil
272 }
273 func (m *MactimeDump) Unmarshal(b []byte) error {
274         buf := codec.NewBuffer(b)
275         m.MyTableEpoch = buf.DecodeUint32()
276         return nil
277 }
278
279 // MactimeDumpReply defines message 'mactime_dump_reply'.
280 type MactimeDumpReply struct {
281         Retval     int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
282         TableEpoch uint32 `binapi:"u32,name=table_epoch" json:"table_epoch,omitempty"`
283 }
284
285 func (m *MactimeDumpReply) Reset()               { *m = MactimeDumpReply{} }
286 func (*MactimeDumpReply) GetMessageName() string { return "mactime_dump_reply" }
287 func (*MactimeDumpReply) GetCrcString() string   { return "49bcc753" }
288 func (*MactimeDumpReply) GetMessageType() api.MessageType {
289         return api.ReplyMessage
290 }
291
292 func (m *MactimeDumpReply) Size() (size int) {
293         if m == nil {
294                 return 0
295         }
296         size += 4 // m.Retval
297         size += 4 // m.TableEpoch
298         return size
299 }
300 func (m *MactimeDumpReply) Marshal(b []byte) ([]byte, error) {
301         if b == nil {
302                 b = make([]byte, m.Size())
303         }
304         buf := codec.NewBuffer(b)
305         buf.EncodeInt32(m.Retval)
306         buf.EncodeUint32(m.TableEpoch)
307         return buf.Bytes(), nil
308 }
309 func (m *MactimeDumpReply) Unmarshal(b []byte) error {
310         buf := codec.NewBuffer(b)
311         m.Retval = buf.DecodeInt32()
312         m.TableEpoch = buf.DecodeUint32()
313         return nil
314 }
315
316 // MactimeEnableDisable defines message 'mactime_enable_disable'.
317 type MactimeEnableDisable struct {
318         EnableDisable bool                           `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
319         SwIfIndex     interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
320 }
321
322 func (m *MactimeEnableDisable) Reset()               { *m = MactimeEnableDisable{} }
323 func (*MactimeEnableDisable) GetMessageName() string { return "mactime_enable_disable" }
324 func (*MactimeEnableDisable) GetCrcString() string   { return "3865946c" }
325 func (*MactimeEnableDisable) GetMessageType() api.MessageType {
326         return api.RequestMessage
327 }
328
329 func (m *MactimeEnableDisable) Size() (size int) {
330         if m == nil {
331                 return 0
332         }
333         size += 1 // m.EnableDisable
334         size += 4 // m.SwIfIndex
335         return size
336 }
337 func (m *MactimeEnableDisable) Marshal(b []byte) ([]byte, error) {
338         if b == nil {
339                 b = make([]byte, m.Size())
340         }
341         buf := codec.NewBuffer(b)
342         buf.EncodeBool(m.EnableDisable)
343         buf.EncodeUint32(uint32(m.SwIfIndex))
344         return buf.Bytes(), nil
345 }
346 func (m *MactimeEnableDisable) Unmarshal(b []byte) error {
347         buf := codec.NewBuffer(b)
348         m.EnableDisable = buf.DecodeBool()
349         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
350         return nil
351 }
352
353 // MactimeEnableDisableReply defines message 'mactime_enable_disable_reply'.
354 type MactimeEnableDisableReply struct {
355         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
356 }
357
358 func (m *MactimeEnableDisableReply) Reset()               { *m = MactimeEnableDisableReply{} }
359 func (*MactimeEnableDisableReply) GetMessageName() string { return "mactime_enable_disable_reply" }
360 func (*MactimeEnableDisableReply) GetCrcString() string   { return "e8d4e804" }
361 func (*MactimeEnableDisableReply) GetMessageType() api.MessageType {
362         return api.ReplyMessage
363 }
364
365 func (m *MactimeEnableDisableReply) Size() (size int) {
366         if m == nil {
367                 return 0
368         }
369         size += 4 // m.Retval
370         return size
371 }
372 func (m *MactimeEnableDisableReply) Marshal(b []byte) ([]byte, error) {
373         if b == nil {
374                 b = make([]byte, m.Size())
375         }
376         buf := codec.NewBuffer(b)
377         buf.EncodeInt32(m.Retval)
378         return buf.Bytes(), nil
379 }
380 func (m *MactimeEnableDisableReply) Unmarshal(b []byte) error {
381         buf := codec.NewBuffer(b)
382         m.Retval = buf.DecodeInt32()
383         return nil
384 }
385
386 func init() { file_mactime_binapi_init() }
387 func file_mactime_binapi_init() {
388         api.RegisterMessage((*MactimeAddDelRange)(nil), "mactime_add_del_range_101858ef")
389         api.RegisterMessage((*MactimeAddDelRangeReply)(nil), "mactime_add_del_range_reply_e8d4e804")
390         api.RegisterMessage((*MactimeDetails)(nil), "mactime_details_44921c06")
391         api.RegisterMessage((*MactimeDump)(nil), "mactime_dump_8f454e23")
392         api.RegisterMessage((*MactimeDumpReply)(nil), "mactime_dump_reply_49bcc753")
393         api.RegisterMessage((*MactimeEnableDisable)(nil), "mactime_enable_disable_3865946c")
394         api.RegisterMessage((*MactimeEnableDisableReply)(nil), "mactime_enable_disable_reply_e8d4e804")
395 }
396
397 // Messages returns list of all messages in this module.
398 func AllMessages() []api.Message {
399         return []api.Message{
400                 (*MactimeAddDelRange)(nil),
401                 (*MactimeAddDelRangeReply)(nil),
402                 (*MactimeDetails)(nil),
403                 (*MactimeDump)(nil),
404                 (*MactimeDumpReply)(nil),
405                 (*MactimeEnableDisable)(nil),
406                 (*MactimeEnableDisableReply)(nil),
407         }
408 }