1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
5 // source: /usr/share/vpp/api/plugins/nat66.api.json
7 // Package nat66 contains generated bindings for API file nat66.api.
15 api "git.fd.io/govpp.git/api"
16 interface_types "git.fd.io/govpp.git/binapi/interface_types"
17 ip_types "git.fd.io/govpp.git/binapi/ip_types"
18 nat_types "git.fd.io/govpp.git/binapi/nat_types"
19 codec "git.fd.io/govpp.git/codec"
22 // This is a compile-time assertion to ensure that this generated file
23 // is compatible with the GoVPP api package it is being compiled against.
24 // A compilation error at this line likely means your copy of the
25 // GoVPP api package needs to be updated.
26 const _ = api.GoVppAPIPackageIsVersion2
31 VersionCrc = 0xa6343f71
34 // Nat66AddDelInterface defines message 'nat66_add_del_interface'.
35 type Nat66AddDelInterface struct {
36 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
37 Flags nat_types.NatConfigFlags `binapi:"nat_config_flags,name=flags" json:"flags,omitempty"`
38 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
41 func (m *Nat66AddDelInterface) Reset() { *m = Nat66AddDelInterface{} }
42 func (*Nat66AddDelInterface) GetMessageName() string { return "nat66_add_del_interface" }
43 func (*Nat66AddDelInterface) GetCrcString() string { return "f3699b83" }
44 func (*Nat66AddDelInterface) GetMessageType() api.MessageType {
45 return api.RequestMessage
48 func (m *Nat66AddDelInterface) Size() (size int) {
54 size += 4 // m.SwIfIndex
57 func (m *Nat66AddDelInterface) Marshal(b []byte) ([]byte, error) {
59 b = make([]byte, m.Size())
61 buf := codec.NewBuffer(b)
62 buf.EncodeBool(m.IsAdd)
63 buf.EncodeUint8(uint8(m.Flags))
64 buf.EncodeUint32(uint32(m.SwIfIndex))
65 return buf.Bytes(), nil
67 func (m *Nat66AddDelInterface) Unmarshal(b []byte) error {
68 buf := codec.NewBuffer(b)
69 m.IsAdd = buf.DecodeBool()
70 m.Flags = nat_types.NatConfigFlags(buf.DecodeUint8())
71 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
75 // Nat66AddDelInterfaceReply defines message 'nat66_add_del_interface_reply'.
76 type Nat66AddDelInterfaceReply struct {
77 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
80 func (m *Nat66AddDelInterfaceReply) Reset() { *m = Nat66AddDelInterfaceReply{} }
81 func (*Nat66AddDelInterfaceReply) GetMessageName() string { return "nat66_add_del_interface_reply" }
82 func (*Nat66AddDelInterfaceReply) GetCrcString() string { return "e8d4e804" }
83 func (*Nat66AddDelInterfaceReply) GetMessageType() api.MessageType {
84 return api.ReplyMessage
87 func (m *Nat66AddDelInterfaceReply) Size() (size int) {
94 func (m *Nat66AddDelInterfaceReply) Marshal(b []byte) ([]byte, error) {
96 b = make([]byte, m.Size())
98 buf := codec.NewBuffer(b)
99 buf.EncodeInt32(m.Retval)
100 return buf.Bytes(), nil
102 func (m *Nat66AddDelInterfaceReply) Unmarshal(b []byte) error {
103 buf := codec.NewBuffer(b)
104 m.Retval = buf.DecodeInt32()
108 // Nat66AddDelStaticMapping defines message 'nat66_add_del_static_mapping'.
109 type Nat66AddDelStaticMapping struct {
110 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
111 LocalIPAddress ip_types.IP6Address `binapi:"ip6_address,name=local_ip_address" json:"local_ip_address,omitempty"`
112 ExternalIPAddress ip_types.IP6Address `binapi:"ip6_address,name=external_ip_address" json:"external_ip_address,omitempty"`
113 VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
116 func (m *Nat66AddDelStaticMapping) Reset() { *m = Nat66AddDelStaticMapping{} }
117 func (*Nat66AddDelStaticMapping) GetMessageName() string { return "nat66_add_del_static_mapping" }
118 func (*Nat66AddDelStaticMapping) GetCrcString() string { return "3ed88f71" }
119 func (*Nat66AddDelStaticMapping) GetMessageType() api.MessageType {
120 return api.RequestMessage
123 func (m *Nat66AddDelStaticMapping) Size() (size int) {
128 size += 1 * 16 // m.LocalIPAddress
129 size += 1 * 16 // m.ExternalIPAddress
133 func (m *Nat66AddDelStaticMapping) Marshal(b []byte) ([]byte, error) {
135 b = make([]byte, m.Size())
137 buf := codec.NewBuffer(b)
138 buf.EncodeBool(m.IsAdd)
139 buf.EncodeBytes(m.LocalIPAddress[:], 16)
140 buf.EncodeBytes(m.ExternalIPAddress[:], 16)
141 buf.EncodeUint32(m.VrfID)
142 return buf.Bytes(), nil
144 func (m *Nat66AddDelStaticMapping) Unmarshal(b []byte) error {
145 buf := codec.NewBuffer(b)
146 m.IsAdd = buf.DecodeBool()
147 copy(m.LocalIPAddress[:], buf.DecodeBytes(16))
148 copy(m.ExternalIPAddress[:], buf.DecodeBytes(16))
149 m.VrfID = buf.DecodeUint32()
153 // Nat66AddDelStaticMappingReply defines message 'nat66_add_del_static_mapping_reply'.
154 type Nat66AddDelStaticMappingReply struct {
155 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
158 func (m *Nat66AddDelStaticMappingReply) Reset() { *m = Nat66AddDelStaticMappingReply{} }
159 func (*Nat66AddDelStaticMappingReply) GetMessageName() string {
160 return "nat66_add_del_static_mapping_reply"
162 func (*Nat66AddDelStaticMappingReply) GetCrcString() string { return "e8d4e804" }
163 func (*Nat66AddDelStaticMappingReply) GetMessageType() api.MessageType {
164 return api.ReplyMessage
167 func (m *Nat66AddDelStaticMappingReply) Size() (size int) {
171 size += 4 // m.Retval
174 func (m *Nat66AddDelStaticMappingReply) Marshal(b []byte) ([]byte, error) {
176 b = make([]byte, m.Size())
178 buf := codec.NewBuffer(b)
179 buf.EncodeInt32(m.Retval)
180 return buf.Bytes(), nil
182 func (m *Nat66AddDelStaticMappingReply) Unmarshal(b []byte) error {
183 buf := codec.NewBuffer(b)
184 m.Retval = buf.DecodeInt32()
188 // Nat66InterfaceDetails defines message 'nat66_interface_details'.
189 type Nat66InterfaceDetails struct {
190 Flags nat_types.NatConfigFlags `binapi:"nat_config_flags,name=flags" json:"flags,omitempty"`
191 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
194 func (m *Nat66InterfaceDetails) Reset() { *m = Nat66InterfaceDetails{} }
195 func (*Nat66InterfaceDetails) GetMessageName() string { return "nat66_interface_details" }
196 func (*Nat66InterfaceDetails) GetCrcString() string { return "5d286289" }
197 func (*Nat66InterfaceDetails) GetMessageType() api.MessageType {
198 return api.ReplyMessage
201 func (m *Nat66InterfaceDetails) Size() (size int) {
206 size += 4 // m.SwIfIndex
209 func (m *Nat66InterfaceDetails) Marshal(b []byte) ([]byte, error) {
211 b = make([]byte, m.Size())
213 buf := codec.NewBuffer(b)
214 buf.EncodeUint8(uint8(m.Flags))
215 buf.EncodeUint32(uint32(m.SwIfIndex))
216 return buf.Bytes(), nil
218 func (m *Nat66InterfaceDetails) Unmarshal(b []byte) error {
219 buf := codec.NewBuffer(b)
220 m.Flags = nat_types.NatConfigFlags(buf.DecodeUint8())
221 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
225 // Nat66InterfaceDump defines message 'nat66_interface_dump'.
226 type Nat66InterfaceDump struct{}
228 func (m *Nat66InterfaceDump) Reset() { *m = Nat66InterfaceDump{} }
229 func (*Nat66InterfaceDump) GetMessageName() string { return "nat66_interface_dump" }
230 func (*Nat66InterfaceDump) GetCrcString() string { return "51077d14" }
231 func (*Nat66InterfaceDump) GetMessageType() api.MessageType {
232 return api.RequestMessage
235 func (m *Nat66InterfaceDump) Size() (size int) {
241 func (m *Nat66InterfaceDump) Marshal(b []byte) ([]byte, error) {
243 b = make([]byte, m.Size())
245 buf := codec.NewBuffer(b)
246 return buf.Bytes(), nil
248 func (m *Nat66InterfaceDump) Unmarshal(b []byte) error {
252 // Nat66PluginEnableDisable defines message 'nat66_plugin_enable_disable'.
253 type Nat66PluginEnableDisable struct {
254 OutsideVrf uint32 `binapi:"u32,name=outside_vrf" json:"outside_vrf,omitempty"`
255 Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
258 func (m *Nat66PluginEnableDisable) Reset() { *m = Nat66PluginEnableDisable{} }
259 func (*Nat66PluginEnableDisable) GetMessageName() string { return "nat66_plugin_enable_disable" }
260 func (*Nat66PluginEnableDisable) GetCrcString() string { return "56f2f83b" }
261 func (*Nat66PluginEnableDisable) GetMessageType() api.MessageType {
262 return api.RequestMessage
265 func (m *Nat66PluginEnableDisable) Size() (size int) {
269 size += 4 // m.OutsideVrf
270 size += 1 // m.Enable
273 func (m *Nat66PluginEnableDisable) Marshal(b []byte) ([]byte, error) {
275 b = make([]byte, m.Size())
277 buf := codec.NewBuffer(b)
278 buf.EncodeUint32(m.OutsideVrf)
279 buf.EncodeBool(m.Enable)
280 return buf.Bytes(), nil
282 func (m *Nat66PluginEnableDisable) Unmarshal(b []byte) error {
283 buf := codec.NewBuffer(b)
284 m.OutsideVrf = buf.DecodeUint32()
285 m.Enable = buf.DecodeBool()
289 // Nat66PluginEnableDisableReply defines message 'nat66_plugin_enable_disable_reply'.
290 type Nat66PluginEnableDisableReply struct {
291 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
294 func (m *Nat66PluginEnableDisableReply) Reset() { *m = Nat66PluginEnableDisableReply{} }
295 func (*Nat66PluginEnableDisableReply) GetMessageName() string {
296 return "nat66_plugin_enable_disable_reply"
298 func (*Nat66PluginEnableDisableReply) GetCrcString() string { return "e8d4e804" }
299 func (*Nat66PluginEnableDisableReply) GetMessageType() api.MessageType {
300 return api.ReplyMessage
303 func (m *Nat66PluginEnableDisableReply) Size() (size int) {
307 size += 4 // m.Retval
310 func (m *Nat66PluginEnableDisableReply) Marshal(b []byte) ([]byte, error) {
312 b = make([]byte, m.Size())
314 buf := codec.NewBuffer(b)
315 buf.EncodeInt32(m.Retval)
316 return buf.Bytes(), nil
318 func (m *Nat66PluginEnableDisableReply) Unmarshal(b []byte) error {
319 buf := codec.NewBuffer(b)
320 m.Retval = buf.DecodeInt32()
324 // Nat66StaticMappingDetails defines message 'nat66_static_mapping_details'.
325 type Nat66StaticMappingDetails struct {
326 LocalIPAddress ip_types.IP6Address `binapi:"ip6_address,name=local_ip_address" json:"local_ip_address,omitempty"`
327 ExternalIPAddress ip_types.IP6Address `binapi:"ip6_address,name=external_ip_address" json:"external_ip_address,omitempty"`
328 VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
329 TotalBytes uint64 `binapi:"u64,name=total_bytes" json:"total_bytes,omitempty"`
330 TotalPkts uint64 `binapi:"u64,name=total_pkts" json:"total_pkts,omitempty"`
333 func (m *Nat66StaticMappingDetails) Reset() { *m = Nat66StaticMappingDetails{} }
334 func (*Nat66StaticMappingDetails) GetMessageName() string { return "nat66_static_mapping_details" }
335 func (*Nat66StaticMappingDetails) GetCrcString() string { return "df39654b" }
336 func (*Nat66StaticMappingDetails) GetMessageType() api.MessageType {
337 return api.ReplyMessage
340 func (m *Nat66StaticMappingDetails) Size() (size int) {
344 size += 1 * 16 // m.LocalIPAddress
345 size += 1 * 16 // m.ExternalIPAddress
347 size += 8 // m.TotalBytes
348 size += 8 // m.TotalPkts
351 func (m *Nat66StaticMappingDetails) Marshal(b []byte) ([]byte, error) {
353 b = make([]byte, m.Size())
355 buf := codec.NewBuffer(b)
356 buf.EncodeBytes(m.LocalIPAddress[:], 16)
357 buf.EncodeBytes(m.ExternalIPAddress[:], 16)
358 buf.EncodeUint32(m.VrfID)
359 buf.EncodeUint64(m.TotalBytes)
360 buf.EncodeUint64(m.TotalPkts)
361 return buf.Bytes(), nil
363 func (m *Nat66StaticMappingDetails) Unmarshal(b []byte) error {
364 buf := codec.NewBuffer(b)
365 copy(m.LocalIPAddress[:], buf.DecodeBytes(16))
366 copy(m.ExternalIPAddress[:], buf.DecodeBytes(16))
367 m.VrfID = buf.DecodeUint32()
368 m.TotalBytes = buf.DecodeUint64()
369 m.TotalPkts = buf.DecodeUint64()
373 // Nat66StaticMappingDump defines message 'nat66_static_mapping_dump'.
374 type Nat66StaticMappingDump struct{}
376 func (m *Nat66StaticMappingDump) Reset() { *m = Nat66StaticMappingDump{} }
377 func (*Nat66StaticMappingDump) GetMessageName() string { return "nat66_static_mapping_dump" }
378 func (*Nat66StaticMappingDump) GetCrcString() string { return "51077d14" }
379 func (*Nat66StaticMappingDump) GetMessageType() api.MessageType {
380 return api.RequestMessage
383 func (m *Nat66StaticMappingDump) Size() (size int) {
389 func (m *Nat66StaticMappingDump) Marshal(b []byte) ([]byte, error) {
391 b = make([]byte, m.Size())
393 buf := codec.NewBuffer(b)
394 return buf.Bytes(), nil
396 func (m *Nat66StaticMappingDump) Unmarshal(b []byte) error {
400 func init() { file_nat66_binapi_init() }
401 func file_nat66_binapi_init() {
402 api.RegisterMessage((*Nat66AddDelInterface)(nil), "nat66_add_del_interface_f3699b83")
403 api.RegisterMessage((*Nat66AddDelInterfaceReply)(nil), "nat66_add_del_interface_reply_e8d4e804")
404 api.RegisterMessage((*Nat66AddDelStaticMapping)(nil), "nat66_add_del_static_mapping_3ed88f71")
405 api.RegisterMessage((*Nat66AddDelStaticMappingReply)(nil), "nat66_add_del_static_mapping_reply_e8d4e804")
406 api.RegisterMessage((*Nat66InterfaceDetails)(nil), "nat66_interface_details_5d286289")
407 api.RegisterMessage((*Nat66InterfaceDump)(nil), "nat66_interface_dump_51077d14")
408 api.RegisterMessage((*Nat66PluginEnableDisable)(nil), "nat66_plugin_enable_disable_56f2f83b")
409 api.RegisterMessage((*Nat66PluginEnableDisableReply)(nil), "nat66_plugin_enable_disable_reply_e8d4e804")
410 api.RegisterMessage((*Nat66StaticMappingDetails)(nil), "nat66_static_mapping_details_df39654b")
411 api.RegisterMessage((*Nat66StaticMappingDump)(nil), "nat66_static_mapping_dump_51077d14")
414 // Messages returns list of all messages in this module.
415 func AllMessages() []api.Message {
416 return []api.Message{
417 (*Nat66AddDelInterface)(nil),
418 (*Nat66AddDelInterfaceReply)(nil),
419 (*Nat66AddDelStaticMapping)(nil),
420 (*Nat66AddDelStaticMappingReply)(nil),
421 (*Nat66InterfaceDetails)(nil),
422 (*Nat66InterfaceDump)(nil),
423 (*Nat66PluginEnableDisable)(nil),
424 (*Nat66PluginEnableDisableReply)(nil),
425 (*Nat66StaticMappingDetails)(nil),
426 (*Nat66StaticMappingDump)(nil),