1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.5.0-dev
5 // source: /usr/share/vpp/api/core/policer.api.json
7 // Package policer contains generated bindings for API file policer.api.
15 api "git.fd.io/govpp.git/api"
16 interface_types "git.fd.io/govpp.git/binapi/interface_types"
17 policer_types "git.fd.io/govpp.git/binapi/policer_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 = 0xf14848c
33 // PolicerAddDel defines message 'policer_add_del'.
34 type PolicerAddDel struct {
35 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
36 Name string `binapi:"string[64],name=name" json:"name,omitempty"`
37 Cir uint32 `binapi:"u32,name=cir" json:"cir,omitempty"`
38 Eir uint32 `binapi:"u32,name=eir" json:"eir,omitempty"`
39 Cb uint64 `binapi:"u64,name=cb" json:"cb,omitempty"`
40 Eb uint64 `binapi:"u64,name=eb" json:"eb,omitempty"`
41 RateType policer_types.Sse2QosRateType `binapi:"sse2_qos_rate_type,name=rate_type" json:"rate_type,omitempty"`
42 RoundType policer_types.Sse2QosRoundType `binapi:"sse2_qos_round_type,name=round_type" json:"round_type,omitempty"`
43 Type policer_types.Sse2QosPolicerType `binapi:"sse2_qos_policer_type,name=type" json:"type,omitempty"`
44 ColorAware bool `binapi:"bool,name=color_aware" json:"color_aware,omitempty"`
45 ConformAction policer_types.Sse2QosAction `binapi:"sse2_qos_action,name=conform_action" json:"conform_action,omitempty"`
46 ExceedAction policer_types.Sse2QosAction `binapi:"sse2_qos_action,name=exceed_action" json:"exceed_action,omitempty"`
47 ViolateAction policer_types.Sse2QosAction `binapi:"sse2_qos_action,name=violate_action" json:"violate_action,omitempty"`
50 func (m *PolicerAddDel) Reset() { *m = PolicerAddDel{} }
51 func (*PolicerAddDel) GetMessageName() string { return "policer_add_del" }
52 func (*PolicerAddDel) GetCrcString() string { return "2b31dd38" }
53 func (*PolicerAddDel) GetMessageType() api.MessageType {
54 return api.RequestMessage
57 func (m *PolicerAddDel) Size() (size int) {
67 size += 1 // m.RateType
68 size += 1 // m.RoundType
70 size += 1 // m.ColorAware
71 size += 1 // m.ConformAction.Type
72 size += 1 // m.ConformAction.Dscp
73 size += 1 // m.ExceedAction.Type
74 size += 1 // m.ExceedAction.Dscp
75 size += 1 // m.ViolateAction.Type
76 size += 1 // m.ViolateAction.Dscp
79 func (m *PolicerAddDel) Marshal(b []byte) ([]byte, error) {
81 b = make([]byte, m.Size())
83 buf := codec.NewBuffer(b)
84 buf.EncodeBool(m.IsAdd)
85 buf.EncodeString(m.Name, 64)
86 buf.EncodeUint32(m.Cir)
87 buf.EncodeUint32(m.Eir)
88 buf.EncodeUint64(m.Cb)
89 buf.EncodeUint64(m.Eb)
90 buf.EncodeUint8(uint8(m.RateType))
91 buf.EncodeUint8(uint8(m.RoundType))
92 buf.EncodeUint8(uint8(m.Type))
93 buf.EncodeBool(m.ColorAware)
94 buf.EncodeUint8(uint8(m.ConformAction.Type))
95 buf.EncodeUint8(m.ConformAction.Dscp)
96 buf.EncodeUint8(uint8(m.ExceedAction.Type))
97 buf.EncodeUint8(m.ExceedAction.Dscp)
98 buf.EncodeUint8(uint8(m.ViolateAction.Type))
99 buf.EncodeUint8(m.ViolateAction.Dscp)
100 return buf.Bytes(), nil
102 func (m *PolicerAddDel) Unmarshal(b []byte) error {
103 buf := codec.NewBuffer(b)
104 m.IsAdd = buf.DecodeBool()
105 m.Name = buf.DecodeString(64)
106 m.Cir = buf.DecodeUint32()
107 m.Eir = buf.DecodeUint32()
108 m.Cb = buf.DecodeUint64()
109 m.Eb = buf.DecodeUint64()
110 m.RateType = policer_types.Sse2QosRateType(buf.DecodeUint8())
111 m.RoundType = policer_types.Sse2QosRoundType(buf.DecodeUint8())
112 m.Type = policer_types.Sse2QosPolicerType(buf.DecodeUint8())
113 m.ColorAware = buf.DecodeBool()
114 m.ConformAction.Type = policer_types.Sse2QosActionType(buf.DecodeUint8())
115 m.ConformAction.Dscp = buf.DecodeUint8()
116 m.ExceedAction.Type = policer_types.Sse2QosActionType(buf.DecodeUint8())
117 m.ExceedAction.Dscp = buf.DecodeUint8()
118 m.ViolateAction.Type = policer_types.Sse2QosActionType(buf.DecodeUint8())
119 m.ViolateAction.Dscp = buf.DecodeUint8()
123 // PolicerAddDelReply defines message 'policer_add_del_reply'.
124 type PolicerAddDelReply struct {
125 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
126 PolicerIndex uint32 `binapi:"u32,name=policer_index" json:"policer_index,omitempty"`
129 func (m *PolicerAddDelReply) Reset() { *m = PolicerAddDelReply{} }
130 func (*PolicerAddDelReply) GetMessageName() string { return "policer_add_del_reply" }
131 func (*PolicerAddDelReply) GetCrcString() string { return "a177cef2" }
132 func (*PolicerAddDelReply) GetMessageType() api.MessageType {
133 return api.ReplyMessage
136 func (m *PolicerAddDelReply) Size() (size int) {
140 size += 4 // m.Retval
141 size += 4 // m.PolicerIndex
144 func (m *PolicerAddDelReply) Marshal(b []byte) ([]byte, error) {
146 b = make([]byte, m.Size())
148 buf := codec.NewBuffer(b)
149 buf.EncodeInt32(m.Retval)
150 buf.EncodeUint32(m.PolicerIndex)
151 return buf.Bytes(), nil
153 func (m *PolicerAddDelReply) Unmarshal(b []byte) error {
154 buf := codec.NewBuffer(b)
155 m.Retval = buf.DecodeInt32()
156 m.PolicerIndex = buf.DecodeUint32()
160 // PolicerBind defines message 'policer_bind'.
161 type PolicerBind struct {
162 Name string `binapi:"string[64],name=name" json:"name,omitempty"`
163 WorkerIndex uint32 `binapi:"u32,name=worker_index" json:"worker_index,omitempty"`
164 BindEnable bool `binapi:"bool,name=bind_enable" json:"bind_enable,omitempty"`
167 func (m *PolicerBind) Reset() { *m = PolicerBind{} }
168 func (*PolicerBind) GetMessageName() string { return "policer_bind" }
169 func (*PolicerBind) GetCrcString() string { return "dcf516f9" }
170 func (*PolicerBind) GetMessageType() api.MessageType {
171 return api.RequestMessage
174 func (m *PolicerBind) Size() (size int) {
179 size += 4 // m.WorkerIndex
180 size += 1 // m.BindEnable
183 func (m *PolicerBind) Marshal(b []byte) ([]byte, error) {
185 b = make([]byte, m.Size())
187 buf := codec.NewBuffer(b)
188 buf.EncodeString(m.Name, 64)
189 buf.EncodeUint32(m.WorkerIndex)
190 buf.EncodeBool(m.BindEnable)
191 return buf.Bytes(), nil
193 func (m *PolicerBind) Unmarshal(b []byte) error {
194 buf := codec.NewBuffer(b)
195 m.Name = buf.DecodeString(64)
196 m.WorkerIndex = buf.DecodeUint32()
197 m.BindEnable = buf.DecodeBool()
201 // PolicerBindReply defines message 'policer_bind_reply'.
202 type PolicerBindReply struct {
203 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
206 func (m *PolicerBindReply) Reset() { *m = PolicerBindReply{} }
207 func (*PolicerBindReply) GetMessageName() string { return "policer_bind_reply" }
208 func (*PolicerBindReply) GetCrcString() string { return "e8d4e804" }
209 func (*PolicerBindReply) GetMessageType() api.MessageType {
210 return api.ReplyMessage
213 func (m *PolicerBindReply) Size() (size int) {
217 size += 4 // m.Retval
220 func (m *PolicerBindReply) Marshal(b []byte) ([]byte, error) {
222 b = make([]byte, m.Size())
224 buf := codec.NewBuffer(b)
225 buf.EncodeInt32(m.Retval)
226 return buf.Bytes(), nil
228 func (m *PolicerBindReply) Unmarshal(b []byte) error {
229 buf := codec.NewBuffer(b)
230 m.Retval = buf.DecodeInt32()
234 // PolicerDetails defines message 'policer_details'.
235 type PolicerDetails struct {
236 Name string `binapi:"string[64],name=name" json:"name,omitempty"`
237 Cir uint32 `binapi:"u32,name=cir" json:"cir,omitempty"`
238 Eir uint32 `binapi:"u32,name=eir" json:"eir,omitempty"`
239 Cb uint64 `binapi:"u64,name=cb" json:"cb,omitempty"`
240 Eb uint64 `binapi:"u64,name=eb" json:"eb,omitempty"`
241 RateType policer_types.Sse2QosRateType `binapi:"sse2_qos_rate_type,name=rate_type" json:"rate_type,omitempty"`
242 RoundType policer_types.Sse2QosRoundType `binapi:"sse2_qos_round_type,name=round_type" json:"round_type,omitempty"`
243 Type policer_types.Sse2QosPolicerType `binapi:"sse2_qos_policer_type,name=type" json:"type,omitempty"`
244 ConformAction policer_types.Sse2QosAction `binapi:"sse2_qos_action,name=conform_action" json:"conform_action,omitempty"`
245 ExceedAction policer_types.Sse2QosAction `binapi:"sse2_qos_action,name=exceed_action" json:"exceed_action,omitempty"`
246 ViolateAction policer_types.Sse2QosAction `binapi:"sse2_qos_action,name=violate_action" json:"violate_action,omitempty"`
247 SingleRate bool `binapi:"bool,name=single_rate" json:"single_rate,omitempty"`
248 ColorAware bool `binapi:"bool,name=color_aware" json:"color_aware,omitempty"`
249 Scale uint32 `binapi:"u32,name=scale" json:"scale,omitempty"`
250 CirTokensPerPeriod uint32 `binapi:"u32,name=cir_tokens_per_period" json:"cir_tokens_per_period,omitempty"`
251 PirTokensPerPeriod uint32 `binapi:"u32,name=pir_tokens_per_period" json:"pir_tokens_per_period,omitempty"`
252 CurrentLimit uint32 `binapi:"u32,name=current_limit" json:"current_limit,omitempty"`
253 CurrentBucket uint32 `binapi:"u32,name=current_bucket" json:"current_bucket,omitempty"`
254 ExtendedLimit uint32 `binapi:"u32,name=extended_limit" json:"extended_limit,omitempty"`
255 ExtendedBucket uint32 `binapi:"u32,name=extended_bucket" json:"extended_bucket,omitempty"`
256 LastUpdateTime uint64 `binapi:"u64,name=last_update_time" json:"last_update_time,omitempty"`
259 func (m *PolicerDetails) Reset() { *m = PolicerDetails{} }
260 func (*PolicerDetails) GetMessageName() string { return "policer_details" }
261 func (*PolicerDetails) GetCrcString() string { return "72d0e248" }
262 func (*PolicerDetails) GetMessageType() api.MessageType {
263 return api.ReplyMessage
266 func (m *PolicerDetails) Size() (size int) {
275 size += 1 // m.RateType
276 size += 1 // m.RoundType
278 size += 1 // m.ConformAction.Type
279 size += 1 // m.ConformAction.Dscp
280 size += 1 // m.ExceedAction.Type
281 size += 1 // m.ExceedAction.Dscp
282 size += 1 // m.ViolateAction.Type
283 size += 1 // m.ViolateAction.Dscp
284 size += 1 // m.SingleRate
285 size += 1 // m.ColorAware
287 size += 4 // m.CirTokensPerPeriod
288 size += 4 // m.PirTokensPerPeriod
289 size += 4 // m.CurrentLimit
290 size += 4 // m.CurrentBucket
291 size += 4 // m.ExtendedLimit
292 size += 4 // m.ExtendedBucket
293 size += 8 // m.LastUpdateTime
296 func (m *PolicerDetails) Marshal(b []byte) ([]byte, error) {
298 b = make([]byte, m.Size())
300 buf := codec.NewBuffer(b)
301 buf.EncodeString(m.Name, 64)
302 buf.EncodeUint32(m.Cir)
303 buf.EncodeUint32(m.Eir)
304 buf.EncodeUint64(m.Cb)
305 buf.EncodeUint64(m.Eb)
306 buf.EncodeUint8(uint8(m.RateType))
307 buf.EncodeUint8(uint8(m.RoundType))
308 buf.EncodeUint8(uint8(m.Type))
309 buf.EncodeUint8(uint8(m.ConformAction.Type))
310 buf.EncodeUint8(m.ConformAction.Dscp)
311 buf.EncodeUint8(uint8(m.ExceedAction.Type))
312 buf.EncodeUint8(m.ExceedAction.Dscp)
313 buf.EncodeUint8(uint8(m.ViolateAction.Type))
314 buf.EncodeUint8(m.ViolateAction.Dscp)
315 buf.EncodeBool(m.SingleRate)
316 buf.EncodeBool(m.ColorAware)
317 buf.EncodeUint32(m.Scale)
318 buf.EncodeUint32(m.CirTokensPerPeriod)
319 buf.EncodeUint32(m.PirTokensPerPeriod)
320 buf.EncodeUint32(m.CurrentLimit)
321 buf.EncodeUint32(m.CurrentBucket)
322 buf.EncodeUint32(m.ExtendedLimit)
323 buf.EncodeUint32(m.ExtendedBucket)
324 buf.EncodeUint64(m.LastUpdateTime)
325 return buf.Bytes(), nil
327 func (m *PolicerDetails) Unmarshal(b []byte) error {
328 buf := codec.NewBuffer(b)
329 m.Name = buf.DecodeString(64)
330 m.Cir = buf.DecodeUint32()
331 m.Eir = buf.DecodeUint32()
332 m.Cb = buf.DecodeUint64()
333 m.Eb = buf.DecodeUint64()
334 m.RateType = policer_types.Sse2QosRateType(buf.DecodeUint8())
335 m.RoundType = policer_types.Sse2QosRoundType(buf.DecodeUint8())
336 m.Type = policer_types.Sse2QosPolicerType(buf.DecodeUint8())
337 m.ConformAction.Type = policer_types.Sse2QosActionType(buf.DecodeUint8())
338 m.ConformAction.Dscp = buf.DecodeUint8()
339 m.ExceedAction.Type = policer_types.Sse2QosActionType(buf.DecodeUint8())
340 m.ExceedAction.Dscp = buf.DecodeUint8()
341 m.ViolateAction.Type = policer_types.Sse2QosActionType(buf.DecodeUint8())
342 m.ViolateAction.Dscp = buf.DecodeUint8()
343 m.SingleRate = buf.DecodeBool()
344 m.ColorAware = buf.DecodeBool()
345 m.Scale = buf.DecodeUint32()
346 m.CirTokensPerPeriod = buf.DecodeUint32()
347 m.PirTokensPerPeriod = buf.DecodeUint32()
348 m.CurrentLimit = buf.DecodeUint32()
349 m.CurrentBucket = buf.DecodeUint32()
350 m.ExtendedLimit = buf.DecodeUint32()
351 m.ExtendedBucket = buf.DecodeUint32()
352 m.LastUpdateTime = buf.DecodeUint64()
356 // PolicerDump defines message 'policer_dump'.
357 type PolicerDump struct {
358 MatchNameValid bool `binapi:"bool,name=match_name_valid" json:"match_name_valid,omitempty"`
359 MatchName string `binapi:"string[64],name=match_name" json:"match_name,omitempty"`
362 func (m *PolicerDump) Reset() { *m = PolicerDump{} }
363 func (*PolicerDump) GetMessageName() string { return "policer_dump" }
364 func (*PolicerDump) GetCrcString() string { return "35f1ae0f" }
365 func (*PolicerDump) GetMessageType() api.MessageType {
366 return api.RequestMessage
369 func (m *PolicerDump) Size() (size int) {
373 size += 1 // m.MatchNameValid
374 size += 64 // m.MatchName
377 func (m *PolicerDump) Marshal(b []byte) ([]byte, error) {
379 b = make([]byte, m.Size())
381 buf := codec.NewBuffer(b)
382 buf.EncodeBool(m.MatchNameValid)
383 buf.EncodeString(m.MatchName, 64)
384 return buf.Bytes(), nil
386 func (m *PolicerDump) Unmarshal(b []byte) error {
387 buf := codec.NewBuffer(b)
388 m.MatchNameValid = buf.DecodeBool()
389 m.MatchName = buf.DecodeString(64)
393 // PolicerInput defines message 'policer_input'.
394 type PolicerInput struct {
395 Name string `binapi:"string[64],name=name" json:"name,omitempty"`
396 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
397 Apply bool `binapi:"bool,name=apply" json:"apply,omitempty"`
400 func (m *PolicerInput) Reset() { *m = PolicerInput{} }
401 func (*PolicerInput) GetMessageName() string { return "policer_input" }
402 func (*PolicerInput) GetCrcString() string { return "233f0ef5" }
403 func (*PolicerInput) GetMessageType() api.MessageType {
404 return api.RequestMessage
407 func (m *PolicerInput) Size() (size int) {
412 size += 4 // m.SwIfIndex
416 func (m *PolicerInput) Marshal(b []byte) ([]byte, error) {
418 b = make([]byte, m.Size())
420 buf := codec.NewBuffer(b)
421 buf.EncodeString(m.Name, 64)
422 buf.EncodeUint32(uint32(m.SwIfIndex))
423 buf.EncodeBool(m.Apply)
424 return buf.Bytes(), nil
426 func (m *PolicerInput) Unmarshal(b []byte) error {
427 buf := codec.NewBuffer(b)
428 m.Name = buf.DecodeString(64)
429 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
430 m.Apply = buf.DecodeBool()
434 // PolicerInputReply defines message 'policer_input_reply'.
435 type PolicerInputReply struct {
436 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
439 func (m *PolicerInputReply) Reset() { *m = PolicerInputReply{} }
440 func (*PolicerInputReply) GetMessageName() string { return "policer_input_reply" }
441 func (*PolicerInputReply) GetCrcString() string { return "e8d4e804" }
442 func (*PolicerInputReply) GetMessageType() api.MessageType {
443 return api.ReplyMessage
446 func (m *PolicerInputReply) Size() (size int) {
450 size += 4 // m.Retval
453 func (m *PolicerInputReply) Marshal(b []byte) ([]byte, error) {
455 b = make([]byte, m.Size())
457 buf := codec.NewBuffer(b)
458 buf.EncodeInt32(m.Retval)
459 return buf.Bytes(), nil
461 func (m *PolicerInputReply) Unmarshal(b []byte) error {
462 buf := codec.NewBuffer(b)
463 m.Retval = buf.DecodeInt32()
467 func init() { file_policer_binapi_init() }
468 func file_policer_binapi_init() {
469 api.RegisterMessage((*PolicerAddDel)(nil), "policer_add_del_2b31dd38")
470 api.RegisterMessage((*PolicerAddDelReply)(nil), "policer_add_del_reply_a177cef2")
471 api.RegisterMessage((*PolicerBind)(nil), "policer_bind_dcf516f9")
472 api.RegisterMessage((*PolicerBindReply)(nil), "policer_bind_reply_e8d4e804")
473 api.RegisterMessage((*PolicerDetails)(nil), "policer_details_72d0e248")
474 api.RegisterMessage((*PolicerDump)(nil), "policer_dump_35f1ae0f")
475 api.RegisterMessage((*PolicerInput)(nil), "policer_input_233f0ef5")
476 api.RegisterMessage((*PolicerInputReply)(nil), "policer_input_reply_e8d4e804")
479 // Messages returns list of all messages in this module.
480 func AllMessages() []api.Message {
481 return []api.Message{
482 (*PolicerAddDel)(nil),
483 (*PolicerAddDelReply)(nil),
485 (*PolicerBindReply)(nil),
486 (*PolicerDetails)(nil),
488 (*PolicerInput)(nil),
489 (*PolicerInputReply)(nil),