1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
5 // source: .vppapi/plugins/mactime.api.json
7 // Package mactime contains generated bindings for API file mactime.api.
18 api "git.fd.io/govpp.git/api"
19 codec "git.fd.io/govpp.git/codec"
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
33 VersionCrc = 0xd32f01e0
36 // IfStatusFlags defines enum 'if_status_flags'.
37 type IfStatusFlags uint32
40 IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
41 IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
45 IfStatusFlags_name = map[uint32]string{
46 1: "IF_STATUS_API_FLAG_ADMIN_UP",
47 2: "IF_STATUS_API_FLAG_LINK_UP",
49 IfStatusFlags_value = map[string]uint32{
50 "IF_STATUS_API_FLAG_ADMIN_UP": 1,
51 "IF_STATUS_API_FLAG_LINK_UP": 2,
55 func (x IfStatusFlags) String() string {
56 s, ok := IfStatusFlags_name[uint32(x)]
60 str := func(n uint32) string {
61 s, ok := IfStatusFlags_name[uint32(n)]
65 return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
67 for i := uint32(0); i <= 32; i++ {
82 // IfType defines enum 'if_type'.
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
93 IfType_name = map[uint32]string{
94 1: "IF_API_TYPE_HARDWARE",
97 4: "IF_API_TYPE_PIPE",
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,
107 func (x IfType) String() string {
108 s, ok := IfType_name[uint32(x)]
112 return "IfType(" + strconv.Itoa(int(x)) + ")"
115 // LinkDuplex defines enum 'link_duplex'.
116 type LinkDuplex uint32
119 LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
120 LINK_DUPLEX_API_HALF LinkDuplex = 1
121 LINK_DUPLEX_API_FULL LinkDuplex = 2
125 LinkDuplex_name = map[uint32]string{
126 0: "LINK_DUPLEX_API_UNKNOWN",
127 1: "LINK_DUPLEX_API_HALF",
128 2: "LINK_DUPLEX_API_FULL",
130 LinkDuplex_value = map[string]uint32{
131 "LINK_DUPLEX_API_UNKNOWN": 0,
132 "LINK_DUPLEX_API_HALF": 1,
133 "LINK_DUPLEX_API_FULL": 2,
137 func (x LinkDuplex) String() string {
138 s, ok := LinkDuplex_name[uint32(x)]
142 return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
145 // MtuProto defines enum 'mtu_proto'.
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
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",
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,
173 func (x MtuProto) String() string {
174 s, ok := MtuProto_name[uint32(x)]
178 return "MtuProto(" + strconv.Itoa(int(x)) + ")"
181 // RxMode defines enum 'rx_mode'.
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
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",
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,
209 func (x RxMode) String() string {
210 s, ok := RxMode_name[uint32(x)]
214 return "RxMode(" + strconv.Itoa(int(x)) + ")"
217 // SubIfFlags defines enum 'sub_if_flags'.
218 type SubIfFlags uint32
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
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",
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,
260 func (x SubIfFlags) String() string {
261 s, ok := SubIfFlags_name[uint32(x)]
265 str := func(n uint32) string {
266 s, ok := SubIfFlags_name[uint32(n)]
270 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
272 for i := uint32(0); i <= 32; i++ {
282 return str(uint32(x))
287 // InterfaceIndex defines alias 'interface_index'.
288 type InterfaceIndex uint32
290 // MacAddress defines alias 'mac_address'.
291 type MacAddress [6]uint8
293 func ParseMacAddress(s string) (MacAddress, error) {
294 var macaddr MacAddress
295 mac, err := net.ParseMAC(s)
299 copy(macaddr[:], mac[:])
302 func (x MacAddress) ToMAC() net.HardwareAddr {
303 return net.HardwareAddr(x[:])
305 func (x MacAddress) String() string {
306 return x.ToMAC().String()
308 func (x *MacAddress) MarshalText() ([]byte, error) {
309 return []byte(x.String()), nil
311 func (x *MacAddress) UnmarshalText(text []byte) error {
312 mac, err := ParseMacAddress(string(text))
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"`
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"`
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"`
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
353 func (m *MactimeAddDelRange) Size() (size int) {
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
366 for j1 := 0; j1 < len(m.Ranges); j1++ {
369 if j1 < len(m.Ranges) {
372 size += 8 // s1.Start
377 func (m *MactimeAddDelRange) Marshal(b []byte) ([]byte, error) {
379 b = make([]byte, m.Size())
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) {
396 buf.EncodeFloat64(v0.Start)
397 buf.EncodeFloat64(v0.End)
399 return buf.Bytes(), nil
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()
420 // MactimeAddDelRangeReply defines message 'mactime_add_del_range_reply'.
421 type MactimeAddDelRangeReply struct {
422 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
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
432 func (m *MactimeAddDelRangeReply) Size() (size int) {
436 size += 4 // m.Retval
439 func (m *MactimeAddDelRangeReply) Marshal(b []byte) ([]byte, error) {
441 b = make([]byte, m.Size())
443 buf := codec.NewBuffer(b)
444 buf.EncodeInt32(m.Retval)
445 return buf.Bytes(), nil
447 func (m *MactimeAddDelRangeReply) Unmarshal(b []byte) error {
448 buf := codec.NewBuffer(b)
449 m.Retval = buf.DecodeInt32()
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"`
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
472 func (m *MactimeDetails) Size() (size int) {
476 size += 4 // m.PoolIndex
477 size += 1 * 6 // m.MacAddress
478 size += 8 // m.DataQuota
479 size += 8 // m.DataUsedInRange
481 size += 64 // m.DeviceName
482 size += 4 // m.Nranges
483 for j1 := 0; j1 < len(m.Ranges); j1++ {
484 var s1 MactimeTimeRange
486 if j1 < len(m.Ranges) {
489 size += 8 // s1.Start
494 func (m *MactimeDetails) Marshal(b []byte) ([]byte, error) {
496 b = make([]byte, m.Size())
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) {
511 buf.EncodeFloat64(v0.Start)
512 buf.EncodeFloat64(v0.End)
514 return buf.Bytes(), nil
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()
533 // MactimeDump defines message 'mactime_dump'.
534 type MactimeDump struct {
535 MyTableEpoch uint32 `binapi:"u32,name=my_table_epoch" json:"my_table_epoch,omitempty"`
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
545 func (m *MactimeDump) Size() (size int) {
549 size += 4 // m.MyTableEpoch
552 func (m *MactimeDump) Marshal(b []byte) ([]byte, error) {
554 b = make([]byte, m.Size())
556 buf := codec.NewBuffer(b)
557 buf.EncodeUint32(m.MyTableEpoch)
558 return buf.Bytes(), nil
560 func (m *MactimeDump) Unmarshal(b []byte) error {
561 buf := codec.NewBuffer(b)
562 m.MyTableEpoch = buf.DecodeUint32()
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"`
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
579 func (m *MactimeDumpReply) Size() (size int) {
583 size += 4 // m.Retval
584 size += 4 // m.TableEpoch
587 func (m *MactimeDumpReply) Marshal(b []byte) ([]byte, error) {
589 b = make([]byte, m.Size())
591 buf := codec.NewBuffer(b)
592 buf.EncodeInt32(m.Retval)
593 buf.EncodeUint32(m.TableEpoch)
594 return buf.Bytes(), nil
596 func (m *MactimeDumpReply) Unmarshal(b []byte) error {
597 buf := codec.NewBuffer(b)
598 m.Retval = buf.DecodeInt32()
599 m.TableEpoch = buf.DecodeUint32()
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"`
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
616 func (m *MactimeEnableDisable) Size() (size int) {
620 size += 1 // m.EnableDisable
621 size += 4 // m.SwIfIndex
624 func (m *MactimeEnableDisable) Marshal(b []byte) ([]byte, error) {
626 b = make([]byte, m.Size())
628 buf := codec.NewBuffer(b)
629 buf.EncodeBool(m.EnableDisable)
630 buf.EncodeUint32(uint32(m.SwIfIndex))
631 return buf.Bytes(), nil
633 func (m *MactimeEnableDisable) Unmarshal(b []byte) error {
634 buf := codec.NewBuffer(b)
635 m.EnableDisable = buf.DecodeBool()
636 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
640 // MactimeEnableDisableReply defines message 'mactime_enable_disable_reply'.
641 type MactimeEnableDisableReply struct {
642 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
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
652 func (m *MactimeEnableDisableReply) Size() (size int) {
656 size += 4 // m.Retval
659 func (m *MactimeEnableDisableReply) Marshal(b []byte) ([]byte, error) {
661 b = make([]byte, m.Size())
663 buf := codec.NewBuffer(b)
664 buf.EncodeInt32(m.Retval)
665 return buf.Bytes(), nil
667 func (m *MactimeEnableDisableReply) Unmarshal(b []byte) error {
668 buf := codec.NewBuffer(b)
669 m.Retval = buf.DecodeInt32()
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")
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),
691 (*MactimeDumpReply)(nil),
692 (*MactimeEnableDisable)(nil),
693 (*MactimeEnableDisableReply)(nil),