1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.5.0-dev
5 // source: .vppapi/plugins/mactime.api.json
7 // Package mactime contains generated bindings for API file mactime.api.
21 api "git.fd.io/govpp.git/api"
22 codec "git.fd.io/govpp.git/codec"
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
34 VersionCrc = 0xd32f01e0
37 // IfStatusFlags defines enum 'if_status_flags'.
38 type IfStatusFlags uint32
41 IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
42 IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
46 IfStatusFlags_name = map[uint32]string{
47 1: "IF_STATUS_API_FLAG_ADMIN_UP",
48 2: "IF_STATUS_API_FLAG_LINK_UP",
50 IfStatusFlags_value = map[string]uint32{
51 "IF_STATUS_API_FLAG_ADMIN_UP": 1,
52 "IF_STATUS_API_FLAG_LINK_UP": 2,
56 func (x IfStatusFlags) String() string {
57 s, ok := IfStatusFlags_name[uint32(x)]
61 str := func(n uint32) string {
62 s, ok := IfStatusFlags_name[uint32(n)]
66 return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
68 for i := uint32(0); i <= 32; i++ {
83 // IfType defines enum 'if_type'.
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
94 IfType_name = map[uint32]string{
95 1: "IF_API_TYPE_HARDWARE",
98 4: "IF_API_TYPE_PIPE",
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,
108 func (x IfType) String() string {
109 s, ok := IfType_name[uint32(x)]
113 return "IfType(" + strconv.Itoa(int(x)) + ")"
116 // LinkDuplex defines enum 'link_duplex'.
117 type LinkDuplex uint32
120 LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
121 LINK_DUPLEX_API_HALF LinkDuplex = 1
122 LINK_DUPLEX_API_FULL LinkDuplex = 2
126 LinkDuplex_name = map[uint32]string{
127 0: "LINK_DUPLEX_API_UNKNOWN",
128 1: "LINK_DUPLEX_API_HALF",
129 2: "LINK_DUPLEX_API_FULL",
131 LinkDuplex_value = map[string]uint32{
132 "LINK_DUPLEX_API_UNKNOWN": 0,
133 "LINK_DUPLEX_API_HALF": 1,
134 "LINK_DUPLEX_API_FULL": 2,
138 func (x LinkDuplex) String() string {
139 s, ok := LinkDuplex_name[uint32(x)]
143 return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
146 // MtuProto defines enum 'mtu_proto'.
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
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",
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,
174 func (x MtuProto) String() string {
175 s, ok := MtuProto_name[uint32(x)]
179 return "MtuProto(" + strconv.Itoa(int(x)) + ")"
182 // RxMode defines enum 'rx_mode'.
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
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",
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,
210 func (x RxMode) String() string {
211 s, ok := RxMode_name[uint32(x)]
215 return "RxMode(" + strconv.Itoa(int(x)) + ")"
218 // SubIfFlags defines enum 'sub_if_flags'.
219 type SubIfFlags uint32
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
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",
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,
261 func (x SubIfFlags) String() string {
262 s, ok := SubIfFlags_name[uint32(x)]
266 str := func(n uint32) string {
267 s, ok := SubIfFlags_name[uint32(n)]
271 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
273 for i := uint32(0); i <= 32; i++ {
283 return str(uint32(x))
288 // InterfaceIndex defines alias 'interface_index'.
289 type InterfaceIndex uint32
291 // MacAddress defines alias 'mac_address'.
292 type MacAddress [6]uint8
294 func ParseMacAddress(s string) (MacAddress, error) {
295 var macaddr MacAddress
296 mac, err := net.ParseMAC(s)
300 copy(macaddr[:], mac[:])
304 func (x MacAddress) ToMAC() net.HardwareAddr {
305 return net.HardwareAddr(x[:])
308 func (x MacAddress) String() string {
309 return x.ToMAC().String()
312 func (x *MacAddress) MarshalText() ([]byte, error) {
313 return []byte(x.String()), nil
316 func (x *MacAddress) UnmarshalText(text []byte) error {
317 mac, err := ParseMacAddress(string(text))
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"`
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"`
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"`
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
358 func (m *MactimeAddDelRange) Size() (size int) {
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
371 for j1 := 0; j1 < len(m.Ranges); j1++ {
374 if j1 < len(m.Ranges) {
377 size += 8 // s1.Start
382 func (m *MactimeAddDelRange) Marshal(b []byte) ([]byte, error) {
384 b = make([]byte, m.Size())
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) {
401 buf.EncodeFloat64(v0.Start)
402 buf.EncodeFloat64(v0.End)
404 return buf.Bytes(), nil
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()
425 // MactimeAddDelRangeReply defines message 'mactime_add_del_range_reply'.
426 type MactimeAddDelRangeReply struct {
427 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
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
437 func (m *MactimeAddDelRangeReply) Size() (size int) {
441 size += 4 // m.Retval
444 func (m *MactimeAddDelRangeReply) Marshal(b []byte) ([]byte, error) {
446 b = make([]byte, m.Size())
448 buf := codec.NewBuffer(b)
449 buf.EncodeInt32(m.Retval)
450 return buf.Bytes(), nil
452 func (m *MactimeAddDelRangeReply) Unmarshal(b []byte) error {
453 buf := codec.NewBuffer(b)
454 m.Retval = buf.DecodeInt32()
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"`
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
477 func (m *MactimeDetails) Size() (size int) {
481 size += 4 // m.PoolIndex
482 size += 1 * 6 // m.MacAddress
483 size += 8 // m.DataQuota
484 size += 8 // m.DataUsedInRange
486 size += 64 // m.DeviceName
487 size += 4 // m.Nranges
488 for j1 := 0; j1 < len(m.Ranges); j1++ {
489 var s1 MactimeTimeRange
491 if j1 < len(m.Ranges) {
494 size += 8 // s1.Start
499 func (m *MactimeDetails) Marshal(b []byte) ([]byte, error) {
501 b = make([]byte, m.Size())
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) {
516 buf.EncodeFloat64(v0.Start)
517 buf.EncodeFloat64(v0.End)
519 return buf.Bytes(), nil
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()
538 // MactimeDump defines message 'mactime_dump'.
539 type MactimeDump struct {
540 MyTableEpoch uint32 `binapi:"u32,name=my_table_epoch" json:"my_table_epoch,omitempty"`
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
550 func (m *MactimeDump) Size() (size int) {
554 size += 4 // m.MyTableEpoch
557 func (m *MactimeDump) Marshal(b []byte) ([]byte, error) {
559 b = make([]byte, m.Size())
561 buf := codec.NewBuffer(b)
562 buf.EncodeUint32(m.MyTableEpoch)
563 return buf.Bytes(), nil
565 func (m *MactimeDump) Unmarshal(b []byte) error {
566 buf := codec.NewBuffer(b)
567 m.MyTableEpoch = buf.DecodeUint32()
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"`
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
584 func (m *MactimeDumpReply) Size() (size int) {
588 size += 4 // m.Retval
589 size += 4 // m.TableEpoch
592 func (m *MactimeDumpReply) Marshal(b []byte) ([]byte, error) {
594 b = make([]byte, m.Size())
596 buf := codec.NewBuffer(b)
597 buf.EncodeInt32(m.Retval)
598 buf.EncodeUint32(m.TableEpoch)
599 return buf.Bytes(), nil
601 func (m *MactimeDumpReply) Unmarshal(b []byte) error {
602 buf := codec.NewBuffer(b)
603 m.Retval = buf.DecodeInt32()
604 m.TableEpoch = buf.DecodeUint32()
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"`
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
621 func (m *MactimeEnableDisable) Size() (size int) {
625 size += 1 // m.EnableDisable
626 size += 4 // m.SwIfIndex
629 func (m *MactimeEnableDisable) Marshal(b []byte) ([]byte, error) {
631 b = make([]byte, m.Size())
633 buf := codec.NewBuffer(b)
634 buf.EncodeBool(m.EnableDisable)
635 buf.EncodeUint32(uint32(m.SwIfIndex))
636 return buf.Bytes(), nil
638 func (m *MactimeEnableDisable) Unmarshal(b []byte) error {
639 buf := codec.NewBuffer(b)
640 m.EnableDisable = buf.DecodeBool()
641 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
645 // MactimeEnableDisableReply defines message 'mactime_enable_disable_reply'.
646 type MactimeEnableDisableReply struct {
647 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
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
657 func (m *MactimeEnableDisableReply) Size() (size int) {
661 size += 4 // m.Retval
664 func (m *MactimeEnableDisableReply) Marshal(b []byte) ([]byte, error) {
666 b = make([]byte, m.Size())
668 buf := codec.NewBuffer(b)
669 buf.EncodeInt32(m.Retval)
670 return buf.Bytes(), nil
672 func (m *MactimeEnableDisableReply) Unmarshal(b []byte) error {
673 buf := codec.NewBuffer(b)
674 m.Retval = buf.DecodeInt32()
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")
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),
696 (*MactimeDumpReply)(nil),
697 (*MactimeEnableDisable)(nil),
698 (*MactimeEnableDisableReply)(nil),