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
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
|
// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
// versions:
// binapi-generator: v0.5.0-dev
// VPP: 20.01
// source: .vppapi/core/sr_mpls.api.json
// Package sr_mpls contains generated bindings for API file sr_mpls.api.
//
// Contents:
// 10 messages
//
package sr_mpls
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 = "sr_mpls"
APIVersion = "1.0.0"
VersionCrc = 0x933a0861
)
// SrMplsPolicyAdd defines message 'sr_mpls_policy_add'.
type SrMplsPolicyAdd struct {
Bsid uint32 `binapi:"u32,name=bsid" json:"bsid,omitempty"`
Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"`
Type uint8 `binapi:"u8,name=type" json:"type,omitempty"`
NSegments uint8 `binapi:"u8,name=n_segments" json:"-"`
Segments []uint32 `binapi:"u32[n_segments],name=segments" json:"segments,omitempty"`
}
func (m *SrMplsPolicyAdd) Reset() { *m = SrMplsPolicyAdd{} }
func (*SrMplsPolicyAdd) GetMessageName() string { return "sr_mpls_policy_add" }
func (*SrMplsPolicyAdd) GetCrcString() string { return "6f5b21cc" }
func (*SrMplsPolicyAdd) GetMessageType() api.MessageType {
return api.RequestMessage
}
func (m *SrMplsPolicyAdd) Size() (size int) {
if m == nil {
return 0
}
size += 4 // m.Bsid
size += 4 // m.Weight
size += 1 // m.Type
size += 1 // m.NSegments
size += 4 * len(m.Segments) // m.Segments
return size
}
func (m *SrMplsPolicyAdd) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeUint32(m.Bsid)
buf.EncodeUint32(m.Weight)
buf.EncodeUint8(m.Type)
buf.EncodeUint8(uint8(len(m.Segments)))
for i := 0; i < len(m.Segments); i++ {
var x uint32
if i < len(m.Segments) {
x = uint32(m.Segments[i])
}
buf.EncodeUint32(x)
}
return buf.Bytes(), nil
}
func (m *SrMplsPolicyAdd) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.Bsid = buf.DecodeUint32()
m.Weight = buf.DecodeUint32()
m.Type = buf.DecodeUint8()
m.NSegments = buf.DecodeUint8()
m.Segments = make([]uint32, m.NSegments)
for i := 0; i < len(m.Segments); i++ {
m.Segments[i] = buf.DecodeUint32()
}
return nil
}
// SrMplsPolicyAddReply defines message 'sr_mpls_policy_add_reply'.
type SrMplsPolicyAddReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
func (m *SrMplsPolicyAddReply) Reset() { *m = SrMplsPolicyAddReply{} }
func (*SrMplsPolicyAddReply) GetMessageName() string { return "sr_mpls_policy_add_reply" }
func (*SrMplsPolicyAddReply) GetCrcString() string { return "e8d4e804" }
func (*SrMplsPolicyAddReply) GetMessageType() api.MessageType {
return api.ReplyMessage
}
func (m *SrMplsPolicyAddReply) Size() (size int) {
if m == nil {
return 0
}
size += 4 // m.Retval
return size
}
func (m *SrMplsPolicyAddReply) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeInt32(m.Retval)
return buf.Bytes(), nil
}
func (m *SrMplsPolicyAddReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.Retval = buf.DecodeInt32()
return nil
}
// SrMplsPolicyAssignEndpointColor defines message 'sr_mpls_policy_assign_endpoint_color'.
type SrMplsPolicyAssignEndpointColor struct {
Bsid uint32 `binapi:"u32,name=bsid" json:"bsid,omitempty"`
Endpoint []byte `binapi:"u8[16],name=endpoint" json:"endpoint,omitempty"`
EndpointType uint8 `binapi:"u8,name=endpoint_type" json:"endpoint_type,omitempty"`
Color uint32 `binapi:"u32,name=color" json:"color,omitempty"`
}
func (m *SrMplsPolicyAssignEndpointColor) Reset() { *m = SrMplsPolicyAssignEndpointColor{} }
func (*SrMplsPolicyAssignEndpointColor) GetMessageName() string {
return "sr_mpls_policy_assign_endpoint_color"
}
func (*SrMplsPolicyAssignEndpointColor) GetCrcString() string { return "6c82a6da" }
func (*SrMplsPolicyAssignEndpointColor) GetMessageType() api.MessageType {
return api.RequestMessage
}
func (m *SrMplsPolicyAssignEndpointColor) Size() (size int) {
if m == nil {
return 0
}
size += 4 // m.Bsid
size += 1 * 16 // m.Endpoint
size += 1 // m.EndpointType
size += 4 // m.Color
return size
}
func (m *SrMplsPolicyAssignEndpointColor) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeUint32(m.Bsid)
buf.EncodeBytes(m.Endpoint, 16)
buf.EncodeUint8(m.EndpointType)
buf.EncodeUint32(m.Color)
return buf.Bytes(), nil
}
func (m *SrMplsPolicyAssignEndpointColor) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.Bsid = buf.DecodeUint32()
m.Endpoint = make([]byte, 16)
copy(m.Endpoint, buf.DecodeBytes(len(m.Endpoint)))
m.EndpointType = buf.DecodeUint8()
m.Color = buf.DecodeUint32()
return nil
}
// SrMplsPolicyAssignEndpointColorReply defines message 'sr_mpls_policy_assign_endpoint_color_reply'.
type SrMplsPolicyAssignEndpointColorReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
func (m *SrMplsPolicyAssignEndpointColorReply) Reset() { *m = SrMplsPolicyAssignEndpointColorReply{} }
func (*SrMplsPolicyAssignEndpointColorReply) GetMessageName() string {
return "sr_mpls_policy_assign_endpoint_color_reply"
}
func (*SrMplsPolicyAssignEndpointColorReply) GetCrcString() string { return "e8d4e804" }
func (*SrMplsPolicyAssignEndpointColorReply) GetMessageType() api.MessageType {
return api.ReplyMessage
}
func (m *SrMplsPolicyAssignEndpointColorReply) Size() (size int) {
if m == nil {
return 0
}
size += 4 // m.Retval
return size
}
func (m *SrMplsPolicyAssignEndpointColorReply) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeInt32(m.Retval)
return buf.Bytes(), nil
}
func (m *SrMplsPolicyAssignEndpointColorReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.Retval = buf.DecodeInt32()
return nil
}
// SrMplsPolicyDel defines message 'sr_mpls_policy_del'.
type SrMplsPolicyDel struct {
Bsid uint32 `binapi:"u32,name=bsid" json:"bsid,omitempty"`
}
func (m *SrMplsPolicyDel) Reset() { *m = SrMplsPolicyDel{} }
func (*SrMplsPolicyDel) GetMessageName() string { return "sr_mpls_policy_del" }
func (*SrMplsPolicyDel) GetCrcString() string { return "e29d34fa" }
func (*SrMplsPolicyDel) GetMessageType() api.MessageType {
return api.RequestMessage
}
func (m *SrMplsPolicyDel) Size() (size int) {
if m == nil {
return 0
}
size += 4 // m.Bsid
return size
}
func (m *SrMplsPolicyDel) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeUint32(m.Bsid)
return buf.Bytes(), nil
}
func (m *SrMplsPolicyDel) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.Bsid = buf.DecodeUint32()
return nil
}
// SrMplsPolicyDelReply defines message 'sr_mpls_policy_del_reply'.
type SrMplsPolicyDelReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
func (m *SrMplsPolicyDelReply) Reset() { *m = SrMplsPolicyDelReply{} }
func (*SrMplsPolicyDelReply) GetMessageName() string { return "sr_mpls_policy_del_reply" }
func (*SrMplsPolicyDelReply) GetCrcString() string { return "e8d4e804" }
func (*SrMplsPolicyDelReply) GetMessageType() api.MessageType {
return api.ReplyMessage
}
func (m *SrMplsPolicyDelReply) Size() (size int) {
if m == nil {
return 0
}
size += 4 // m.Retval
return size
}
func (m *SrMplsPolicyDelReply) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeInt32(m.Retval)
return buf.Bytes(), nil
}
func (m *SrMplsPolicyDelReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.Retval = buf.DecodeInt32()
return nil
}
// SrMplsPolicyMod defines message 'sr_mpls_policy_mod'.
type SrMplsPolicyMod struct {
Bsid uint32 `binapi:"u32,name=bsid" json:"bsid,omitempty"`
Operation uint8 `binapi:"u8,name=operation" json:"operation,omitempty"`
SlIndex uint32 `binapi:"u32,name=sl_index" json:"sl_index,omitempty"`
Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"`
NSegments uint8 `binapi:"u8,name=n_segments" json:"-"`
Segments []uint32 `binapi:"u32[n_segments],name=segments" json:"segments,omitempty"`
}
func (m *SrMplsPolicyMod) Reset() { *m = SrMplsPolicyMod{} }
func (*SrMplsPolicyMod) GetMessageName() string { return "sr_mpls_policy_mod" }
func (*SrMplsPolicyMod) GetCrcString() string { return "09d338ac" }
func (*SrMplsPolicyMod) GetMessageType() api.MessageType {
return api.RequestMessage
}
func (m *SrMplsPolicyMod) Size() (size int) {
if m == nil {
return 0
}
size += 4 // m.Bsid
size += 1 // m.Operation
size += 4 // m.SlIndex
size += 4 // m.Weight
size += 1 // m.NSegments
size += 4 * len(m.Segments) // m.Segments
return size
}
func (m *SrMplsPolicyMod) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeUint32(m.Bsid)
buf.EncodeUint8(m.Operation)
buf.EncodeUint32(m.SlIndex)
buf.EncodeUint32(m.Weight)
buf.EncodeUint8(uint8(len(m.Segments)))
for i := 0; i < len(m.Segments); i++ {
var x uint32
if i < len(m.Segments) {
x = uint32(m.Segments[i])
}
buf.EncodeUint32(x)
}
return buf.Bytes(), nil
}
func (m *SrMplsPolicyMod) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.Bsid = buf.DecodeUint32()
m.Operation = buf.DecodeUint8()
m.SlIndex = buf.DecodeUint32()
m.Weight = buf.DecodeUint32()
m.NSegments = buf.DecodeUint8()
m.Segments = make([]uint32, m.NSegments)
for i := 0; i < len(m.Segments); i++ {
m.Segments[i] = buf.DecodeUint32()
}
return nil
}
// SrMplsPolicyModReply defines message 'sr_mpls_policy_mod_reply'.
type SrMplsPolicyModReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
func (m *SrMplsPolicyModReply) Reset() { *m = SrMplsPolicyModReply{} }
func (*SrMplsPolicyModReply) GetMessageName() string { return "sr_mpls_policy_mod_reply" }
func (*SrMplsPolicyModReply) GetCrcString() string { return "e8d4e804" }
func (*SrMplsPolicyModReply) GetMessageType() api.MessageType {
return api.ReplyMessage
}
func (m *SrMplsPolicyModReply) Size() (size int) {
if m == nil {
return 0
}
size += 4 // m.Retval
return size
}
func (m *SrMplsPolicyModReply) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeInt32(m.Retval)
return buf.Bytes(), nil
}
func (m *SrMplsPolicyModReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.Retval = buf.DecodeInt32()
return nil
}
// SrMplsSteeringAddDel defines message 'sr_mpls_steering_add_del'.
type SrMplsSteeringAddDel struct {
IsDel uint8 `binapi:"u8,name=is_del" json:"is_del,omitempty"`
Bsid uint32 `binapi:"u32,name=bsid" json:"bsid,omitempty"`
TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
PrefixAddr []byte `binapi:"u8[16],name=prefix_addr" json:"prefix_addr,omitempty"`
MaskWidth uint32 `binapi:"u32,name=mask_width" json:"mask_width,omitempty"`
TrafficType uint8 `binapi:"u8,name=traffic_type" json:"traffic_type,omitempty"`
NextHop []byte `binapi:"u8[16],name=next_hop" json:"next_hop,omitempty"`
NhType uint8 `binapi:"u8,name=nh_type" json:"nh_type,omitempty"`
Color uint32 `binapi:"u32,name=color" json:"color,omitempty"`
CoBits uint8 `binapi:"u8,name=co_bits" json:"co_bits,omitempty"`
VPNLabel uint32 `binapi:"u32,name=vpn_label" json:"vpn_label,omitempty"`
}
func (m *SrMplsSteeringAddDel) Reset() { *m = SrMplsSteeringAddDel{} }
func (*SrMplsSteeringAddDel) GetMessageName() string { return "sr_mpls_steering_add_del" }
func (*SrMplsSteeringAddDel) GetCrcString() string { return "1591f94a" }
func (*SrMplsSteeringAddDel) GetMessageType() api.MessageType {
return api.RequestMessage
}
func (m *SrMplsSteeringAddDel) Size() (size int) {
if m == nil {
return 0
}
size += 1 // m.IsDel
size += 4 // m.Bsid
size += 4 // m.TableID
size += 1 * 16 // m.PrefixAddr
size += 4 // m.MaskWidth
size += 1 // m.TrafficType
size += 1 * 16 // m.NextHop
size += 1 // m.NhType
size += 4 // m.Color
size += 1 // m.CoBits
size += 4 // m.VPNLabel
return size
}
func (m *SrMplsSteeringAddDel) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeUint8(m.IsDel)
buf.EncodeUint32(m.Bsid)
buf.EncodeUint32(m.TableID)
buf.EncodeBytes(m.PrefixAddr, 16)
buf.EncodeUint32(m.MaskWidth)
buf.EncodeUint8(m.TrafficType)
buf.EncodeBytes(m.NextHop, 16)
buf.EncodeUint8(m.NhType)
buf.EncodeUint32(m.Color)
buf.EncodeUint8(m.CoBits)
buf.EncodeUint32(m.VPNLabel)
return buf.Bytes(), nil
}
func (m *SrMplsSteeringAddDel) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.IsDel = buf.DecodeUint8()
m.Bsid = buf.DecodeUint32()
m.TableID = buf.DecodeUint32()
m.PrefixAddr = make([]byte, 16)
copy(m.PrefixAddr, buf.DecodeBytes(len(m.PrefixAddr)))
m.MaskWidth = buf.DecodeUint32()
m.TrafficType = buf.DecodeUint8()
m.NextHop = make([]byte, 16)
copy(m.NextHop, buf.DecodeBytes(len(m.NextHop)))
m.NhType = buf.DecodeUint8()
m.Color = buf.DecodeUint32()
m.CoBits = buf.DecodeUint8()
m.VPNLabel = buf.DecodeUint32()
return nil
}
// SrMplsSteeringAddDelReply defines message 'sr_mpls_steering_add_del_reply'.
type SrMplsSteeringAddDelReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
func (m *SrMplsSteeringAddDelReply) Reset() { *m = SrMplsSteeringAddDelReply{} }
func (*SrMplsSteeringAddDelReply) GetMessageName() string { return "sr_mpls_steering_add_del_reply" }
func (*SrMplsSteeringAddDelReply) GetCrcString() string { return "e8d4e804" }
func (*SrMplsSteeringAddDelReply) GetMessageType() api.MessageType {
return api.ReplyMessage
}
func (m *SrMplsSteeringAddDelReply) Size() (size int) {
if m == nil {
return 0
}
size += 4 // m.Retval
return size
}
func (m *SrMplsSteeringAddDelReply) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeInt32(m.Retval)
return buf.Bytes(), nil
}
func (m *SrMplsSteeringAddDelReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.Retval = buf.DecodeInt32()
return nil
}
func init() { file_sr_mpls_binapi_init() }
func file_sr_mpls_binapi_init() {
api.RegisterMessage((*SrMplsPolicyAdd)(nil), "sr_mpls_policy_add_6f5b21cc")
api.RegisterMessage((*SrMplsPolicyAddReply)(nil), "sr_mpls_policy_add_reply_e8d4e804")
api.RegisterMessage((*SrMplsPolicyAssignEndpointColor)(nil), "sr_mpls_policy_assign_endpoint_color_6c82a6da")
api.RegisterMessage((*SrMplsPolicyAssignEndpointColorReply)(nil), "sr_mpls_policy_assign_endpoint_color_reply_e8d4e804")
api.RegisterMessage((*SrMplsPolicyDel)(nil), "sr_mpls_policy_del_e29d34fa")
api.RegisterMessage((*SrMplsPolicyDelReply)(nil), "sr_mpls_policy_del_reply_e8d4e804")
api.RegisterMessage((*SrMplsPolicyMod)(nil), "sr_mpls_policy_mod_09d338ac")
api.RegisterMessage((*SrMplsPolicyModReply)(nil), "sr_mpls_policy_mod_reply_e8d4e804")
api.RegisterMessage((*SrMplsSteeringAddDel)(nil), "sr_mpls_steering_add_del_1591f94a")
api.RegisterMessage((*SrMplsSteeringAddDelReply)(nil), "sr_mpls_steering_add_del_reply_e8d4e804")
}
// Messages returns list of all messages in this module.
func AllMessages() []api.Message {
return []api.Message{
(*SrMplsPolicyAdd)(nil),
(*SrMplsPolicyAddReply)(nil),
(*SrMplsPolicyAssignEndpointColor)(nil),
(*SrMplsPolicyAssignEndpointColorReply)(nil),
(*SrMplsPolicyDel)(nil),
(*SrMplsPolicyDelReply)(nil),
(*SrMplsPolicyMod)(nil),
(*SrMplsPolicyModReply)(nil),
(*SrMplsSteeringAddDel)(nil),
(*SrMplsSteeringAddDelReply)(nil),
}
}
|