Update generated binapi to v22.02 & makefile changes
[govpp.git] / internal / testbinapi / binapi2001 / mactime / mactime.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.5.0-dev
4 //  VPP:              20.01
5 // source: .vppapi/plugins/mactime.api.json
6
7 // Package mactime contains generated bindings for API file mactime.api.
8 //
9 // Contents:
10 //   2 aliases
11 //   6 enums
12 //   2 structs
13 //   7 messages
14 //
15 package mactime
16
17 import (
18         "net"
19         "strconv"
20
21         api "git.fd.io/govpp.git/api"
22         codec "git.fd.io/govpp.git/codec"
23 )
24
25 // This is a compile-time assertion to ensure that this generated file
26 // is compatible with the GoVPP api package it is being compiled against.
27 // A compilation error at this line likely means your copy of the
28 // GoVPP api package needs to be updated.
29 const _ = api.GoVppAPIPackageIsVersion2
30
31 const (
32         APIFile    = "mactime"
33         APIVersion = "2.0.0"
34         VersionCrc = 0xd32f01e0
35 )
36
37 // IfStatusFlags defines enum 'if_status_flags'.
38 type IfStatusFlags uint32
39
40 const (
41         IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
42         IF_STATUS_API_FLAG_LINK_UP  IfStatusFlags = 2
43 )
44
45 var (
46         IfStatusFlags_name = map[uint32]string{
47                 1: "IF_STATUS_API_FLAG_ADMIN_UP",
48                 2: "IF_STATUS_API_FLAG_LINK_UP",
49         }
50         IfStatusFlags_value = map[string]uint32{
51                 "IF_STATUS_API_FLAG_ADMIN_UP": 1,
52                 "IF_STATUS_API_FLAG_LINK_UP":  2,
53         }
54 )
55
56 func (x IfStatusFlags) String() string {
57         s, ok := IfStatusFlags_name[uint32(x)]
58         if ok {
59                 return s
60         }
61         str := func(n uint32) string {
62                 s, ok := IfStatusFlags_name[uint32(n)]
63                 if ok {
64                         return s
65                 }
66                 return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
67         }
68         for i := uint32(0); i <= 32; i++ {
69                 val := uint32(x)
70                 if val&(1<<i) != 0 {
71                         if s != "" {
72                                 s += "|"
73                         }
74                         s += str(1 << i)
75                 }
76         }
77         if s == "" {
78                 return str(uint32(x))
79         }
80         return s
81 }
82
83 // IfType defines enum 'if_type'.
84 type IfType uint32
85
86 const (
87         IF_API_TYPE_HARDWARE IfType = 1
88         IF_API_TYPE_SUB      IfType = 2
89         IF_API_TYPE_P2P      IfType = 3
90         IF_API_TYPE_PIPE     IfType = 4
91 )
92
93 var (
94         IfType_name = map[uint32]string{
95                 1: "IF_API_TYPE_HARDWARE",
96                 2: "IF_API_TYPE_SUB",
97                 3: "IF_API_TYPE_P2P",
98                 4: "IF_API_TYPE_PIPE",
99         }
100         IfType_value = map[string]uint32{
101                 "IF_API_TYPE_HARDWARE": 1,
102                 "IF_API_TYPE_SUB":      2,
103                 "IF_API_TYPE_P2P":      3,
104                 "IF_API_TYPE_PIPE":     4,
105         }
106 )
107
108 func (x IfType) String() string {
109         s, ok := IfType_name[uint32(x)]
110         if ok {
111                 return s
112         }
113         return "IfType(" + strconv.Itoa(int(x)) + ")"
114 }
115
116 // LinkDuplex defines enum 'link_duplex'.
117 type LinkDuplex uint32
118
119 const (
120         LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
121         LINK_DUPLEX_API_HALF    LinkDuplex = 1
122         LINK_DUPLEX_API_FULL    LinkDuplex = 2
123 )
124
125 var (
126         LinkDuplex_name = map[uint32]string{
127                 0: "LINK_DUPLEX_API_UNKNOWN",
128                 1: "LINK_DUPLEX_API_HALF",
129                 2: "LINK_DUPLEX_API_FULL",
130         }
131         LinkDuplex_value = map[string]uint32{
132                 "LINK_DUPLEX_API_UNKNOWN": 0,
133                 "LINK_DUPLEX_API_HALF":    1,
134                 "LINK_DUPLEX_API_FULL":    2,
135         }
136 )
137
138 func (x LinkDuplex) String() string {
139         s, ok := LinkDuplex_name[uint32(x)]
140         if ok {
141                 return s
142         }
143         return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
144 }
145
146 // MtuProto defines enum 'mtu_proto'.
147 type MtuProto uint32
148
149 const (
150         MTU_PROTO_API_L3   MtuProto = 1
151         MTU_PROTO_API_IP4  MtuProto = 2
152         MTU_PROTO_API_IP6  MtuProto = 3
153         MTU_PROTO_API_MPLS MtuProto = 4
154         MTU_PROTO_API_N    MtuProto = 5
155 )
156
157 var (
158         MtuProto_name = map[uint32]string{
159                 1: "MTU_PROTO_API_L3",
160                 2: "MTU_PROTO_API_IP4",
161                 3: "MTU_PROTO_API_IP6",
162                 4: "MTU_PROTO_API_MPLS",
163                 5: "MTU_PROTO_API_N",
164         }
165         MtuProto_value = map[string]uint32{
166                 "MTU_PROTO_API_L3":   1,
167                 "MTU_PROTO_API_IP4":  2,
168                 "MTU_PROTO_API_IP6":  3,
169                 "MTU_PROTO_API_MPLS": 4,
170                 "MTU_PROTO_API_N":    5,
171         }
172 )
173
174 func (x MtuProto) String() string {
175         s, ok := MtuProto_name[uint32(x)]
176         if ok {
177                 return s
178         }
179         return "MtuProto(" + strconv.Itoa(int(x)) + ")"
180 }
181
182 // RxMode defines enum 'rx_mode'.
183 type RxMode uint32
184
185 const (
186         RX_MODE_API_UNKNOWN   RxMode = 0
187         RX_MODE_API_POLLING   RxMode = 1
188         RX_MODE_API_INTERRUPT RxMode = 2
189         RX_MODE_API_ADAPTIVE  RxMode = 3
190         RX_MODE_API_DEFAULT   RxMode = 4
191 )
192
193 var (
194         RxMode_name = map[uint32]string{
195                 0: "RX_MODE_API_UNKNOWN",
196                 1: "RX_MODE_API_POLLING",
197                 2: "RX_MODE_API_INTERRUPT",
198                 3: "RX_MODE_API_ADAPTIVE",
199                 4: "RX_MODE_API_DEFAULT",
200         }
201         RxMode_value = map[string]uint32{
202                 "RX_MODE_API_UNKNOWN":   0,
203                 "RX_MODE_API_POLLING":   1,
204                 "RX_MODE_API_INTERRUPT": 2,
205                 "RX_MODE_API_ADAPTIVE":  3,
206                 "RX_MODE_API_DEFAULT":   4,
207         }
208 )
209
210 func (x RxMode) String() string {
211         s, ok := RxMode_name[uint32(x)]
212         if ok {
213                 return s
214         }
215         return "RxMode(" + strconv.Itoa(int(x)) + ")"
216 }
217
218 // SubIfFlags defines enum 'sub_if_flags'.
219 type SubIfFlags uint32
220
221 const (
222         SUB_IF_API_FLAG_NO_TAGS           SubIfFlags = 1
223         SUB_IF_API_FLAG_ONE_TAG           SubIfFlags = 2
224         SUB_IF_API_FLAG_TWO_TAGS          SubIfFlags = 4
225         SUB_IF_API_FLAG_DOT1AD            SubIfFlags = 8
226         SUB_IF_API_FLAG_EXACT_MATCH       SubIfFlags = 16
227         SUB_IF_API_FLAG_DEFAULT           SubIfFlags = 32
228         SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
229         SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
230         SUB_IF_API_FLAG_MASK_VNET         SubIfFlags = 254
231         SUB_IF_API_FLAG_DOT1AH            SubIfFlags = 256
232 )
233
234 var (
235         SubIfFlags_name = map[uint32]string{
236                 1:   "SUB_IF_API_FLAG_NO_TAGS",
237                 2:   "SUB_IF_API_FLAG_ONE_TAG",
238                 4:   "SUB_IF_API_FLAG_TWO_TAGS",
239                 8:   "SUB_IF_API_FLAG_DOT1AD",
240                 16:  "SUB_IF_API_FLAG_EXACT_MATCH",
241                 32:  "SUB_IF_API_FLAG_DEFAULT",
242                 64:  "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
243                 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
244                 254: "SUB_IF_API_FLAG_MASK_VNET",
245                 256: "SUB_IF_API_FLAG_DOT1AH",
246         }
247         SubIfFlags_value = map[string]uint32{
248                 "SUB_IF_API_FLAG_NO_TAGS":           1,
249                 "SUB_IF_API_FLAG_ONE_TAG":           2,
250                 "SUB_IF_API_FLAG_TWO_TAGS":          4,
251                 "SUB_IF_API_FLAG_DOT1AD":            8,
252                 "SUB_IF_API_FLAG_EXACT_MATCH":       16,
253                 "SUB_IF_API_FLAG_DEFAULT":           32,
254                 "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY": 64,
255                 "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY": 128,
256                 "SUB_IF_API_FLAG_MASK_VNET":         254,
257                 "SUB_IF_API_FLAG_DOT1AH":            256,
258         }
259 )
260
261 func (x SubIfFlags) String() string {
262         s, ok := SubIfFlags_name[uint32(x)]
263         if ok {
264                 return s
265         }
266         str := func(n uint32) string {
267                 s, ok := SubIfFlags_name[uint32(n)]
268                 if ok {
269                         return s
270                 }
271                 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
272         }
273         for i := uint32(0); i <= 32; i++ {
274                 val := uint32(x)
275                 if val&(1<<i) != 0 {
276                         if s != "" {
277                                 s += "|"
278                         }
279                         s += str(1 << i)
280                 }
281         }
282         if s == "" {
283                 return str(uint32(x))
284         }
285         return s
286 }
287
288 // InterfaceIndex defines alias 'interface_index'.
289 type InterfaceIndex uint32
290
291 // MacAddress defines alias 'mac_address'.
292 type MacAddress [6]uint8
293
294 func ParseMacAddress(s string) (MacAddress, error) {
295         var macaddr MacAddress
296         mac, err := net.ParseMAC(s)
297         if err != nil {
298                 return macaddr, err
299         }
300         copy(macaddr[:], mac[:])
301         return macaddr, nil
302 }
303
304 func (x MacAddress) ToMAC() net.HardwareAddr {
305         return net.HardwareAddr(x[:])
306 }
307
308 func (x MacAddress) String() string {
309         return x.ToMAC().String()
310 }
311
312 func (x *MacAddress) MarshalText() ([]byte, error) {
313         return []byte(x.String()), nil
314 }
315
316 func (x *MacAddress) UnmarshalText(text []byte) error {
317         mac, err := ParseMacAddress(string(text))
318         if err != nil {
319                 return err
320         }
321         *x = mac
322         return nil
323 }
324
325 // MactimeTimeRange defines type 'mactime_time_range'.
326 type MactimeTimeRange struct {
327         Start float64 `binapi:"f64,name=start" json:"start,omitempty"`
328         End   float64 `binapi:"f64,name=end" json:"end,omitempty"`
329 }
330
331 // TimeRange defines type 'time_range'.
332 type TimeRange struct {
333         Start float64 `binapi:"f64,name=start" json:"start,omitempty"`
334         End   float64 `binapi:"f64,name=end" json:"end,omitempty"`
335 }
336
337 // MactimeAddDelRange defines message 'mactime_add_del_range'.
338 type MactimeAddDelRange struct {
339         IsAdd      bool        `binapi:"bool,name=is_add" json:"is_add,omitempty"`
340         Drop       bool        `binapi:"bool,name=drop" json:"drop,omitempty"`
341         Allow      bool        `binapi:"bool,name=allow" json:"allow,omitempty"`
342         AllowQuota uint8       `binapi:"u8,name=allow_quota" json:"allow_quota,omitempty"`
343         NoUDP10001 bool        `binapi:"bool,name=no_udp_10001" json:"no_udp_10001,omitempty"`
344         DataQuota  uint64      `binapi:"u64,name=data_quota" json:"data_quota,omitempty"`
345         MacAddress MacAddress  `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
346         DeviceName string      `binapi:"string[64],name=device_name" json:"device_name,omitempty"`
347         Count      uint32      `binapi:"u32,name=count" json:"-"`
348         Ranges     []TimeRange `binapi:"time_range[count],name=ranges" json:"ranges,omitempty"`
349 }
350
351 func (m *MactimeAddDelRange) Reset()               { *m = MactimeAddDelRange{} }
352 func (*MactimeAddDelRange) GetMessageName() string { return "mactime_add_del_range" }
353 func (*MactimeAddDelRange) GetCrcString() string   { return "101858ef" }
354 func (*MactimeAddDelRange) GetMessageType() api.MessageType {
355         return api.RequestMessage
356 }
357
358 func (m *MactimeAddDelRange) Size() (size int) {
359         if m == nil {
360                 return 0
361         }
362         size += 1     // m.IsAdd
363         size += 1     // m.Drop
364         size += 1     // m.Allow
365         size += 1     // m.AllowQuota
366         size += 1     // m.NoUDP10001
367         size += 8     // m.DataQuota
368         size += 1 * 6 // m.MacAddress
369         size += 64    // m.DeviceName
370         size += 4     // m.Count
371         for j1 := 0; j1 < len(m.Ranges); j1++ {
372                 var s1 TimeRange
373                 _ = s1
374                 if j1 < len(m.Ranges) {
375                         s1 = m.Ranges[j1]
376                 }
377                 size += 8 // s1.Start
378                 size += 8 // s1.End
379         }
380         return size
381 }
382 func (m *MactimeAddDelRange) Marshal(b []byte) ([]byte, error) {
383         if b == nil {
384                 b = make([]byte, m.Size())
385         }
386         buf := codec.NewBuffer(b)
387         buf.EncodeBool(m.IsAdd)
388         buf.EncodeBool(m.Drop)
389         buf.EncodeBool(m.Allow)
390         buf.EncodeUint8(m.AllowQuota)
391         buf.EncodeBool(m.NoUDP10001)
392         buf.EncodeUint64(m.DataQuota)
393         buf.EncodeBytes(m.MacAddress[:], 6)
394         buf.EncodeString(m.DeviceName, 64)
395         buf.EncodeUint32(uint32(len(m.Ranges)))
396         for j0 := 0; j0 < len(m.Ranges); j0++ {
397                 var v0 TimeRange // Ranges
398                 if j0 < len(m.Ranges) {
399                         v0 = m.Ranges[j0]
400                 }
401                 buf.EncodeFloat64(v0.Start)
402                 buf.EncodeFloat64(v0.End)
403         }
404         return buf.Bytes(), nil
405 }
406 func (m *MactimeAddDelRange) Unmarshal(b []byte) error {
407         buf := codec.NewBuffer(b)
408         m.IsAdd = buf.DecodeBool()
409         m.Drop = buf.DecodeBool()
410         m.Allow = buf.DecodeBool()
411         m.AllowQuota = buf.DecodeUint8()
412         m.NoUDP10001 = buf.DecodeBool()
413         m.DataQuota = buf.DecodeUint64()
414         copy(m.MacAddress[:], buf.DecodeBytes(6))
415         m.DeviceName = buf.DecodeString(64)
416         m.Count = buf.DecodeUint32()
417         m.Ranges = make([]TimeRange, m.Count)
418         for j0 := 0; j0 < len(m.Ranges); j0++ {
419                 m.Ranges[j0].Start = buf.DecodeFloat64()
420                 m.Ranges[j0].End = buf.DecodeFloat64()
421         }
422         return nil
423 }
424
425 // MactimeAddDelRangeReply defines message 'mactime_add_del_range_reply'.
426 type MactimeAddDelRangeReply struct {
427         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
428 }
429
430 func (m *MactimeAddDelRangeReply) Reset()               { *m = MactimeAddDelRangeReply{} }
431 func (*MactimeAddDelRangeReply) GetMessageName() string { return "mactime_add_del_range_reply" }
432 func (*MactimeAddDelRangeReply) GetCrcString() string   { return "e8d4e804" }
433 func (*MactimeAddDelRangeReply) GetMessageType() api.MessageType {
434         return api.ReplyMessage
435 }
436
437 func (m *MactimeAddDelRangeReply) Size() (size int) {
438         if m == nil {
439                 return 0
440         }
441         size += 4 // m.Retval
442         return size
443 }
444 func (m *MactimeAddDelRangeReply) Marshal(b []byte) ([]byte, error) {
445         if b == nil {
446                 b = make([]byte, m.Size())
447         }
448         buf := codec.NewBuffer(b)
449         buf.EncodeInt32(m.Retval)
450         return buf.Bytes(), nil
451 }
452 func (m *MactimeAddDelRangeReply) Unmarshal(b []byte) error {
453         buf := codec.NewBuffer(b)
454         m.Retval = buf.DecodeInt32()
455         return nil
456 }
457
458 // MactimeDetails defines message 'mactime_details'.
459 type MactimeDetails struct {
460         PoolIndex       uint32             `binapi:"u32,name=pool_index" json:"pool_index,omitempty"`
461         MacAddress      MacAddress         `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
462         DataQuota       uint64             `binapi:"u64,name=data_quota" json:"data_quota,omitempty"`
463         DataUsedInRange uint64             `binapi:"u64,name=data_used_in_range" json:"data_used_in_range,omitempty"`
464         Flags           uint32             `binapi:"u32,name=flags" json:"flags,omitempty"`
465         DeviceName      string             `binapi:"string[64],name=device_name" json:"device_name,omitempty"`
466         Nranges         uint32             `binapi:"u32,name=nranges" json:"-"`
467         Ranges          []MactimeTimeRange `binapi:"mactime_time_range[nranges],name=ranges" json:"ranges,omitempty"`
468 }
469
470 func (m *MactimeDetails) Reset()               { *m = MactimeDetails{} }
471 func (*MactimeDetails) GetMessageName() string { return "mactime_details" }
472 func (*MactimeDetails) GetCrcString() string   { return "44921c06" }
473 func (*MactimeDetails) GetMessageType() api.MessageType {
474         return api.ReplyMessage
475 }
476
477 func (m *MactimeDetails) Size() (size int) {
478         if m == nil {
479                 return 0
480         }
481         size += 4     // m.PoolIndex
482         size += 1 * 6 // m.MacAddress
483         size += 8     // m.DataQuota
484         size += 8     // m.DataUsedInRange
485         size += 4     // m.Flags
486         size += 64    // m.DeviceName
487         size += 4     // m.Nranges
488         for j1 := 0; j1 < len(m.Ranges); j1++ {
489                 var s1 MactimeTimeRange
490                 _ = s1
491                 if j1 < len(m.Ranges) {
492                         s1 = m.Ranges[j1]
493                 }
494                 size += 8 // s1.Start
495                 size += 8 // s1.End
496         }
497         return size
498 }
499 func (m *MactimeDetails) Marshal(b []byte) ([]byte, error) {
500         if b == nil {
501                 b = make([]byte, m.Size())
502         }
503         buf := codec.NewBuffer(b)
504         buf.EncodeUint32(m.PoolIndex)
505         buf.EncodeBytes(m.MacAddress[:], 6)
506         buf.EncodeUint64(m.DataQuota)
507         buf.EncodeUint64(m.DataUsedInRange)
508         buf.EncodeUint32(m.Flags)
509         buf.EncodeString(m.DeviceName, 64)
510         buf.EncodeUint32(uint32(len(m.Ranges)))
511         for j0 := 0; j0 < len(m.Ranges); j0++ {
512                 var v0 MactimeTimeRange // Ranges
513                 if j0 < len(m.Ranges) {
514                         v0 = m.Ranges[j0]
515                 }
516                 buf.EncodeFloat64(v0.Start)
517                 buf.EncodeFloat64(v0.End)
518         }
519         return buf.Bytes(), nil
520 }
521 func (m *MactimeDetails) Unmarshal(b []byte) error {
522         buf := codec.NewBuffer(b)
523         m.PoolIndex = buf.DecodeUint32()
524         copy(m.MacAddress[:], buf.DecodeBytes(6))
525         m.DataQuota = buf.DecodeUint64()
526         m.DataUsedInRange = buf.DecodeUint64()
527         m.Flags = buf.DecodeUint32()
528         m.DeviceName = buf.DecodeString(64)
529         m.Nranges = buf.DecodeUint32()
530         m.Ranges = make([]MactimeTimeRange, m.Nranges)
531         for j0 := 0; j0 < len(m.Ranges); j0++ {
532                 m.Ranges[j0].Start = buf.DecodeFloat64()
533                 m.Ranges[j0].End = buf.DecodeFloat64()
534         }
535         return nil
536 }
537
538 // MactimeDump defines message 'mactime_dump'.
539 type MactimeDump struct {
540         MyTableEpoch uint32 `binapi:"u32,name=my_table_epoch" json:"my_table_epoch,omitempty"`
541 }
542
543 func (m *MactimeDump) Reset()               { *m = MactimeDump{} }
544 func (*MactimeDump) GetMessageName() string { return "mactime_dump" }
545 func (*MactimeDump) GetCrcString() string   { return "8f454e23" }
546 func (*MactimeDump) GetMessageType() api.MessageType {
547         return api.RequestMessage
548 }
549
550 func (m *MactimeDump) Size() (size int) {
551         if m == nil {
552                 return 0
553         }
554         size += 4 // m.MyTableEpoch
555         return size
556 }
557 func (m *MactimeDump) Marshal(b []byte) ([]byte, error) {
558         if b == nil {
559                 b = make([]byte, m.Size())
560         }
561         buf := codec.NewBuffer(b)
562         buf.EncodeUint32(m.MyTableEpoch)
563         return buf.Bytes(), nil
564 }
565 func (m *MactimeDump) Unmarshal(b []byte) error {
566         buf := codec.NewBuffer(b)
567         m.MyTableEpoch = buf.DecodeUint32()
568         return nil
569 }
570
571 // MactimeDumpReply defines message 'mactime_dump_reply'.
572 type MactimeDumpReply struct {
573         Retval     int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
574         TableEpoch uint32 `binapi:"u32,name=table_epoch" json:"table_epoch,omitempty"`
575 }
576
577 func (m *MactimeDumpReply) Reset()               { *m = MactimeDumpReply{} }
578 func (*MactimeDumpReply) GetMessageName() string { return "mactime_dump_reply" }
579 func (*MactimeDumpReply) GetCrcString() string   { return "49bcc753" }
580 func (*MactimeDumpReply) GetMessageType() api.MessageType {
581         return api.ReplyMessage
582 }
583
584 func (m *MactimeDumpReply) Size() (size int) {
585         if m == nil {
586                 return 0
587         }
588         size += 4 // m.Retval
589         size += 4 // m.TableEpoch
590         return size
591 }
592 func (m *MactimeDumpReply) Marshal(b []byte) ([]byte, error) {
593         if b == nil {
594                 b = make([]byte, m.Size())
595         }
596         buf := codec.NewBuffer(b)
597         buf.EncodeInt32(m.Retval)
598         buf.EncodeUint32(m.TableEpoch)
599         return buf.Bytes(), nil
600 }
601 func (m *MactimeDumpReply) Unmarshal(b []byte) error {
602         buf := codec.NewBuffer(b)
603         m.Retval = buf.DecodeInt32()
604         m.TableEpoch = buf.DecodeUint32()
605         return nil
606 }
607
608 // MactimeEnableDisable defines message 'mactime_enable_disable'.
609 type MactimeEnableDisable struct {
610         EnableDisable bool           `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
611         SwIfIndex     InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
612 }
613
614 func (m *MactimeEnableDisable) Reset()               { *m = MactimeEnableDisable{} }
615 func (*MactimeEnableDisable) GetMessageName() string { return "mactime_enable_disable" }
616 func (*MactimeEnableDisable) GetCrcString() string   { return "3865946c" }
617 func (*MactimeEnableDisable) GetMessageType() api.MessageType {
618         return api.RequestMessage
619 }
620
621 func (m *MactimeEnableDisable) Size() (size int) {
622         if m == nil {
623                 return 0
624         }
625         size += 1 // m.EnableDisable
626         size += 4 // m.SwIfIndex
627         return size
628 }
629 func (m *MactimeEnableDisable) Marshal(b []byte) ([]byte, error) {
630         if b == nil {
631                 b = make([]byte, m.Size())
632         }
633         buf := codec.NewBuffer(b)
634         buf.EncodeBool(m.EnableDisable)
635         buf.EncodeUint32(uint32(m.SwIfIndex))
636         return buf.Bytes(), nil
637 }
638 func (m *MactimeEnableDisable) Unmarshal(b []byte) error {
639         buf := codec.NewBuffer(b)
640         m.EnableDisable = buf.DecodeBool()
641         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
642         return nil
643 }
644
645 // MactimeEnableDisableReply defines message 'mactime_enable_disable_reply'.
646 type MactimeEnableDisableReply struct {
647         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
648 }
649
650 func (m *MactimeEnableDisableReply) Reset()               { *m = MactimeEnableDisableReply{} }
651 func (*MactimeEnableDisableReply) GetMessageName() string { return "mactime_enable_disable_reply" }
652 func (*MactimeEnableDisableReply) GetCrcString() string   { return "e8d4e804" }
653 func (*MactimeEnableDisableReply) GetMessageType() api.MessageType {
654         return api.ReplyMessage
655 }
656
657 func (m *MactimeEnableDisableReply) Size() (size int) {
658         if m == nil {
659                 return 0
660         }
661         size += 4 // m.Retval
662         return size
663 }
664 func (m *MactimeEnableDisableReply) Marshal(b []byte) ([]byte, error) {
665         if b == nil {
666                 b = make([]byte, m.Size())
667         }
668         buf := codec.NewBuffer(b)
669         buf.EncodeInt32(m.Retval)
670         return buf.Bytes(), nil
671 }
672 func (m *MactimeEnableDisableReply) Unmarshal(b []byte) error {
673         buf := codec.NewBuffer(b)
674         m.Retval = buf.DecodeInt32()
675         return nil
676 }
677
678 func init() { file_mactime_binapi_init() }
679 func file_mactime_binapi_init() {
680         api.RegisterMessage((*MactimeAddDelRange)(nil), "mactime_add_del_range_101858ef")
681         api.RegisterMessage((*MactimeAddDelRangeReply)(nil), "mactime_add_del_range_reply_e8d4e804")
682         api.RegisterMessage((*MactimeDetails)(nil), "mactime_details_44921c06")
683         api.RegisterMessage((*MactimeDump)(nil), "mactime_dump_8f454e23")
684         api.RegisterMessage((*MactimeDumpReply)(nil), "mactime_dump_reply_49bcc753")
685         api.RegisterMessage((*MactimeEnableDisable)(nil), "mactime_enable_disable_3865946c")
686         api.RegisterMessage((*MactimeEnableDisableReply)(nil), "mactime_enable_disable_reply_e8d4e804")
687 }
688
689 // Messages returns list of all messages in this module.
690 func AllMessages() []api.Message {
691         return []api.Message{
692                 (*MactimeAddDelRange)(nil),
693                 (*MactimeAddDelRangeReply)(nil),
694                 (*MactimeDetails)(nil),
695                 (*MactimeDump)(nil),
696                 (*MactimeDumpReply)(nil),
697                 (*MactimeEnableDisable)(nil),
698                 (*MactimeEnableDisableReply)(nil),
699         }
700 }