summaryrefslogtreecommitdiffstats
path: root/internal/testbinapi/binapi2001/policer/policer.ba.go
blob: d5bf1d416bad6c542d4e758670793376d524944d (plain)
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
335
336
337
338
339
340
341
342
// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
// versions:
//  binapi-generator: v0.4.0-dev
//  VPP:              20.01
// source: .vppapi/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"
	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 = "1.0.0"
	VersionCrc = 0x4218ed4f
)

// PolicerAddDel defines message 'policer_add_del'.
type PolicerAddDel struct {
	IsAdd             uint8  `binapi:"u8,name=is_add" json:"is_add,omitempty"`
	Name              []byte `binapi:"u8[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          uint8  `binapi:"u8,name=rate_type" json:"rate_type,omitempty"`
	RoundType         uint8  `binapi:"u8,name=round_type" json:"round_type,omitempty"`
	Type              uint8  `binapi:"u8,name=type" json:"type,omitempty"`
	ColorAware        uint8  `binapi:"u8,name=color_aware" json:"color_aware,omitempty"`
	ConformActionType uint8  `binapi:"u8,name=conform_action_type" json:"conform_action_type,omitempty"`
	ConformDscp       uint8  `binapi:"u8,name=conform_dscp" json:"conform_dscp,omitempty"`
	ExceedActionType  uint8  `binapi:"u8,name=exceed_action_type" json:"exceed_action_type,omitempty"`
	ExceedDscp        uint8  `binapi:"u8,name=exceed_dscp" json:"exceed_dscp,omitempty"`
	ViolateActionType uint8  `binapi:"u8,name=violate_action_type" json:"violate_action_type,omitempty"`
	ViolateDscp       uint8  `binapi:"u8,name=violate_dscp" json:"violate_dscp,omitempty"`
}

func (m *PolicerAddDel) Reset()               { *m = PolicerAddDel{} }
func (*PolicerAddDel) GetMessageName() string { return "policer_add_del" }
func (*PolicerAddDel) GetCrcString() string   { return "dfea2be8" }
func (*PolicerAddDel) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *PolicerAddDel) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 1      // m.IsAdd
	size += 1 * 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.ConformActionType
	size += 1      // m.ConformDscp
	size += 1      // m.ExceedActionType
	size += 1      // m.ExceedDscp
	size += 1      // m.ViolateActionType
	size += 1      // m.ViolateDscp
	return size
}
func (m *PolicerAddDel) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeUint8(m.IsAdd)
	buf.EncodeBytes(m.Name, 64)
	buf.EncodeUint32(m.Cir)
	buf.EncodeUint32(m.Eir)
	buf.EncodeUint64(m.Cb)
	buf.EncodeUint64(m.Eb)
	buf.EncodeUint8(m.RateType)
	buf.EncodeUint8(m.RoundType)
	buf.EncodeUint8(m.Type)
	buf.EncodeUint8(m.ColorAware)
	buf.EncodeUint8(m.ConformActionType)
	buf.EncodeUint8(m.ConformDscp)
	buf.EncodeUint8(m.ExceedActionType)
	buf.EncodeUint8(m.ExceedDscp)
	buf.EncodeUint8(m.ViolateActionType)
	buf.EncodeUint8(m.ViolateDscp)
	return buf.Bytes(), nil
}
func (m *PolicerAddDel) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.IsAdd = buf.DecodeUint8()
	m.Name = make([]byte, 64)
	copy(m.Name, buf.DecodeBytes(len(m.Name)))
	m.Cir = buf.DecodeUint32()
	m.Eir = buf.DecodeUint32()
	m.Cb = buf.DecodeUint64()
	m.Eb = buf.DecodeUint64()
	m.RateType = buf.DecodeUint8()
	m.RoundType = buf.DecodeUint8()
	m.Type = buf.DecodeUint8()
	m.ColorAware = buf.DecodeUint8()
	m.ConformActionType = buf.DecodeUint8()
	m.ConformDscp = buf.DecodeUint8()
	m.ExceedActionType = buf.DecodeUint8()
	m.ExceedDscp = buf.DecodeUint8()
	m.ViolateActionType = buf.DecodeUint8()
	m.ViolateDscp = 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               []byte `binapi:"u8[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           uint8  `binapi:"u8,name=rate_type" json:"rate_type,omitempty"`
	RoundType          uint8  `binapi:"u8,name=round_type" json:"round_type,omitempty"`
	Type               uint8  `binapi:"u8,name=type" json:"type,omitempty"`
	ConformActionType  uint8  `binapi:"u8,name=conform_action_type" json:"conform_action_type,omitempty"`
	ConformDscp        uint8  `binapi:"u8,name=conform_dscp" json:"conform_dscp,omitempty"`
	ExceedActionType   uint8  `binapi:"u8,name=exceed_action_type" json:"exceed_action_type,omitempty"`
	ExceedDscp         uint8  `binapi:"u8,name=exceed_dscp" json:"exceed_dscp,omitempty"`
	ViolateActionType  uint8  `binapi:"u8,name=violate_action_type" json:"violate_action_type,omitempty"`
	ViolateDscp        uint8  `binapi:"u8,name=violate_dscp" json:"violate_dscp,omitempty"`
	SingleRate         uint8  `binapi:"u8,name=single_rate" json:"single_rate,omitempty"`
	ColorAware         uint8  `binapi:"u8,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 "ff2765f0" }
func (*PolicerDetails) GetMessageType() api.MessageType {
	return api.ReplyMessage
}

func (m *PolicerDetails) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 1 * 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.ConformActionType
	size += 1      // m.ConformDscp
	size += 1      // m.ExceedActionType
	size += 1      // m.ExceedDscp
	size += 1      // m.ViolateActionType
	size += 1      // m.ViolateDscp
	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.EncodeBytes(m.Name, 64)
	buf.EncodeUint32(m.Cir)
	buf.EncodeUint32(m.Eir)
	buf.EncodeUint64(m.Cb)
	buf.EncodeUint64(m.Eb)
	buf.EncodeUint8(m.RateType)
	buf.EncodeUint8(m.RoundType)
	buf.EncodeUint8(m.Type)
	buf.EncodeUint8(m.ConformActionType)
	buf.EncodeUint8(m.ConformDscp)
	buf.EncodeUint8(m.ExceedActionType)
	buf.EncodeUint8(m.ExceedDscp)
	buf.EncodeUint8(m.ViolateActionType)
	buf.EncodeUint8(m.ViolateDscp)
	buf.EncodeUint8(m.SingleRate)
	buf.EncodeUint8(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 = make([]byte, 64)
	copy(m.Name, buf.DecodeBytes(len(m.Name)))
	m.Cir = buf.DecodeUint32()
	m.Eir = buf.DecodeUint32()
	m.Cb = buf.DecodeUint64()
	m.Eb = buf.DecodeUint64()
	m.RateType = buf.DecodeUint8()
	m.RoundType = buf.DecodeUint8()
	m.Type = buf.DecodeUint8()
	m.ConformActionType = buf.DecodeUint8()
	m.ConformDscp = buf.DecodeUint8()
	m.ExceedActionType = buf.DecodeUint8()
	m.ExceedDscp = buf.DecodeUint8()
	m.ViolateActionType = buf.DecodeUint8()
	m.ViolateDscp = buf.DecodeUint8()
	m.SingleRate = buf.DecodeUint8()
	m.ColorAware = buf.DecodeUint8()
	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 uint8  `binapi:"u8,name=match_name_valid" json:"match_name_valid,omitempty"`
	MatchName      []byte `binapi:"u8[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 "8be04d34" }
func (*PolicerDump) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *PolicerDump) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 1      // m.MatchNameValid
	size += 1 * 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.EncodeUint8(m.MatchNameValid)
	buf.EncodeBytes(m.MatchName, 64)
	return buf.Bytes(), nil
}
func (m *PolicerDump) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.MatchNameValid = buf.DecodeUint8()
	m.MatchName = make([]byte, 64)
	copy(m.MatchName, buf.DecodeBytes(len(m.MatchName)))
	return nil
}

func init() { file_policer_binapi_init() }
func file_policer_binapi_init() {
	api.RegisterMessage((*PolicerAddDel)(nil), "policer_add_del_dfea2be8")
	api.RegisterMessage((*PolicerAddDelReply)(nil), "policer_add_del_reply_a177cef2")
	api.RegisterMessage((*PolicerDetails)(nil), "policer_details_ff2765f0")
	api.RegisterMessage((*PolicerDump)(nil), "policer_dump_8be04d34")
}

// Messages returns list of all messages in this module.
func AllMessages() []api.Message {
	return []api.Message{
		(*PolicerAddDel)(nil),
		(*PolicerAddDelReply)(nil),
		(*PolicerDetails)(nil),
		(*PolicerDump)(nil),
	}
}