1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
|
// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
// versions:
// binapi-generator: v0.4.0-dev
// VPP: 20.05-release
// source: /usr/share/vpp/api/core/policer.api.json
// Package policer contains generated bindings for API file policer.api.
//
// Contents:
// 4 messages
//
package policer
import (
api "git.fd.io/govpp.git/api"
policer_types "git.fd.io/govpp.git/binapi/policer_types"
codec "git.fd.io/govpp.git/codec"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the GoVPP api package it is being compiled against.
// A compilation error at this line likely means your copy of the
// GoVPP api package needs to be updated.
const _ = api.GoVppAPIPackageIsVersion2
const (
APIFile = "policer"
APIVersion = "2.0.0"
VersionCrc = 0xd9188811
)
// PolicerAddDel defines message 'policer_add_del'.
type PolicerAddDel struct {
IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
Name string `binapi:"string[64],name=name" json:"name,omitempty"`
Cir uint32 `binapi:"u32,name=cir" json:"cir,omitempty"`
Eir uint32 `binapi:"u32,name=eir" json:"eir,omitempty"`
Cb uint64 `binapi:"u64,name=cb" json:"cb,omitempty"`
Eb uint64 `binapi:"u64,name=eb" json:"eb,omitempty"`
RateType policer_types.Sse2QosRateType `binapi:"sse2_qos_rate_type,name=rate_type" json:"rate_type,omitempty"`
RoundType policer_types.Sse2QosRoundType `binapi:"sse2_qos_round_type,name=round_type" json:"round_type,omitempty"`
Type policer_types.Sse2QosPolicerType `binapi:"sse2_qos_policer_type,name=type" json:"type,omitempty"`
ColorAware bool `binapi:"bool,name=color_aware" json:"color_aware,omitempty"`
ConformAction policer_types.Sse2QosAction `binapi:"sse2_qos_action,name=conform_action" json:"conform_action,omitempty"`
ExceedAction policer_types.Sse2QosAction `binapi:"sse2_qos_action,name=exceed_action" json:"exceed_action,omitempty"`
ViolateAction policer_types.Sse2QosAction `binapi:"sse2_qos_action,name=violate_action" json:"violate_action,omitempty"`
}
func (m *PolicerAddDel) Reset() { *m = PolicerAddDel{} }
func (*PolicerAddDel) GetMessageName() string { return "policer_add_del" }
func (*PolicerAddDel) GetCrcString() string { return "cb948f6e" }
func (*PolicerAddDel) GetMessageType() api.MessageType {
return api.RequestMessage
}
func (m *PolicerAddDel) Size() (size int) {
if m == nil {
return 0
}
size += 1 // m.IsAdd
size += 64 // m.Name
size += 4 // m.Cir
size += 4 // m.Eir
size += 8 // m.Cb
size += 8 // m.Eb
size += 1 // m.RateType
size += 1 // m.RoundType
size += 1 // m.Type
size += 1 // m.ColorAware
size += 1 // m.ConformAction.Type
size += 1 // m.ConformAction.Dscp
size += 1 // m.ExceedAction.Type
size += 1 // m.ExceedAction.Dscp
size += 1 // m.ViolateAction.Type
size += 1 // m.ViolateAction.Dscp
return size
}
func (m *PolicerAddDel) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeBool(m.IsAdd)
buf.EncodeString(m.Name, 64)
buf.EncodeUint32(m.Cir)
buf.EncodeUint32(m.Eir)
buf.EncodeUint64(m.Cb)
buf.EncodeUint64(m.Eb)
buf.EncodeUint8(uint8(m.RateType))
buf.EncodeUint8(uint8(m.RoundType))
buf.EncodeUint8(uint8(m.Type))
buf.EncodeBool(m.ColorAware)
buf.EncodeUint8(uint8(m.ConformAction.Type))
buf.EncodeUint8(m.ConformAction.Dscp)
buf.EncodeUint8(uint8(m.ExceedAction.Type))
buf.EncodeUint8(m.ExceedAction.Dscp)
buf.EncodeUint8(uint8(m.ViolateAction.Type))
buf.EncodeUint8(m.ViolateAction.Dscp)
return buf.Bytes(), nil
}
func (m *PolicerAddDel) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.IsAdd = buf.DecodeBool()
m.Name = buf.DecodeString(64)
m.Cir = buf.DecodeUint32()
m.Eir = buf.DecodeUint32()
m.Cb = buf.DecodeUint64()
m.Eb = buf.DecodeUint64()
m.RateType = policer_types.Sse2QosRateType(buf.DecodeUint8())
m.RoundType = policer_types.Sse2QosRoundType(buf.DecodeUint8())
m.Type = policer_types.Sse2QosPolicerType(buf.DecodeUint8())
m.ColorAware = buf.DecodeBool()
m.ConformAction.Type = policer_types.Sse2QosActionType(buf.DecodeUint8())
m.ConformAction.Dscp = buf.DecodeUint8()
m.ExceedAction.Type = policer_types.Sse2QosActionType(buf.DecodeUint8())
m.ExceedAction.Dscp = buf.DecodeUint8()
m.ViolateAction.Type = policer_types.Sse2QosActionType(buf.DecodeUint8())
m.ViolateAction.Dscp = buf.DecodeUint8()
return nil
}
// PolicerAddDelReply defines message 'policer_add_del_reply'.
type PolicerAddDelReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
PolicerIndex uint32 `binapi:"u32,name=policer_index" json:"policer_index,omitempty"`
}
func (m *PolicerAddDelReply) Reset() { *m = PolicerAddDelReply{} }
func (*PolicerAddDelReply) GetMessageName() string { return "policer_add_del_reply" }
func (*PolicerAddDelReply) GetCrcString() string { return "a177cef2" }
func (*PolicerAddDelReply) GetMessageType() api.MessageType {
return api.ReplyMessage
}
func (m *PolicerAddDelReply) Size() (size int) {
if m == nil {
return 0
}
size += 4 // m.Retval
size += 4 // m.PolicerIndex
return size
}
func (m *PolicerAddDelReply) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeInt32(m.Retval)
buf.EncodeUint32(m.PolicerIndex)
return buf.Bytes(), nil
}
func (m *PolicerAddDelReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.Retval = buf.DecodeInt32()
m.PolicerIndex = buf.DecodeUint32()
return nil
}
// PolicerDetails defines message 'policer_details'.
type PolicerDetails struct {
Name string `binapi:"string[64],name=name" json:"name,omitempty"`
Cir uint32 `binapi:"u32,name=cir" json:"cir,omitempty"`
Eir uint32 `binapi:"u32,name=eir" json:"eir,omitempty"`
Cb uint64 `binapi:"u64,name=cb" json:"cb,omitempty"`
Eb uint64 `binapi:"u64,name=eb" json:"eb,omitempty"`
RateType policer_types.Sse2QosRateType `binapi:"sse2_qos_rate_type,name=rate_type" json:"rate_type,omitempty"`
RoundType policer_types.Sse2QosRoundType `binapi:"sse2_qos_round_type,name=round_type" json:"round_type,omitempty"`
Type policer_types.Sse2QosPolicerType `binapi:"sse2_qos_policer_type,name=type" json:"type,omitempty"`
ConformAction policer_types.Sse2QosAction `binapi:"sse2_qos_action,name=conform_action" json:"conform_action,omitempty"`
ExceedAction policer_types.Sse2QosAction `binapi:"sse2_qos_action,name=exceed_action" json:"exceed_action,omitempty"`
ViolateAction policer_types.Sse2QosAction `binapi:"sse2_qos_action,name=violate_action" json:"violate_action,omitempty"`
SingleRate bool `binapi:"bool,name=single_rate" json:"single_rate,omitempty"`
ColorAware bool `binapi:"bool,name=color_aware" json:"color_aware,omitempty"`
Scale uint32 `binapi:"u32,name=scale" json:"scale,omitempty"`
CirTokensPerPeriod uint32 `binapi:"u32,name=cir_tokens_per_period" json:"cir_tokens_per_period,omitempty"`
PirTokensPerPeriod uint32 `binapi:"u32,name=pir_tokens_per_period" json:"pir_tokens_per_period,omitempty"`
CurrentLimit uint32 `binapi:"u32,name=current_limit" json:"current_limit,omitempty"`
CurrentBucket uint32 `binapi:"u32,name=current_bucket" json:"current_bucket,omitempty"`
ExtendedLimit uint32 `binapi:"u32,name=extended_limit" json:"extended_limit,omitempty"`
ExtendedBucket uint32 `binapi:"u32,name=extended_bucket" json:"extended_bucket,omitempty"`
LastUpdateTime uint64 `binapi:"u64,name=last_update_time" json:"last_update_time,omitempty"`
}
func (m *PolicerDetails) Reset() { *m = PolicerDetails{} }
func (*PolicerDetails) GetMessageName() string { return "policer_details" }
func (*PolicerDetails) GetCrcString() string { return "a43f781a" }
func (*PolicerDetails) GetMessageType() api.MessageType {
return api.ReplyMessage
}
func (m *PolicerDetails) Size() (size int) {
if m == nil {
return 0
}
size += 64 // m.Name
size += 4 // m.Cir
size += 4 // m.Eir
size += 8 // m.Cb
size += 8 // m.Eb
size += 1 // m.RateType
size += 1 // m.RoundType
size += 1 // m.Type
size += 1 // m.ConformAction.Type
size += 1 // m.ConformAction.Dscp
size += 1 // m.ExceedAction.Type
size += 1 // m.ExceedAction.Dscp
size += 1 // m.ViolateAction.Type
size += 1 // m.ViolateAction.Dscp
size += 1 // m.SingleRate
size += 1 // m.ColorAware
size += 4 // m.Scale
size += 4 // m.CirTokensPerPeriod
size += 4 // m.PirTokensPerPeriod
size += 4 // m.CurrentLimit
size += 4 // m.CurrentBucket
size += 4 // m.ExtendedLimit
size += 4 // m.ExtendedBucket
size += 8 // m.LastUpdateTime
return size
}
func (m *PolicerDetails) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeString(m.Name, 64)
buf.EncodeUint32(m.Cir)
buf.EncodeUint32(m.Eir)
buf.EncodeUint64(m.Cb)
buf.EncodeUint64(m.Eb)
buf.EncodeUint8(uint8(m.RateType))
buf.EncodeUint8(uint8(m.RoundType))
buf.EncodeUint8(uint8(m.Type))
buf.EncodeUint8(uint8(m.ConformAction.Type))
buf.EncodeUint8(m.ConformAction.Dscp)
buf.EncodeUint8(uint8(m.ExceedAction.Type))
buf.EncodeUint8(m.ExceedAction.Dscp)
buf.EncodeUint8(uint8(m.ViolateAction.Type))
buf.EncodeUint8(m.ViolateAction.Dscp)
buf.EncodeBool(m.SingleRate)
buf.EncodeBool(m.ColorAware)
buf.EncodeUint32(m.Scale)
buf.EncodeUint32(m.CirTokensPerPeriod)
buf.EncodeUint32(m.PirTokensPerPeriod)
buf.EncodeUint32(m.CurrentLimit)
buf.EncodeUint32(m.CurrentBucket)
buf.EncodeUint32(m.ExtendedLimit)
buf.EncodeUint32(m.ExtendedBucket)
buf.EncodeUint64(m.LastUpdateTime)
return buf.Bytes(), nil
}
func (m *PolicerDetails) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.Name = buf.DecodeString(64)
m.Cir = buf.DecodeUint32()
m.Eir = buf.DecodeUint32()
m.Cb = buf.DecodeUint64()
m.Eb = buf.DecodeUint64()
m.RateType = policer_types.Sse2QosRateType(buf.DecodeUint8())
m.RoundType = policer_types.Sse2QosRoundType(buf.DecodeUint8())
m.Type = policer_types.Sse2QosPolicerType(buf.DecodeUint8())
m.ConformAction.Type = policer_types.Sse2QosActionType(buf.DecodeUint8())
m.ConformAction.Dscp = buf.DecodeUint8()
m.ExceedAction.Type = policer_types.Sse2QosActionType(buf.DecodeUint8())
m.ExceedAction.Dscp = buf.DecodeUint8()
m.ViolateAction.Type = policer_types.Sse2QosActionType(buf.DecodeUint8())
m.ViolateAction.Dscp = buf.DecodeUint8()
m.SingleRate = buf.DecodeBool()
m.ColorAware = buf.DecodeBool()
m.Scale = buf.DecodeUint32()
m.CirTokensPerPeriod = buf.DecodeUint32()
m.PirTokensPerPeriod = buf.DecodeUint32()
m.CurrentLimit = buf.DecodeUint32()
m.CurrentBucket = buf.DecodeUint32()
m.ExtendedLimit = buf.DecodeUint32()
m.ExtendedBucket = buf.DecodeUint32()
m.LastUpdateTime = buf.DecodeUint64()
return nil
}
// PolicerDump defines message 'policer_dump'.
type PolicerDump struct {
MatchNameValid bool `binapi:"bool,name=match_name_valid" json:"match_name_valid,omitempty"`
MatchName string `binapi:"string[64],name=match_name" json:"match_name,omitempty"`
}
func (m *PolicerDump) Reset() { *m = PolicerDump{} }
func (*PolicerDump) GetMessageName() string { return "policer_dump" }
func (*PolicerDump) GetCrcString() string { return "35f1ae0f" }
func (*PolicerDump) GetMessageType() api.MessageType {
return api.RequestMessage
}
func (m *PolicerDump) Size() (size int) {
if m == nil {
return 0
}
size += 1 // m.MatchNameValid
size += 64 // m.MatchName
return size
}
func (m *PolicerDump) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeBool(m.MatchNameValid)
buf.EncodeString(m.MatchName, 64)
return buf.Bytes(), nil
}
func (m *PolicerDump) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.MatchNameValid = buf.DecodeBool()
m.MatchName = buf.DecodeString(64)
return nil
}
func init() { file_policer_binapi_init() }
func file_policer_binapi_init() {
api.RegisterMessage((*PolicerAddDel)(nil), "policer_add_del_cb948f6e")
api.RegisterMessage((*PolicerAddDelReply)(nil), "policer_add_del_reply_a177cef2")
api.RegisterMessage((*PolicerDetails)(nil), "policer_details_a43f781a")
api.RegisterMessage((*PolicerDump)(nil), "policer_dump_35f1ae0f")
}
// Messages returns list of all messages in this module.
func AllMessages() []api.Message {
return []api.Message{
(*PolicerAddDel)(nil),
(*PolicerAddDelReply)(nil),
(*PolicerDetails)(nil),
(*PolicerDump)(nil),
}
}
|