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