github.com/edwarnicke/govpp@v0.0.0-20230130211138-14ef5d20b1d0/binapi/nat66/nat66.ba.go (about) 1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT. 2 // versions: 3 // binapi-generator: v0.4.0-dev 4 // VPP: 23.02-rc0~189-g57127b32a 5 // source: /usr/share/vpp/api/plugins/nat66.api.json 6 7 // Package nat66 contains generated bindings for API file nat66.api. 8 // 9 // Contents: 10 // 10 messages 11 // 12 package nat66 13 14 import ( 15 api "git.fd.io/govpp.git/api" 16 codec "git.fd.io/govpp.git/codec" 17 interface_types "github.com/edwarnicke/govpp/binapi/interface_types" 18 ip_types "github.com/edwarnicke/govpp/binapi/ip_types" 19 nat_types "github.com/edwarnicke/govpp/binapi/nat_types" 20 ) 21 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 27 28 const ( 29 APIFile = "nat66" 30 APIVersion = "1.0.0" 31 VersionCrc = 0xa6343f71 32 ) 33 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"` 39 } 40 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 46 } 47 48 func (m *Nat66AddDelInterface) Size() (size int) { 49 if m == nil { 50 return 0 51 } 52 size += 1 // m.IsAdd 53 size += 1 // m.Flags 54 size += 4 // m.SwIfIndex 55 return size 56 } 57 func (m *Nat66AddDelInterface) Marshal(b []byte) ([]byte, error) { 58 if b == nil { 59 b = make([]byte, m.Size()) 60 } 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 66 } 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()) 72 return nil 73 } 74 75 // Nat66AddDelInterfaceReply defines message 'nat66_add_del_interface_reply'. 76 type Nat66AddDelInterfaceReply struct { 77 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 78 } 79 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 85 } 86 87 func (m *Nat66AddDelInterfaceReply) Size() (size int) { 88 if m == nil { 89 return 0 90 } 91 size += 4 // m.Retval 92 return size 93 } 94 func (m *Nat66AddDelInterfaceReply) Marshal(b []byte) ([]byte, error) { 95 if b == nil { 96 b = make([]byte, m.Size()) 97 } 98 buf := codec.NewBuffer(b) 99 buf.EncodeInt32(m.Retval) 100 return buf.Bytes(), nil 101 } 102 func (m *Nat66AddDelInterfaceReply) Unmarshal(b []byte) error { 103 buf := codec.NewBuffer(b) 104 m.Retval = buf.DecodeInt32() 105 return nil 106 } 107 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"` 114 } 115 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 121 } 122 123 func (m *Nat66AddDelStaticMapping) Size() (size int) { 124 if m == nil { 125 return 0 126 } 127 size += 1 // m.IsAdd 128 size += 1 * 16 // m.LocalIPAddress 129 size += 1 * 16 // m.ExternalIPAddress 130 size += 4 // m.VrfID 131 return size 132 } 133 func (m *Nat66AddDelStaticMapping) Marshal(b []byte) ([]byte, error) { 134 if b == nil { 135 b = make([]byte, m.Size()) 136 } 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 143 } 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() 150 return nil 151 } 152 153 // Nat66AddDelStaticMappingReply defines message 'nat66_add_del_static_mapping_reply'. 154 type Nat66AddDelStaticMappingReply struct { 155 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 156 } 157 158 func (m *Nat66AddDelStaticMappingReply) Reset() { *m = Nat66AddDelStaticMappingReply{} } 159 func (*Nat66AddDelStaticMappingReply) GetMessageName() string { 160 return "nat66_add_del_static_mapping_reply" 161 } 162 func (*Nat66AddDelStaticMappingReply) GetCrcString() string { return "e8d4e804" } 163 func (*Nat66AddDelStaticMappingReply) GetMessageType() api.MessageType { 164 return api.ReplyMessage 165 } 166 167 func (m *Nat66AddDelStaticMappingReply) Size() (size int) { 168 if m == nil { 169 return 0 170 } 171 size += 4 // m.Retval 172 return size 173 } 174 func (m *Nat66AddDelStaticMappingReply) Marshal(b []byte) ([]byte, error) { 175 if b == nil { 176 b = make([]byte, m.Size()) 177 } 178 buf := codec.NewBuffer(b) 179 buf.EncodeInt32(m.Retval) 180 return buf.Bytes(), nil 181 } 182 func (m *Nat66AddDelStaticMappingReply) Unmarshal(b []byte) error { 183 buf := codec.NewBuffer(b) 184 m.Retval = buf.DecodeInt32() 185 return nil 186 } 187 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"` 192 } 193 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 199 } 200 201 func (m *Nat66InterfaceDetails) Size() (size int) { 202 if m == nil { 203 return 0 204 } 205 size += 1 // m.Flags 206 size += 4 // m.SwIfIndex 207 return size 208 } 209 func (m *Nat66InterfaceDetails) Marshal(b []byte) ([]byte, error) { 210 if b == nil { 211 b = make([]byte, m.Size()) 212 } 213 buf := codec.NewBuffer(b) 214 buf.EncodeUint8(uint8(m.Flags)) 215 buf.EncodeUint32(uint32(m.SwIfIndex)) 216 return buf.Bytes(), nil 217 } 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()) 222 return nil 223 } 224 225 // Nat66InterfaceDump defines message 'nat66_interface_dump'. 226 type Nat66InterfaceDump struct{} 227 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 233 } 234 235 func (m *Nat66InterfaceDump) Size() (size int) { 236 if m == nil { 237 return 0 238 } 239 return size 240 } 241 func (m *Nat66InterfaceDump) Marshal(b []byte) ([]byte, error) { 242 if b == nil { 243 b = make([]byte, m.Size()) 244 } 245 buf := codec.NewBuffer(b) 246 return buf.Bytes(), nil 247 } 248 func (m *Nat66InterfaceDump) Unmarshal(b []byte) error { 249 return nil 250 } 251 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"` 256 } 257 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 263 } 264 265 func (m *Nat66PluginEnableDisable) Size() (size int) { 266 if m == nil { 267 return 0 268 } 269 size += 4 // m.OutsideVrf 270 size += 1 // m.Enable 271 return size 272 } 273 func (m *Nat66PluginEnableDisable) Marshal(b []byte) ([]byte, error) { 274 if b == nil { 275 b = make([]byte, m.Size()) 276 } 277 buf := codec.NewBuffer(b) 278 buf.EncodeUint32(m.OutsideVrf) 279 buf.EncodeBool(m.Enable) 280 return buf.Bytes(), nil 281 } 282 func (m *Nat66PluginEnableDisable) Unmarshal(b []byte) error { 283 buf := codec.NewBuffer(b) 284 m.OutsideVrf = buf.DecodeUint32() 285 m.Enable = buf.DecodeBool() 286 return nil 287 } 288 289 // Nat66PluginEnableDisableReply defines message 'nat66_plugin_enable_disable_reply'. 290 type Nat66PluginEnableDisableReply struct { 291 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 292 } 293 294 func (m *Nat66PluginEnableDisableReply) Reset() { *m = Nat66PluginEnableDisableReply{} } 295 func (*Nat66PluginEnableDisableReply) GetMessageName() string { 296 return "nat66_plugin_enable_disable_reply" 297 } 298 func (*Nat66PluginEnableDisableReply) GetCrcString() string { return "e8d4e804" } 299 func (*Nat66PluginEnableDisableReply) GetMessageType() api.MessageType { 300 return api.ReplyMessage 301 } 302 303 func (m *Nat66PluginEnableDisableReply) Size() (size int) { 304 if m == nil { 305 return 0 306 } 307 size += 4 // m.Retval 308 return size 309 } 310 func (m *Nat66PluginEnableDisableReply) Marshal(b []byte) ([]byte, error) { 311 if b == nil { 312 b = make([]byte, m.Size()) 313 } 314 buf := codec.NewBuffer(b) 315 buf.EncodeInt32(m.Retval) 316 return buf.Bytes(), nil 317 } 318 func (m *Nat66PluginEnableDisableReply) Unmarshal(b []byte) error { 319 buf := codec.NewBuffer(b) 320 m.Retval = buf.DecodeInt32() 321 return nil 322 } 323 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"` 331 } 332 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 338 } 339 340 func (m *Nat66StaticMappingDetails) Size() (size int) { 341 if m == nil { 342 return 0 343 } 344 size += 1 * 16 // m.LocalIPAddress 345 size += 1 * 16 // m.ExternalIPAddress 346 size += 4 // m.VrfID 347 size += 8 // m.TotalBytes 348 size += 8 // m.TotalPkts 349 return size 350 } 351 func (m *Nat66StaticMappingDetails) Marshal(b []byte) ([]byte, error) { 352 if b == nil { 353 b = make([]byte, m.Size()) 354 } 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 362 } 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() 370 return nil 371 } 372 373 // Nat66StaticMappingDump defines message 'nat66_static_mapping_dump'. 374 type Nat66StaticMappingDump struct{} 375 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 381 } 382 383 func (m *Nat66StaticMappingDump) Size() (size int) { 384 if m == nil { 385 return 0 386 } 387 return size 388 } 389 func (m *Nat66StaticMappingDump) Marshal(b []byte) ([]byte, error) { 390 if b == nil { 391 b = make([]byte, m.Size()) 392 } 393 buf := codec.NewBuffer(b) 394 return buf.Bytes(), nil 395 } 396 func (m *Nat66StaticMappingDump) Unmarshal(b []byte) error { 397 return nil 398 } 399 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") 412 } 413 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), 427 } 428 }