github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/map/map.ba.go (about) 1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT. 2 // versions: 3 // binapi-generator: v0.10.0-dev 4 // VPP: 23.10-rc0~170-g6f1548434 5 // source: plugins/map.api.json 6 7 // Package maps contains generated bindings for API file map.api. 8 // 9 // Contents: 10 // - 32 messages 11 package maps 12 13 import ( 14 interface_types "github.com/networkservicemesh/govpp/binapi/interface_types" 15 ip_types "github.com/networkservicemesh/govpp/binapi/ip_types" 16 api "go.fd.io/govpp/api" 17 codec "go.fd.io/govpp/codec" 18 ) 19 20 // This is a compile-time assertion to ensure that this generated file 21 // is compatible with the GoVPP api package it is being compiled against. 22 // A compilation error at this line likely means your copy of the 23 // GoVPP api package needs to be updated. 24 const _ = api.GoVppAPIPackageIsVersion2 25 26 const ( 27 APIFile = "map" 28 APIVersion = "4.2.1" 29 VersionCrc = 0xd1f7f56c 30 ) 31 32 // Add or Delete MAP rule from a domain (Only used for shared IPv4 per subscriber) 33 // - index - MAP Domain index 34 // - is_add - If 1 add rule, if 0 delete rule 35 // - ip6_dst - MAP CE IPv6 address 36 // - psid - Rule PSID 37 // 38 // MapAddDelRule defines message 'map_add_del_rule'. 39 type MapAddDelRule struct { 40 Index uint32 `binapi:"u32,name=index" json:"index,omitempty"` 41 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` 42 IP6Dst ip_types.IP6Address `binapi:"ip6_address,name=ip6_dst" json:"ip6_dst,omitempty"` 43 Psid uint16 `binapi:"u16,name=psid" json:"psid,omitempty"` 44 } 45 46 func (m *MapAddDelRule) Reset() { *m = MapAddDelRule{} } 47 func (*MapAddDelRule) GetMessageName() string { return "map_add_del_rule" } 48 func (*MapAddDelRule) GetCrcString() string { return "c65b32f7" } 49 func (*MapAddDelRule) GetMessageType() api.MessageType { 50 return api.RequestMessage 51 } 52 53 func (m *MapAddDelRule) Size() (size int) { 54 if m == nil { 55 return 0 56 } 57 size += 4 // m.Index 58 size += 1 // m.IsAdd 59 size += 1 * 16 // m.IP6Dst 60 size += 2 // m.Psid 61 return size 62 } 63 func (m *MapAddDelRule) Marshal(b []byte) ([]byte, error) { 64 if b == nil { 65 b = make([]byte, m.Size()) 66 } 67 buf := codec.NewBuffer(b) 68 buf.EncodeUint32(m.Index) 69 buf.EncodeBool(m.IsAdd) 70 buf.EncodeBytes(m.IP6Dst[:], 16) 71 buf.EncodeUint16(m.Psid) 72 return buf.Bytes(), nil 73 } 74 func (m *MapAddDelRule) Unmarshal(b []byte) error { 75 buf := codec.NewBuffer(b) 76 m.Index = buf.DecodeUint32() 77 m.IsAdd = buf.DecodeBool() 78 copy(m.IP6Dst[:], buf.DecodeBytes(16)) 79 m.Psid = buf.DecodeUint16() 80 return nil 81 } 82 83 // MapAddDelRuleReply defines message 'map_add_del_rule_reply'. 84 type MapAddDelRuleReply struct { 85 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 86 } 87 88 func (m *MapAddDelRuleReply) Reset() { *m = MapAddDelRuleReply{} } 89 func (*MapAddDelRuleReply) GetMessageName() string { return "map_add_del_rule_reply" } 90 func (*MapAddDelRuleReply) GetCrcString() string { return "e8d4e804" } 91 func (*MapAddDelRuleReply) GetMessageType() api.MessageType { 92 return api.ReplyMessage 93 } 94 95 func (m *MapAddDelRuleReply) Size() (size int) { 96 if m == nil { 97 return 0 98 } 99 size += 4 // m.Retval 100 return size 101 } 102 func (m *MapAddDelRuleReply) Marshal(b []byte) ([]byte, error) { 103 if b == nil { 104 b = make([]byte, m.Size()) 105 } 106 buf := codec.NewBuffer(b) 107 buf.EncodeInt32(m.Retval) 108 return buf.Bytes(), nil 109 } 110 func (m *MapAddDelRuleReply) Unmarshal(b []byte) error { 111 buf := codec.NewBuffer(b) 112 m.Retval = buf.DecodeInt32() 113 return nil 114 } 115 116 // Add MAP domains 117 // - ip6_prefix - Rule IPv6 prefix 118 // - ip4_prefix - Rule IPv4 prefix 119 // - ip6_src - MAP domain IPv6 BR address / Tunnel source 120 // - ea_bits_len - Embedded Address bits length 121 // - psid_offset - Port Set Identifier (PSID) offset 122 // - psid_length - PSID length 123 // - mtu - MTU. default 1280 124 // - tag - A user field stored with the MAP 125 // 126 // MapAddDomain defines message 'map_add_domain'. 127 type MapAddDomain struct { 128 IP6Prefix ip_types.IP6Prefix `binapi:"ip6_prefix,name=ip6_prefix" json:"ip6_prefix,omitempty"` 129 IP4Prefix ip_types.IP4Prefix `binapi:"ip4_prefix,name=ip4_prefix" json:"ip4_prefix,omitempty"` 130 IP6Src ip_types.IP6Prefix `binapi:"ip6_prefix,name=ip6_src" json:"ip6_src,omitempty"` 131 EaBitsLen uint8 `binapi:"u8,name=ea_bits_len" json:"ea_bits_len,omitempty"` 132 PsidOffset uint8 `binapi:"u8,name=psid_offset" json:"psid_offset,omitempty"` 133 PsidLength uint8 `binapi:"u8,name=psid_length" json:"psid_length,omitempty"` 134 Mtu uint16 `binapi:"u16,name=mtu,default=1280" json:"mtu,omitempty"` 135 Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"` 136 } 137 138 func (m *MapAddDomain) Reset() { *m = MapAddDomain{} } 139 func (*MapAddDomain) GetMessageName() string { return "map_add_domain" } 140 func (*MapAddDomain) GetCrcString() string { return "249f195c" } 141 func (*MapAddDomain) GetMessageType() api.MessageType { 142 return api.RequestMessage 143 } 144 145 func (m *MapAddDomain) Size() (size int) { 146 if m == nil { 147 return 0 148 } 149 size += 1 * 16 // m.IP6Prefix.Address 150 size += 1 // m.IP6Prefix.Len 151 size += 1 * 4 // m.IP4Prefix.Address 152 size += 1 // m.IP4Prefix.Len 153 size += 1 * 16 // m.IP6Src.Address 154 size += 1 // m.IP6Src.Len 155 size += 1 // m.EaBitsLen 156 size += 1 // m.PsidOffset 157 size += 1 // m.PsidLength 158 size += 2 // m.Mtu 159 size += 64 // m.Tag 160 return size 161 } 162 func (m *MapAddDomain) Marshal(b []byte) ([]byte, error) { 163 if b == nil { 164 b = make([]byte, m.Size()) 165 } 166 buf := codec.NewBuffer(b) 167 buf.EncodeBytes(m.IP6Prefix.Address[:], 16) 168 buf.EncodeUint8(m.IP6Prefix.Len) 169 buf.EncodeBytes(m.IP4Prefix.Address[:], 4) 170 buf.EncodeUint8(m.IP4Prefix.Len) 171 buf.EncodeBytes(m.IP6Src.Address[:], 16) 172 buf.EncodeUint8(m.IP6Src.Len) 173 buf.EncodeUint8(m.EaBitsLen) 174 buf.EncodeUint8(m.PsidOffset) 175 buf.EncodeUint8(m.PsidLength) 176 buf.EncodeUint16(m.Mtu) 177 buf.EncodeString(m.Tag, 64) 178 return buf.Bytes(), nil 179 } 180 func (m *MapAddDomain) Unmarshal(b []byte) error { 181 buf := codec.NewBuffer(b) 182 copy(m.IP6Prefix.Address[:], buf.DecodeBytes(16)) 183 m.IP6Prefix.Len = buf.DecodeUint8() 184 copy(m.IP4Prefix.Address[:], buf.DecodeBytes(4)) 185 m.IP4Prefix.Len = buf.DecodeUint8() 186 copy(m.IP6Src.Address[:], buf.DecodeBytes(16)) 187 m.IP6Src.Len = buf.DecodeUint8() 188 m.EaBitsLen = buf.DecodeUint8() 189 m.PsidOffset = buf.DecodeUint8() 190 m.PsidLength = buf.DecodeUint8() 191 m.Mtu = buf.DecodeUint16() 192 m.Tag = buf.DecodeString(64) 193 return nil 194 } 195 196 // Reply for MAP domain add 197 // - index - MAP domain index 198 // - retval - return code 199 // 200 // MapAddDomainReply defines message 'map_add_domain_reply'. 201 type MapAddDomainReply struct { 202 Index uint32 `binapi:"u32,name=index" json:"index,omitempty"` 203 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 204 } 205 206 func (m *MapAddDomainReply) Reset() { *m = MapAddDomainReply{} } 207 func (*MapAddDomainReply) GetMessageName() string { return "map_add_domain_reply" } 208 func (*MapAddDomainReply) GetCrcString() string { return "3e6d4e2c" } 209 func (*MapAddDomainReply) GetMessageType() api.MessageType { 210 return api.ReplyMessage 211 } 212 213 func (m *MapAddDomainReply) Size() (size int) { 214 if m == nil { 215 return 0 216 } 217 size += 4 // m.Index 218 size += 4 // m.Retval 219 return size 220 } 221 func (m *MapAddDomainReply) Marshal(b []byte) ([]byte, error) { 222 if b == nil { 223 b = make([]byte, m.Size()) 224 } 225 buf := codec.NewBuffer(b) 226 buf.EncodeUint32(m.Index) 227 buf.EncodeInt32(m.Retval) 228 return buf.Bytes(), nil 229 } 230 func (m *MapAddDomainReply) Unmarshal(b []byte) error { 231 buf := codec.NewBuffer(b) 232 m.Index = buf.DecodeUint32() 233 m.Retval = buf.DecodeInt32() 234 return nil 235 } 236 237 // Delete MAP domain 238 // - index - MAP Domain index 239 // 240 // MapDelDomain defines message 'map_del_domain'. 241 type MapDelDomain struct { 242 Index uint32 `binapi:"u32,name=index" json:"index,omitempty"` 243 } 244 245 func (m *MapDelDomain) Reset() { *m = MapDelDomain{} } 246 func (*MapDelDomain) GetMessageName() string { return "map_del_domain" } 247 func (*MapDelDomain) GetCrcString() string { return "8ac76db6" } 248 func (*MapDelDomain) GetMessageType() api.MessageType { 249 return api.RequestMessage 250 } 251 252 func (m *MapDelDomain) Size() (size int) { 253 if m == nil { 254 return 0 255 } 256 size += 4 // m.Index 257 return size 258 } 259 func (m *MapDelDomain) Marshal(b []byte) ([]byte, error) { 260 if b == nil { 261 b = make([]byte, m.Size()) 262 } 263 buf := codec.NewBuffer(b) 264 buf.EncodeUint32(m.Index) 265 return buf.Bytes(), nil 266 } 267 func (m *MapDelDomain) Unmarshal(b []byte) error { 268 buf := codec.NewBuffer(b) 269 m.Index = buf.DecodeUint32() 270 return nil 271 } 272 273 // MapDelDomainReply defines message 'map_del_domain_reply'. 274 type MapDelDomainReply struct { 275 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 276 } 277 278 func (m *MapDelDomainReply) Reset() { *m = MapDelDomainReply{} } 279 func (*MapDelDomainReply) GetMessageName() string { return "map_del_domain_reply" } 280 func (*MapDelDomainReply) GetCrcString() string { return "e8d4e804" } 281 func (*MapDelDomainReply) GetMessageType() api.MessageType { 282 return api.ReplyMessage 283 } 284 285 func (m *MapDelDomainReply) Size() (size int) { 286 if m == nil { 287 return 0 288 } 289 size += 4 // m.Retval 290 return size 291 } 292 func (m *MapDelDomainReply) Marshal(b []byte) ([]byte, error) { 293 if b == nil { 294 b = make([]byte, m.Size()) 295 } 296 buf := codec.NewBuffer(b) 297 buf.EncodeInt32(m.Retval) 298 return buf.Bytes(), nil 299 } 300 func (m *MapDelDomainReply) Unmarshal(b []byte) error { 301 buf := codec.NewBuffer(b) 302 m.Retval = buf.DecodeInt32() 303 return nil 304 } 305 306 // Details about a single MAP domain 307 // - domain_index - MAP domain index 308 // - ip6_prefix - Rule IPv6 prefix 309 // - ip4_prefix - Rule IPv4 prefix 310 // - ip6_src - MAP domain IPv6 BR address / Tunnel source 311 // - ea_bits_len - Embedded Address bits length 312 // - psid_offset - Port Set Identifier (PSID) offset 313 // - psid_length - PSID length 314 // - flags - 315 // - mtu - MTU 316 // - tag - The user field stored with the MAP at creation time 317 // 318 // MapDomainDetails defines message 'map_domain_details'. 319 type MapDomainDetails struct { 320 DomainIndex uint32 `binapi:"u32,name=domain_index" json:"domain_index,omitempty"` 321 IP6Prefix ip_types.IP6Prefix `binapi:"ip6_prefix,name=ip6_prefix" json:"ip6_prefix,omitempty"` 322 IP4Prefix ip_types.IP4Prefix `binapi:"ip4_prefix,name=ip4_prefix" json:"ip4_prefix,omitempty"` 323 IP6Src ip_types.IP6Prefix `binapi:"ip6_prefix,name=ip6_src" json:"ip6_src,omitempty"` 324 EaBitsLen uint8 `binapi:"u8,name=ea_bits_len" json:"ea_bits_len,omitempty"` 325 PsidOffset uint8 `binapi:"u8,name=psid_offset" json:"psid_offset,omitempty"` 326 PsidLength uint8 `binapi:"u8,name=psid_length" json:"psid_length,omitempty"` 327 Flags uint8 `binapi:"u8,name=flags" json:"flags,omitempty"` 328 Mtu uint16 `binapi:"u16,name=mtu" json:"mtu,omitempty"` 329 Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"` 330 } 331 332 func (m *MapDomainDetails) Reset() { *m = MapDomainDetails{} } 333 func (*MapDomainDetails) GetMessageName() string { return "map_domain_details" } 334 func (*MapDomainDetails) GetCrcString() string { return "796edb50" } 335 func (*MapDomainDetails) GetMessageType() api.MessageType { 336 return api.ReplyMessage 337 } 338 339 func (m *MapDomainDetails) Size() (size int) { 340 if m == nil { 341 return 0 342 } 343 size += 4 // m.DomainIndex 344 size += 1 * 16 // m.IP6Prefix.Address 345 size += 1 // m.IP6Prefix.Len 346 size += 1 * 4 // m.IP4Prefix.Address 347 size += 1 // m.IP4Prefix.Len 348 size += 1 * 16 // m.IP6Src.Address 349 size += 1 // m.IP6Src.Len 350 size += 1 // m.EaBitsLen 351 size += 1 // m.PsidOffset 352 size += 1 // m.PsidLength 353 size += 1 // m.Flags 354 size += 2 // m.Mtu 355 size += 64 // m.Tag 356 return size 357 } 358 func (m *MapDomainDetails) Marshal(b []byte) ([]byte, error) { 359 if b == nil { 360 b = make([]byte, m.Size()) 361 } 362 buf := codec.NewBuffer(b) 363 buf.EncodeUint32(m.DomainIndex) 364 buf.EncodeBytes(m.IP6Prefix.Address[:], 16) 365 buf.EncodeUint8(m.IP6Prefix.Len) 366 buf.EncodeBytes(m.IP4Prefix.Address[:], 4) 367 buf.EncodeUint8(m.IP4Prefix.Len) 368 buf.EncodeBytes(m.IP6Src.Address[:], 16) 369 buf.EncodeUint8(m.IP6Src.Len) 370 buf.EncodeUint8(m.EaBitsLen) 371 buf.EncodeUint8(m.PsidOffset) 372 buf.EncodeUint8(m.PsidLength) 373 buf.EncodeUint8(m.Flags) 374 buf.EncodeUint16(m.Mtu) 375 buf.EncodeString(m.Tag, 64) 376 return buf.Bytes(), nil 377 } 378 func (m *MapDomainDetails) Unmarshal(b []byte) error { 379 buf := codec.NewBuffer(b) 380 m.DomainIndex = buf.DecodeUint32() 381 copy(m.IP6Prefix.Address[:], buf.DecodeBytes(16)) 382 m.IP6Prefix.Len = buf.DecodeUint8() 383 copy(m.IP4Prefix.Address[:], buf.DecodeBytes(4)) 384 m.IP4Prefix.Len = buf.DecodeUint8() 385 copy(m.IP6Src.Address[:], buf.DecodeBytes(16)) 386 m.IP6Src.Len = buf.DecodeUint8() 387 m.EaBitsLen = buf.DecodeUint8() 388 m.PsidOffset = buf.DecodeUint8() 389 m.PsidLength = buf.DecodeUint8() 390 m.Flags = buf.DecodeUint8() 391 m.Mtu = buf.DecodeUint16() 392 m.Tag = buf.DecodeString(64) 393 return nil 394 } 395 396 // MapDomainDump defines message 'map_domain_dump'. 397 // Deprecated: the message will be removed in the future versions 398 type MapDomainDump struct{} 399 400 func (m *MapDomainDump) Reset() { *m = MapDomainDump{} } 401 func (*MapDomainDump) GetMessageName() string { return "map_domain_dump" } 402 func (*MapDomainDump) GetCrcString() string { return "51077d14" } 403 func (*MapDomainDump) GetMessageType() api.MessageType { 404 return api.RequestMessage 405 } 406 407 func (m *MapDomainDump) Size() (size int) { 408 if m == nil { 409 return 0 410 } 411 return size 412 } 413 func (m *MapDomainDump) Marshal(b []byte) ([]byte, error) { 414 if b == nil { 415 b = make([]byte, m.Size()) 416 } 417 buf := codec.NewBuffer(b) 418 return buf.Bytes(), nil 419 } 420 func (m *MapDomainDump) Unmarshal(b []byte) error { 421 return nil 422 } 423 424 // Get list of map domains 425 // MapDomainsGet defines message 'map_domains_get'. 426 type MapDomainsGet struct { 427 Cursor uint32 `binapi:"u32,name=cursor" json:"cursor,omitempty"` 428 } 429 430 func (m *MapDomainsGet) Reset() { *m = MapDomainsGet{} } 431 func (*MapDomainsGet) GetMessageName() string { return "map_domains_get" } 432 func (*MapDomainsGet) GetCrcString() string { return "f75ba505" } 433 func (*MapDomainsGet) GetMessageType() api.MessageType { 434 return api.RequestMessage 435 } 436 437 func (m *MapDomainsGet) Size() (size int) { 438 if m == nil { 439 return 0 440 } 441 size += 4 // m.Cursor 442 return size 443 } 444 func (m *MapDomainsGet) Marshal(b []byte) ([]byte, error) { 445 if b == nil { 446 b = make([]byte, m.Size()) 447 } 448 buf := codec.NewBuffer(b) 449 buf.EncodeUint32(m.Cursor) 450 return buf.Bytes(), nil 451 } 452 func (m *MapDomainsGet) Unmarshal(b []byte) error { 453 buf := codec.NewBuffer(b) 454 m.Cursor = buf.DecodeUint32() 455 return nil 456 } 457 458 // MapDomainsGetReply defines message 'map_domains_get_reply'. 459 type MapDomainsGetReply struct { 460 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 461 Cursor uint32 `binapi:"u32,name=cursor" json:"cursor,omitempty"` 462 } 463 464 func (m *MapDomainsGetReply) Reset() { *m = MapDomainsGetReply{} } 465 func (*MapDomainsGetReply) GetMessageName() string { return "map_domains_get_reply" } 466 func (*MapDomainsGetReply) GetCrcString() string { return "53b48f5d" } 467 func (*MapDomainsGetReply) GetMessageType() api.MessageType { 468 return api.ReplyMessage 469 } 470 471 func (m *MapDomainsGetReply) Size() (size int) { 472 if m == nil { 473 return 0 474 } 475 size += 4 // m.Retval 476 size += 4 // m.Cursor 477 return size 478 } 479 func (m *MapDomainsGetReply) Marshal(b []byte) ([]byte, error) { 480 if b == nil { 481 b = make([]byte, m.Size()) 482 } 483 buf := codec.NewBuffer(b) 484 buf.EncodeInt32(m.Retval) 485 buf.EncodeUint32(m.Cursor) 486 return buf.Bytes(), nil 487 } 488 func (m *MapDomainsGetReply) Unmarshal(b []byte) error { 489 buf := codec.NewBuffer(b) 490 m.Retval = buf.DecodeInt32() 491 m.Cursor = buf.DecodeUint32() 492 return nil 493 } 494 495 // Enable or disable a MAP interface 496 // - sw_if_index - 497 // - is_enable - 0=disable, 1=enable interface 498 // - is_translation - 0=encapsulation, 1=translation 499 // 500 // MapIfEnableDisable defines message 'map_if_enable_disable'. 501 type MapIfEnableDisable struct { 502 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 503 IsEnable bool `binapi:"bool,name=is_enable" json:"is_enable,omitempty"` 504 IsTranslation bool `binapi:"bool,name=is_translation" json:"is_translation,omitempty"` 505 } 506 507 func (m *MapIfEnableDisable) Reset() { *m = MapIfEnableDisable{} } 508 func (*MapIfEnableDisable) GetMessageName() string { return "map_if_enable_disable" } 509 func (*MapIfEnableDisable) GetCrcString() string { return "59bb32f4" } 510 func (*MapIfEnableDisable) GetMessageType() api.MessageType { 511 return api.RequestMessage 512 } 513 514 func (m *MapIfEnableDisable) Size() (size int) { 515 if m == nil { 516 return 0 517 } 518 size += 4 // m.SwIfIndex 519 size += 1 // m.IsEnable 520 size += 1 // m.IsTranslation 521 return size 522 } 523 func (m *MapIfEnableDisable) Marshal(b []byte) ([]byte, error) { 524 if b == nil { 525 b = make([]byte, m.Size()) 526 } 527 buf := codec.NewBuffer(b) 528 buf.EncodeUint32(uint32(m.SwIfIndex)) 529 buf.EncodeBool(m.IsEnable) 530 buf.EncodeBool(m.IsTranslation) 531 return buf.Bytes(), nil 532 } 533 func (m *MapIfEnableDisable) Unmarshal(b []byte) error { 534 buf := codec.NewBuffer(b) 535 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 536 m.IsEnable = buf.DecodeBool() 537 m.IsTranslation = buf.DecodeBool() 538 return nil 539 } 540 541 // MapIfEnableDisableReply defines message 'map_if_enable_disable_reply'. 542 type MapIfEnableDisableReply struct { 543 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 544 } 545 546 func (m *MapIfEnableDisableReply) Reset() { *m = MapIfEnableDisableReply{} } 547 func (*MapIfEnableDisableReply) GetMessageName() string { return "map_if_enable_disable_reply" } 548 func (*MapIfEnableDisableReply) GetCrcString() string { return "e8d4e804" } 549 func (*MapIfEnableDisableReply) GetMessageType() api.MessageType { 550 return api.ReplyMessage 551 } 552 553 func (m *MapIfEnableDisableReply) Size() (size int) { 554 if m == nil { 555 return 0 556 } 557 size += 4 // m.Retval 558 return size 559 } 560 func (m *MapIfEnableDisableReply) Marshal(b []byte) ([]byte, error) { 561 if b == nil { 562 b = make([]byte, m.Size()) 563 } 564 buf := codec.NewBuffer(b) 565 buf.EncodeInt32(m.Retval) 566 return buf.Bytes(), nil 567 } 568 func (m *MapIfEnableDisableReply) Unmarshal(b []byte) error { 569 buf := codec.NewBuffer(b) 570 m.Retval = buf.DecodeInt32() 571 return nil 572 } 573 574 // Add/delete MAP pre-resolve IP addresses parameters 575 // - is_add - 1 = Add non-zero IP addresses, 0 = delete 576 // - ip4_nh_address - direct IP4 next-hop address 577 // - ip6_nh_address - direct IP6 next-hop address 578 // 579 // MapParamAddDelPreResolve defines message 'map_param_add_del_pre_resolve'. 580 type MapParamAddDelPreResolve struct { 581 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` 582 IP4NhAddress ip_types.IP4Address `binapi:"ip4_address,name=ip4_nh_address" json:"ip4_nh_address,omitempty"` 583 IP6NhAddress ip_types.IP6Address `binapi:"ip6_address,name=ip6_nh_address" json:"ip6_nh_address,omitempty"` 584 } 585 586 func (m *MapParamAddDelPreResolve) Reset() { *m = MapParamAddDelPreResolve{} } 587 func (*MapParamAddDelPreResolve) GetMessageName() string { return "map_param_add_del_pre_resolve" } 588 func (*MapParamAddDelPreResolve) GetCrcString() string { return "dae5af03" } 589 func (*MapParamAddDelPreResolve) GetMessageType() api.MessageType { 590 return api.RequestMessage 591 } 592 593 func (m *MapParamAddDelPreResolve) Size() (size int) { 594 if m == nil { 595 return 0 596 } 597 size += 1 // m.IsAdd 598 size += 1 * 4 // m.IP4NhAddress 599 size += 1 * 16 // m.IP6NhAddress 600 return size 601 } 602 func (m *MapParamAddDelPreResolve) Marshal(b []byte) ([]byte, error) { 603 if b == nil { 604 b = make([]byte, m.Size()) 605 } 606 buf := codec.NewBuffer(b) 607 buf.EncodeBool(m.IsAdd) 608 buf.EncodeBytes(m.IP4NhAddress[:], 4) 609 buf.EncodeBytes(m.IP6NhAddress[:], 16) 610 return buf.Bytes(), nil 611 } 612 func (m *MapParamAddDelPreResolve) Unmarshal(b []byte) error { 613 buf := codec.NewBuffer(b) 614 m.IsAdd = buf.DecodeBool() 615 copy(m.IP4NhAddress[:], buf.DecodeBytes(4)) 616 copy(m.IP6NhAddress[:], buf.DecodeBytes(16)) 617 return nil 618 } 619 620 // MapParamAddDelPreResolveReply defines message 'map_param_add_del_pre_resolve_reply'. 621 type MapParamAddDelPreResolveReply struct { 622 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 623 } 624 625 func (m *MapParamAddDelPreResolveReply) Reset() { *m = MapParamAddDelPreResolveReply{} } 626 func (*MapParamAddDelPreResolveReply) GetMessageName() string { 627 return "map_param_add_del_pre_resolve_reply" 628 } 629 func (*MapParamAddDelPreResolveReply) GetCrcString() string { return "e8d4e804" } 630 func (*MapParamAddDelPreResolveReply) GetMessageType() api.MessageType { 631 return api.ReplyMessage 632 } 633 634 func (m *MapParamAddDelPreResolveReply) Size() (size int) { 635 if m == nil { 636 return 0 637 } 638 size += 4 // m.Retval 639 return size 640 } 641 func (m *MapParamAddDelPreResolveReply) Marshal(b []byte) ([]byte, error) { 642 if b == nil { 643 b = make([]byte, m.Size()) 644 } 645 buf := codec.NewBuffer(b) 646 buf.EncodeInt32(m.Retval) 647 return buf.Bytes(), nil 648 } 649 func (m *MapParamAddDelPreResolveReply) Unmarshal(b []byte) error { 650 buf := codec.NewBuffer(b) 651 m.Retval = buf.DecodeInt32() 652 return nil 653 } 654 655 // Request for a single block of MAP parameters 656 // MapParamGet defines message 'map_param_get'. 657 type MapParamGet struct{} 658 659 func (m *MapParamGet) Reset() { *m = MapParamGet{} } 660 func (*MapParamGet) GetMessageName() string { return "map_param_get" } 661 func (*MapParamGet) GetCrcString() string { return "51077d14" } 662 func (*MapParamGet) GetMessageType() api.MessageType { 663 return api.RequestMessage 664 } 665 666 func (m *MapParamGet) Size() (size int) { 667 if m == nil { 668 return 0 669 } 670 return size 671 } 672 func (m *MapParamGet) Marshal(b []byte) ([]byte, error) { 673 if b == nil { 674 b = make([]byte, m.Size()) 675 } 676 buf := codec.NewBuffer(b) 677 return buf.Bytes(), nil 678 } 679 func (m *MapParamGet) Unmarshal(b []byte) error { 680 return nil 681 } 682 683 // Reply for map_param_get request 684 // - retval - return code for request 685 // - inner - 1=frag inner packet, 0=frag tunnel packets, ~0=untouched 686 // - ignore_df - 1=IP4 fragm despite DF bit, 0=honor DF, ~0=untouched 687 // - icmp_ip4_err_relay_src - IPv4 ICMP err relay src address 688 // - icmp6_enable_unreachable - 1 = send ICMP unreachable err msgs 689 // - ip4_nh_address - direct IP4 next-hop address 690 // - ip6_nh_address - direct IP6 next-hop address 691 // - sec_check_enable - 1=enable security check on first inbound packet 692 // - sec_check_fragments - 1=enable check on (subsequent) fragments too 693 // - tc_copy - 1 = copy packet class/TOS field, 0 = use class instead 694 // - tc_class - class field value when copy == 0 695 // 696 // MapParamGetReply defines message 'map_param_get_reply'. 697 type MapParamGetReply struct { 698 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 699 FragInner uint8 `binapi:"u8,name=frag_inner" json:"frag_inner,omitempty"` 700 FragIgnoreDf uint8 `binapi:"u8,name=frag_ignore_df" json:"frag_ignore_df,omitempty"` 701 ICMPIP4ErrRelaySrc ip_types.IP4Address `binapi:"ip4_address,name=icmp_ip4_err_relay_src" json:"icmp_ip4_err_relay_src,omitempty"` 702 ICMP6EnableUnreachable bool `binapi:"bool,name=icmp6_enable_unreachable" json:"icmp6_enable_unreachable,omitempty"` 703 IP4NhAddress ip_types.IP4Address `binapi:"ip4_address,name=ip4_nh_address" json:"ip4_nh_address,omitempty"` 704 IP6NhAddress ip_types.IP6Address `binapi:"ip6_address,name=ip6_nh_address" json:"ip6_nh_address,omitempty"` 705 IP4LifetimeMs uint16 `binapi:"u16,name=ip4_lifetime_ms" json:"ip4_lifetime_ms,omitempty"` 706 IP4PoolSize uint16 `binapi:"u16,name=ip4_pool_size" json:"ip4_pool_size,omitempty"` 707 IP4Buffers uint32 `binapi:"u32,name=ip4_buffers" json:"ip4_buffers,omitempty"` 708 IP4HtRatio float64 `binapi:"f64,name=ip4_ht_ratio" json:"ip4_ht_ratio,omitempty"` 709 SecCheckEnable bool `binapi:"bool,name=sec_check_enable" json:"sec_check_enable,omitempty"` 710 SecCheckFragments bool `binapi:"bool,name=sec_check_fragments" json:"sec_check_fragments,omitempty"` 711 TcCopy bool `binapi:"bool,name=tc_copy" json:"tc_copy,omitempty"` 712 TcClass uint8 `binapi:"u8,name=tc_class" json:"tc_class,omitempty"` 713 } 714 715 func (m *MapParamGetReply) Reset() { *m = MapParamGetReply{} } 716 func (*MapParamGetReply) GetMessageName() string { return "map_param_get_reply" } 717 func (*MapParamGetReply) GetCrcString() string { return "26272c90" } 718 func (*MapParamGetReply) GetMessageType() api.MessageType { 719 return api.ReplyMessage 720 } 721 722 func (m *MapParamGetReply) Size() (size int) { 723 if m == nil { 724 return 0 725 } 726 size += 4 // m.Retval 727 size += 1 // m.FragInner 728 size += 1 // m.FragIgnoreDf 729 size += 1 * 4 // m.ICMPIP4ErrRelaySrc 730 size += 1 // m.ICMP6EnableUnreachable 731 size += 1 * 4 // m.IP4NhAddress 732 size += 1 * 16 // m.IP6NhAddress 733 size += 2 // m.IP4LifetimeMs 734 size += 2 // m.IP4PoolSize 735 size += 4 // m.IP4Buffers 736 size += 8 // m.IP4HtRatio 737 size += 1 // m.SecCheckEnable 738 size += 1 // m.SecCheckFragments 739 size += 1 // m.TcCopy 740 size += 1 // m.TcClass 741 return size 742 } 743 func (m *MapParamGetReply) Marshal(b []byte) ([]byte, error) { 744 if b == nil { 745 b = make([]byte, m.Size()) 746 } 747 buf := codec.NewBuffer(b) 748 buf.EncodeInt32(m.Retval) 749 buf.EncodeUint8(m.FragInner) 750 buf.EncodeUint8(m.FragIgnoreDf) 751 buf.EncodeBytes(m.ICMPIP4ErrRelaySrc[:], 4) 752 buf.EncodeBool(m.ICMP6EnableUnreachable) 753 buf.EncodeBytes(m.IP4NhAddress[:], 4) 754 buf.EncodeBytes(m.IP6NhAddress[:], 16) 755 buf.EncodeUint16(m.IP4LifetimeMs) 756 buf.EncodeUint16(m.IP4PoolSize) 757 buf.EncodeUint32(m.IP4Buffers) 758 buf.EncodeFloat64(m.IP4HtRatio) 759 buf.EncodeBool(m.SecCheckEnable) 760 buf.EncodeBool(m.SecCheckFragments) 761 buf.EncodeBool(m.TcCopy) 762 buf.EncodeUint8(m.TcClass) 763 return buf.Bytes(), nil 764 } 765 func (m *MapParamGetReply) Unmarshal(b []byte) error { 766 buf := codec.NewBuffer(b) 767 m.Retval = buf.DecodeInt32() 768 m.FragInner = buf.DecodeUint8() 769 m.FragIgnoreDf = buf.DecodeUint8() 770 copy(m.ICMPIP4ErrRelaySrc[:], buf.DecodeBytes(4)) 771 m.ICMP6EnableUnreachable = buf.DecodeBool() 772 copy(m.IP4NhAddress[:], buf.DecodeBytes(4)) 773 copy(m.IP6NhAddress[:], buf.DecodeBytes(16)) 774 m.IP4LifetimeMs = buf.DecodeUint16() 775 m.IP4PoolSize = buf.DecodeUint16() 776 m.IP4Buffers = buf.DecodeUint32() 777 m.IP4HtRatio = buf.DecodeFloat64() 778 m.SecCheckEnable = buf.DecodeBool() 779 m.SecCheckFragments = buf.DecodeBool() 780 m.TcCopy = buf.DecodeBool() 781 m.TcClass = buf.DecodeUint8() 782 return nil 783 } 784 785 // Set MAP fragmentation parameters 786 // - inner - 1=frag inner packet, 0=frag tunnel packets 787 // - ignore_df - 1=IP4 fragment despite DF bit, 0=honor DF 788 // 789 // MapParamSetFragmentation defines message 'map_param_set_fragmentation'. 790 type MapParamSetFragmentation struct { 791 Inner bool `binapi:"bool,name=inner" json:"inner,omitempty"` 792 IgnoreDf bool `binapi:"bool,name=ignore_df" json:"ignore_df,omitempty"` 793 } 794 795 func (m *MapParamSetFragmentation) Reset() { *m = MapParamSetFragmentation{} } 796 func (*MapParamSetFragmentation) GetMessageName() string { return "map_param_set_fragmentation" } 797 func (*MapParamSetFragmentation) GetCrcString() string { return "9ff54d90" } 798 func (*MapParamSetFragmentation) GetMessageType() api.MessageType { 799 return api.RequestMessage 800 } 801 802 func (m *MapParamSetFragmentation) Size() (size int) { 803 if m == nil { 804 return 0 805 } 806 size += 1 // m.Inner 807 size += 1 // m.IgnoreDf 808 return size 809 } 810 func (m *MapParamSetFragmentation) Marshal(b []byte) ([]byte, error) { 811 if b == nil { 812 b = make([]byte, m.Size()) 813 } 814 buf := codec.NewBuffer(b) 815 buf.EncodeBool(m.Inner) 816 buf.EncodeBool(m.IgnoreDf) 817 return buf.Bytes(), nil 818 } 819 func (m *MapParamSetFragmentation) Unmarshal(b []byte) error { 820 buf := codec.NewBuffer(b) 821 m.Inner = buf.DecodeBool() 822 m.IgnoreDf = buf.DecodeBool() 823 return nil 824 } 825 826 // MapParamSetFragmentationReply defines message 'map_param_set_fragmentation_reply'. 827 type MapParamSetFragmentationReply struct { 828 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 829 } 830 831 func (m *MapParamSetFragmentationReply) Reset() { *m = MapParamSetFragmentationReply{} } 832 func (*MapParamSetFragmentationReply) GetMessageName() string { 833 return "map_param_set_fragmentation_reply" 834 } 835 func (*MapParamSetFragmentationReply) GetCrcString() string { return "e8d4e804" } 836 func (*MapParamSetFragmentationReply) GetMessageType() api.MessageType { 837 return api.ReplyMessage 838 } 839 840 func (m *MapParamSetFragmentationReply) Size() (size int) { 841 if m == nil { 842 return 0 843 } 844 size += 4 // m.Retval 845 return size 846 } 847 func (m *MapParamSetFragmentationReply) Marshal(b []byte) ([]byte, error) { 848 if b == nil { 849 b = make([]byte, m.Size()) 850 } 851 buf := codec.NewBuffer(b) 852 buf.EncodeInt32(m.Retval) 853 return buf.Bytes(), nil 854 } 855 func (m *MapParamSetFragmentationReply) Unmarshal(b []byte) error { 856 buf := codec.NewBuffer(b) 857 m.Retval = buf.DecodeInt32() 858 return nil 859 } 860 861 // Set MAP ICMP parameters 862 // - icmp4_err_relay_src - IPv4 ICMP err relay src address 863 // 864 // MapParamSetICMP defines message 'map_param_set_icmp'. 865 type MapParamSetICMP struct { 866 IP4ErrRelaySrc ip_types.IP4Address `binapi:"ip4_address,name=ip4_err_relay_src" json:"ip4_err_relay_src,omitempty"` 867 } 868 869 func (m *MapParamSetICMP) Reset() { *m = MapParamSetICMP{} } 870 func (*MapParamSetICMP) GetMessageName() string { return "map_param_set_icmp" } 871 func (*MapParamSetICMP) GetCrcString() string { return "58210cbf" } 872 func (*MapParamSetICMP) GetMessageType() api.MessageType { 873 return api.RequestMessage 874 } 875 876 func (m *MapParamSetICMP) Size() (size int) { 877 if m == nil { 878 return 0 879 } 880 size += 1 * 4 // m.IP4ErrRelaySrc 881 return size 882 } 883 func (m *MapParamSetICMP) Marshal(b []byte) ([]byte, error) { 884 if b == nil { 885 b = make([]byte, m.Size()) 886 } 887 buf := codec.NewBuffer(b) 888 buf.EncodeBytes(m.IP4ErrRelaySrc[:], 4) 889 return buf.Bytes(), nil 890 } 891 func (m *MapParamSetICMP) Unmarshal(b []byte) error { 892 buf := codec.NewBuffer(b) 893 copy(m.IP4ErrRelaySrc[:], buf.DecodeBytes(4)) 894 return nil 895 } 896 897 // Set MAP ICMP6 parameters 898 // - enable_unreachable - 1 = send ICMP unreachable err msgs 899 // 900 // MapParamSetICMP6 defines message 'map_param_set_icmp6'. 901 type MapParamSetICMP6 struct { 902 EnableUnreachable bool `binapi:"bool,name=enable_unreachable" json:"enable_unreachable,omitempty"` 903 } 904 905 func (m *MapParamSetICMP6) Reset() { *m = MapParamSetICMP6{} } 906 func (*MapParamSetICMP6) GetMessageName() string { return "map_param_set_icmp6" } 907 func (*MapParamSetICMP6) GetCrcString() string { return "5d01f8c1" } 908 func (*MapParamSetICMP6) GetMessageType() api.MessageType { 909 return api.RequestMessage 910 } 911 912 func (m *MapParamSetICMP6) Size() (size int) { 913 if m == nil { 914 return 0 915 } 916 size += 1 // m.EnableUnreachable 917 return size 918 } 919 func (m *MapParamSetICMP6) Marshal(b []byte) ([]byte, error) { 920 if b == nil { 921 b = make([]byte, m.Size()) 922 } 923 buf := codec.NewBuffer(b) 924 buf.EncodeBool(m.EnableUnreachable) 925 return buf.Bytes(), nil 926 } 927 func (m *MapParamSetICMP6) Unmarshal(b []byte) error { 928 buf := codec.NewBuffer(b) 929 m.EnableUnreachable = buf.DecodeBool() 930 return nil 931 } 932 933 // MapParamSetICMP6Reply defines message 'map_param_set_icmp6_reply'. 934 type MapParamSetICMP6Reply struct { 935 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 936 } 937 938 func (m *MapParamSetICMP6Reply) Reset() { *m = MapParamSetICMP6Reply{} } 939 func (*MapParamSetICMP6Reply) GetMessageName() string { return "map_param_set_icmp6_reply" } 940 func (*MapParamSetICMP6Reply) GetCrcString() string { return "e8d4e804" } 941 func (*MapParamSetICMP6Reply) GetMessageType() api.MessageType { 942 return api.ReplyMessage 943 } 944 945 func (m *MapParamSetICMP6Reply) Size() (size int) { 946 if m == nil { 947 return 0 948 } 949 size += 4 // m.Retval 950 return size 951 } 952 func (m *MapParamSetICMP6Reply) Marshal(b []byte) ([]byte, error) { 953 if b == nil { 954 b = make([]byte, m.Size()) 955 } 956 buf := codec.NewBuffer(b) 957 buf.EncodeInt32(m.Retval) 958 return buf.Bytes(), nil 959 } 960 func (m *MapParamSetICMP6Reply) Unmarshal(b []byte) error { 961 buf := codec.NewBuffer(b) 962 m.Retval = buf.DecodeInt32() 963 return nil 964 } 965 966 // MapParamSetICMPReply defines message 'map_param_set_icmp_reply'. 967 type MapParamSetICMPReply struct { 968 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 969 } 970 971 func (m *MapParamSetICMPReply) Reset() { *m = MapParamSetICMPReply{} } 972 func (*MapParamSetICMPReply) GetMessageName() string { return "map_param_set_icmp_reply" } 973 func (*MapParamSetICMPReply) GetCrcString() string { return "e8d4e804" } 974 func (*MapParamSetICMPReply) GetMessageType() api.MessageType { 975 return api.ReplyMessage 976 } 977 978 func (m *MapParamSetICMPReply) Size() (size int) { 979 if m == nil { 980 return 0 981 } 982 size += 4 // m.Retval 983 return size 984 } 985 func (m *MapParamSetICMPReply) Marshal(b []byte) ([]byte, error) { 986 if b == nil { 987 b = make([]byte, m.Size()) 988 } 989 buf := codec.NewBuffer(b) 990 buf.EncodeInt32(m.Retval) 991 return buf.Bytes(), nil 992 } 993 func (m *MapParamSetICMPReply) Unmarshal(b []byte) error { 994 buf := codec.NewBuffer(b) 995 m.Retval = buf.DecodeInt32() 996 return nil 997 } 998 999 // Set MAP security-check parameters 1000 // - enable - 1=enable security check on first inbound packet 1001 // - fragments - 1=enable check on (subsequent) fragments too 1002 // 1003 // MapParamSetSecurityCheck defines message 'map_param_set_security_check'. 1004 type MapParamSetSecurityCheck struct { 1005 Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"` 1006 Fragments bool `binapi:"bool,name=fragments" json:"fragments,omitempty"` 1007 } 1008 1009 func (m *MapParamSetSecurityCheck) Reset() { *m = MapParamSetSecurityCheck{} } 1010 func (*MapParamSetSecurityCheck) GetMessageName() string { return "map_param_set_security_check" } 1011 func (*MapParamSetSecurityCheck) GetCrcString() string { return "6abe9836" } 1012 func (*MapParamSetSecurityCheck) GetMessageType() api.MessageType { 1013 return api.RequestMessage 1014 } 1015 1016 func (m *MapParamSetSecurityCheck) Size() (size int) { 1017 if m == nil { 1018 return 0 1019 } 1020 size += 1 // m.Enable 1021 size += 1 // m.Fragments 1022 return size 1023 } 1024 func (m *MapParamSetSecurityCheck) Marshal(b []byte) ([]byte, error) { 1025 if b == nil { 1026 b = make([]byte, m.Size()) 1027 } 1028 buf := codec.NewBuffer(b) 1029 buf.EncodeBool(m.Enable) 1030 buf.EncodeBool(m.Fragments) 1031 return buf.Bytes(), nil 1032 } 1033 func (m *MapParamSetSecurityCheck) Unmarshal(b []byte) error { 1034 buf := codec.NewBuffer(b) 1035 m.Enable = buf.DecodeBool() 1036 m.Fragments = buf.DecodeBool() 1037 return nil 1038 } 1039 1040 // MapParamSetSecurityCheckReply defines message 'map_param_set_security_check_reply'. 1041 type MapParamSetSecurityCheckReply struct { 1042 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1043 } 1044 1045 func (m *MapParamSetSecurityCheckReply) Reset() { *m = MapParamSetSecurityCheckReply{} } 1046 func (*MapParamSetSecurityCheckReply) GetMessageName() string { 1047 return "map_param_set_security_check_reply" 1048 } 1049 func (*MapParamSetSecurityCheckReply) GetCrcString() string { return "e8d4e804" } 1050 func (*MapParamSetSecurityCheckReply) GetMessageType() api.MessageType { 1051 return api.ReplyMessage 1052 } 1053 1054 func (m *MapParamSetSecurityCheckReply) Size() (size int) { 1055 if m == nil { 1056 return 0 1057 } 1058 size += 4 // m.Retval 1059 return size 1060 } 1061 func (m *MapParamSetSecurityCheckReply) Marshal(b []byte) ([]byte, error) { 1062 if b == nil { 1063 b = make([]byte, m.Size()) 1064 } 1065 buf := codec.NewBuffer(b) 1066 buf.EncodeInt32(m.Retval) 1067 return buf.Bytes(), nil 1068 } 1069 func (m *MapParamSetSecurityCheckReply) Unmarshal(b []byte) error { 1070 buf := codec.NewBuffer(b) 1071 m.Retval = buf.DecodeInt32() 1072 return nil 1073 } 1074 1075 // Set MAP TCP parameters 1076 // 1077 // @parma tcp_mss - TCP MSS clamping value 1078 // 1079 // MapParamSetTCP defines message 'map_param_set_tcp'. 1080 type MapParamSetTCP struct { 1081 TCPMss uint16 `binapi:"u16,name=tcp_mss" json:"tcp_mss,omitempty"` 1082 } 1083 1084 func (m *MapParamSetTCP) Reset() { *m = MapParamSetTCP{} } 1085 func (*MapParamSetTCP) GetMessageName() string { return "map_param_set_tcp" } 1086 func (*MapParamSetTCP) GetCrcString() string { return "87a825d9" } 1087 func (*MapParamSetTCP) GetMessageType() api.MessageType { 1088 return api.RequestMessage 1089 } 1090 1091 func (m *MapParamSetTCP) Size() (size int) { 1092 if m == nil { 1093 return 0 1094 } 1095 size += 2 // m.TCPMss 1096 return size 1097 } 1098 func (m *MapParamSetTCP) Marshal(b []byte) ([]byte, error) { 1099 if b == nil { 1100 b = make([]byte, m.Size()) 1101 } 1102 buf := codec.NewBuffer(b) 1103 buf.EncodeUint16(m.TCPMss) 1104 return buf.Bytes(), nil 1105 } 1106 func (m *MapParamSetTCP) Unmarshal(b []byte) error { 1107 buf := codec.NewBuffer(b) 1108 m.TCPMss = buf.DecodeUint16() 1109 return nil 1110 } 1111 1112 // MapParamSetTCPReply defines message 'map_param_set_tcp_reply'. 1113 type MapParamSetTCPReply struct { 1114 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1115 } 1116 1117 func (m *MapParamSetTCPReply) Reset() { *m = MapParamSetTCPReply{} } 1118 func (*MapParamSetTCPReply) GetMessageName() string { return "map_param_set_tcp_reply" } 1119 func (*MapParamSetTCPReply) GetCrcString() string { return "e8d4e804" } 1120 func (*MapParamSetTCPReply) GetMessageType() api.MessageType { 1121 return api.ReplyMessage 1122 } 1123 1124 func (m *MapParamSetTCPReply) Size() (size int) { 1125 if m == nil { 1126 return 0 1127 } 1128 size += 4 // m.Retval 1129 return size 1130 } 1131 func (m *MapParamSetTCPReply) Marshal(b []byte) ([]byte, error) { 1132 if b == nil { 1133 b = make([]byte, m.Size()) 1134 } 1135 buf := codec.NewBuffer(b) 1136 buf.EncodeInt32(m.Retval) 1137 return buf.Bytes(), nil 1138 } 1139 func (m *MapParamSetTCPReply) Unmarshal(b []byte) error { 1140 buf := codec.NewBuffer(b) 1141 m.Retval = buf.DecodeInt32() 1142 return nil 1143 } 1144 1145 // Set MAP traffic class parameters 1146 // - copy - 1 = copy packet class/TOS field, 0 = use tc_class instead 1147 // - tc_class - class field value when copy == 0 1148 // 1149 // MapParamSetTrafficClass defines message 'map_param_set_traffic_class'. 1150 type MapParamSetTrafficClass struct { 1151 Copy bool `binapi:"bool,name=copy" json:"copy,omitempty"` 1152 TcClass uint8 `binapi:"u8,name=tc_class" json:"tc_class,omitempty"` 1153 } 1154 1155 func (m *MapParamSetTrafficClass) Reset() { *m = MapParamSetTrafficClass{} } 1156 func (*MapParamSetTrafficClass) GetMessageName() string { return "map_param_set_traffic_class" } 1157 func (*MapParamSetTrafficClass) GetCrcString() string { return "9cac455c" } 1158 func (*MapParamSetTrafficClass) GetMessageType() api.MessageType { 1159 return api.RequestMessage 1160 } 1161 1162 func (m *MapParamSetTrafficClass) Size() (size int) { 1163 if m == nil { 1164 return 0 1165 } 1166 size += 1 // m.Copy 1167 size += 1 // m.TcClass 1168 return size 1169 } 1170 func (m *MapParamSetTrafficClass) Marshal(b []byte) ([]byte, error) { 1171 if b == nil { 1172 b = make([]byte, m.Size()) 1173 } 1174 buf := codec.NewBuffer(b) 1175 buf.EncodeBool(m.Copy) 1176 buf.EncodeUint8(m.TcClass) 1177 return buf.Bytes(), nil 1178 } 1179 func (m *MapParamSetTrafficClass) Unmarshal(b []byte) error { 1180 buf := codec.NewBuffer(b) 1181 m.Copy = buf.DecodeBool() 1182 m.TcClass = buf.DecodeUint8() 1183 return nil 1184 } 1185 1186 // MapParamSetTrafficClassReply defines message 'map_param_set_traffic_class_reply'. 1187 type MapParamSetTrafficClassReply struct { 1188 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1189 } 1190 1191 func (m *MapParamSetTrafficClassReply) Reset() { *m = MapParamSetTrafficClassReply{} } 1192 func (*MapParamSetTrafficClassReply) GetMessageName() string { 1193 return "map_param_set_traffic_class_reply" 1194 } 1195 func (*MapParamSetTrafficClassReply) GetCrcString() string { return "e8d4e804" } 1196 func (*MapParamSetTrafficClassReply) GetMessageType() api.MessageType { 1197 return api.ReplyMessage 1198 } 1199 1200 func (m *MapParamSetTrafficClassReply) Size() (size int) { 1201 if m == nil { 1202 return 0 1203 } 1204 size += 4 // m.Retval 1205 return size 1206 } 1207 func (m *MapParamSetTrafficClassReply) Marshal(b []byte) ([]byte, error) { 1208 if b == nil { 1209 b = make([]byte, m.Size()) 1210 } 1211 buf := codec.NewBuffer(b) 1212 buf.EncodeInt32(m.Retval) 1213 return buf.Bytes(), nil 1214 } 1215 func (m *MapParamSetTrafficClassReply) Unmarshal(b []byte) error { 1216 buf := codec.NewBuffer(b) 1217 m.Retval = buf.DecodeInt32() 1218 return nil 1219 } 1220 1221 // MapRuleDetails defines message 'map_rule_details'. 1222 type MapRuleDetails struct { 1223 IP6Dst ip_types.IP6Address `binapi:"ip6_address,name=ip6_dst" json:"ip6_dst,omitempty"` 1224 Psid uint16 `binapi:"u16,name=psid" json:"psid,omitempty"` 1225 } 1226 1227 func (m *MapRuleDetails) Reset() { *m = MapRuleDetails{} } 1228 func (*MapRuleDetails) GetMessageName() string { return "map_rule_details" } 1229 func (*MapRuleDetails) GetCrcString() string { return "c7cbeea5" } 1230 func (*MapRuleDetails) GetMessageType() api.MessageType { 1231 return api.ReplyMessage 1232 } 1233 1234 func (m *MapRuleDetails) Size() (size int) { 1235 if m == nil { 1236 return 0 1237 } 1238 size += 1 * 16 // m.IP6Dst 1239 size += 2 // m.Psid 1240 return size 1241 } 1242 func (m *MapRuleDetails) Marshal(b []byte) ([]byte, error) { 1243 if b == nil { 1244 b = make([]byte, m.Size()) 1245 } 1246 buf := codec.NewBuffer(b) 1247 buf.EncodeBytes(m.IP6Dst[:], 16) 1248 buf.EncodeUint16(m.Psid) 1249 return buf.Bytes(), nil 1250 } 1251 func (m *MapRuleDetails) Unmarshal(b []byte) error { 1252 buf := codec.NewBuffer(b) 1253 copy(m.IP6Dst[:], buf.DecodeBytes(16)) 1254 m.Psid = buf.DecodeUint16() 1255 return nil 1256 } 1257 1258 // MapRuleDump defines message 'map_rule_dump'. 1259 type MapRuleDump struct { 1260 DomainIndex uint32 `binapi:"u32,name=domain_index" json:"domain_index,omitempty"` 1261 } 1262 1263 func (m *MapRuleDump) Reset() { *m = MapRuleDump{} } 1264 func (*MapRuleDump) GetMessageName() string { return "map_rule_dump" } 1265 func (*MapRuleDump) GetCrcString() string { return "e43e6ff6" } 1266 func (*MapRuleDump) GetMessageType() api.MessageType { 1267 return api.RequestMessage 1268 } 1269 1270 func (m *MapRuleDump) Size() (size int) { 1271 if m == nil { 1272 return 0 1273 } 1274 size += 4 // m.DomainIndex 1275 return size 1276 } 1277 func (m *MapRuleDump) Marshal(b []byte) ([]byte, error) { 1278 if b == nil { 1279 b = make([]byte, m.Size()) 1280 } 1281 buf := codec.NewBuffer(b) 1282 buf.EncodeUint32(m.DomainIndex) 1283 return buf.Bytes(), nil 1284 } 1285 func (m *MapRuleDump) Unmarshal(b []byte) error { 1286 buf := codec.NewBuffer(b) 1287 m.DomainIndex = buf.DecodeUint32() 1288 return nil 1289 } 1290 1291 // Request for a single block of summary stats 1292 // MapSummaryStats defines message 'map_summary_stats'. 1293 type MapSummaryStats struct{} 1294 1295 func (m *MapSummaryStats) Reset() { *m = MapSummaryStats{} } 1296 func (*MapSummaryStats) GetMessageName() string { return "map_summary_stats" } 1297 func (*MapSummaryStats) GetCrcString() string { return "51077d14" } 1298 func (*MapSummaryStats) GetMessageType() api.MessageType { 1299 return api.RequestMessage 1300 } 1301 1302 func (m *MapSummaryStats) Size() (size int) { 1303 if m == nil { 1304 return 0 1305 } 1306 return size 1307 } 1308 func (m *MapSummaryStats) Marshal(b []byte) ([]byte, error) { 1309 if b == nil { 1310 b = make([]byte, m.Size()) 1311 } 1312 buf := codec.NewBuffer(b) 1313 return buf.Bytes(), nil 1314 } 1315 func (m *MapSummaryStats) Unmarshal(b []byte) error { 1316 return nil 1317 } 1318 1319 // Reply for map_summary_stats request 1320 // - retval - return code for request 1321 // - total_bindings - 1322 // - total_pkts - 1323 // - total_ip4_fragments - 1324 // - total_security_check - 1325 // 1326 // MapSummaryStatsReply defines message 'map_summary_stats_reply'. 1327 type MapSummaryStatsReply struct { 1328 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1329 TotalBindings uint64 `binapi:"u64,name=total_bindings" json:"total_bindings,omitempty"` 1330 TotalPkts []uint64 `binapi:"u64[2],name=total_pkts" json:"total_pkts,omitempty"` 1331 TotalBytes []uint64 `binapi:"u64[2],name=total_bytes" json:"total_bytes,omitempty"` 1332 TotalIP4Fragments uint64 `binapi:"u64,name=total_ip4_fragments" json:"total_ip4_fragments,omitempty"` 1333 TotalSecurityCheck []uint64 `binapi:"u64[2],name=total_security_check" json:"total_security_check,omitempty"` 1334 } 1335 1336 func (m *MapSummaryStatsReply) Reset() { *m = MapSummaryStatsReply{} } 1337 func (*MapSummaryStatsReply) GetMessageName() string { return "map_summary_stats_reply" } 1338 func (*MapSummaryStatsReply) GetCrcString() string { return "0e4ace0e" } 1339 func (*MapSummaryStatsReply) GetMessageType() api.MessageType { 1340 return api.ReplyMessage 1341 } 1342 1343 func (m *MapSummaryStatsReply) Size() (size int) { 1344 if m == nil { 1345 return 0 1346 } 1347 size += 4 // m.Retval 1348 size += 8 // m.TotalBindings 1349 size += 8 * 2 // m.TotalPkts 1350 size += 8 * 2 // m.TotalBytes 1351 size += 8 // m.TotalIP4Fragments 1352 size += 8 * 2 // m.TotalSecurityCheck 1353 return size 1354 } 1355 func (m *MapSummaryStatsReply) Marshal(b []byte) ([]byte, error) { 1356 if b == nil { 1357 b = make([]byte, m.Size()) 1358 } 1359 buf := codec.NewBuffer(b) 1360 buf.EncodeInt32(m.Retval) 1361 buf.EncodeUint64(m.TotalBindings) 1362 for i := 0; i < 2; i++ { 1363 var x uint64 1364 if i < len(m.TotalPkts) { 1365 x = uint64(m.TotalPkts[i]) 1366 } 1367 buf.EncodeUint64(x) 1368 } 1369 for i := 0; i < 2; i++ { 1370 var x uint64 1371 if i < len(m.TotalBytes) { 1372 x = uint64(m.TotalBytes[i]) 1373 } 1374 buf.EncodeUint64(x) 1375 } 1376 buf.EncodeUint64(m.TotalIP4Fragments) 1377 for i := 0; i < 2; i++ { 1378 var x uint64 1379 if i < len(m.TotalSecurityCheck) { 1380 x = uint64(m.TotalSecurityCheck[i]) 1381 } 1382 buf.EncodeUint64(x) 1383 } 1384 return buf.Bytes(), nil 1385 } 1386 func (m *MapSummaryStatsReply) Unmarshal(b []byte) error { 1387 buf := codec.NewBuffer(b) 1388 m.Retval = buf.DecodeInt32() 1389 m.TotalBindings = buf.DecodeUint64() 1390 m.TotalPkts = make([]uint64, 2) 1391 for i := 0; i < len(m.TotalPkts); i++ { 1392 m.TotalPkts[i] = buf.DecodeUint64() 1393 } 1394 m.TotalBytes = make([]uint64, 2) 1395 for i := 0; i < len(m.TotalBytes); i++ { 1396 m.TotalBytes[i] = buf.DecodeUint64() 1397 } 1398 m.TotalIP4Fragments = buf.DecodeUint64() 1399 m.TotalSecurityCheck = make([]uint64, 2) 1400 for i := 0; i < len(m.TotalSecurityCheck); i++ { 1401 m.TotalSecurityCheck[i] = buf.DecodeUint64() 1402 } 1403 return nil 1404 } 1405 1406 func init() { file_maps_binapi_init() } 1407 func file_maps_binapi_init() { 1408 api.RegisterMessage((*MapAddDelRule)(nil), "map_add_del_rule_c65b32f7") 1409 api.RegisterMessage((*MapAddDelRuleReply)(nil), "map_add_del_rule_reply_e8d4e804") 1410 api.RegisterMessage((*MapAddDomain)(nil), "map_add_domain_249f195c") 1411 api.RegisterMessage((*MapAddDomainReply)(nil), "map_add_domain_reply_3e6d4e2c") 1412 api.RegisterMessage((*MapDelDomain)(nil), "map_del_domain_8ac76db6") 1413 api.RegisterMessage((*MapDelDomainReply)(nil), "map_del_domain_reply_e8d4e804") 1414 api.RegisterMessage((*MapDomainDetails)(nil), "map_domain_details_796edb50") 1415 api.RegisterMessage((*MapDomainDump)(nil), "map_domain_dump_51077d14") 1416 api.RegisterMessage((*MapDomainsGet)(nil), "map_domains_get_f75ba505") 1417 api.RegisterMessage((*MapDomainsGetReply)(nil), "map_domains_get_reply_53b48f5d") 1418 api.RegisterMessage((*MapIfEnableDisable)(nil), "map_if_enable_disable_59bb32f4") 1419 api.RegisterMessage((*MapIfEnableDisableReply)(nil), "map_if_enable_disable_reply_e8d4e804") 1420 api.RegisterMessage((*MapParamAddDelPreResolve)(nil), "map_param_add_del_pre_resolve_dae5af03") 1421 api.RegisterMessage((*MapParamAddDelPreResolveReply)(nil), "map_param_add_del_pre_resolve_reply_e8d4e804") 1422 api.RegisterMessage((*MapParamGet)(nil), "map_param_get_51077d14") 1423 api.RegisterMessage((*MapParamGetReply)(nil), "map_param_get_reply_26272c90") 1424 api.RegisterMessage((*MapParamSetFragmentation)(nil), "map_param_set_fragmentation_9ff54d90") 1425 api.RegisterMessage((*MapParamSetFragmentationReply)(nil), "map_param_set_fragmentation_reply_e8d4e804") 1426 api.RegisterMessage((*MapParamSetICMP)(nil), "map_param_set_icmp_58210cbf") 1427 api.RegisterMessage((*MapParamSetICMP6)(nil), "map_param_set_icmp6_5d01f8c1") 1428 api.RegisterMessage((*MapParamSetICMP6Reply)(nil), "map_param_set_icmp6_reply_e8d4e804") 1429 api.RegisterMessage((*MapParamSetICMPReply)(nil), "map_param_set_icmp_reply_e8d4e804") 1430 api.RegisterMessage((*MapParamSetSecurityCheck)(nil), "map_param_set_security_check_6abe9836") 1431 api.RegisterMessage((*MapParamSetSecurityCheckReply)(nil), "map_param_set_security_check_reply_e8d4e804") 1432 api.RegisterMessage((*MapParamSetTCP)(nil), "map_param_set_tcp_87a825d9") 1433 api.RegisterMessage((*MapParamSetTCPReply)(nil), "map_param_set_tcp_reply_e8d4e804") 1434 api.RegisterMessage((*MapParamSetTrafficClass)(nil), "map_param_set_traffic_class_9cac455c") 1435 api.RegisterMessage((*MapParamSetTrafficClassReply)(nil), "map_param_set_traffic_class_reply_e8d4e804") 1436 api.RegisterMessage((*MapRuleDetails)(nil), "map_rule_details_c7cbeea5") 1437 api.RegisterMessage((*MapRuleDump)(nil), "map_rule_dump_e43e6ff6") 1438 api.RegisterMessage((*MapSummaryStats)(nil), "map_summary_stats_51077d14") 1439 api.RegisterMessage((*MapSummaryStatsReply)(nil), "map_summary_stats_reply_0e4ace0e") 1440 } 1441 1442 // Messages returns list of all messages in this module. 1443 func AllMessages() []api.Message { 1444 return []api.Message{ 1445 (*MapAddDelRule)(nil), 1446 (*MapAddDelRuleReply)(nil), 1447 (*MapAddDomain)(nil), 1448 (*MapAddDomainReply)(nil), 1449 (*MapDelDomain)(nil), 1450 (*MapDelDomainReply)(nil), 1451 (*MapDomainDetails)(nil), 1452 (*MapDomainDump)(nil), 1453 (*MapDomainsGet)(nil), 1454 (*MapDomainsGetReply)(nil), 1455 (*MapIfEnableDisable)(nil), 1456 (*MapIfEnableDisableReply)(nil), 1457 (*MapParamAddDelPreResolve)(nil), 1458 (*MapParamAddDelPreResolveReply)(nil), 1459 (*MapParamGet)(nil), 1460 (*MapParamGetReply)(nil), 1461 (*MapParamSetFragmentation)(nil), 1462 (*MapParamSetFragmentationReply)(nil), 1463 (*MapParamSetICMP)(nil), 1464 (*MapParamSetICMP6)(nil), 1465 (*MapParamSetICMP6Reply)(nil), 1466 (*MapParamSetICMPReply)(nil), 1467 (*MapParamSetSecurityCheck)(nil), 1468 (*MapParamSetSecurityCheckReply)(nil), 1469 (*MapParamSetTCP)(nil), 1470 (*MapParamSetTCPReply)(nil), 1471 (*MapParamSetTrafficClass)(nil), 1472 (*MapParamSetTrafficClassReply)(nil), 1473 (*MapRuleDetails)(nil), 1474 (*MapRuleDump)(nil), 1475 (*MapSummaryStats)(nil), 1476 (*MapSummaryStatsReply)(nil), 1477 } 1478 }