1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
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() int {
75 size += 1 // m.AllowQuota
76 size += 1 // m.NoUDP10001
77 size += 8 // m.DataQuota
78 size += 1 * 6 // m.MacAddress
79 size += 64 // m.DeviceName
81 for j1 := 0; j1 < len(m.Ranges); j1++ {
84 if j1 < len(m.Ranges) {
92 func (m *MactimeAddDelRange) Marshal(b []byte) ([]byte, error) {
95 buf = codec.NewBuffer(make([]byte, m.Size()))
97 buf = codec.NewBuffer(b)
99 buf.EncodeBool(m.IsAdd)
100 buf.EncodeBool(m.Drop)
101 buf.EncodeBool(m.Allow)
102 buf.EncodeUint8(uint8(m.AllowQuota))
103 buf.EncodeBool(m.NoUDP10001)
104 buf.EncodeUint64(uint64(m.DataQuota))
105 buf.EncodeBytes(m.MacAddress[:], 6)
106 buf.EncodeString(m.DeviceName, 64)
107 buf.EncodeUint32(uint32(len(m.Ranges)))
108 for j0 := 0; j0 < len(m.Ranges); j0++ {
110 if j0 < len(m.Ranges) {
113 buf.EncodeFloat64(float64(v0.Start))
114 buf.EncodeFloat64(float64(v0.End))
116 return buf.Bytes(), nil
118 func (m *MactimeAddDelRange) Unmarshal(b []byte) error {
119 buf := codec.NewBuffer(b)
120 m.IsAdd = buf.DecodeBool()
121 m.Drop = buf.DecodeBool()
122 m.Allow = buf.DecodeBool()
123 m.AllowQuota = buf.DecodeUint8()
124 m.NoUDP10001 = buf.DecodeBool()
125 m.DataQuota = buf.DecodeUint64()
126 copy(m.MacAddress[:], buf.DecodeBytes(6))
127 m.DeviceName = buf.DecodeString(64)
128 m.Count = buf.DecodeUint32()
129 m.Ranges = make([]TimeRange, int(m.Count))
130 for j0 := 0; j0 < len(m.Ranges); j0++ {
131 m.Ranges[j0].Start = float64(buf.DecodeFloat64())
132 m.Ranges[j0].End = float64(buf.DecodeFloat64())
137 // MactimeAddDelRangeReply defines message 'mactime_add_del_range_reply'.
138 type MactimeAddDelRangeReply struct {
139 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
142 func (m *MactimeAddDelRangeReply) Reset() { *m = MactimeAddDelRangeReply{} }
143 func (*MactimeAddDelRangeReply) GetMessageName() string { return "mactime_add_del_range_reply" }
144 func (*MactimeAddDelRangeReply) GetCrcString() string { return "e8d4e804" }
145 func (*MactimeAddDelRangeReply) GetMessageType() api.MessageType {
146 return api.ReplyMessage
149 func (m *MactimeAddDelRangeReply) Size() int {
154 size += 4 // m.Retval
157 func (m *MactimeAddDelRangeReply) Marshal(b []byte) ([]byte, error) {
158 var buf *codec.Buffer
160 buf = codec.NewBuffer(make([]byte, m.Size()))
162 buf = codec.NewBuffer(b)
164 buf.EncodeUint32(uint32(m.Retval))
165 return buf.Bytes(), nil
167 func (m *MactimeAddDelRangeReply) Unmarshal(b []byte) error {
168 buf := codec.NewBuffer(b)
169 m.Retval = int32(buf.DecodeUint32())
173 // MactimeDetails defines message 'mactime_details'.
174 type MactimeDetails struct {
175 PoolIndex uint32 `binapi:"u32,name=pool_index" json:"pool_index,omitempty"`
176 MacAddress ethernet_types.MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
177 DataQuota uint64 `binapi:"u64,name=data_quota" json:"data_quota,omitempty"`
178 DataUsedInRange uint64 `binapi:"u64,name=data_used_in_range" json:"data_used_in_range,omitempty"`
179 Flags uint32 `binapi:"u32,name=flags" json:"flags,omitempty"`
180 DeviceName string `binapi:"string[64],name=device_name" json:"device_name,omitempty"`
181 Nranges uint32 `binapi:"u32,name=nranges" json:"-"`
182 Ranges []MactimeTimeRange `binapi:"mactime_time_range[nranges],name=ranges" json:"ranges,omitempty"`
185 func (m *MactimeDetails) Reset() { *m = MactimeDetails{} }
186 func (*MactimeDetails) GetMessageName() string { return "mactime_details" }
187 func (*MactimeDetails) GetCrcString() string { return "44921c06" }
188 func (*MactimeDetails) GetMessageType() api.MessageType {
189 return api.ReplyMessage
192 func (m *MactimeDetails) Size() int {
197 size += 4 // m.PoolIndex
198 size += 1 * 6 // m.MacAddress
199 size += 8 // m.DataQuota
200 size += 8 // m.DataUsedInRange
202 size += 64 // m.DeviceName
203 size += 4 // m.Nranges
204 for j1 := 0; j1 < len(m.Ranges); j1++ {
205 var s1 MactimeTimeRange
207 if j1 < len(m.Ranges) {
210 size += 8 // s1.Start
215 func (m *MactimeDetails) Marshal(b []byte) ([]byte, error) {
216 var buf *codec.Buffer
218 buf = codec.NewBuffer(make([]byte, m.Size()))
220 buf = codec.NewBuffer(b)
222 buf.EncodeUint32(uint32(m.PoolIndex))
223 buf.EncodeBytes(m.MacAddress[:], 6)
224 buf.EncodeUint64(uint64(m.DataQuota))
225 buf.EncodeUint64(uint64(m.DataUsedInRange))
226 buf.EncodeUint32(uint32(m.Flags))
227 buf.EncodeString(m.DeviceName, 64)
228 buf.EncodeUint32(uint32(len(m.Ranges)))
229 for j0 := 0; j0 < len(m.Ranges); j0++ {
230 var v0 MactimeTimeRange
231 if j0 < len(m.Ranges) {
234 buf.EncodeFloat64(float64(v0.Start))
235 buf.EncodeFloat64(float64(v0.End))
237 return buf.Bytes(), nil
239 func (m *MactimeDetails) Unmarshal(b []byte) error {
240 buf := codec.NewBuffer(b)
241 m.PoolIndex = buf.DecodeUint32()
242 copy(m.MacAddress[:], buf.DecodeBytes(6))
243 m.DataQuota = buf.DecodeUint64()
244 m.DataUsedInRange = buf.DecodeUint64()
245 m.Flags = buf.DecodeUint32()
246 m.DeviceName = buf.DecodeString(64)
247 m.Nranges = buf.DecodeUint32()
248 m.Ranges = make([]MactimeTimeRange, int(m.Nranges))
249 for j0 := 0; j0 < len(m.Ranges); j0++ {
250 m.Ranges[j0].Start = float64(buf.DecodeFloat64())
251 m.Ranges[j0].End = float64(buf.DecodeFloat64())
256 // MactimeDump defines message 'mactime_dump'.
257 type MactimeDump struct {
258 MyTableEpoch uint32 `binapi:"u32,name=my_table_epoch" json:"my_table_epoch,omitempty"`
261 func (m *MactimeDump) Reset() { *m = MactimeDump{} }
262 func (*MactimeDump) GetMessageName() string { return "mactime_dump" }
263 func (*MactimeDump) GetCrcString() string { return "8f454e23" }
264 func (*MactimeDump) GetMessageType() api.MessageType {
265 return api.RequestMessage
268 func (m *MactimeDump) Size() int {
273 size += 4 // m.MyTableEpoch
276 func (m *MactimeDump) Marshal(b []byte) ([]byte, error) {
277 var buf *codec.Buffer
279 buf = codec.NewBuffer(make([]byte, m.Size()))
281 buf = codec.NewBuffer(b)
283 buf.EncodeUint32(uint32(m.MyTableEpoch))
284 return buf.Bytes(), nil
286 func (m *MactimeDump) Unmarshal(b []byte) error {
287 buf := codec.NewBuffer(b)
288 m.MyTableEpoch = buf.DecodeUint32()
292 // MactimeDumpReply defines message 'mactime_dump_reply'.
293 type MactimeDumpReply struct {
294 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
295 TableEpoch uint32 `binapi:"u32,name=table_epoch" json:"table_epoch,omitempty"`
298 func (m *MactimeDumpReply) Reset() { *m = MactimeDumpReply{} }
299 func (*MactimeDumpReply) GetMessageName() string { return "mactime_dump_reply" }
300 func (*MactimeDumpReply) GetCrcString() string { return "49bcc753" }
301 func (*MactimeDumpReply) GetMessageType() api.MessageType {
302 return api.ReplyMessage
305 func (m *MactimeDumpReply) Size() int {
310 size += 4 // m.Retval
311 size += 4 // m.TableEpoch
314 func (m *MactimeDumpReply) Marshal(b []byte) ([]byte, error) {
315 var buf *codec.Buffer
317 buf = codec.NewBuffer(make([]byte, m.Size()))
319 buf = codec.NewBuffer(b)
321 buf.EncodeUint32(uint32(m.Retval))
322 buf.EncodeUint32(uint32(m.TableEpoch))
323 return buf.Bytes(), nil
325 func (m *MactimeDumpReply) Unmarshal(b []byte) error {
326 buf := codec.NewBuffer(b)
327 m.Retval = int32(buf.DecodeUint32())
328 m.TableEpoch = buf.DecodeUint32()
332 // MactimeEnableDisable defines message 'mactime_enable_disable'.
333 type MactimeEnableDisable struct {
334 EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
335 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
338 func (m *MactimeEnableDisable) Reset() { *m = MactimeEnableDisable{} }
339 func (*MactimeEnableDisable) GetMessageName() string { return "mactime_enable_disable" }
340 func (*MactimeEnableDisable) GetCrcString() string { return "3865946c" }
341 func (*MactimeEnableDisable) GetMessageType() api.MessageType {
342 return api.RequestMessage
345 func (m *MactimeEnableDisable) Size() int {
350 size += 1 // m.EnableDisable
351 size += 4 // m.SwIfIndex
354 func (m *MactimeEnableDisable) Marshal(b []byte) ([]byte, error) {
355 var buf *codec.Buffer
357 buf = codec.NewBuffer(make([]byte, m.Size()))
359 buf = codec.NewBuffer(b)
361 buf.EncodeBool(m.EnableDisable)
362 buf.EncodeUint32(uint32(m.SwIfIndex))
363 return buf.Bytes(), nil
365 func (m *MactimeEnableDisable) Unmarshal(b []byte) error {
366 buf := codec.NewBuffer(b)
367 m.EnableDisable = buf.DecodeBool()
368 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
372 // MactimeEnableDisableReply defines message 'mactime_enable_disable_reply'.
373 type MactimeEnableDisableReply struct {
374 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
377 func (m *MactimeEnableDisableReply) Reset() { *m = MactimeEnableDisableReply{} }
378 func (*MactimeEnableDisableReply) GetMessageName() string { return "mactime_enable_disable_reply" }
379 func (*MactimeEnableDisableReply) GetCrcString() string { return "e8d4e804" }
380 func (*MactimeEnableDisableReply) GetMessageType() api.MessageType {
381 return api.ReplyMessage
384 func (m *MactimeEnableDisableReply) Size() int {
389 size += 4 // m.Retval
392 func (m *MactimeEnableDisableReply) Marshal(b []byte) ([]byte, error) {
393 var buf *codec.Buffer
395 buf = codec.NewBuffer(make([]byte, m.Size()))
397 buf = codec.NewBuffer(b)
399 buf.EncodeUint32(uint32(m.Retval))
400 return buf.Bytes(), nil
402 func (m *MactimeEnableDisableReply) Unmarshal(b []byte) error {
403 buf := codec.NewBuffer(b)
404 m.Retval = int32(buf.DecodeUint32())
408 func init() { file_mactime_binapi_init() }
409 func file_mactime_binapi_init() {
410 api.RegisterMessage((*MactimeAddDelRange)(nil), "mactime_add_del_range_101858ef")
411 api.RegisterMessage((*MactimeAddDelRangeReply)(nil), "mactime_add_del_range_reply_e8d4e804")
412 api.RegisterMessage((*MactimeDetails)(nil), "mactime_details_44921c06")
413 api.RegisterMessage((*MactimeDump)(nil), "mactime_dump_8f454e23")
414 api.RegisterMessage((*MactimeDumpReply)(nil), "mactime_dump_reply_49bcc753")
415 api.RegisterMessage((*MactimeEnableDisable)(nil), "mactime_enable_disable_3865946c")
416 api.RegisterMessage((*MactimeEnableDisableReply)(nil), "mactime_enable_disable_reply_e8d4e804")
419 // Messages returns list of all messages in this module.
420 func AllMessages() []api.Message {
421 return []api.Message{
422 (*MactimeAddDelRange)(nil),
423 (*MactimeAddDelRangeReply)(nil),
424 (*MactimeDetails)(nil),
426 (*MactimeDumpReply)(nil),
427 (*MactimeEnableDisable)(nil),
428 (*MactimeEnableDisableReply)(nil),