1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.5.0-dev
5 // source: .vppapi/core/policer.api.json
7 // Package policer contains generated bindings for API file policer.api.
15 api "git.fd.io/govpp.git/api"
16 codec "git.fd.io/govpp.git/codec"
19 // This is a compile-time assertion to ensure that this generated file
20 // is compatible with the GoVPP api package it is being compiled against.
21 // A compilation error at this line likely means your copy of the
22 // GoVPP api package needs to be updated.
23 const _ = api.GoVppAPIPackageIsVersion2
28 VersionCrc = 0x4218ed4f
31 // PolicerAddDel defines message 'policer_add_del'.
32 type PolicerAddDel struct {
33 IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
34 Name []byte `binapi:"u8[64],name=name" json:"name,omitempty"`
35 Cir uint32 `binapi:"u32,name=cir" json:"cir,omitempty"`
36 Eir uint32 `binapi:"u32,name=eir" json:"eir,omitempty"`
37 Cb uint64 `binapi:"u64,name=cb" json:"cb,omitempty"`
38 Eb uint64 `binapi:"u64,name=eb" json:"eb,omitempty"`
39 RateType uint8 `binapi:"u8,name=rate_type" json:"rate_type,omitempty"`
40 RoundType uint8 `binapi:"u8,name=round_type" json:"round_type,omitempty"`
41 Type uint8 `binapi:"u8,name=type" json:"type,omitempty"`
42 ColorAware uint8 `binapi:"u8,name=color_aware" json:"color_aware,omitempty"`
43 ConformActionType uint8 `binapi:"u8,name=conform_action_type" json:"conform_action_type,omitempty"`
44 ConformDscp uint8 `binapi:"u8,name=conform_dscp" json:"conform_dscp,omitempty"`
45 ExceedActionType uint8 `binapi:"u8,name=exceed_action_type" json:"exceed_action_type,omitempty"`
46 ExceedDscp uint8 `binapi:"u8,name=exceed_dscp" json:"exceed_dscp,omitempty"`
47 ViolateActionType uint8 `binapi:"u8,name=violate_action_type" json:"violate_action_type,omitempty"`
48 ViolateDscp uint8 `binapi:"u8,name=violate_dscp" json:"violate_dscp,omitempty"`
51 func (m *PolicerAddDel) Reset() { *m = PolicerAddDel{} }
52 func (*PolicerAddDel) GetMessageName() string { return "policer_add_del" }
53 func (*PolicerAddDel) GetCrcString() string { return "dfea2be8" }
54 func (*PolicerAddDel) GetMessageType() api.MessageType {
55 return api.RequestMessage
58 func (m *PolicerAddDel) Size() (size int) {
63 size += 1 * 64 // m.Name
68 size += 1 // m.RateType
69 size += 1 // m.RoundType
71 size += 1 // m.ColorAware
72 size += 1 // m.ConformActionType
73 size += 1 // m.ConformDscp
74 size += 1 // m.ExceedActionType
75 size += 1 // m.ExceedDscp
76 size += 1 // m.ViolateActionType
77 size += 1 // m.ViolateDscp
80 func (m *PolicerAddDel) Marshal(b []byte) ([]byte, error) {
82 b = make([]byte, m.Size())
84 buf := codec.NewBuffer(b)
85 buf.EncodeUint8(m.IsAdd)
86 buf.EncodeBytes(m.Name, 64)
87 buf.EncodeUint32(m.Cir)
88 buf.EncodeUint32(m.Eir)
89 buf.EncodeUint64(m.Cb)
90 buf.EncodeUint64(m.Eb)
91 buf.EncodeUint8(m.RateType)
92 buf.EncodeUint8(m.RoundType)
93 buf.EncodeUint8(m.Type)
94 buf.EncodeUint8(m.ColorAware)
95 buf.EncodeUint8(m.ConformActionType)
96 buf.EncodeUint8(m.ConformDscp)
97 buf.EncodeUint8(m.ExceedActionType)
98 buf.EncodeUint8(m.ExceedDscp)
99 buf.EncodeUint8(m.ViolateActionType)
100 buf.EncodeUint8(m.ViolateDscp)
101 return buf.Bytes(), nil
103 func (m *PolicerAddDel) Unmarshal(b []byte) error {
104 buf := codec.NewBuffer(b)
105 m.IsAdd = buf.DecodeUint8()
106 m.Name = make([]byte, 64)
107 copy(m.Name, buf.DecodeBytes(len(m.Name)))
108 m.Cir = buf.DecodeUint32()
109 m.Eir = buf.DecodeUint32()
110 m.Cb = buf.DecodeUint64()
111 m.Eb = buf.DecodeUint64()
112 m.RateType = buf.DecodeUint8()
113 m.RoundType = buf.DecodeUint8()
114 m.Type = buf.DecodeUint8()
115 m.ColorAware = buf.DecodeUint8()
116 m.ConformActionType = buf.DecodeUint8()
117 m.ConformDscp = buf.DecodeUint8()
118 m.ExceedActionType = buf.DecodeUint8()
119 m.ExceedDscp = buf.DecodeUint8()
120 m.ViolateActionType = buf.DecodeUint8()
121 m.ViolateDscp = buf.DecodeUint8()
125 // PolicerAddDelReply defines message 'policer_add_del_reply'.
126 type PolicerAddDelReply struct {
127 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
128 PolicerIndex uint32 `binapi:"u32,name=policer_index" json:"policer_index,omitempty"`
131 func (m *PolicerAddDelReply) Reset() { *m = PolicerAddDelReply{} }
132 func (*PolicerAddDelReply) GetMessageName() string { return "policer_add_del_reply" }
133 func (*PolicerAddDelReply) GetCrcString() string { return "a177cef2" }
134 func (*PolicerAddDelReply) GetMessageType() api.MessageType {
135 return api.ReplyMessage
138 func (m *PolicerAddDelReply) Size() (size int) {
142 size += 4 // m.Retval
143 size += 4 // m.PolicerIndex
146 func (m *PolicerAddDelReply) Marshal(b []byte) ([]byte, error) {
148 b = make([]byte, m.Size())
150 buf := codec.NewBuffer(b)
151 buf.EncodeInt32(m.Retval)
152 buf.EncodeUint32(m.PolicerIndex)
153 return buf.Bytes(), nil
155 func (m *PolicerAddDelReply) Unmarshal(b []byte) error {
156 buf := codec.NewBuffer(b)
157 m.Retval = buf.DecodeInt32()
158 m.PolicerIndex = buf.DecodeUint32()
162 // PolicerDetails defines message 'policer_details'.
163 type PolicerDetails struct {
164 Name []byte `binapi:"u8[64],name=name" json:"name,omitempty"`
165 Cir uint32 `binapi:"u32,name=cir" json:"cir,omitempty"`
166 Eir uint32 `binapi:"u32,name=eir" json:"eir,omitempty"`
167 Cb uint64 `binapi:"u64,name=cb" json:"cb,omitempty"`
168 Eb uint64 `binapi:"u64,name=eb" json:"eb,omitempty"`
169 RateType uint8 `binapi:"u8,name=rate_type" json:"rate_type,omitempty"`
170 RoundType uint8 `binapi:"u8,name=round_type" json:"round_type,omitempty"`
171 Type uint8 `binapi:"u8,name=type" json:"type,omitempty"`
172 ConformActionType uint8 `binapi:"u8,name=conform_action_type" json:"conform_action_type,omitempty"`
173 ConformDscp uint8 `binapi:"u8,name=conform_dscp" json:"conform_dscp,omitempty"`
174 ExceedActionType uint8 `binapi:"u8,name=exceed_action_type" json:"exceed_action_type,omitempty"`
175 ExceedDscp uint8 `binapi:"u8,name=exceed_dscp" json:"exceed_dscp,omitempty"`
176 ViolateActionType uint8 `binapi:"u8,name=violate_action_type" json:"violate_action_type,omitempty"`
177 ViolateDscp uint8 `binapi:"u8,name=violate_dscp" json:"violate_dscp,omitempty"`
178 SingleRate uint8 `binapi:"u8,name=single_rate" json:"single_rate,omitempty"`
179 ColorAware uint8 `binapi:"u8,name=color_aware" json:"color_aware,omitempty"`
180 Scale uint32 `binapi:"u32,name=scale" json:"scale,omitempty"`
181 CirTokensPerPeriod uint32 `binapi:"u32,name=cir_tokens_per_period" json:"cir_tokens_per_period,omitempty"`
182 PirTokensPerPeriod uint32 `binapi:"u32,name=pir_tokens_per_period" json:"pir_tokens_per_period,omitempty"`
183 CurrentLimit uint32 `binapi:"u32,name=current_limit" json:"current_limit,omitempty"`
184 CurrentBucket uint32 `binapi:"u32,name=current_bucket" json:"current_bucket,omitempty"`
185 ExtendedLimit uint32 `binapi:"u32,name=extended_limit" json:"extended_limit,omitempty"`
186 ExtendedBucket uint32 `binapi:"u32,name=extended_bucket" json:"extended_bucket,omitempty"`
187 LastUpdateTime uint64 `binapi:"u64,name=last_update_time" json:"last_update_time,omitempty"`
190 func (m *PolicerDetails) Reset() { *m = PolicerDetails{} }
191 func (*PolicerDetails) GetMessageName() string { return "policer_details" }
192 func (*PolicerDetails) GetCrcString() string { return "ff2765f0" }
193 func (*PolicerDetails) GetMessageType() api.MessageType {
194 return api.ReplyMessage
197 func (m *PolicerDetails) Size() (size int) {
201 size += 1 * 64 // m.Name
206 size += 1 // m.RateType
207 size += 1 // m.RoundType
209 size += 1 // m.ConformActionType
210 size += 1 // m.ConformDscp
211 size += 1 // m.ExceedActionType
212 size += 1 // m.ExceedDscp
213 size += 1 // m.ViolateActionType
214 size += 1 // m.ViolateDscp
215 size += 1 // m.SingleRate
216 size += 1 // m.ColorAware
218 size += 4 // m.CirTokensPerPeriod
219 size += 4 // m.PirTokensPerPeriod
220 size += 4 // m.CurrentLimit
221 size += 4 // m.CurrentBucket
222 size += 4 // m.ExtendedLimit
223 size += 4 // m.ExtendedBucket
224 size += 8 // m.LastUpdateTime
227 func (m *PolicerDetails) Marshal(b []byte) ([]byte, error) {
229 b = make([]byte, m.Size())
231 buf := codec.NewBuffer(b)
232 buf.EncodeBytes(m.Name, 64)
233 buf.EncodeUint32(m.Cir)
234 buf.EncodeUint32(m.Eir)
235 buf.EncodeUint64(m.Cb)
236 buf.EncodeUint64(m.Eb)
237 buf.EncodeUint8(m.RateType)
238 buf.EncodeUint8(m.RoundType)
239 buf.EncodeUint8(m.Type)
240 buf.EncodeUint8(m.ConformActionType)
241 buf.EncodeUint8(m.ConformDscp)
242 buf.EncodeUint8(m.ExceedActionType)
243 buf.EncodeUint8(m.ExceedDscp)
244 buf.EncodeUint8(m.ViolateActionType)
245 buf.EncodeUint8(m.ViolateDscp)
246 buf.EncodeUint8(m.SingleRate)
247 buf.EncodeUint8(m.ColorAware)
248 buf.EncodeUint32(m.Scale)
249 buf.EncodeUint32(m.CirTokensPerPeriod)
250 buf.EncodeUint32(m.PirTokensPerPeriod)
251 buf.EncodeUint32(m.CurrentLimit)
252 buf.EncodeUint32(m.CurrentBucket)
253 buf.EncodeUint32(m.ExtendedLimit)
254 buf.EncodeUint32(m.ExtendedBucket)
255 buf.EncodeUint64(m.LastUpdateTime)
256 return buf.Bytes(), nil
258 func (m *PolicerDetails) Unmarshal(b []byte) error {
259 buf := codec.NewBuffer(b)
260 m.Name = make([]byte, 64)
261 copy(m.Name, buf.DecodeBytes(len(m.Name)))
262 m.Cir = buf.DecodeUint32()
263 m.Eir = buf.DecodeUint32()
264 m.Cb = buf.DecodeUint64()
265 m.Eb = buf.DecodeUint64()
266 m.RateType = buf.DecodeUint8()
267 m.RoundType = buf.DecodeUint8()
268 m.Type = buf.DecodeUint8()
269 m.ConformActionType = buf.DecodeUint8()
270 m.ConformDscp = buf.DecodeUint8()
271 m.ExceedActionType = buf.DecodeUint8()
272 m.ExceedDscp = buf.DecodeUint8()
273 m.ViolateActionType = buf.DecodeUint8()
274 m.ViolateDscp = buf.DecodeUint8()
275 m.SingleRate = buf.DecodeUint8()
276 m.ColorAware = buf.DecodeUint8()
277 m.Scale = buf.DecodeUint32()
278 m.CirTokensPerPeriod = buf.DecodeUint32()
279 m.PirTokensPerPeriod = buf.DecodeUint32()
280 m.CurrentLimit = buf.DecodeUint32()
281 m.CurrentBucket = buf.DecodeUint32()
282 m.ExtendedLimit = buf.DecodeUint32()
283 m.ExtendedBucket = buf.DecodeUint32()
284 m.LastUpdateTime = buf.DecodeUint64()
288 // PolicerDump defines message 'policer_dump'.
289 type PolicerDump struct {
290 MatchNameValid uint8 `binapi:"u8,name=match_name_valid" json:"match_name_valid,omitempty"`
291 MatchName []byte `binapi:"u8[64],name=match_name" json:"match_name,omitempty"`
294 func (m *PolicerDump) Reset() { *m = PolicerDump{} }
295 func (*PolicerDump) GetMessageName() string { return "policer_dump" }
296 func (*PolicerDump) GetCrcString() string { return "8be04d34" }
297 func (*PolicerDump) GetMessageType() api.MessageType {
298 return api.RequestMessage
301 func (m *PolicerDump) Size() (size int) {
305 size += 1 // m.MatchNameValid
306 size += 1 * 64 // m.MatchName
309 func (m *PolicerDump) Marshal(b []byte) ([]byte, error) {
311 b = make([]byte, m.Size())
313 buf := codec.NewBuffer(b)
314 buf.EncodeUint8(m.MatchNameValid)
315 buf.EncodeBytes(m.MatchName, 64)
316 return buf.Bytes(), nil
318 func (m *PolicerDump) Unmarshal(b []byte) error {
319 buf := codec.NewBuffer(b)
320 m.MatchNameValid = buf.DecodeUint8()
321 m.MatchName = make([]byte, 64)
322 copy(m.MatchName, buf.DecodeBytes(len(m.MatchName)))
326 func init() { file_policer_binapi_init() }
327 func file_policer_binapi_init() {
328 api.RegisterMessage((*PolicerAddDel)(nil), "policer_add_del_dfea2be8")
329 api.RegisterMessage((*PolicerAddDelReply)(nil), "policer_add_del_reply_a177cef2")
330 api.RegisterMessage((*PolicerDetails)(nil), "policer_details_ff2765f0")
331 api.RegisterMessage((*PolicerDump)(nil), "policer_dump_8be04d34")
334 // Messages returns list of all messages in this module.
335 func AllMessages() []api.Message {
336 return []api.Message{
337 (*PolicerAddDel)(nil),
338 (*PolicerAddDelReply)(nil),
339 (*PolicerDetails)(nil),