github.com/edwarnicke/govpp@v0.0.0-20230130211138-14ef5d20b1d0/binapi/lb/lb.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/lb.api.json 6 7 // Package lb contains generated bindings for API file lb.api. 8 // 9 // Contents: 10 // 16 messages 11 // 12 package lb 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 lb_types "github.com/edwarnicke/govpp/binapi/lb_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 = "lb" 30 APIVersion = "1.0.0" 31 VersionCrc = 0x50c0a6c9 32 ) 33 34 // LbAddDelAs defines message 'lb_add_del_as'. 35 type LbAddDelAs struct { 36 Pfx ip_types.AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"` 37 Protocol uint8 `binapi:"u8,name=protocol,default=255" json:"protocol,omitempty"` 38 Port uint16 `binapi:"u16,name=port" json:"port,omitempty"` 39 AsAddress ip_types.Address `binapi:"address,name=as_address" json:"as_address,omitempty"` 40 IsDel bool `binapi:"bool,name=is_del" json:"is_del,omitempty"` 41 IsFlush bool `binapi:"bool,name=is_flush" json:"is_flush,omitempty"` 42 } 43 44 func (m *LbAddDelAs) Reset() { *m = LbAddDelAs{} } 45 func (*LbAddDelAs) GetMessageName() string { return "lb_add_del_as" } 46 func (*LbAddDelAs) GetCrcString() string { return "35d72500" } 47 func (*LbAddDelAs) GetMessageType() api.MessageType { 48 return api.RequestMessage 49 } 50 51 func (m *LbAddDelAs) Size() (size int) { 52 if m == nil { 53 return 0 54 } 55 size += 1 // m.Pfx.Address.Af 56 size += 1 * 16 // m.Pfx.Address.Un 57 size += 1 // m.Pfx.Len 58 size += 1 // m.Protocol 59 size += 2 // m.Port 60 size += 1 // m.AsAddress.Af 61 size += 1 * 16 // m.AsAddress.Un 62 size += 1 // m.IsDel 63 size += 1 // m.IsFlush 64 return size 65 } 66 func (m *LbAddDelAs) Marshal(b []byte) ([]byte, error) { 67 if b == nil { 68 b = make([]byte, m.Size()) 69 } 70 buf := codec.NewBuffer(b) 71 buf.EncodeUint8(uint8(m.Pfx.Address.Af)) 72 buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 16) 73 buf.EncodeUint8(m.Pfx.Len) 74 buf.EncodeUint8(m.Protocol) 75 buf.EncodeUint16(m.Port) 76 buf.EncodeUint8(uint8(m.AsAddress.Af)) 77 buf.EncodeBytes(m.AsAddress.Un.XXX_UnionData[:], 16) 78 buf.EncodeBool(m.IsDel) 79 buf.EncodeBool(m.IsFlush) 80 return buf.Bytes(), nil 81 } 82 func (m *LbAddDelAs) Unmarshal(b []byte) error { 83 buf := codec.NewBuffer(b) 84 m.Pfx.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) 85 copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 86 m.Pfx.Len = buf.DecodeUint8() 87 m.Protocol = buf.DecodeUint8() 88 m.Port = buf.DecodeUint16() 89 m.AsAddress.Af = ip_types.AddressFamily(buf.DecodeUint8()) 90 copy(m.AsAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 91 m.IsDel = buf.DecodeBool() 92 m.IsFlush = buf.DecodeBool() 93 return nil 94 } 95 96 // LbAddDelAsReply defines message 'lb_add_del_as_reply'. 97 type LbAddDelAsReply struct { 98 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 99 } 100 101 func (m *LbAddDelAsReply) Reset() { *m = LbAddDelAsReply{} } 102 func (*LbAddDelAsReply) GetMessageName() string { return "lb_add_del_as_reply" } 103 func (*LbAddDelAsReply) GetCrcString() string { return "e8d4e804" } 104 func (*LbAddDelAsReply) GetMessageType() api.MessageType { 105 return api.ReplyMessage 106 } 107 108 func (m *LbAddDelAsReply) Size() (size int) { 109 if m == nil { 110 return 0 111 } 112 size += 4 // m.Retval 113 return size 114 } 115 func (m *LbAddDelAsReply) Marshal(b []byte) ([]byte, error) { 116 if b == nil { 117 b = make([]byte, m.Size()) 118 } 119 buf := codec.NewBuffer(b) 120 buf.EncodeInt32(m.Retval) 121 return buf.Bytes(), nil 122 } 123 func (m *LbAddDelAsReply) Unmarshal(b []byte) error { 124 buf := codec.NewBuffer(b) 125 m.Retval = buf.DecodeInt32() 126 return nil 127 } 128 129 // LbAddDelIntfNat4 defines message 'lb_add_del_intf_nat4'. 130 type LbAddDelIntfNat4 struct { 131 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` 132 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 133 } 134 135 func (m *LbAddDelIntfNat4) Reset() { *m = LbAddDelIntfNat4{} } 136 func (*LbAddDelIntfNat4) GetMessageName() string { return "lb_add_del_intf_nat4" } 137 func (*LbAddDelIntfNat4) GetCrcString() string { return "47d6e753" } 138 func (*LbAddDelIntfNat4) GetMessageType() api.MessageType { 139 return api.RequestMessage 140 } 141 142 func (m *LbAddDelIntfNat4) Size() (size int) { 143 if m == nil { 144 return 0 145 } 146 size += 1 // m.IsAdd 147 size += 4 // m.SwIfIndex 148 return size 149 } 150 func (m *LbAddDelIntfNat4) Marshal(b []byte) ([]byte, error) { 151 if b == nil { 152 b = make([]byte, m.Size()) 153 } 154 buf := codec.NewBuffer(b) 155 buf.EncodeBool(m.IsAdd) 156 buf.EncodeUint32(uint32(m.SwIfIndex)) 157 return buf.Bytes(), nil 158 } 159 func (m *LbAddDelIntfNat4) Unmarshal(b []byte) error { 160 buf := codec.NewBuffer(b) 161 m.IsAdd = buf.DecodeBool() 162 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 163 return nil 164 } 165 166 // LbAddDelIntfNat4Reply defines message 'lb_add_del_intf_nat4_reply'. 167 type LbAddDelIntfNat4Reply struct { 168 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 169 } 170 171 func (m *LbAddDelIntfNat4Reply) Reset() { *m = LbAddDelIntfNat4Reply{} } 172 func (*LbAddDelIntfNat4Reply) GetMessageName() string { return "lb_add_del_intf_nat4_reply" } 173 func (*LbAddDelIntfNat4Reply) GetCrcString() string { return "e8d4e804" } 174 func (*LbAddDelIntfNat4Reply) GetMessageType() api.MessageType { 175 return api.ReplyMessage 176 } 177 178 func (m *LbAddDelIntfNat4Reply) Size() (size int) { 179 if m == nil { 180 return 0 181 } 182 size += 4 // m.Retval 183 return size 184 } 185 func (m *LbAddDelIntfNat4Reply) Marshal(b []byte) ([]byte, error) { 186 if b == nil { 187 b = make([]byte, m.Size()) 188 } 189 buf := codec.NewBuffer(b) 190 buf.EncodeInt32(m.Retval) 191 return buf.Bytes(), nil 192 } 193 func (m *LbAddDelIntfNat4Reply) Unmarshal(b []byte) error { 194 buf := codec.NewBuffer(b) 195 m.Retval = buf.DecodeInt32() 196 return nil 197 } 198 199 // LbAddDelIntfNat6 defines message 'lb_add_del_intf_nat6'. 200 type LbAddDelIntfNat6 struct { 201 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` 202 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 203 } 204 205 func (m *LbAddDelIntfNat6) Reset() { *m = LbAddDelIntfNat6{} } 206 func (*LbAddDelIntfNat6) GetMessageName() string { return "lb_add_del_intf_nat6" } 207 func (*LbAddDelIntfNat6) GetCrcString() string { return "47d6e753" } 208 func (*LbAddDelIntfNat6) GetMessageType() api.MessageType { 209 return api.RequestMessage 210 } 211 212 func (m *LbAddDelIntfNat6) Size() (size int) { 213 if m == nil { 214 return 0 215 } 216 size += 1 // m.IsAdd 217 size += 4 // m.SwIfIndex 218 return size 219 } 220 func (m *LbAddDelIntfNat6) Marshal(b []byte) ([]byte, error) { 221 if b == nil { 222 b = make([]byte, m.Size()) 223 } 224 buf := codec.NewBuffer(b) 225 buf.EncodeBool(m.IsAdd) 226 buf.EncodeUint32(uint32(m.SwIfIndex)) 227 return buf.Bytes(), nil 228 } 229 func (m *LbAddDelIntfNat6) Unmarshal(b []byte) error { 230 buf := codec.NewBuffer(b) 231 m.IsAdd = buf.DecodeBool() 232 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 233 return nil 234 } 235 236 // LbAddDelIntfNat6Reply defines message 'lb_add_del_intf_nat6_reply'. 237 type LbAddDelIntfNat6Reply struct { 238 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 239 } 240 241 func (m *LbAddDelIntfNat6Reply) Reset() { *m = LbAddDelIntfNat6Reply{} } 242 func (*LbAddDelIntfNat6Reply) GetMessageName() string { return "lb_add_del_intf_nat6_reply" } 243 func (*LbAddDelIntfNat6Reply) GetCrcString() string { return "e8d4e804" } 244 func (*LbAddDelIntfNat6Reply) GetMessageType() api.MessageType { 245 return api.ReplyMessage 246 } 247 248 func (m *LbAddDelIntfNat6Reply) Size() (size int) { 249 if m == nil { 250 return 0 251 } 252 size += 4 // m.Retval 253 return size 254 } 255 func (m *LbAddDelIntfNat6Reply) Marshal(b []byte) ([]byte, error) { 256 if b == nil { 257 b = make([]byte, m.Size()) 258 } 259 buf := codec.NewBuffer(b) 260 buf.EncodeInt32(m.Retval) 261 return buf.Bytes(), nil 262 } 263 func (m *LbAddDelIntfNat6Reply) Unmarshal(b []byte) error { 264 buf := codec.NewBuffer(b) 265 m.Retval = buf.DecodeInt32() 266 return nil 267 } 268 269 // LbAddDelVip defines message 'lb_add_del_vip'. 270 type LbAddDelVip struct { 271 Pfx ip_types.AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"` 272 Protocol uint8 `binapi:"u8,name=protocol,default=255" json:"protocol,omitempty"` 273 Port uint16 `binapi:"u16,name=port" json:"port,omitempty"` 274 Encap lb_types.LbEncapType `binapi:"lb_encap_type,name=encap" json:"encap,omitempty"` 275 Dscp uint8 `binapi:"u8,name=dscp" json:"dscp,omitempty"` 276 Type lb_types.LbSrvType `binapi:"lb_srv_type,name=type" json:"type,omitempty"` 277 TargetPort uint16 `binapi:"u16,name=target_port" json:"target_port,omitempty"` 278 NodePort uint16 `binapi:"u16,name=node_port" json:"node_port,omitempty"` 279 NewFlowsTableLength uint32 `binapi:"u32,name=new_flows_table_length,default=1024" json:"new_flows_table_length,omitempty"` 280 IsDel bool `binapi:"bool,name=is_del" json:"is_del,omitempty"` 281 } 282 283 func (m *LbAddDelVip) Reset() { *m = LbAddDelVip{} } 284 func (*LbAddDelVip) GetMessageName() string { return "lb_add_del_vip" } 285 func (*LbAddDelVip) GetCrcString() string { return "6fa569c7" } 286 func (*LbAddDelVip) GetMessageType() api.MessageType { 287 return api.RequestMessage 288 } 289 290 func (m *LbAddDelVip) Size() (size int) { 291 if m == nil { 292 return 0 293 } 294 size += 1 // m.Pfx.Address.Af 295 size += 1 * 16 // m.Pfx.Address.Un 296 size += 1 // m.Pfx.Len 297 size += 1 // m.Protocol 298 size += 2 // m.Port 299 size += 4 // m.Encap 300 size += 1 // m.Dscp 301 size += 4 // m.Type 302 size += 2 // m.TargetPort 303 size += 2 // m.NodePort 304 size += 4 // m.NewFlowsTableLength 305 size += 1 // m.IsDel 306 return size 307 } 308 func (m *LbAddDelVip) Marshal(b []byte) ([]byte, error) { 309 if b == nil { 310 b = make([]byte, m.Size()) 311 } 312 buf := codec.NewBuffer(b) 313 buf.EncodeUint8(uint8(m.Pfx.Address.Af)) 314 buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 16) 315 buf.EncodeUint8(m.Pfx.Len) 316 buf.EncodeUint8(m.Protocol) 317 buf.EncodeUint16(m.Port) 318 buf.EncodeUint32(uint32(m.Encap)) 319 buf.EncodeUint8(m.Dscp) 320 buf.EncodeUint32(uint32(m.Type)) 321 buf.EncodeUint16(m.TargetPort) 322 buf.EncodeUint16(m.NodePort) 323 buf.EncodeUint32(m.NewFlowsTableLength) 324 buf.EncodeBool(m.IsDel) 325 return buf.Bytes(), nil 326 } 327 func (m *LbAddDelVip) Unmarshal(b []byte) error { 328 buf := codec.NewBuffer(b) 329 m.Pfx.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) 330 copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 331 m.Pfx.Len = buf.DecodeUint8() 332 m.Protocol = buf.DecodeUint8() 333 m.Port = buf.DecodeUint16() 334 m.Encap = lb_types.LbEncapType(buf.DecodeUint32()) 335 m.Dscp = buf.DecodeUint8() 336 m.Type = lb_types.LbSrvType(buf.DecodeUint32()) 337 m.TargetPort = buf.DecodeUint16() 338 m.NodePort = buf.DecodeUint16() 339 m.NewFlowsTableLength = buf.DecodeUint32() 340 m.IsDel = buf.DecodeBool() 341 return nil 342 } 343 344 // LbAddDelVipReply defines message 'lb_add_del_vip_reply'. 345 type LbAddDelVipReply struct { 346 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 347 } 348 349 func (m *LbAddDelVipReply) Reset() { *m = LbAddDelVipReply{} } 350 func (*LbAddDelVipReply) GetMessageName() string { return "lb_add_del_vip_reply" } 351 func (*LbAddDelVipReply) GetCrcString() string { return "e8d4e804" } 352 func (*LbAddDelVipReply) GetMessageType() api.MessageType { 353 return api.ReplyMessage 354 } 355 356 func (m *LbAddDelVipReply) Size() (size int) { 357 if m == nil { 358 return 0 359 } 360 size += 4 // m.Retval 361 return size 362 } 363 func (m *LbAddDelVipReply) Marshal(b []byte) ([]byte, error) { 364 if b == nil { 365 b = make([]byte, m.Size()) 366 } 367 buf := codec.NewBuffer(b) 368 buf.EncodeInt32(m.Retval) 369 return buf.Bytes(), nil 370 } 371 func (m *LbAddDelVipReply) Unmarshal(b []byte) error { 372 buf := codec.NewBuffer(b) 373 m.Retval = buf.DecodeInt32() 374 return nil 375 } 376 377 // LbAsDetails defines message 'lb_as_details'. 378 type LbAsDetails struct { 379 Vip lb_types.LbVip `binapi:"lb_vip,name=vip" json:"vip,omitempty"` 380 AppSrv ip_types.Address `binapi:"address,name=app_srv" json:"app_srv,omitempty"` 381 Flags uint8 `binapi:"u8,name=flags" json:"flags,omitempty"` 382 InUseSince uint32 `binapi:"u32,name=in_use_since" json:"in_use_since,omitempty"` 383 } 384 385 func (m *LbAsDetails) Reset() { *m = LbAsDetails{} } 386 func (*LbAsDetails) GetMessageName() string { return "lb_as_details" } 387 func (*LbAsDetails) GetCrcString() string { return "8d24c29e" } 388 func (*LbAsDetails) GetMessageType() api.MessageType { 389 return api.ReplyMessage 390 } 391 392 func (m *LbAsDetails) Size() (size int) { 393 if m == nil { 394 return 0 395 } 396 size += 1 // m.Vip.Pfx.Address.Af 397 size += 1 * 16 // m.Vip.Pfx.Address.Un 398 size += 1 // m.Vip.Pfx.Len 399 size += 1 // m.Vip.Protocol 400 size += 2 // m.Vip.Port 401 size += 1 // m.AppSrv.Af 402 size += 1 * 16 // m.AppSrv.Un 403 size += 1 // m.Flags 404 size += 4 // m.InUseSince 405 return size 406 } 407 func (m *LbAsDetails) Marshal(b []byte) ([]byte, error) { 408 if b == nil { 409 b = make([]byte, m.Size()) 410 } 411 buf := codec.NewBuffer(b) 412 buf.EncodeUint8(uint8(m.Vip.Pfx.Address.Af)) 413 buf.EncodeBytes(m.Vip.Pfx.Address.Un.XXX_UnionData[:], 16) 414 buf.EncodeUint8(m.Vip.Pfx.Len) 415 buf.EncodeUint8(uint8(m.Vip.Protocol)) 416 buf.EncodeUint16(m.Vip.Port) 417 buf.EncodeUint8(uint8(m.AppSrv.Af)) 418 buf.EncodeBytes(m.AppSrv.Un.XXX_UnionData[:], 16) 419 buf.EncodeUint8(m.Flags) 420 buf.EncodeUint32(m.InUseSince) 421 return buf.Bytes(), nil 422 } 423 func (m *LbAsDetails) Unmarshal(b []byte) error { 424 buf := codec.NewBuffer(b) 425 m.Vip.Pfx.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) 426 copy(m.Vip.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 427 m.Vip.Pfx.Len = buf.DecodeUint8() 428 m.Vip.Protocol = ip_types.IPProto(buf.DecodeUint8()) 429 m.Vip.Port = buf.DecodeUint16() 430 m.AppSrv.Af = ip_types.AddressFamily(buf.DecodeUint8()) 431 copy(m.AppSrv.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 432 m.Flags = buf.DecodeUint8() 433 m.InUseSince = buf.DecodeUint32() 434 return nil 435 } 436 437 // LbAsDump defines message 'lb_as_dump'. 438 type LbAsDump struct { 439 Pfx ip_types.AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"` 440 Protocol uint8 `binapi:"u8,name=protocol" json:"protocol,omitempty"` 441 Port uint16 `binapi:"u16,name=port" json:"port,omitempty"` 442 } 443 444 func (m *LbAsDump) Reset() { *m = LbAsDump{} } 445 func (*LbAsDump) GetMessageName() string { return "lb_as_dump" } 446 func (*LbAsDump) GetCrcString() string { return "1063f819" } 447 func (*LbAsDump) GetMessageType() api.MessageType { 448 return api.RequestMessage 449 } 450 451 func (m *LbAsDump) Size() (size int) { 452 if m == nil { 453 return 0 454 } 455 size += 1 // m.Pfx.Address.Af 456 size += 1 * 16 // m.Pfx.Address.Un 457 size += 1 // m.Pfx.Len 458 size += 1 // m.Protocol 459 size += 2 // m.Port 460 return size 461 } 462 func (m *LbAsDump) Marshal(b []byte) ([]byte, error) { 463 if b == nil { 464 b = make([]byte, m.Size()) 465 } 466 buf := codec.NewBuffer(b) 467 buf.EncodeUint8(uint8(m.Pfx.Address.Af)) 468 buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 16) 469 buf.EncodeUint8(m.Pfx.Len) 470 buf.EncodeUint8(m.Protocol) 471 buf.EncodeUint16(m.Port) 472 return buf.Bytes(), nil 473 } 474 func (m *LbAsDump) Unmarshal(b []byte) error { 475 buf := codec.NewBuffer(b) 476 m.Pfx.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) 477 copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 478 m.Pfx.Len = buf.DecodeUint8() 479 m.Protocol = buf.DecodeUint8() 480 m.Port = buf.DecodeUint16() 481 return nil 482 } 483 484 // LbConf defines message 'lb_conf'. 485 type LbConf struct { 486 IP4SrcAddress ip_types.IP4Address `binapi:"ip4_address,name=ip4_src_address" json:"ip4_src_address,omitempty"` 487 IP6SrcAddress ip_types.IP6Address `binapi:"ip6_address,name=ip6_src_address" json:"ip6_src_address,omitempty"` 488 StickyBucketsPerCore uint32 `binapi:"u32,name=sticky_buckets_per_core,default=4294967295" json:"sticky_buckets_per_core,omitempty"` 489 FlowTimeout uint32 `binapi:"u32,name=flow_timeout,default=4294967295" json:"flow_timeout,omitempty"` 490 } 491 492 func (m *LbConf) Reset() { *m = LbConf{} } 493 func (*LbConf) GetMessageName() string { return "lb_conf" } 494 func (*LbConf) GetCrcString() string { return "56cd3261" } 495 func (*LbConf) GetMessageType() api.MessageType { 496 return api.RequestMessage 497 } 498 499 func (m *LbConf) Size() (size int) { 500 if m == nil { 501 return 0 502 } 503 size += 1 * 4 // m.IP4SrcAddress 504 size += 1 * 16 // m.IP6SrcAddress 505 size += 4 // m.StickyBucketsPerCore 506 size += 4 // m.FlowTimeout 507 return size 508 } 509 func (m *LbConf) Marshal(b []byte) ([]byte, error) { 510 if b == nil { 511 b = make([]byte, m.Size()) 512 } 513 buf := codec.NewBuffer(b) 514 buf.EncodeBytes(m.IP4SrcAddress[:], 4) 515 buf.EncodeBytes(m.IP6SrcAddress[:], 16) 516 buf.EncodeUint32(m.StickyBucketsPerCore) 517 buf.EncodeUint32(m.FlowTimeout) 518 return buf.Bytes(), nil 519 } 520 func (m *LbConf) Unmarshal(b []byte) error { 521 buf := codec.NewBuffer(b) 522 copy(m.IP4SrcAddress[:], buf.DecodeBytes(4)) 523 copy(m.IP6SrcAddress[:], buf.DecodeBytes(16)) 524 m.StickyBucketsPerCore = buf.DecodeUint32() 525 m.FlowTimeout = buf.DecodeUint32() 526 return nil 527 } 528 529 // LbConfReply defines message 'lb_conf_reply'. 530 type LbConfReply struct { 531 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 532 } 533 534 func (m *LbConfReply) Reset() { *m = LbConfReply{} } 535 func (*LbConfReply) GetMessageName() string { return "lb_conf_reply" } 536 func (*LbConfReply) GetCrcString() string { return "e8d4e804" } 537 func (*LbConfReply) GetMessageType() api.MessageType { 538 return api.ReplyMessage 539 } 540 541 func (m *LbConfReply) Size() (size int) { 542 if m == nil { 543 return 0 544 } 545 size += 4 // m.Retval 546 return size 547 } 548 func (m *LbConfReply) Marshal(b []byte) ([]byte, error) { 549 if b == nil { 550 b = make([]byte, m.Size()) 551 } 552 buf := codec.NewBuffer(b) 553 buf.EncodeInt32(m.Retval) 554 return buf.Bytes(), nil 555 } 556 func (m *LbConfReply) Unmarshal(b []byte) error { 557 buf := codec.NewBuffer(b) 558 m.Retval = buf.DecodeInt32() 559 return nil 560 } 561 562 // LbFlushVip defines message 'lb_flush_vip'. 563 type LbFlushVip struct { 564 Pfx ip_types.AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"` 565 Protocol uint8 `binapi:"u8,name=protocol" json:"protocol,omitempty"` 566 Port uint16 `binapi:"u16,name=port" json:"port,omitempty"` 567 } 568 569 func (m *LbFlushVip) Reset() { *m = LbFlushVip{} } 570 func (*LbFlushVip) GetMessageName() string { return "lb_flush_vip" } 571 func (*LbFlushVip) GetCrcString() string { return "1063f819" } 572 func (*LbFlushVip) GetMessageType() api.MessageType { 573 return api.RequestMessage 574 } 575 576 func (m *LbFlushVip) Size() (size int) { 577 if m == nil { 578 return 0 579 } 580 size += 1 // m.Pfx.Address.Af 581 size += 1 * 16 // m.Pfx.Address.Un 582 size += 1 // m.Pfx.Len 583 size += 1 // m.Protocol 584 size += 2 // m.Port 585 return size 586 } 587 func (m *LbFlushVip) Marshal(b []byte) ([]byte, error) { 588 if b == nil { 589 b = make([]byte, m.Size()) 590 } 591 buf := codec.NewBuffer(b) 592 buf.EncodeUint8(uint8(m.Pfx.Address.Af)) 593 buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 16) 594 buf.EncodeUint8(m.Pfx.Len) 595 buf.EncodeUint8(m.Protocol) 596 buf.EncodeUint16(m.Port) 597 return buf.Bytes(), nil 598 } 599 func (m *LbFlushVip) Unmarshal(b []byte) error { 600 buf := codec.NewBuffer(b) 601 m.Pfx.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) 602 copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 603 m.Pfx.Len = buf.DecodeUint8() 604 m.Protocol = buf.DecodeUint8() 605 m.Port = buf.DecodeUint16() 606 return nil 607 } 608 609 // LbFlushVipReply defines message 'lb_flush_vip_reply'. 610 type LbFlushVipReply struct { 611 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 612 } 613 614 func (m *LbFlushVipReply) Reset() { *m = LbFlushVipReply{} } 615 func (*LbFlushVipReply) GetMessageName() string { return "lb_flush_vip_reply" } 616 func (*LbFlushVipReply) GetCrcString() string { return "e8d4e804" } 617 func (*LbFlushVipReply) GetMessageType() api.MessageType { 618 return api.ReplyMessage 619 } 620 621 func (m *LbFlushVipReply) Size() (size int) { 622 if m == nil { 623 return 0 624 } 625 size += 4 // m.Retval 626 return size 627 } 628 func (m *LbFlushVipReply) Marshal(b []byte) ([]byte, error) { 629 if b == nil { 630 b = make([]byte, m.Size()) 631 } 632 buf := codec.NewBuffer(b) 633 buf.EncodeInt32(m.Retval) 634 return buf.Bytes(), nil 635 } 636 func (m *LbFlushVipReply) Unmarshal(b []byte) error { 637 buf := codec.NewBuffer(b) 638 m.Retval = buf.DecodeInt32() 639 return nil 640 } 641 642 // LbVipDetails defines message 'lb_vip_details'. 643 type LbVipDetails struct { 644 Vip lb_types.LbVip `binapi:"lb_vip,name=vip" json:"vip,omitempty"` 645 Encap lb_types.LbEncapType `binapi:"lb_encap_type,name=encap" json:"encap,omitempty"` 646 Dscp ip_types.IPDscp `binapi:"ip_dscp,name=dscp" json:"dscp,omitempty"` 647 SrvType lb_types.LbSrvType `binapi:"lb_srv_type,name=srv_type" json:"srv_type,omitempty"` 648 TargetPort uint16 `binapi:"u16,name=target_port" json:"target_port,omitempty"` 649 FlowTableLength uint16 `binapi:"u16,name=flow_table_length" json:"flow_table_length,omitempty"` 650 } 651 652 func (m *LbVipDetails) Reset() { *m = LbVipDetails{} } 653 func (*LbVipDetails) GetMessageName() string { return "lb_vip_details" } 654 func (*LbVipDetails) GetCrcString() string { return "1329ec9b" } 655 func (*LbVipDetails) GetMessageType() api.MessageType { 656 return api.ReplyMessage 657 } 658 659 func (m *LbVipDetails) Size() (size int) { 660 if m == nil { 661 return 0 662 } 663 size += 1 // m.Vip.Pfx.Address.Af 664 size += 1 * 16 // m.Vip.Pfx.Address.Un 665 size += 1 // m.Vip.Pfx.Len 666 size += 1 // m.Vip.Protocol 667 size += 2 // m.Vip.Port 668 size += 4 // m.Encap 669 size += 1 // m.Dscp 670 size += 4 // m.SrvType 671 size += 2 // m.TargetPort 672 size += 2 // m.FlowTableLength 673 return size 674 } 675 func (m *LbVipDetails) Marshal(b []byte) ([]byte, error) { 676 if b == nil { 677 b = make([]byte, m.Size()) 678 } 679 buf := codec.NewBuffer(b) 680 buf.EncodeUint8(uint8(m.Vip.Pfx.Address.Af)) 681 buf.EncodeBytes(m.Vip.Pfx.Address.Un.XXX_UnionData[:], 16) 682 buf.EncodeUint8(m.Vip.Pfx.Len) 683 buf.EncodeUint8(uint8(m.Vip.Protocol)) 684 buf.EncodeUint16(m.Vip.Port) 685 buf.EncodeUint32(uint32(m.Encap)) 686 buf.EncodeUint8(uint8(m.Dscp)) 687 buf.EncodeUint32(uint32(m.SrvType)) 688 buf.EncodeUint16(m.TargetPort) 689 buf.EncodeUint16(m.FlowTableLength) 690 return buf.Bytes(), nil 691 } 692 func (m *LbVipDetails) Unmarshal(b []byte) error { 693 buf := codec.NewBuffer(b) 694 m.Vip.Pfx.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) 695 copy(m.Vip.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 696 m.Vip.Pfx.Len = buf.DecodeUint8() 697 m.Vip.Protocol = ip_types.IPProto(buf.DecodeUint8()) 698 m.Vip.Port = buf.DecodeUint16() 699 m.Encap = lb_types.LbEncapType(buf.DecodeUint32()) 700 m.Dscp = ip_types.IPDscp(buf.DecodeUint8()) 701 m.SrvType = lb_types.LbSrvType(buf.DecodeUint32()) 702 m.TargetPort = buf.DecodeUint16() 703 m.FlowTableLength = buf.DecodeUint16() 704 return nil 705 } 706 707 // LbVipDump defines message 'lb_vip_dump'. 708 type LbVipDump struct { 709 Pfx ip_types.AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"` 710 PfxMatcher ip_types.PrefixMatcher `binapi:"prefix_matcher,name=pfx_matcher" json:"pfx_matcher,omitempty"` 711 Protocol uint8 `binapi:"u8,name=protocol,default=255" json:"protocol,omitempty"` 712 Port uint16 `binapi:"u16,name=port" json:"port,omitempty"` 713 } 714 715 func (m *LbVipDump) Reset() { *m = LbVipDump{} } 716 func (*LbVipDump) GetMessageName() string { return "lb_vip_dump" } 717 func (*LbVipDump) GetCrcString() string { return "56110cb7" } 718 func (*LbVipDump) GetMessageType() api.MessageType { 719 return api.RequestMessage 720 } 721 722 func (m *LbVipDump) Size() (size int) { 723 if m == nil { 724 return 0 725 } 726 size += 1 // m.Pfx.Address.Af 727 size += 1 * 16 // m.Pfx.Address.Un 728 size += 1 // m.Pfx.Len 729 size += 1 // m.PfxMatcher.Le 730 size += 1 // m.PfxMatcher.Ge 731 size += 1 // m.Protocol 732 size += 2 // m.Port 733 return size 734 } 735 func (m *LbVipDump) Marshal(b []byte) ([]byte, error) { 736 if b == nil { 737 b = make([]byte, m.Size()) 738 } 739 buf := codec.NewBuffer(b) 740 buf.EncodeUint8(uint8(m.Pfx.Address.Af)) 741 buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 16) 742 buf.EncodeUint8(m.Pfx.Len) 743 buf.EncodeUint8(m.PfxMatcher.Le) 744 buf.EncodeUint8(m.PfxMatcher.Ge) 745 buf.EncodeUint8(m.Protocol) 746 buf.EncodeUint16(m.Port) 747 return buf.Bytes(), nil 748 } 749 func (m *LbVipDump) Unmarshal(b []byte) error { 750 buf := codec.NewBuffer(b) 751 m.Pfx.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) 752 copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 753 m.Pfx.Len = buf.DecodeUint8() 754 m.PfxMatcher.Le = buf.DecodeUint8() 755 m.PfxMatcher.Ge = buf.DecodeUint8() 756 m.Protocol = buf.DecodeUint8() 757 m.Port = buf.DecodeUint16() 758 return nil 759 } 760 761 func init() { file_lb_binapi_init() } 762 func file_lb_binapi_init() { 763 api.RegisterMessage((*LbAddDelAs)(nil), "lb_add_del_as_35d72500") 764 api.RegisterMessage((*LbAddDelAsReply)(nil), "lb_add_del_as_reply_e8d4e804") 765 api.RegisterMessage((*LbAddDelIntfNat4)(nil), "lb_add_del_intf_nat4_47d6e753") 766 api.RegisterMessage((*LbAddDelIntfNat4Reply)(nil), "lb_add_del_intf_nat4_reply_e8d4e804") 767 api.RegisterMessage((*LbAddDelIntfNat6)(nil), "lb_add_del_intf_nat6_47d6e753") 768 api.RegisterMessage((*LbAddDelIntfNat6Reply)(nil), "lb_add_del_intf_nat6_reply_e8d4e804") 769 api.RegisterMessage((*LbAddDelVip)(nil), "lb_add_del_vip_6fa569c7") 770 api.RegisterMessage((*LbAddDelVipReply)(nil), "lb_add_del_vip_reply_e8d4e804") 771 api.RegisterMessage((*LbAsDetails)(nil), "lb_as_details_8d24c29e") 772 api.RegisterMessage((*LbAsDump)(nil), "lb_as_dump_1063f819") 773 api.RegisterMessage((*LbConf)(nil), "lb_conf_56cd3261") 774 api.RegisterMessage((*LbConfReply)(nil), "lb_conf_reply_e8d4e804") 775 api.RegisterMessage((*LbFlushVip)(nil), "lb_flush_vip_1063f819") 776 api.RegisterMessage((*LbFlushVipReply)(nil), "lb_flush_vip_reply_e8d4e804") 777 api.RegisterMessage((*LbVipDetails)(nil), "lb_vip_details_1329ec9b") 778 api.RegisterMessage((*LbVipDump)(nil), "lb_vip_dump_56110cb7") 779 } 780 781 // Messages returns list of all messages in this module. 782 func AllMessages() []api.Message { 783 return []api.Message{ 784 (*LbAddDelAs)(nil), 785 (*LbAddDelAsReply)(nil), 786 (*LbAddDelIntfNat4)(nil), 787 (*LbAddDelIntfNat4Reply)(nil), 788 (*LbAddDelIntfNat6)(nil), 789 (*LbAddDelIntfNat6Reply)(nil), 790 (*LbAddDelVip)(nil), 791 (*LbAddDelVipReply)(nil), 792 (*LbAsDetails)(nil), 793 (*LbAsDump)(nil), 794 (*LbConf)(nil), 795 (*LbConfReply)(nil), 796 (*LbFlushVip)(nil), 797 (*LbFlushVipReply)(nil), 798 (*LbVipDetails)(nil), 799 (*LbVipDump)(nil), 800 } 801 }