summaryrefslogtreecommitdiffstats
path: root/binapi/vxlan_gbp/vxlan_gbp.ba.go
blob: b5df3e00ecd191a1e3a633b8410bd1b76cd91be9 (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
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
// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
// versions:
//  binapi-generator: v0.3.5-56-gc0da1f2-dirty
//  VPP:              21.06-release
// source: /usr/share/vpp/api/core/vxlan_gbp.api.json

// Package vxlan_gbp contains generated bindings for API file vxlan_gbp.api.
//
// Contents:
//   1 enum
//   1 struct
//   6 messages
//
package vxlan_gbp

import (
	"strconv"

	api "git.fd.io/govpp.git/api"
	interface_types "git.fd.io/govpp.git/binapi/interface_types"
	ip_types "git.fd.io/govpp.git/binapi/ip_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    = "vxlan_gbp"
	APIVersion = "1.1.1"
	VersionCrc = 0xb40203a1
)

// VxlanGbpAPITunnelMode defines enum 'vxlan_gbp_api_tunnel_mode'.
type VxlanGbpAPITunnelMode uint32

const (
	VXLAN_GBP_API_TUNNEL_MODE_L2 VxlanGbpAPITunnelMode = 1
	VXLAN_GBP_API_TUNNEL_MODE_L3 VxlanGbpAPITunnelMode = 2
)

var (
	VxlanGbpAPITunnelMode_name = map[uint32]string{
		1: "VXLAN_GBP_API_TUNNEL_MODE_L2",
		2: "VXLAN_GBP_API_TUNNEL_MODE_L3",
	}
	VxlanGbpAPITunnelMode_value = map[string]uint32{
		"VXLAN_GBP_API_TUNNEL_MODE_L2": 1,
		"VXLAN_GBP_API_TUNNEL_MODE_L3": 2,
	}
)

func (x VxlanGbpAPITunnelMode) String() string {
	s, ok := VxlanGbpAPITunnelMode_name[uint32(x)]
	if ok {
		return s
	}
	return "VxlanGbpAPITunnelMode(" + strconv.Itoa(int(x)) + ")"
}

// VxlanGbpTunnel defines type 'vxlan_gbp_tunnel'.
type VxlanGbpTunnel struct {
	Instance       uint32                         `binapi:"u32,name=instance" json:"instance,omitempty"`
	Src            ip_types.Address               `binapi:"address,name=src" json:"src,omitempty"`
	Dst            ip_types.Address               `binapi:"address,name=dst" json:"dst,omitempty"`
	McastSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=mcast_sw_if_index" json:"mcast_sw_if_index,omitempty"`
	EncapTableID   uint32                         `binapi:"u32,name=encap_table_id" json:"encap_table_id,omitempty"`
	Vni            uint32                         `binapi:"u32,name=vni" json:"vni,omitempty"`
	SwIfIndex      interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
	Mode           VxlanGbpAPITunnelMode          `binapi:"vxlan_gbp_api_tunnel_mode,name=mode" json:"mode,omitempty"`
}

// SwInterfaceSetVxlanGbpBypass defines message 'sw_interface_set_vxlan_gbp_bypass'.
// InProgress: the message form may change in the future versions
type SwInterfaceSetVxlanGbpBypass struct {
	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
	IsIPv6    bool                           `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
	Enable    bool                           `binapi:"bool,name=enable,default=true" json:"enable,omitempty"`
}

func (m *SwInterfaceSetVxlanGbpBypass) Reset() { *m = SwInterfaceSetVxlanGbpBypass{} }
func (*SwInterfaceSetVxlanGbpBypass) GetMessageName() string {
	return "sw_interface_set_vxlan_gbp_bypass"
}
func (*SwInterfaceSetVxlanGbpBypass) GetCrcString() string { return "65247409" }
func (*SwInterfaceSetVxlanGbpBypass) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *SwInterfaceSetVxlanGbpBypass) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 4 // m.SwIfIndex
	size += 1 // m.IsIPv6
	size += 1 // m.Enable
	return size
}
func (m *SwInterfaceSetVxlanGbpBypass) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeUint32(uint32(m.SwIfIndex))
	buf.EncodeBool(m.IsIPv6)
	buf.EncodeBool(m.Enable)
	return buf.Bytes(), nil
}
func (m *SwInterfaceSetVxlanGbpBypass) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
	m.IsIPv6 = buf.DecodeBool()
	m.Enable = buf.DecodeBool()
	return nil
}

// SwInterfaceSetVxlanGbpBypassReply defines message 'sw_interface_set_vxlan_gbp_bypass_reply'.
// InProgress: the message form may change in the future versions
type SwInterfaceSetVxlanGbpBypassReply struct {
	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}

func (m *SwInterfaceSetVxlanGbpBypassReply) Reset() { *m = SwInterfaceSetVxlanGbpBypassReply{} }
func (*SwInterfaceSetVxlanGbpBypassReply) GetMessageName() string {
	return "sw_interface_set_vxlan_gbp_bypass_reply"
}
func (*SwInterfaceSetVxlanGbpBypassReply) GetCrcString() string { return "e8d4e804" }
func (*SwInterfaceSetVxlanGbpBypassReply) GetMessageType() api.MessageType {
	return api.ReplyMessage
}

func (m *SwInterfaceSetVxlanGbpBypassReply) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 4 // m.Retval
	return size
}
func (m *SwInterfaceSetVxlanGbpBypassReply) 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 *SwInterfaceSetVxlanGbpBypassReply) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Retval = buf.DecodeInt32()
	return nil
}

// VxlanGbpTunnelAddDel defines message 'vxlan_gbp_tunnel_add_del'.
// InProgress: the message form may change in the future versions
type VxlanGbpTunnelAddDel struct {
	IsAdd  bool           `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
	Tunnel VxlanGbpTunnel `binapi:"vxlan_gbp_tunnel,name=tunnel" json:"tunnel,omitempty"`
}

func (m *VxlanGbpTunnelAddDel) Reset()               { *m = VxlanGbpTunnelAddDel{} }
func (*VxlanGbpTunnelAddDel) GetMessageName() string { return "vxlan_gbp_tunnel_add_del" }
func (*VxlanGbpTunnelAddDel) GetCrcString() string   { return "6c743427" }
func (*VxlanGbpTunnelAddDel) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *VxlanGbpTunnelAddDel) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 1      // m.IsAdd
	size += 4      // m.Tunnel.Instance
	size += 1      // m.Tunnel.Src.Af
	size += 1 * 16 // m.Tunnel.Src.Un
	size += 1      // m.Tunnel.Dst.Af
	size += 1 * 16 // m.Tunnel.Dst.Un
	size += 4      // m.Tunnel.McastSwIfIndex
	size += 4      // m.Tunnel.EncapTableID
	size += 4      // m.Tunnel.Vni
	size += 4      // m.Tunnel.SwIfIndex
	size += 4      // m.Tunnel.Mode
	return size
}
func (m *VxlanGbpTunnelAddDel) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeBool(m.IsAdd)
	buf.EncodeUint32(m.Tunnel.Instance)
	buf.EncodeUint8(uint8(m.Tunnel.Src.Af))
	buf.EncodeBytes(m.Tunnel.Src.Un.XXX_UnionData[:], 16)
	buf.EncodeUint8(uint8(m.Tunnel.Dst.Af))
	buf.EncodeBytes(m.Tunnel.Dst.Un.XXX_UnionData[:], 16)
	buf.EncodeUint32(uint32(m.Tunnel.McastSwIfIndex))
	buf.EncodeUint32(m.Tunnel.EncapTableID)
	buf.EncodeUint32(m.Tunnel.Vni)
	buf.EncodeUint32(uint32(m.Tunnel.SwIfIndex))
	buf.EncodeUint32(uint32(m.Tunnel.Mode))
	return buf.Bytes(), nil
}
func (m *VxlanGbpTunnelAddDel) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.IsAdd = buf.DecodeBool()
	m.Tunnel.Instance = buf.DecodeUint32()
	m.Tunnel.Src.Af = ip_types.AddressFamily(buf.DecodeUint8())
	copy(m.Tunnel.Src.Un.XXX_UnionData[:], buf.DecodeBytes(16))
	m.Tunnel.Dst.Af = ip_types.AddressFamily(buf.DecodeUint8())
	copy(m.Tunnel.Dst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
	m.Tunnel.McastSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
	m.Tunnel.EncapTableID = buf.DecodeUint32()
	m.Tunnel.Vni = buf.DecodeUint32()
	m.Tunnel.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
	m.Tunnel.Mode = VxlanGbpAPITunnelMode(buf.DecodeUint32())
	return nil
}

// VxlanGbpTunnelAddDelReply defines message 'vxlan_gbp_tunnel_add_del_reply'.
// InProgress: the message form may change in the future versions
type VxlanGbpTunnelAddDelReply struct {
	Retval    int32                          `binapi:"i32,name=retval" json:"retval,omitempty"`
	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
}

func (m *VxlanGbpTunnelAddDelReply) Reset()               { *m = VxlanGbpTunnelAddDelReply{} }
func (*VxlanGbpTunnelAddDelReply) GetMessageName() string { return "vxlan_gbp_tunnel_add_del_reply" }
func (*VxlanGbpTunnelAddDelReply) GetCrcString() string   { return "5383d31f" }
func (*VxlanGbpTunnelAddDelReply) GetMessageType() api.MessageType {
	return api.ReplyMessage
}

func (m *VxlanGbpTunnelAddDelReply) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 4 // m.Retval
	size += 4 // m.SwIfIndex
	return size
}
func (m *VxlanGbpTunnelAddDelReply) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeInt32(m.Retval)
	buf.EncodeUint32(uint32(m.SwIfIndex))
	return buf.Bytes(), nil
}
func (m *VxlanGbpTunnelAddDelReply) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Retval = buf.DecodeInt32()
	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
	return nil
}

// VxlanGbpTunnelDetails defines message 'vxlan_gbp_tunnel_details'.
// InProgress: the message form may change in the future versions
type VxlanGbpTunnelDetails struct {
	Tunnel VxlanGbpTunnel `binapi:"vxlan_gbp_tunnel,name=tunnel" json:"tunnel,omitempty"`
}

func (m *VxlanGbpTunnelDetails) Reset()               { *m = VxlanGbpTunnelDetails{} }
func (*VxlanGbpTunnelDetails) GetMessageName() string { return "vxlan_gbp_tunnel_details" }
func (*VxlanGbpTunnelDetails) GetCrcString() string   { return "66e94a89" }
func (*VxlanGbpTunnelDetails) GetMessageType() api.MessageType {
	return api.ReplyMessage
}

func (m *VxlanGbpTunnelDetails) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 4      // m.Tunnel.Instance
	size += 1      // m.Tunnel.Src.Af
	size += 1 * 16 // m.Tunnel.Src.Un
	size += 1      // m.Tunnel.Dst.Af
	size += 1 * 16 // m.Tunnel.Dst.Un
	size += 4      // m.Tunnel.McastSwIfIndex
	size += 4      // m.Tunnel.EncapTableID
	size += 4      // m.Tunnel.Vni
	size += 4      // m.Tunnel.SwIfIndex
	size += 4      // m.Tunnel.Mode
	return size
}
func (m *VxlanGbpTunnelDetails) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeUint32(m.Tunnel.Instance)
	buf.EncodeUint8(uint8(m.Tunnel.Src.Af))
	buf.EncodeBytes(m.Tunnel.Src.Un.XXX_UnionData[:], 16)
	buf.EncodeUint8(uint8(m.Tunnel.Dst.Af))
	buf.EncodeBytes(m.Tunnel.Dst.Un.XXX_UnionData[:], 16)
	buf.EncodeUint32(uint32(m.Tunnel.McastSwIfIndex))
	buf.EncodeUint32(m.Tunnel.EncapTableID)
	buf.EncodeUint32(m.Tunnel.Vni)
	buf.EncodeUint32(uint32(m.Tunnel.SwIfIndex))
	buf.EncodeUint32(uint32(m.Tunnel.Mode))
	return buf.Bytes(), nil
}
func (m *VxlanGbpTunnelDetails) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Tunnel.Instance = buf.DecodeUint32()
	m.Tunnel.Src.Af = ip_types.AddressFamily(buf.DecodeUint8())
	copy(m.Tunnel.Src.Un.XXX_UnionData[:], buf.DecodeBytes(16))
	m.Tunnel.Dst.Af = ip_types.AddressFamily(buf.DecodeUint8())
	copy(m.Tunnel.Dst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
	m.Tunnel.McastSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
	m.Tunnel.EncapTableID = buf.DecodeUint32()
	m.Tunnel.Vni = buf.DecodeUint32()
	m.Tunnel.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
	m.Tunnel.Mode = VxlanGbpAPITunnelMode(buf.DecodeUint32())
	return nil
}

// VxlanGbpTunnelDump defines message 'vxlan_gbp_tunnel_dump'.
// InProgress: the message form may change in the future versions
type VxlanGbpTunnelDump struct {
	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"`
}

func (m *VxlanGbpTunnelDump) Reset()               { *m = VxlanGbpTunnelDump{} }
func (*VxlanGbpTunnelDump) GetMessageName() string { return "vxlan_gbp_tunnel_dump" }
func (*VxlanGbpTunnelDump) GetCrcString() string   { return "f9e6675e" }
func (*VxlanGbpTunnelDump) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *VxlanGbpTunnelDump) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 4 // m.SwIfIndex
	return size
}
func (m *VxlanGbpTunnelDump) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeUint32(uint32(m.SwIfIndex))
	return buf.Bytes(), nil
}
func (m *VxlanGbpTunnelDump) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
	return nil
}

func init() { file_vxlan_gbp_binapi_init() }
func file_vxlan_gbp_binapi_init() {
	api.RegisterMessage((*SwInterfaceSetVxlanGbpBypass)(nil), "sw_interface_set_vxlan_gbp_bypass_65247409")
	api.RegisterMessage((*SwInterfaceSetVxlanGbpBypassReply)(nil), "sw_interface_set_vxlan_gbp_bypass_reply_e8d4e804")
	api.RegisterMessage((*VxlanGbpTunnelAddDel)(nil), "vxlan_gbp_tunnel_add_del_6c743427")
	api.RegisterMessage((*VxlanGbpTunnelAddDelReply)(nil), "vxlan_gbp_tunnel_add_del_reply_5383d31f")
	api.RegisterMessage((*VxlanGbpTunnelDetails)(nil), "vxlan_gbp_tunnel_details_66e94a89")
	api.RegisterMessage((*VxlanGbpTunnelDump)(nil), "vxlan_gbp_tunnel_dump_f9e6675e")
}

// Messages returns list of all messages in this module.
func AllMessages() []api.Message {
	return []api.Message{
		(*SwInterfaceSetVxlanGbpBypass)(nil),
		(*SwInterfaceSetVxlanGbpBypassReply)(nil),
		(*VxlanGbpTunnelAddDel)(nil),
		(*VxlanGbpTunnelAddDelReply)(nil),
		(*VxlanGbpTunnelDetails)(nil),
		(*VxlanGbpTunnelDump)(nil),
	}
}