summaryrefslogtreecommitdiffstats
path: root/binapi/nat66/nat66.ba.go
blob: 632c3f97dac816c9031e8a75abd12c92a287d940 (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
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
// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
// versions:
//  binapi-generator: v0.5.0-dev
//  VPP:              21.06-release
// source: /usr/share/vpp/api/plugins/nat66.api.json

// Package nat66 contains generated bindings for API file nat66.api.
//
// Contents:
//  10 messages
//
package nat66

import (
	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"
	nat_types "git.fd.io/govpp.git/binapi/nat_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    = "nat66"
	APIVersion = "1.0.0"
	VersionCrc = 0xa6343f71
)

// Nat66AddDelInterface defines message 'nat66_add_del_interface'.
type Nat66AddDelInterface struct {
	IsAdd     bool                           `binapi:"bool,name=is_add" json:"is_add,omitempty"`
	Flags     nat_types.NatConfigFlags       `binapi:"nat_config_flags,name=flags" json:"flags,omitempty"`
	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
}

func (m *Nat66AddDelInterface) Reset()               { *m = Nat66AddDelInterface{} }
func (*Nat66AddDelInterface) GetMessageName() string { return "nat66_add_del_interface" }
func (*Nat66AddDelInterface) GetCrcString() string   { return "f3699b83" }
func (*Nat66AddDelInterface) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *Nat66AddDelInterface) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 1 // m.IsAdd
	size += 1 // m.Flags
	size += 4 // m.SwIfIndex
	return size
}
func (m *Nat66AddDelInterface) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeBool(m.IsAdd)
	buf.EncodeUint8(uint8(m.Flags))
	buf.EncodeUint32(uint32(m.SwIfIndex))
	return buf.Bytes(), nil
}
func (m *Nat66AddDelInterface) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.IsAdd = buf.DecodeBool()
	m.Flags = nat_types.NatConfigFlags(buf.DecodeUint8())
	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
	return nil
}

// Nat66AddDelInterfaceReply defines message 'nat66_add_del_interface_reply'.
type Nat66AddDelInterfaceReply struct {
	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}

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

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

// Nat66AddDelStaticMapping defines message 'nat66_add_del_static_mapping'.
type Nat66AddDelStaticMapping struct {
	IsAdd             bool                `binapi:"bool,name=is_add" json:"is_add,omitempty"`
	LocalIPAddress    ip_types.IP6Address `binapi:"ip6_address,name=local_ip_address" json:"local_ip_address,omitempty"`
	ExternalIPAddress ip_types.IP6Address `binapi:"ip6_address,name=external_ip_address" json:"external_ip_address,omitempty"`
	VrfID             uint32              `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
}

func (m *Nat66AddDelStaticMapping) Reset()               { *m = Nat66AddDelStaticMapping{} }
func (*Nat66AddDelStaticMapping) GetMessageName() string { return "nat66_add_del_static_mapping" }
func (*Nat66AddDelStaticMapping) GetCrcString() string   { return "3ed88f71" }
func (*Nat66AddDelStaticMapping) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *Nat66AddDelStaticMapping) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 1      // m.IsAdd
	size += 1 * 16 // m.LocalIPAddress
	size += 1 * 16 // m.ExternalIPAddress
	size += 4      // m.VrfID
	return size
}
func (m *Nat66AddDelStaticMapping) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeBool(m.IsAdd)
	buf.EncodeBytes(m.LocalIPAddress[:], 16)
	buf.EncodeBytes(m.ExternalIPAddress[:], 16)
	buf.EncodeUint32(m.VrfID)
	return buf.Bytes(), nil
}
func (m *Nat66AddDelStaticMapping) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.IsAdd = buf.DecodeBool()
	copy(m.LocalIPAddress[:], buf.DecodeBytes(16))
	copy(m.ExternalIPAddress[:], buf.DecodeBytes(16))
	m.VrfID = buf.DecodeUint32()
	return nil
}

// Nat66AddDelStaticMappingReply defines message 'nat66_add_del_static_mapping_reply'.
type Nat66AddDelStaticMappingReply struct {
	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}

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

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

// Nat66InterfaceDetails defines message 'nat66_interface_details'.
type Nat66InterfaceDetails struct {
	Flags     nat_types.NatConfigFlags       `binapi:"nat_config_flags,name=flags" json:"flags,omitempty"`
	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
}

func (m *Nat66InterfaceDetails) Reset()               { *m = Nat66InterfaceDetails{} }
func (*Nat66InterfaceDetails) GetMessageName() string { return "nat66_interface_details" }
func (*Nat66InterfaceDetails) GetCrcString() string   { return "5d286289" }
func (*Nat66InterfaceDetails) GetMessageType() api.MessageType {
	return api.ReplyMessage
}

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

// Nat66InterfaceDump defines message 'nat66_interface_dump'.
type Nat66InterfaceDump struct{}

func (m *Nat66InterfaceDump) Reset()               { *m = Nat66InterfaceDump{} }
func (*Nat66InterfaceDump) GetMessageName() string { return "nat66_interface_dump" }
func (*Nat66InterfaceDump) GetCrcString() string   { return "51077d14" }
func (*Nat66InterfaceDump) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *Nat66InterfaceDump) Size() (size int) {
	if m == nil {
		return 0
	}
	return size
}
func (m *Nat66InterfaceDump) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	return buf.Bytes(), nil
}
func (m *Nat66InterfaceDump) Unmarshal(b []byte) error {
	return nil
}

// Nat66PluginEnableDisable defines message 'nat66_plugin_enable_disable'.
type Nat66PluginEnableDisable struct {
	OutsideVrf uint32 `binapi:"u32,name=outside_vrf" json:"outside_vrf,omitempty"`
	Enable     bool   `binapi:"bool,name=enable" json:"enable,omitempty"`
}

func (m *Nat66PluginEnableDisable) Reset()               { *m = Nat66PluginEnableDisable{} }
func (*Nat66PluginEnableDisable) GetMessageName() string { return "nat66_plugin_enable_disable" }
func (*Nat66PluginEnableDisable) GetCrcString() string   { return "56f2f83b" }
func (*Nat66PluginEnableDisable) GetMessageType() api.MessageType {
	return api.RequestMessage
}

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

// Nat66PluginEnableDisableReply defines message 'nat66_plugin_enable_disable_reply'.
type Nat66PluginEnableDisableReply struct {
	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}

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

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

// Nat66StaticMappingDetails defines message 'nat66_static_mapping_details'.
type Nat66StaticMappingDetails struct {
	LocalIPAddress    ip_types.IP6Address `binapi:"ip6_address,name=local_ip_address" json:"local_ip_address,omitempty"`
	ExternalIPAddress ip_types.IP6Address `binapi:"ip6_address,name=external_ip_address" json:"external_ip_address,omitempty"`
	VrfID             uint32              `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
	TotalBytes        uint64              `binapi:"u64,name=total_bytes" json:"total_bytes,omitempty"`
	TotalPkts         uint64              `binapi:"u64,name=total_pkts" json:"total_pkts,omitempty"`
}

func (m *Nat66StaticMappingDetails) Reset()               { *m = Nat66StaticMappingDetails{} }
func (*Nat66StaticMappingDetails) GetMessageName() string { return "nat66_static_mapping_details" }
func (*Nat66StaticMappingDetails) GetCrcString() string   { return "df39654b" }
func (*Nat66StaticMappingDetails) GetMessageType() api.MessageType {
	return api.ReplyMessage
}

func (m *Nat66StaticMappingDetails) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 1 * 16 // m.LocalIPAddress
	size += 1 * 16 // m.ExternalIPAddress
	size += 4      // m.VrfID
	size += 8      // m.TotalBytes
	size += 8      // m.TotalPkts
	return size
}
func (m *Nat66StaticMappingDetails) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeBytes(m.LocalIPAddress[:], 16)
	buf.EncodeBytes(m.ExternalIPAddress[:], 16)
	buf.EncodeUint32(m.VrfID)
	buf.EncodeUint64(m.TotalBytes)
	buf.EncodeUint64(m.TotalPkts)
	return buf.Bytes(), nil
}
func (m *Nat66StaticMappingDetails) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	copy(m.LocalIPAddress[:], buf.DecodeBytes(16))
	copy(m.ExternalIPAddress[:], buf.DecodeBytes(16))
	m.VrfID = buf.DecodeUint32()
	m.TotalBytes = buf.DecodeUint64()
	m.TotalPkts = buf.DecodeUint64()
	return nil
}

// Nat66StaticMappingDump defines message 'nat66_static_mapping_dump'.
type Nat66StaticMappingDump struct{}

func (m *Nat66StaticMappingDump) Reset()               { *m = Nat66StaticMappingDump{} }
func (*Nat66StaticMappingDump) GetMessageName() string { return "nat66_static_mapping_dump" }
func (*Nat66StaticMappingDump) GetCrcString() string   { return "51077d14" }
func (*Nat66StaticMappingDump) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *Nat66StaticMappingDump) Size() (size int) {
	if m == nil {
		return 0
	}
	return size
}
func (m *Nat66StaticMappingDump) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	return buf.Bytes(), nil
}
func (m *Nat66StaticMappingDump) Unmarshal(b []byte) error {
	return nil
}

func init() { file_nat66_binapi_init() }
func file_nat66_binapi_init() {
	api.RegisterMessage((*Nat66AddDelInterface)(nil), "nat66_add_del_interface_f3699b83")
	api.RegisterMessage((*Nat66AddDelInterfaceReply)(nil), "nat66_add_del_interface_reply_e8d4e804")
	api.RegisterMessage((*Nat66AddDelStaticMapping)(nil), "nat66_add_del_static_mapping_3ed88f71")
	api.RegisterMessage((*Nat66AddDelStaticMappingReply)(nil), "nat66_add_del_static_mapping_reply_e8d4e804")
	api.RegisterMessage((*Nat66InterfaceDetails)(nil), "nat66_interface_details_5d286289")
	api.RegisterMessage((*Nat66InterfaceDump)(nil), "nat66_interface_dump_51077d14")
	api.RegisterMessage((*Nat66PluginEnableDisable)(nil), "nat66_plugin_enable_disable_56f2f83b")
	api.RegisterMessage((*Nat66PluginEnableDisableReply)(nil), "nat66_plugin_enable_disable_reply_e8d4e804")
	api.RegisterMessage((*Nat66StaticMappingDetails)(nil), "nat66_static_mapping_details_df39654b")
	api.RegisterMessage((*Nat66StaticMappingDump)(nil), "nat66_static_mapping_dump_51077d14")
}

// Messages returns list of all messages in this module.
func AllMessages() []api.Message {
	return []api.Message{
		(*Nat66AddDelInterface)(nil),
		(*Nat66AddDelInterfaceReply)(nil),
		(*Nat66AddDelStaticMapping)(nil),
		(*Nat66AddDelStaticMappingReply)(nil),
		(*Nat66InterfaceDetails)(nil),
		(*Nat66InterfaceDump)(nil),
		(*Nat66PluginEnableDisable)(nil),
		(*Nat66PluginEnableDisableReply)(nil),
		(*Nat66StaticMappingDetails)(nil),
		(*Nat66StaticMappingDump)(nil),
	}
}