1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
6 // Package mactime contains generated bindings for API file mactime.api.
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"
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
30 VersionCrc = 0x9283d3e
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"`
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"`
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"`
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
66 func (m *MactimeAddDelRange) Size() (size int) {
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
79 for j1 := 0; j1 < len(m.Ranges); j1++ {
82 if j1 < len(m.Ranges) {
90 func (m *MactimeAddDelRange) Marshal(b []byte) ([]byte, error) {
92 b = make([]byte, m.Size())
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) {
109 buf.EncodeFloat64(v0.Start)
110 buf.EncodeFloat64(v0.End)
112 return buf.Bytes(), nil
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()
133 // MactimeAddDelRangeReply defines message 'mactime_add_del_range_reply'.
134 type MactimeAddDelRangeReply struct {
135 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
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
145 func (m *MactimeAddDelRangeReply) Size() (size int) {
149 size += 4 // m.Retval
152 func (m *MactimeAddDelRangeReply) Marshal(b []byte) ([]byte, error) {
154 b = make([]byte, m.Size())
156 buf := codec.NewBuffer(b)
157 buf.EncodeInt32(m.Retval)
158 return buf.Bytes(), nil
160 func (m *MactimeAddDelRangeReply) Unmarshal(b []byte) error {
161 buf := codec.NewBuffer(b)
162 m.Retval = buf.DecodeInt32()
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"`
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
185 func (m *MactimeDetails) Size() (size int) {
189 size += 4 // m.PoolIndex
190 size += 1 * 6 // m.MacAddress
191 size += 8 // m.DataQuota
192 size += 8 // m.DataUsedInRange
194 size += 64 // m.DeviceName
195 size += 4 // m.Nranges
196 for j1 := 0; j1 < len(m.Ranges); j1++ {
197 var s1 MactimeTimeRange
199 if j1 < len(m.Ranges) {
202 size += 8 // s1.Start
207 func (m *MactimeDetails) Marshal(b []byte) ([]byte, error) {
209 b = make([]byte, m.Size())
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) {
224 buf.EncodeFloat64(v0.Start)
225 buf.EncodeFloat64(v0.End)
227 return buf.Bytes(), nil
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()
246 // MactimeDump defines message 'mactime_dump'.
247 type MactimeDump struct {
248 MyTableEpoch uint32 `binapi:"u32,name=my_table_epoch" json:"my_table_epoch,omitempty"`
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
258 func (m *MactimeDump) Size() (size int) {
262 size += 4 // m.MyTableEpoch
265 func (m *MactimeDump) Marshal(b []byte) ([]byte, error) {
267 b = make([]byte, m.Size())
269 buf := codec.NewBuffer(b)
270 buf.EncodeUint32(m.MyTableEpoch)
271 return buf.Bytes(), nil
273 func (m *MactimeDump) Unmarshal(b []byte) error {
274 buf := codec.NewBuffer(b)
275 m.MyTableEpoch = buf.DecodeUint32()
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"`
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
292 func (m *MactimeDumpReply) Size() (size int) {
296 size += 4 // m.Retval
297 size += 4 // m.TableEpoch
300 func (m *MactimeDumpReply) Marshal(b []byte) ([]byte, error) {
302 b = make([]byte, m.Size())
304 buf := codec.NewBuffer(b)
305 buf.EncodeInt32(m.Retval)
306 buf.EncodeUint32(m.TableEpoch)
307 return buf.Bytes(), nil
309 func (m *MactimeDumpReply) Unmarshal(b []byte) error {
310 buf := codec.NewBuffer(b)
311 m.Retval = buf.DecodeInt32()
312 m.TableEpoch = buf.DecodeUint32()
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"`
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
329 func (m *MactimeEnableDisable) Size() (size int) {
333 size += 1 // m.EnableDisable
334 size += 4 // m.SwIfIndex
337 func (m *MactimeEnableDisable) Marshal(b []byte) ([]byte, error) {
339 b = make([]byte, m.Size())
341 buf := codec.NewBuffer(b)
342 buf.EncodeBool(m.EnableDisable)
343 buf.EncodeUint32(uint32(m.SwIfIndex))
344 return buf.Bytes(), nil
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())
353 // MactimeEnableDisableReply defines message 'mactime_enable_disable_reply'.
354 type MactimeEnableDisableReply struct {
355 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
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
365 func (m *MactimeEnableDisableReply) Size() (size int) {
369 size += 4 // m.Retval
372 func (m *MactimeEnableDisableReply) Marshal(b []byte) ([]byte, error) {
374 b = make([]byte, m.Size())
376 buf := codec.NewBuffer(b)
377 buf.EncodeInt32(m.Retval)
378 return buf.Bytes(), nil
380 func (m *MactimeEnableDisableReply) Unmarshal(b []byte) error {
381 buf := codec.NewBuffer(b)
382 m.Retval = buf.DecodeInt32()
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")
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),
404 (*MactimeDumpReply)(nil),
405 (*MactimeEnableDisable)(nil),
406 (*MactimeEnableDisableReply)(nil),