1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0
4 // VPP: 20.05.1-release
5 // source: /usr/share/vpp/api/plugins/mactime.api.json
7 // Package mactime contains generated bindings for API file mactime.api.
16 api "git.fd.io/govpp.git/api"
17 ethernet_types "git.fd.io/govpp.git/binapi/ethernet_types"
18 interface_types "git.fd.io/govpp.git/binapi/interface_types"
19 codec "git.fd.io/govpp.git/codec"
22 // This is a compile-time assertion to ensure that this generated file
23 // is compatible with the GoVPP api package it is being compiled against.
24 // A compilation error at this line likely means your copy of the
25 // GoVPP api package needs to be updated.
26 const _ = api.GoVppAPIPackageIsVersion2
31 VersionCrc = 0x9283d3e
34 // MactimeTimeRange defines type 'mactime_time_range'.
35 type MactimeTimeRange struct {
36 Start float64 `binapi:"f64,name=start" json:"start,omitempty"`
37 End float64 `binapi:"f64,name=end" json:"end,omitempty"`
40 // TimeRange defines type 'time_range'.
41 type TimeRange struct {
42 Start float64 `binapi:"f64,name=start" json:"start,omitempty"`
43 End float64 `binapi:"f64,name=end" json:"end,omitempty"`
46 // MactimeAddDelRange defines message 'mactime_add_del_range'.
47 type MactimeAddDelRange struct {
48 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
49 Drop bool `binapi:"bool,name=drop" json:"drop,omitempty"`
50 Allow bool `binapi:"bool,name=allow" json:"allow,omitempty"`
51 AllowQuota uint8 `binapi:"u8,name=allow_quota" json:"allow_quota,omitempty"`
52 NoUDP10001 bool `binapi:"bool,name=no_udp_10001" json:"no_udp_10001,omitempty"`
53 DataQuota uint64 `binapi:"u64,name=data_quota" json:"data_quota,omitempty"`
54 MacAddress ethernet_types.MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
55 DeviceName string `binapi:"string[64],name=device_name" json:"device_name,omitempty"`
56 Count uint32 `binapi:"u32,name=count" json:"-"`
57 Ranges []TimeRange `binapi:"time_range[count],name=ranges" json:"ranges,omitempty"`
60 func (m *MactimeAddDelRange) Reset() { *m = MactimeAddDelRange{} }
61 func (*MactimeAddDelRange) GetMessageName() string { return "mactime_add_del_range" }
62 func (*MactimeAddDelRange) GetCrcString() string { return "101858ef" }
63 func (*MactimeAddDelRange) GetMessageType() api.MessageType {
64 return api.RequestMessage
67 func (m *MactimeAddDelRange) Size() (size int) {
74 size += 1 // m.AllowQuota
75 size += 1 // m.NoUDP10001
76 size += 8 // m.DataQuota
77 size += 1 * 6 // m.MacAddress
78 size += 64 // m.DeviceName
80 for j1 := 0; j1 < len(m.Ranges); j1++ {
83 if j1 < len(m.Ranges) {
91 func (m *MactimeAddDelRange) Marshal(b []byte) ([]byte, error) {
93 b = make([]byte, m.Size())
95 buf := codec.NewBuffer(b)
96 buf.EncodeBool(m.IsAdd)
97 buf.EncodeBool(m.Drop)
98 buf.EncodeBool(m.Allow)
99 buf.EncodeUint8(m.AllowQuota)
100 buf.EncodeBool(m.NoUDP10001)
101 buf.EncodeUint64(m.DataQuota)
102 buf.EncodeBytes(m.MacAddress[:], 6)
103 buf.EncodeString(m.DeviceName, 64)
104 buf.EncodeUint32(uint32(len(m.Ranges)))
105 for j0 := 0; j0 < len(m.Ranges); j0++ {
106 var v0 TimeRange // Ranges
107 if j0 < len(m.Ranges) {
110 buf.EncodeFloat64(v0.Start)
111 buf.EncodeFloat64(v0.End)
113 return buf.Bytes(), nil
115 func (m *MactimeAddDelRange) Unmarshal(b []byte) error {
116 buf := codec.NewBuffer(b)
117 m.IsAdd = buf.DecodeBool()
118 m.Drop = buf.DecodeBool()
119 m.Allow = buf.DecodeBool()
120 m.AllowQuota = buf.DecodeUint8()
121 m.NoUDP10001 = buf.DecodeBool()
122 m.DataQuota = buf.DecodeUint64()
123 copy(m.MacAddress[:], buf.DecodeBytes(6))
124 m.DeviceName = buf.DecodeString(64)
125 m.Count = buf.DecodeUint32()
126 m.Ranges = make([]TimeRange, m.Count)
127 for j0 := 0; j0 < len(m.Ranges); j0++ {
128 m.Ranges[j0].Start = buf.DecodeFloat64()
129 m.Ranges[j0].End = buf.DecodeFloat64()
134 // MactimeAddDelRangeReply defines message 'mactime_add_del_range_reply'.
135 type MactimeAddDelRangeReply struct {
136 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
139 func (m *MactimeAddDelRangeReply) Reset() { *m = MactimeAddDelRangeReply{} }
140 func (*MactimeAddDelRangeReply) GetMessageName() string { return "mactime_add_del_range_reply" }
141 func (*MactimeAddDelRangeReply) GetCrcString() string { return "e8d4e804" }
142 func (*MactimeAddDelRangeReply) GetMessageType() api.MessageType {
143 return api.ReplyMessage
146 func (m *MactimeAddDelRangeReply) Size() (size int) {
150 size += 4 // m.Retval
153 func (m *MactimeAddDelRangeReply) Marshal(b []byte) ([]byte, error) {
155 b = make([]byte, m.Size())
157 buf := codec.NewBuffer(b)
158 buf.EncodeInt32(m.Retval)
159 return buf.Bytes(), nil
161 func (m *MactimeAddDelRangeReply) Unmarshal(b []byte) error {
162 buf := codec.NewBuffer(b)
163 m.Retval = buf.DecodeInt32()
167 // MactimeDetails defines message 'mactime_details'.
168 type MactimeDetails struct {
169 PoolIndex uint32 `binapi:"u32,name=pool_index" json:"pool_index,omitempty"`
170 MacAddress ethernet_types.MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
171 DataQuota uint64 `binapi:"u64,name=data_quota" json:"data_quota,omitempty"`
172 DataUsedInRange uint64 `binapi:"u64,name=data_used_in_range" json:"data_used_in_range,omitempty"`
173 Flags uint32 `binapi:"u32,name=flags" json:"flags,omitempty"`
174 DeviceName string `binapi:"string[64],name=device_name" json:"device_name,omitempty"`
175 Nranges uint32 `binapi:"u32,name=nranges" json:"-"`
176 Ranges []MactimeTimeRange `binapi:"mactime_time_range[nranges],name=ranges" json:"ranges,omitempty"`
179 func (m *MactimeDetails) Reset() { *m = MactimeDetails{} }
180 func (*MactimeDetails) GetMessageName() string { return "mactime_details" }
181 func (*MactimeDetails) GetCrcString() string { return "44921c06" }
182 func (*MactimeDetails) GetMessageType() api.MessageType {
183 return api.ReplyMessage
186 func (m *MactimeDetails) Size() (size int) {
190 size += 4 // m.PoolIndex
191 size += 1 * 6 // m.MacAddress
192 size += 8 // m.DataQuota
193 size += 8 // m.DataUsedInRange
195 size += 64 // m.DeviceName
196 size += 4 // m.Nranges
197 for j1 := 0; j1 < len(m.Ranges); j1++ {
198 var s1 MactimeTimeRange
200 if j1 < len(m.Ranges) {
203 size += 8 // s1.Start
208 func (m *MactimeDetails) Marshal(b []byte) ([]byte, error) {
210 b = make([]byte, m.Size())
212 buf := codec.NewBuffer(b)
213 buf.EncodeUint32(m.PoolIndex)
214 buf.EncodeBytes(m.MacAddress[:], 6)
215 buf.EncodeUint64(m.DataQuota)
216 buf.EncodeUint64(m.DataUsedInRange)
217 buf.EncodeUint32(m.Flags)
218 buf.EncodeString(m.DeviceName, 64)
219 buf.EncodeUint32(uint32(len(m.Ranges)))
220 for j0 := 0; j0 < len(m.Ranges); j0++ {
221 var v0 MactimeTimeRange // Ranges
222 if j0 < len(m.Ranges) {
225 buf.EncodeFloat64(v0.Start)
226 buf.EncodeFloat64(v0.End)
228 return buf.Bytes(), nil
230 func (m *MactimeDetails) Unmarshal(b []byte) error {
231 buf := codec.NewBuffer(b)
232 m.PoolIndex = buf.DecodeUint32()
233 copy(m.MacAddress[:], buf.DecodeBytes(6))
234 m.DataQuota = buf.DecodeUint64()
235 m.DataUsedInRange = buf.DecodeUint64()
236 m.Flags = buf.DecodeUint32()
237 m.DeviceName = buf.DecodeString(64)
238 m.Nranges = buf.DecodeUint32()
239 m.Ranges = make([]MactimeTimeRange, m.Nranges)
240 for j0 := 0; j0 < len(m.Ranges); j0++ {
241 m.Ranges[j0].Start = buf.DecodeFloat64()
242 m.Ranges[j0].End = buf.DecodeFloat64()
247 // MactimeDump defines message 'mactime_dump'.
248 type MactimeDump struct {
249 MyTableEpoch uint32 `binapi:"u32,name=my_table_epoch" json:"my_table_epoch,omitempty"`
252 func (m *MactimeDump) Reset() { *m = MactimeDump{} }
253 func (*MactimeDump) GetMessageName() string { return "mactime_dump" }
254 func (*MactimeDump) GetCrcString() string { return "8f454e23" }
255 func (*MactimeDump) GetMessageType() api.MessageType {
256 return api.RequestMessage
259 func (m *MactimeDump) Size() (size int) {
263 size += 4 // m.MyTableEpoch
266 func (m *MactimeDump) Marshal(b []byte) ([]byte, error) {
268 b = make([]byte, m.Size())
270 buf := codec.NewBuffer(b)
271 buf.EncodeUint32(m.MyTableEpoch)
272 return buf.Bytes(), nil
274 func (m *MactimeDump) Unmarshal(b []byte) error {
275 buf := codec.NewBuffer(b)
276 m.MyTableEpoch = buf.DecodeUint32()
280 // MactimeDumpReply defines message 'mactime_dump_reply'.
281 type MactimeDumpReply struct {
282 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
283 TableEpoch uint32 `binapi:"u32,name=table_epoch" json:"table_epoch,omitempty"`
286 func (m *MactimeDumpReply) Reset() { *m = MactimeDumpReply{} }
287 func (*MactimeDumpReply) GetMessageName() string { return "mactime_dump_reply" }
288 func (*MactimeDumpReply) GetCrcString() string { return "49bcc753" }
289 func (*MactimeDumpReply) GetMessageType() api.MessageType {
290 return api.ReplyMessage
293 func (m *MactimeDumpReply) Size() (size int) {
297 size += 4 // m.Retval
298 size += 4 // m.TableEpoch
301 func (m *MactimeDumpReply) Marshal(b []byte) ([]byte, error) {
303 b = make([]byte, m.Size())
305 buf := codec.NewBuffer(b)
306 buf.EncodeInt32(m.Retval)
307 buf.EncodeUint32(m.TableEpoch)
308 return buf.Bytes(), nil
310 func (m *MactimeDumpReply) Unmarshal(b []byte) error {
311 buf := codec.NewBuffer(b)
312 m.Retval = buf.DecodeInt32()
313 m.TableEpoch = buf.DecodeUint32()
317 // MactimeEnableDisable defines message 'mactime_enable_disable'.
318 type MactimeEnableDisable struct {
319 EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
320 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
323 func (m *MactimeEnableDisable) Reset() { *m = MactimeEnableDisable{} }
324 func (*MactimeEnableDisable) GetMessageName() string { return "mactime_enable_disable" }
325 func (*MactimeEnableDisable) GetCrcString() string { return "3865946c" }
326 func (*MactimeEnableDisable) GetMessageType() api.MessageType {
327 return api.RequestMessage
330 func (m *MactimeEnableDisable) Size() (size int) {
334 size += 1 // m.EnableDisable
335 size += 4 // m.SwIfIndex
338 func (m *MactimeEnableDisable) Marshal(b []byte) ([]byte, error) {
340 b = make([]byte, m.Size())
342 buf := codec.NewBuffer(b)
343 buf.EncodeBool(m.EnableDisable)
344 buf.EncodeUint32(uint32(m.SwIfIndex))
345 return buf.Bytes(), nil
347 func (m *MactimeEnableDisable) Unmarshal(b []byte) error {
348 buf := codec.NewBuffer(b)
349 m.EnableDisable = buf.DecodeBool()
350 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
354 // MactimeEnableDisableReply defines message 'mactime_enable_disable_reply'.
355 type MactimeEnableDisableReply struct {
356 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
359 func (m *MactimeEnableDisableReply) Reset() { *m = MactimeEnableDisableReply{} }
360 func (*MactimeEnableDisableReply) GetMessageName() string { return "mactime_enable_disable_reply" }
361 func (*MactimeEnableDisableReply) GetCrcString() string { return "e8d4e804" }
362 func (*MactimeEnableDisableReply) GetMessageType() api.MessageType {
363 return api.ReplyMessage
366 func (m *MactimeEnableDisableReply) Size() (size int) {
370 size += 4 // m.Retval
373 func (m *MactimeEnableDisableReply) Marshal(b []byte) ([]byte, error) {
375 b = make([]byte, m.Size())
377 buf := codec.NewBuffer(b)
378 buf.EncodeInt32(m.Retval)
379 return buf.Bytes(), nil
381 func (m *MactimeEnableDisableReply) Unmarshal(b []byte) error {
382 buf := codec.NewBuffer(b)
383 m.Retval = buf.DecodeInt32()
387 func init() { file_mactime_binapi_init() }
388 func file_mactime_binapi_init() {
389 api.RegisterMessage((*MactimeAddDelRange)(nil), "mactime_add_del_range_101858ef")
390 api.RegisterMessage((*MactimeAddDelRangeReply)(nil), "mactime_add_del_range_reply_e8d4e804")
391 api.RegisterMessage((*MactimeDetails)(nil), "mactime_details_44921c06")
392 api.RegisterMessage((*MactimeDump)(nil), "mactime_dump_8f454e23")
393 api.RegisterMessage((*MactimeDumpReply)(nil), "mactime_dump_reply_49bcc753")
394 api.RegisterMessage((*MactimeEnableDisable)(nil), "mactime_enable_disable_3865946c")
395 api.RegisterMessage((*MactimeEnableDisableReply)(nil), "mactime_enable_disable_reply_e8d4e804")
398 // Messages returns list of all messages in this module.
399 func AllMessages() []api.Message {
400 return []api.Message{
401 (*MactimeAddDelRange)(nil),
402 (*MactimeAddDelRangeReply)(nil),
403 (*MactimeDetails)(nil),
405 (*MactimeDumpReply)(nil),
406 (*MactimeEnableDisable)(nil),
407 (*MactimeEnableDisableReply)(nil),