github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/ip/ip.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: core/ip.api.json 6 7 // Package ip contains generated bindings for API file ip.api. 8 // 9 // Contents: 10 // - 3 enums 11 // - 7 structs 12 // - 93 messages 13 package ip 14 15 import ( 16 "strconv" 17 18 _ "github.com/networkservicemesh/govpp/binapi/ethernet_types" 19 fib_types "github.com/networkservicemesh/govpp/binapi/fib_types" 20 interface_types "github.com/networkservicemesh/govpp/binapi/interface_types" 21 ip_types "github.com/networkservicemesh/govpp/binapi/ip_types" 22 mfib_types "github.com/networkservicemesh/govpp/binapi/mfib_types" 23 api "go.fd.io/govpp/api" 24 codec "go.fd.io/govpp/codec" 25 ) 26 27 // This is a compile-time assertion to ensure that this generated file 28 // is compatible with the GoVPP api package it is being compiled against. 29 // A compilation error at this line likely means your copy of the 30 // GoVPP api package needs to be updated. 31 const _ = api.GoVppAPIPackageIsVersion2 32 33 const ( 34 APIFile = "ip" 35 APIVersion = "3.2.0" 36 VersionCrc = 0xbd2f873b 37 ) 38 39 // IPReassType defines enum 'ip_reass_type'. 40 type IPReassType uint32 41 42 const ( 43 IP_REASS_TYPE_FULL IPReassType = 0 44 IP_REASS_TYPE_SHALLOW_VIRTUAL IPReassType = 1 45 ) 46 47 var ( 48 IPReassType_name = map[uint32]string{ 49 0: "IP_REASS_TYPE_FULL", 50 1: "IP_REASS_TYPE_SHALLOW_VIRTUAL", 51 } 52 IPReassType_value = map[string]uint32{ 53 "IP_REASS_TYPE_FULL": 0, 54 "IP_REASS_TYPE_SHALLOW_VIRTUAL": 1, 55 } 56 ) 57 58 func (x IPReassType) String() string { 59 s, ok := IPReassType_name[uint32(x)] 60 if ok { 61 return s 62 } 63 return "IPReassType(" + strconv.Itoa(int(x)) + ")" 64 } 65 66 // IPFlowHashConfig defines enum 'ip_flow_hash_config'. 67 type IPFlowHashConfig uint32 68 69 const ( 70 IP_API_FLOW_HASH_SRC_IP IPFlowHashConfig = 1 71 IP_API_FLOW_HASH_DST_IP IPFlowHashConfig = 2 72 IP_API_FLOW_HASH_SRC_PORT IPFlowHashConfig = 4 73 IP_API_FLOW_HASH_DST_PORT IPFlowHashConfig = 8 74 IP_API_FLOW_HASH_PROTO IPFlowHashConfig = 16 75 IP_API_FLOW_HASH_REVERSE IPFlowHashConfig = 32 76 IP_API_FLOW_HASH_SYMETRIC IPFlowHashConfig = 64 77 IP_API_FLOW_HASH_FLOW_LABEL IPFlowHashConfig = 128 78 ) 79 80 var ( 81 IPFlowHashConfig_name = map[uint32]string{ 82 1: "IP_API_FLOW_HASH_SRC_IP", 83 2: "IP_API_FLOW_HASH_DST_IP", 84 4: "IP_API_FLOW_HASH_SRC_PORT", 85 8: "IP_API_FLOW_HASH_DST_PORT", 86 16: "IP_API_FLOW_HASH_PROTO", 87 32: "IP_API_FLOW_HASH_REVERSE", 88 64: "IP_API_FLOW_HASH_SYMETRIC", 89 128: "IP_API_FLOW_HASH_FLOW_LABEL", 90 } 91 IPFlowHashConfig_value = map[string]uint32{ 92 "IP_API_FLOW_HASH_SRC_IP": 1, 93 "IP_API_FLOW_HASH_DST_IP": 2, 94 "IP_API_FLOW_HASH_SRC_PORT": 4, 95 "IP_API_FLOW_HASH_DST_PORT": 8, 96 "IP_API_FLOW_HASH_PROTO": 16, 97 "IP_API_FLOW_HASH_REVERSE": 32, 98 "IP_API_FLOW_HASH_SYMETRIC": 64, 99 "IP_API_FLOW_HASH_FLOW_LABEL": 128, 100 } 101 ) 102 103 func (x IPFlowHashConfig) String() string { 104 s, ok := IPFlowHashConfig_name[uint32(x)] 105 if ok { 106 return s 107 } 108 str := func(n uint32) string { 109 s, ok := IPFlowHashConfig_name[uint32(n)] 110 if ok { 111 return s 112 } 113 return "IPFlowHashConfig(" + strconv.Itoa(int(n)) + ")" 114 } 115 for i := uint32(0); i <= 32; i++ { 116 val := uint32(x) 117 if val&(1<<i) != 0 { 118 if s != "" { 119 s += "|" 120 } 121 s += str(1 << i) 122 } 123 } 124 if s == "" { 125 return str(uint32(x)) 126 } 127 return s 128 } 129 130 // IPFlowHashConfigV2 defines enum 'ip_flow_hash_config_v2'. 131 type IPFlowHashConfigV2 uint32 132 133 const ( 134 IP_API_V2_FLOW_HASH_SRC_IP IPFlowHashConfigV2 = 1 135 IP_API_V2_FLOW_HASH_DST_IP IPFlowHashConfigV2 = 2 136 IP_API_V2_FLOW_HASH_SRC_PORT IPFlowHashConfigV2 = 4 137 IP_API_V2_FLOW_HASH_DST_PORT IPFlowHashConfigV2 = 8 138 IP_API_V2_FLOW_HASH_PROTO IPFlowHashConfigV2 = 16 139 IP_API_V2_FLOW_HASH_REVERSE IPFlowHashConfigV2 = 32 140 IP_API_V2_FLOW_HASH_SYMETRIC IPFlowHashConfigV2 = 64 141 IP_API_V2_FLOW_HASH_FLOW_LABEL IPFlowHashConfigV2 = 128 142 IP_API_V2_FLOW_HASH_GTPV1_TEID IPFlowHashConfigV2 = 256 143 ) 144 145 var ( 146 IPFlowHashConfigV2_name = map[uint32]string{ 147 1: "IP_API_V2_FLOW_HASH_SRC_IP", 148 2: "IP_API_V2_FLOW_HASH_DST_IP", 149 4: "IP_API_V2_FLOW_HASH_SRC_PORT", 150 8: "IP_API_V2_FLOW_HASH_DST_PORT", 151 16: "IP_API_V2_FLOW_HASH_PROTO", 152 32: "IP_API_V2_FLOW_HASH_REVERSE", 153 64: "IP_API_V2_FLOW_HASH_SYMETRIC", 154 128: "IP_API_V2_FLOW_HASH_FLOW_LABEL", 155 256: "IP_API_V2_FLOW_HASH_GTPV1_TEID", 156 } 157 IPFlowHashConfigV2_value = map[string]uint32{ 158 "IP_API_V2_FLOW_HASH_SRC_IP": 1, 159 "IP_API_V2_FLOW_HASH_DST_IP": 2, 160 "IP_API_V2_FLOW_HASH_SRC_PORT": 4, 161 "IP_API_V2_FLOW_HASH_DST_PORT": 8, 162 "IP_API_V2_FLOW_HASH_PROTO": 16, 163 "IP_API_V2_FLOW_HASH_REVERSE": 32, 164 "IP_API_V2_FLOW_HASH_SYMETRIC": 64, 165 "IP_API_V2_FLOW_HASH_FLOW_LABEL": 128, 166 "IP_API_V2_FLOW_HASH_GTPV1_TEID": 256, 167 } 168 ) 169 170 func (x IPFlowHashConfigV2) String() string { 171 s, ok := IPFlowHashConfigV2_name[uint32(x)] 172 if ok { 173 return s 174 } 175 str := func(n uint32) string { 176 s, ok := IPFlowHashConfigV2_name[uint32(n)] 177 if ok { 178 return s 179 } 180 return "IPFlowHashConfigV2(" + strconv.Itoa(int(n)) + ")" 181 } 182 for i := uint32(0); i <= 32; i++ { 183 val := uint32(x) 184 if val&(1<<i) != 0 { 185 if s != "" { 186 s += "|" 187 } 188 s += str(1 << i) 189 } 190 } 191 if s == "" { 192 return str(uint32(x)) 193 } 194 return s 195 } 196 197 // IPMroute defines type 'ip_mroute'. 198 type IPMroute struct { 199 TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"` 200 EntryFlags mfib_types.MfibEntryFlags `binapi:"mfib_entry_flags,name=entry_flags" json:"entry_flags,omitempty"` 201 RpfID uint32 `binapi:"u32,name=rpf_id" json:"rpf_id,omitempty"` 202 Prefix ip_types.Mprefix `binapi:"mprefix,name=prefix" json:"prefix,omitempty"` 203 NPaths uint8 `binapi:"u8,name=n_paths" json:"-"` 204 Paths []mfib_types.MfibPath `binapi:"mfib_path[n_paths],name=paths" json:"paths,omitempty"` 205 } 206 207 // IPPathMtu defines type 'ip_path_mtu'. 208 type IPPathMtu struct { 209 ClientIndex uint32 `binapi:"u32,name=client_index" json:"client_index,omitempty"` 210 Context uint32 `binapi:"u32,name=context" json:"context,omitempty"` 211 TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"` 212 Nh ip_types.Address `binapi:"address,name=nh" json:"nh,omitempty"` 213 PathMtu uint16 `binapi:"u16,name=path_mtu" json:"path_mtu,omitempty"` 214 } 215 216 // IPRoute defines type 'ip_route'. 217 type IPRoute struct { 218 TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"` 219 StatsIndex uint32 `binapi:"u32,name=stats_index" json:"stats_index,omitempty"` 220 Prefix ip_types.Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"` 221 NPaths uint8 `binapi:"u8,name=n_paths" json:"-"` 222 Paths []fib_types.FibPath `binapi:"fib_path[n_paths],name=paths" json:"paths,omitempty"` 223 } 224 225 // IPRouteV2 defines type 'ip_route_v2'. 226 type IPRouteV2 struct { 227 TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"` 228 StatsIndex uint32 `binapi:"u32,name=stats_index" json:"stats_index,omitempty"` 229 Prefix ip_types.Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"` 230 NPaths uint8 `binapi:"u8,name=n_paths" json:"-"` 231 Src uint8 `binapi:"u8,name=src" json:"src,omitempty"` 232 Paths []fib_types.FibPath `binapi:"fib_path[n_paths],name=paths" json:"paths,omitempty"` 233 } 234 235 // IPTable defines type 'ip_table'. 236 type IPTable struct { 237 TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"` 238 IsIP6 bool `binapi:"bool,name=is_ip6" json:"is_ip6,omitempty"` 239 Name string `binapi:"string[64],name=name" json:"name,omitempty"` 240 } 241 242 // PuntRedirect defines type 'punt_redirect'. 243 type PuntRedirect struct { 244 RxSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"` 245 TxSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=tx_sw_if_index" json:"tx_sw_if_index,omitempty"` 246 Nh ip_types.Address `binapi:"address,name=nh" json:"nh,omitempty"` 247 } 248 249 // PuntRedirectV2 defines type 'punt_redirect_v2'. 250 type PuntRedirectV2 struct { 251 RxSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=rx_sw_if_index,default=4294967295" json:"rx_sw_if_index,omitempty"` 252 Af ip_types.AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"` 253 NPaths uint32 `binapi:"u32,name=n_paths" json:"-"` 254 Paths []fib_types.FibPath `binapi:"fib_path[n_paths],name=paths" json:"paths,omitempty"` 255 } 256 257 // Add IP punt redirect rule 258 // - punt - punt definition 259 // - is_add - 1 to add punt_redirect rule, 0 to delete 260 // 261 // AddDelIPPuntRedirectV2 defines message 'add_del_ip_punt_redirect_v2'. 262 type AddDelIPPuntRedirectV2 struct { 263 IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"` 264 Punt PuntRedirectV2 `binapi:"punt_redirect_v2,name=punt" json:"punt,omitempty"` 265 } 266 267 func (m *AddDelIPPuntRedirectV2) Reset() { *m = AddDelIPPuntRedirectV2{} } 268 func (*AddDelIPPuntRedirectV2) GetMessageName() string { return "add_del_ip_punt_redirect_v2" } 269 func (*AddDelIPPuntRedirectV2) GetCrcString() string { return "9e804227" } 270 func (*AddDelIPPuntRedirectV2) GetMessageType() api.MessageType { 271 return api.RequestMessage 272 } 273 274 func (m *AddDelIPPuntRedirectV2) Size() (size int) { 275 if m == nil { 276 return 0 277 } 278 size += 1 // m.IsAdd 279 size += 4 // m.Punt.RxSwIfIndex 280 size += 1 // m.Punt.Af 281 size += 4 // m.Punt.NPaths 282 for j2 := 0; j2 < len(m.Punt.Paths); j2++ { 283 var s2 fib_types.FibPath 284 _ = s2 285 if j2 < len(m.Punt.Paths) { 286 s2 = m.Punt.Paths[j2] 287 } 288 size += 4 // s2.SwIfIndex 289 size += 4 // s2.TableID 290 size += 4 // s2.RpfID 291 size += 1 // s2.Weight 292 size += 1 // s2.Preference 293 size += 4 // s2.Type 294 size += 4 // s2.Flags 295 size += 4 // s2.Proto 296 size += 1 * 16 // s2.Nh.Address 297 size += 4 // s2.Nh.ViaLabel 298 size += 4 // s2.Nh.ObjID 299 size += 4 // s2.Nh.ClassifyTableIndex 300 size += 1 // s2.NLabels 301 for j3 := 0; j3 < 16; j3++ { 302 size += 1 // s2.LabelStack[j3].IsUniform 303 size += 4 // s2.LabelStack[j3].Label 304 size += 1 // s2.LabelStack[j3].TTL 305 size += 1 // s2.LabelStack[j3].Exp 306 } 307 } 308 return size 309 } 310 func (m *AddDelIPPuntRedirectV2) Marshal(b []byte) ([]byte, error) { 311 if b == nil { 312 b = make([]byte, m.Size()) 313 } 314 buf := codec.NewBuffer(b) 315 buf.EncodeBool(m.IsAdd) 316 buf.EncodeUint32(uint32(m.Punt.RxSwIfIndex)) 317 buf.EncodeUint8(uint8(m.Punt.Af)) 318 buf.EncodeUint32(uint32(len(m.Punt.Paths))) 319 for j1 := 0; j1 < len(m.Punt.Paths); j1++ { 320 var v1 fib_types.FibPath // Paths 321 if j1 < len(m.Punt.Paths) { 322 v1 = m.Punt.Paths[j1] 323 } 324 buf.EncodeUint32(v1.SwIfIndex) 325 buf.EncodeUint32(v1.TableID) 326 buf.EncodeUint32(v1.RpfID) 327 buf.EncodeUint8(v1.Weight) 328 buf.EncodeUint8(v1.Preference) 329 buf.EncodeUint32(uint32(v1.Type)) 330 buf.EncodeUint32(uint32(v1.Flags)) 331 buf.EncodeUint32(uint32(v1.Proto)) 332 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16) 333 buf.EncodeUint32(v1.Nh.ViaLabel) 334 buf.EncodeUint32(v1.Nh.ObjID) 335 buf.EncodeUint32(v1.Nh.ClassifyTableIndex) 336 buf.EncodeUint8(v1.NLabels) 337 for j2 := 0; j2 < 16; j2++ { 338 buf.EncodeUint8(v1.LabelStack[j2].IsUniform) 339 buf.EncodeUint32(v1.LabelStack[j2].Label) 340 buf.EncodeUint8(v1.LabelStack[j2].TTL) 341 buf.EncodeUint8(v1.LabelStack[j2].Exp) 342 } 343 } 344 return buf.Bytes(), nil 345 } 346 func (m *AddDelIPPuntRedirectV2) Unmarshal(b []byte) error { 347 buf := codec.NewBuffer(b) 348 m.IsAdd = buf.DecodeBool() 349 m.Punt.RxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 350 m.Punt.Af = ip_types.AddressFamily(buf.DecodeUint8()) 351 m.Punt.NPaths = buf.DecodeUint32() 352 m.Punt.Paths = make([]fib_types.FibPath, m.Punt.NPaths) 353 for j1 := 0; j1 < len(m.Punt.Paths); j1++ { 354 m.Punt.Paths[j1].SwIfIndex = buf.DecodeUint32() 355 m.Punt.Paths[j1].TableID = buf.DecodeUint32() 356 m.Punt.Paths[j1].RpfID = buf.DecodeUint32() 357 m.Punt.Paths[j1].Weight = buf.DecodeUint8() 358 m.Punt.Paths[j1].Preference = buf.DecodeUint8() 359 m.Punt.Paths[j1].Type = fib_types.FibPathType(buf.DecodeUint32()) 360 m.Punt.Paths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32()) 361 m.Punt.Paths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32()) 362 copy(m.Punt.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16)) 363 m.Punt.Paths[j1].Nh.ViaLabel = buf.DecodeUint32() 364 m.Punt.Paths[j1].Nh.ObjID = buf.DecodeUint32() 365 m.Punt.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32() 366 m.Punt.Paths[j1].NLabels = buf.DecodeUint8() 367 for j2 := 0; j2 < 16; j2++ { 368 m.Punt.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8() 369 m.Punt.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32() 370 m.Punt.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8() 371 m.Punt.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8() 372 } 373 } 374 return nil 375 } 376 377 // AddDelIPPuntRedirectV2Reply defines message 'add_del_ip_punt_redirect_v2_reply'. 378 type AddDelIPPuntRedirectV2Reply struct { 379 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 380 } 381 382 func (m *AddDelIPPuntRedirectV2Reply) Reset() { *m = AddDelIPPuntRedirectV2Reply{} } 383 func (*AddDelIPPuntRedirectV2Reply) GetMessageName() string { 384 return "add_del_ip_punt_redirect_v2_reply" 385 } 386 func (*AddDelIPPuntRedirectV2Reply) GetCrcString() string { return "e8d4e804" } 387 func (*AddDelIPPuntRedirectV2Reply) GetMessageType() api.MessageType { 388 return api.ReplyMessage 389 } 390 391 func (m *AddDelIPPuntRedirectV2Reply) Size() (size int) { 392 if m == nil { 393 return 0 394 } 395 size += 4 // m.Retval 396 return size 397 } 398 func (m *AddDelIPPuntRedirectV2Reply) Marshal(b []byte) ([]byte, error) { 399 if b == nil { 400 b = make([]byte, m.Size()) 401 } 402 buf := codec.NewBuffer(b) 403 buf.EncodeInt32(m.Retval) 404 return buf.Bytes(), nil 405 } 406 func (m *AddDelIPPuntRedirectV2Reply) Unmarshal(b []byte) error { 407 buf := codec.NewBuffer(b) 408 m.Retval = buf.DecodeInt32() 409 return nil 410 } 411 412 // iOAM disable 413 // - index - MAP Domain index 414 // 415 // IoamDisable defines message 'ioam_disable'. 416 type IoamDisable struct { 417 ID uint16 `binapi:"u16,name=id" json:"id,omitempty"` 418 } 419 420 func (m *IoamDisable) Reset() { *m = IoamDisable{} } 421 func (*IoamDisable) GetMessageName() string { return "ioam_disable" } 422 func (*IoamDisable) GetCrcString() string { return "6b16a45e" } 423 func (*IoamDisable) GetMessageType() api.MessageType { 424 return api.RequestMessage 425 } 426 427 func (m *IoamDisable) Size() (size int) { 428 if m == nil { 429 return 0 430 } 431 size += 2 // m.ID 432 return size 433 } 434 func (m *IoamDisable) Marshal(b []byte) ([]byte, error) { 435 if b == nil { 436 b = make([]byte, m.Size()) 437 } 438 buf := codec.NewBuffer(b) 439 buf.EncodeUint16(m.ID) 440 return buf.Bytes(), nil 441 } 442 func (m *IoamDisable) Unmarshal(b []byte) error { 443 buf := codec.NewBuffer(b) 444 m.ID = buf.DecodeUint16() 445 return nil 446 } 447 448 // IoamDisableReply defines message 'ioam_disable_reply'. 449 type IoamDisableReply struct { 450 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 451 } 452 453 func (m *IoamDisableReply) Reset() { *m = IoamDisableReply{} } 454 func (*IoamDisableReply) GetMessageName() string { return "ioam_disable_reply" } 455 func (*IoamDisableReply) GetCrcString() string { return "e8d4e804" } 456 func (*IoamDisableReply) GetMessageType() api.MessageType { 457 return api.ReplyMessage 458 } 459 460 func (m *IoamDisableReply) Size() (size int) { 461 if m == nil { 462 return 0 463 } 464 size += 4 // m.Retval 465 return size 466 } 467 func (m *IoamDisableReply) Marshal(b []byte) ([]byte, error) { 468 if b == nil { 469 b = make([]byte, m.Size()) 470 } 471 buf := codec.NewBuffer(b) 472 buf.EncodeInt32(m.Retval) 473 return buf.Bytes(), nil 474 } 475 func (m *IoamDisableReply) Unmarshal(b []byte) error { 476 buf := codec.NewBuffer(b) 477 m.Retval = buf.DecodeInt32() 478 return nil 479 } 480 481 // IOAM enable : Enable in-band OAM 482 // - id - profile id 483 // - seqno - To enable Seqno Processing 484 // - analyse - Enabling analysis of iOAM at decap node 485 // - pow_enable - Proof of Work enabled or not flag 486 // - trace_enable - iOAM Trace enabled or not flag 487 // 488 // IoamEnable defines message 'ioam_enable'. 489 type IoamEnable struct { 490 ID uint16 `binapi:"u16,name=id" json:"id,omitempty"` 491 Seqno bool `binapi:"bool,name=seqno" json:"seqno,omitempty"` 492 Analyse bool `binapi:"bool,name=analyse" json:"analyse,omitempty"` 493 PotEnable bool `binapi:"bool,name=pot_enable" json:"pot_enable,omitempty"` 494 TraceEnable bool `binapi:"bool,name=trace_enable" json:"trace_enable,omitempty"` 495 NodeID uint32 `binapi:"u32,name=node_id" json:"node_id,omitempty"` 496 } 497 498 func (m *IoamEnable) Reset() { *m = IoamEnable{} } 499 func (*IoamEnable) GetMessageName() string { return "ioam_enable" } 500 func (*IoamEnable) GetCrcString() string { return "51ccd868" } 501 func (*IoamEnable) GetMessageType() api.MessageType { 502 return api.RequestMessage 503 } 504 505 func (m *IoamEnable) Size() (size int) { 506 if m == nil { 507 return 0 508 } 509 size += 2 // m.ID 510 size += 1 // m.Seqno 511 size += 1 // m.Analyse 512 size += 1 // m.PotEnable 513 size += 1 // m.TraceEnable 514 size += 4 // m.NodeID 515 return size 516 } 517 func (m *IoamEnable) Marshal(b []byte) ([]byte, error) { 518 if b == nil { 519 b = make([]byte, m.Size()) 520 } 521 buf := codec.NewBuffer(b) 522 buf.EncodeUint16(m.ID) 523 buf.EncodeBool(m.Seqno) 524 buf.EncodeBool(m.Analyse) 525 buf.EncodeBool(m.PotEnable) 526 buf.EncodeBool(m.TraceEnable) 527 buf.EncodeUint32(m.NodeID) 528 return buf.Bytes(), nil 529 } 530 func (m *IoamEnable) Unmarshal(b []byte) error { 531 buf := codec.NewBuffer(b) 532 m.ID = buf.DecodeUint16() 533 m.Seqno = buf.DecodeBool() 534 m.Analyse = buf.DecodeBool() 535 m.PotEnable = buf.DecodeBool() 536 m.TraceEnable = buf.DecodeBool() 537 m.NodeID = buf.DecodeUint32() 538 return nil 539 } 540 541 // IoamEnableReply defines message 'ioam_enable_reply'. 542 type IoamEnableReply struct { 543 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 544 } 545 546 func (m *IoamEnableReply) Reset() { *m = IoamEnableReply{} } 547 func (*IoamEnableReply) GetMessageName() string { return "ioam_enable_reply" } 548 func (*IoamEnableReply) GetCrcString() string { return "e8d4e804" } 549 func (*IoamEnableReply) GetMessageType() api.MessageType { 550 return api.ReplyMessage 551 } 552 553 func (m *IoamEnableReply) Size() (size int) { 554 if m == nil { 555 return 0 556 } 557 size += 4 // m.Retval 558 return size 559 } 560 func (m *IoamEnableReply) 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 *IoamEnableReply) Unmarshal(b []byte) error { 569 buf := codec.NewBuffer(b) 570 m.Retval = buf.DecodeInt32() 571 return nil 572 } 573 574 // IPAddressDetails defines message 'ip_address_details'. 575 type IPAddressDetails struct { 576 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 577 Prefix ip_types.AddressWithPrefix `binapi:"address_with_prefix,name=prefix" json:"prefix,omitempty"` 578 } 579 580 func (m *IPAddressDetails) Reset() { *m = IPAddressDetails{} } 581 func (*IPAddressDetails) GetMessageName() string { return "ip_address_details" } 582 func (*IPAddressDetails) GetCrcString() string { return "ee29b797" } 583 func (*IPAddressDetails) GetMessageType() api.MessageType { 584 return api.ReplyMessage 585 } 586 587 func (m *IPAddressDetails) Size() (size int) { 588 if m == nil { 589 return 0 590 } 591 size += 4 // m.SwIfIndex 592 size += 1 // m.Prefix.Address.Af 593 size += 1 * 16 // m.Prefix.Address.Un 594 size += 1 // m.Prefix.Len 595 return size 596 } 597 func (m *IPAddressDetails) Marshal(b []byte) ([]byte, error) { 598 if b == nil { 599 b = make([]byte, m.Size()) 600 } 601 buf := codec.NewBuffer(b) 602 buf.EncodeUint32(uint32(m.SwIfIndex)) 603 buf.EncodeUint8(uint8(m.Prefix.Address.Af)) 604 buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16) 605 buf.EncodeUint8(m.Prefix.Len) 606 return buf.Bytes(), nil 607 } 608 func (m *IPAddressDetails) Unmarshal(b []byte) error { 609 buf := codec.NewBuffer(b) 610 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 611 m.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) 612 copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 613 m.Prefix.Len = buf.DecodeUint8() 614 return nil 615 } 616 617 // IPAddressDump defines message 'ip_address_dump'. 618 type IPAddressDump struct { 619 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 620 IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"` 621 } 622 623 func (m *IPAddressDump) Reset() { *m = IPAddressDump{} } 624 func (*IPAddressDump) GetMessageName() string { return "ip_address_dump" } 625 func (*IPAddressDump) GetCrcString() string { return "2d033de4" } 626 func (*IPAddressDump) GetMessageType() api.MessageType { 627 return api.RequestMessage 628 } 629 630 func (m *IPAddressDump) Size() (size int) { 631 if m == nil { 632 return 0 633 } 634 size += 4 // m.SwIfIndex 635 size += 1 // m.IsIPv6 636 return size 637 } 638 func (m *IPAddressDump) Marshal(b []byte) ([]byte, error) { 639 if b == nil { 640 b = make([]byte, m.Size()) 641 } 642 buf := codec.NewBuffer(b) 643 buf.EncodeUint32(uint32(m.SwIfIndex)) 644 buf.EncodeBool(m.IsIPv6) 645 return buf.Bytes(), nil 646 } 647 func (m *IPAddressDump) Unmarshal(b []byte) error { 648 buf := codec.NewBuffer(b) 649 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 650 m.IsIPv6 = buf.DecodeBool() 651 return nil 652 } 653 654 // IPContainerProxyAddDel defines message 'ip_container_proxy_add_del'. 655 type IPContainerProxyAddDel struct { 656 Pfx ip_types.Prefix `binapi:"prefix,name=pfx" json:"pfx,omitempty"` 657 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 658 IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"` 659 } 660 661 func (m *IPContainerProxyAddDel) Reset() { *m = IPContainerProxyAddDel{} } 662 func (*IPContainerProxyAddDel) GetMessageName() string { return "ip_container_proxy_add_del" } 663 func (*IPContainerProxyAddDel) GetCrcString() string { return "7df1dff1" } 664 func (*IPContainerProxyAddDel) GetMessageType() api.MessageType { 665 return api.RequestMessage 666 } 667 668 func (m *IPContainerProxyAddDel) Size() (size int) { 669 if m == nil { 670 return 0 671 } 672 size += 1 // m.Pfx.Address.Af 673 size += 1 * 16 // m.Pfx.Address.Un 674 size += 1 // m.Pfx.Len 675 size += 4 // m.SwIfIndex 676 size += 1 // m.IsAdd 677 return size 678 } 679 func (m *IPContainerProxyAddDel) Marshal(b []byte) ([]byte, error) { 680 if b == nil { 681 b = make([]byte, m.Size()) 682 } 683 buf := codec.NewBuffer(b) 684 buf.EncodeUint8(uint8(m.Pfx.Address.Af)) 685 buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 16) 686 buf.EncodeUint8(m.Pfx.Len) 687 buf.EncodeUint32(uint32(m.SwIfIndex)) 688 buf.EncodeBool(m.IsAdd) 689 return buf.Bytes(), nil 690 } 691 func (m *IPContainerProxyAddDel) Unmarshal(b []byte) error { 692 buf := codec.NewBuffer(b) 693 m.Pfx.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) 694 copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 695 m.Pfx.Len = buf.DecodeUint8() 696 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 697 m.IsAdd = buf.DecodeBool() 698 return nil 699 } 700 701 // IPContainerProxyAddDelReply defines message 'ip_container_proxy_add_del_reply'. 702 type IPContainerProxyAddDelReply struct { 703 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 704 } 705 706 func (m *IPContainerProxyAddDelReply) Reset() { *m = IPContainerProxyAddDelReply{} } 707 func (*IPContainerProxyAddDelReply) GetMessageName() string { 708 return "ip_container_proxy_add_del_reply" 709 } 710 func (*IPContainerProxyAddDelReply) GetCrcString() string { return "e8d4e804" } 711 func (*IPContainerProxyAddDelReply) GetMessageType() api.MessageType { 712 return api.ReplyMessage 713 } 714 715 func (m *IPContainerProxyAddDelReply) Size() (size int) { 716 if m == nil { 717 return 0 718 } 719 size += 4 // m.Retval 720 return size 721 } 722 func (m *IPContainerProxyAddDelReply) Marshal(b []byte) ([]byte, error) { 723 if b == nil { 724 b = make([]byte, m.Size()) 725 } 726 buf := codec.NewBuffer(b) 727 buf.EncodeInt32(m.Retval) 728 return buf.Bytes(), nil 729 } 730 func (m *IPContainerProxyAddDelReply) Unmarshal(b []byte) error { 731 buf := codec.NewBuffer(b) 732 m.Retval = buf.DecodeInt32() 733 return nil 734 } 735 736 // IPContainerProxyDetails defines message 'ip_container_proxy_details'. 737 type IPContainerProxyDetails struct { 738 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 739 Prefix ip_types.Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"` 740 } 741 742 func (m *IPContainerProxyDetails) Reset() { *m = IPContainerProxyDetails{} } 743 func (*IPContainerProxyDetails) GetMessageName() string { return "ip_container_proxy_details" } 744 func (*IPContainerProxyDetails) GetCrcString() string { return "a8085523" } 745 func (*IPContainerProxyDetails) GetMessageType() api.MessageType { 746 return api.ReplyMessage 747 } 748 749 func (m *IPContainerProxyDetails) Size() (size int) { 750 if m == nil { 751 return 0 752 } 753 size += 4 // m.SwIfIndex 754 size += 1 // m.Prefix.Address.Af 755 size += 1 * 16 // m.Prefix.Address.Un 756 size += 1 // m.Prefix.Len 757 return size 758 } 759 func (m *IPContainerProxyDetails) Marshal(b []byte) ([]byte, error) { 760 if b == nil { 761 b = make([]byte, m.Size()) 762 } 763 buf := codec.NewBuffer(b) 764 buf.EncodeUint32(uint32(m.SwIfIndex)) 765 buf.EncodeUint8(uint8(m.Prefix.Address.Af)) 766 buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16) 767 buf.EncodeUint8(m.Prefix.Len) 768 return buf.Bytes(), nil 769 } 770 func (m *IPContainerProxyDetails) Unmarshal(b []byte) error { 771 buf := codec.NewBuffer(b) 772 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 773 m.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) 774 copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 775 m.Prefix.Len = buf.DecodeUint8() 776 return nil 777 } 778 779 // IPContainerProxyDump defines message 'ip_container_proxy_dump'. 780 type IPContainerProxyDump struct{} 781 782 func (m *IPContainerProxyDump) Reset() { *m = IPContainerProxyDump{} } 783 func (*IPContainerProxyDump) GetMessageName() string { return "ip_container_proxy_dump" } 784 func (*IPContainerProxyDump) GetCrcString() string { return "51077d14" } 785 func (*IPContainerProxyDump) GetMessageType() api.MessageType { 786 return api.RequestMessage 787 } 788 789 func (m *IPContainerProxyDump) Size() (size int) { 790 if m == nil { 791 return 0 792 } 793 return size 794 } 795 func (m *IPContainerProxyDump) Marshal(b []byte) ([]byte, error) { 796 if b == nil { 797 b = make([]byte, m.Size()) 798 } 799 buf := codec.NewBuffer(b) 800 return buf.Bytes(), nil 801 } 802 func (m *IPContainerProxyDump) Unmarshal(b []byte) error { 803 return nil 804 } 805 806 // IPDetails defines message 'ip_details'. 807 type IPDetails struct { 808 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 809 IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"` 810 } 811 812 func (m *IPDetails) Reset() { *m = IPDetails{} } 813 func (*IPDetails) GetMessageName() string { return "ip_details" } 814 func (*IPDetails) GetCrcString() string { return "eb152d07" } 815 func (*IPDetails) GetMessageType() api.MessageType { 816 return api.ReplyMessage 817 } 818 819 func (m *IPDetails) Size() (size int) { 820 if m == nil { 821 return 0 822 } 823 size += 4 // m.SwIfIndex 824 size += 1 // m.IsIPv6 825 return size 826 } 827 func (m *IPDetails) Marshal(b []byte) ([]byte, error) { 828 if b == nil { 829 b = make([]byte, m.Size()) 830 } 831 buf := codec.NewBuffer(b) 832 buf.EncodeUint32(uint32(m.SwIfIndex)) 833 buf.EncodeBool(m.IsIPv6) 834 return buf.Bytes(), nil 835 } 836 func (m *IPDetails) Unmarshal(b []byte) error { 837 buf := codec.NewBuffer(b) 838 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 839 m.IsIPv6 = buf.DecodeBool() 840 return nil 841 } 842 843 // IPDump defines message 'ip_dump'. 844 type IPDump struct { 845 IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"` 846 } 847 848 func (m *IPDump) Reset() { *m = IPDump{} } 849 func (*IPDump) GetMessageName() string { return "ip_dump" } 850 func (*IPDump) GetCrcString() string { return "98d231ca" } 851 func (*IPDump) GetMessageType() api.MessageType { 852 return api.RequestMessage 853 } 854 855 func (m *IPDump) Size() (size int) { 856 if m == nil { 857 return 0 858 } 859 size += 1 // m.IsIPv6 860 return size 861 } 862 func (m *IPDump) Marshal(b []byte) ([]byte, error) { 863 if b == nil { 864 b = make([]byte, m.Size()) 865 } 866 buf := codec.NewBuffer(b) 867 buf.EncodeBool(m.IsIPv6) 868 return buf.Bytes(), nil 869 } 870 func (m *IPDump) Unmarshal(b []byte) error { 871 buf := codec.NewBuffer(b) 872 m.IsIPv6 = buf.DecodeBool() 873 return nil 874 } 875 876 // enable/disable full reassembly of packets aimed at our addresses 877 // IPLocalReassEnableDisable defines message 'ip_local_reass_enable_disable'. 878 type IPLocalReassEnableDisable struct { 879 EnableIP4 bool `binapi:"bool,name=enable_ip4" json:"enable_ip4,omitempty"` 880 EnableIP6 bool `binapi:"bool,name=enable_ip6" json:"enable_ip6,omitempty"` 881 } 882 883 func (m *IPLocalReassEnableDisable) Reset() { *m = IPLocalReassEnableDisable{} } 884 func (*IPLocalReassEnableDisable) GetMessageName() string { return "ip_local_reass_enable_disable" } 885 func (*IPLocalReassEnableDisable) GetCrcString() string { return "34e2ccc4" } 886 func (*IPLocalReassEnableDisable) GetMessageType() api.MessageType { 887 return api.RequestMessage 888 } 889 890 func (m *IPLocalReassEnableDisable) Size() (size int) { 891 if m == nil { 892 return 0 893 } 894 size += 1 // m.EnableIP4 895 size += 1 // m.EnableIP6 896 return size 897 } 898 func (m *IPLocalReassEnableDisable) Marshal(b []byte) ([]byte, error) { 899 if b == nil { 900 b = make([]byte, m.Size()) 901 } 902 buf := codec.NewBuffer(b) 903 buf.EncodeBool(m.EnableIP4) 904 buf.EncodeBool(m.EnableIP6) 905 return buf.Bytes(), nil 906 } 907 func (m *IPLocalReassEnableDisable) Unmarshal(b []byte) error { 908 buf := codec.NewBuffer(b) 909 m.EnableIP4 = buf.DecodeBool() 910 m.EnableIP6 = buf.DecodeBool() 911 return nil 912 } 913 914 // IPLocalReassEnableDisableReply defines message 'ip_local_reass_enable_disable_reply'. 915 type IPLocalReassEnableDisableReply struct { 916 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 917 } 918 919 func (m *IPLocalReassEnableDisableReply) Reset() { *m = IPLocalReassEnableDisableReply{} } 920 func (*IPLocalReassEnableDisableReply) GetMessageName() string { 921 return "ip_local_reass_enable_disable_reply" 922 } 923 func (*IPLocalReassEnableDisableReply) GetCrcString() string { return "e8d4e804" } 924 func (*IPLocalReassEnableDisableReply) GetMessageType() api.MessageType { 925 return api.ReplyMessage 926 } 927 928 func (m *IPLocalReassEnableDisableReply) Size() (size int) { 929 if m == nil { 930 return 0 931 } 932 size += 4 // m.Retval 933 return size 934 } 935 func (m *IPLocalReassEnableDisableReply) Marshal(b []byte) ([]byte, error) { 936 if b == nil { 937 b = make([]byte, m.Size()) 938 } 939 buf := codec.NewBuffer(b) 940 buf.EncodeInt32(m.Retval) 941 return buf.Bytes(), nil 942 } 943 func (m *IPLocalReassEnableDisableReply) Unmarshal(b []byte) error { 944 buf := codec.NewBuffer(b) 945 m.Retval = buf.DecodeInt32() 946 return nil 947 } 948 949 // get status of local reassembly 950 // IPLocalReassGet defines message 'ip_local_reass_get'. 951 type IPLocalReassGet struct{} 952 953 func (m *IPLocalReassGet) Reset() { *m = IPLocalReassGet{} } 954 func (*IPLocalReassGet) GetMessageName() string { return "ip_local_reass_get" } 955 func (*IPLocalReassGet) GetCrcString() string { return "51077d14" } 956 func (*IPLocalReassGet) GetMessageType() api.MessageType { 957 return api.RequestMessage 958 } 959 960 func (m *IPLocalReassGet) Size() (size int) { 961 if m == nil { 962 return 0 963 } 964 return size 965 } 966 func (m *IPLocalReassGet) Marshal(b []byte) ([]byte, error) { 967 if b == nil { 968 b = make([]byte, m.Size()) 969 } 970 buf := codec.NewBuffer(b) 971 return buf.Bytes(), nil 972 } 973 func (m *IPLocalReassGet) Unmarshal(b []byte) error { 974 return nil 975 } 976 977 // IPLocalReassGetReply defines message 'ip_local_reass_get_reply'. 978 type IPLocalReassGetReply struct { 979 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 980 IP4IsEnabled bool `binapi:"bool,name=ip4_is_enabled" json:"ip4_is_enabled,omitempty"` 981 IP6IsEnabled bool `binapi:"bool,name=ip6_is_enabled" json:"ip6_is_enabled,omitempty"` 982 } 983 984 func (m *IPLocalReassGetReply) Reset() { *m = IPLocalReassGetReply{} } 985 func (*IPLocalReassGetReply) GetMessageName() string { return "ip_local_reass_get_reply" } 986 func (*IPLocalReassGetReply) GetCrcString() string { return "3e93a702" } 987 func (*IPLocalReassGetReply) GetMessageType() api.MessageType { 988 return api.ReplyMessage 989 } 990 991 func (m *IPLocalReassGetReply) Size() (size int) { 992 if m == nil { 993 return 0 994 } 995 size += 4 // m.Retval 996 size += 1 // m.IP4IsEnabled 997 size += 1 // m.IP6IsEnabled 998 return size 999 } 1000 func (m *IPLocalReassGetReply) Marshal(b []byte) ([]byte, error) { 1001 if b == nil { 1002 b = make([]byte, m.Size()) 1003 } 1004 buf := codec.NewBuffer(b) 1005 buf.EncodeInt32(m.Retval) 1006 buf.EncodeBool(m.IP4IsEnabled) 1007 buf.EncodeBool(m.IP6IsEnabled) 1008 return buf.Bytes(), nil 1009 } 1010 func (m *IPLocalReassGetReply) Unmarshal(b []byte) error { 1011 buf := codec.NewBuffer(b) 1012 m.Retval = buf.DecodeInt32() 1013 m.IP4IsEnabled = buf.DecodeBool() 1014 m.IP6IsEnabled = buf.DecodeBool() 1015 return nil 1016 } 1017 1018 // Add / del route request 1019 // 1020 // Adds a route, consisting both of the MFIB entry to match packets 1021 // (which may already exist) and a path to send those packets down. 1022 // Routes can be entered repeatedly to add multiple paths. Deletions are 1023 // per-path. 1024 // - table_id - fib table /vrf associated with the route 1025 // - is_add - true if adding a route; false if deleting one 1026 // - is_ipv6 - true iff all the addresses are v6 1027 // - entry_flags - see fib_entry_flag_t 1028 // - itf_flags - see mfib_entry_flags_t 1029 // - next_hop_afi - see dpo_proto_t; the type of destination description 1030 // - src_address - the source of the packet 1031 // - grp_address - the group the packet is destined to 1032 // - nh_address - the nexthop to forward the packet to 1033 // - next_hop_sw_if_index - interface to emit packet on 1034 // BIER AFIs use the BIER imposition ID. v4 and v6 AFIs use either the 1035 // interface or the nexthop address. 1036 // Note that if the route is source-specific (S is supplied, not all 0s), 1037 // the prefix match is treated as exact (prefixlen /32 or /128). 1038 // FIXME not complete yet 1039 // 1040 // IPMrouteAddDel defines message 'ip_mroute_add_del'. 1041 type IPMrouteAddDel struct { 1042 IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"` 1043 IsMultipath bool `binapi:"bool,name=is_multipath" json:"is_multipath,omitempty"` 1044 Route IPMroute `binapi:"ip_mroute,name=route" json:"route,omitempty"` 1045 } 1046 1047 func (m *IPMrouteAddDel) Reset() { *m = IPMrouteAddDel{} } 1048 func (*IPMrouteAddDel) GetMessageName() string { return "ip_mroute_add_del" } 1049 func (*IPMrouteAddDel) GetCrcString() string { return "0dd7e790" } 1050 func (*IPMrouteAddDel) GetMessageType() api.MessageType { 1051 return api.RequestMessage 1052 } 1053 1054 func (m *IPMrouteAddDel) Size() (size int) { 1055 if m == nil { 1056 return 0 1057 } 1058 size += 1 // m.IsAdd 1059 size += 1 // m.IsMultipath 1060 size += 4 // m.Route.TableID 1061 size += 4 // m.Route.EntryFlags 1062 size += 4 // m.Route.RpfID 1063 size += 1 // m.Route.Prefix.Af 1064 size += 2 // m.Route.Prefix.GrpAddressLength 1065 size += 1 * 16 // m.Route.Prefix.GrpAddress 1066 size += 1 * 16 // m.Route.Prefix.SrcAddress 1067 size += 1 // m.Route.NPaths 1068 for j2 := 0; j2 < len(m.Route.Paths); j2++ { 1069 var s2 mfib_types.MfibPath 1070 _ = s2 1071 if j2 < len(m.Route.Paths) { 1072 s2 = m.Route.Paths[j2] 1073 } 1074 size += 4 // s2.ItfFlags 1075 size += 4 // s2.Path.SwIfIndex 1076 size += 4 // s2.Path.TableID 1077 size += 4 // s2.Path.RpfID 1078 size += 1 // s2.Path.Weight 1079 size += 1 // s2.Path.Preference 1080 size += 4 // s2.Path.Type 1081 size += 4 // s2.Path.Flags 1082 size += 4 // s2.Path.Proto 1083 size += 1 * 16 // s2.Path.Nh.Address 1084 size += 4 // s2.Path.Nh.ViaLabel 1085 size += 4 // s2.Path.Nh.ObjID 1086 size += 4 // s2.Path.Nh.ClassifyTableIndex 1087 size += 1 // s2.Path.NLabels 1088 for j4 := 0; j4 < 16; j4++ { 1089 size += 1 // s2.Path.LabelStack[j4].IsUniform 1090 size += 4 // s2.Path.LabelStack[j4].Label 1091 size += 1 // s2.Path.LabelStack[j4].TTL 1092 size += 1 // s2.Path.LabelStack[j4].Exp 1093 } 1094 } 1095 return size 1096 } 1097 func (m *IPMrouteAddDel) Marshal(b []byte) ([]byte, error) { 1098 if b == nil { 1099 b = make([]byte, m.Size()) 1100 } 1101 buf := codec.NewBuffer(b) 1102 buf.EncodeBool(m.IsAdd) 1103 buf.EncodeBool(m.IsMultipath) 1104 buf.EncodeUint32(m.Route.TableID) 1105 buf.EncodeUint32(uint32(m.Route.EntryFlags)) 1106 buf.EncodeUint32(m.Route.RpfID) 1107 buf.EncodeUint8(uint8(m.Route.Prefix.Af)) 1108 buf.EncodeUint16(m.Route.Prefix.GrpAddressLength) 1109 buf.EncodeBytes(m.Route.Prefix.GrpAddress.XXX_UnionData[:], 16) 1110 buf.EncodeBytes(m.Route.Prefix.SrcAddress.XXX_UnionData[:], 16) 1111 buf.EncodeUint8(uint8(len(m.Route.Paths))) 1112 for j1 := 0; j1 < len(m.Route.Paths); j1++ { 1113 var v1 mfib_types.MfibPath // Paths 1114 if j1 < len(m.Route.Paths) { 1115 v1 = m.Route.Paths[j1] 1116 } 1117 buf.EncodeUint32(uint32(v1.ItfFlags)) 1118 buf.EncodeUint32(v1.Path.SwIfIndex) 1119 buf.EncodeUint32(v1.Path.TableID) 1120 buf.EncodeUint32(v1.Path.RpfID) 1121 buf.EncodeUint8(v1.Path.Weight) 1122 buf.EncodeUint8(v1.Path.Preference) 1123 buf.EncodeUint32(uint32(v1.Path.Type)) 1124 buf.EncodeUint32(uint32(v1.Path.Flags)) 1125 buf.EncodeUint32(uint32(v1.Path.Proto)) 1126 buf.EncodeBytes(v1.Path.Nh.Address.XXX_UnionData[:], 16) 1127 buf.EncodeUint32(v1.Path.Nh.ViaLabel) 1128 buf.EncodeUint32(v1.Path.Nh.ObjID) 1129 buf.EncodeUint32(v1.Path.Nh.ClassifyTableIndex) 1130 buf.EncodeUint8(v1.Path.NLabels) 1131 for j3 := 0; j3 < 16; j3++ { 1132 buf.EncodeUint8(v1.Path.LabelStack[j3].IsUniform) 1133 buf.EncodeUint32(v1.Path.LabelStack[j3].Label) 1134 buf.EncodeUint8(v1.Path.LabelStack[j3].TTL) 1135 buf.EncodeUint8(v1.Path.LabelStack[j3].Exp) 1136 } 1137 } 1138 return buf.Bytes(), nil 1139 } 1140 func (m *IPMrouteAddDel) Unmarshal(b []byte) error { 1141 buf := codec.NewBuffer(b) 1142 m.IsAdd = buf.DecodeBool() 1143 m.IsMultipath = buf.DecodeBool() 1144 m.Route.TableID = buf.DecodeUint32() 1145 m.Route.EntryFlags = mfib_types.MfibEntryFlags(buf.DecodeUint32()) 1146 m.Route.RpfID = buf.DecodeUint32() 1147 m.Route.Prefix.Af = ip_types.AddressFamily(buf.DecodeUint8()) 1148 m.Route.Prefix.GrpAddressLength = buf.DecodeUint16() 1149 copy(m.Route.Prefix.GrpAddress.XXX_UnionData[:], buf.DecodeBytes(16)) 1150 copy(m.Route.Prefix.SrcAddress.XXX_UnionData[:], buf.DecodeBytes(16)) 1151 m.Route.NPaths = buf.DecodeUint8() 1152 m.Route.Paths = make([]mfib_types.MfibPath, m.Route.NPaths) 1153 for j1 := 0; j1 < len(m.Route.Paths); j1++ { 1154 m.Route.Paths[j1].ItfFlags = mfib_types.MfibItfFlags(buf.DecodeUint32()) 1155 m.Route.Paths[j1].Path.SwIfIndex = buf.DecodeUint32() 1156 m.Route.Paths[j1].Path.TableID = buf.DecodeUint32() 1157 m.Route.Paths[j1].Path.RpfID = buf.DecodeUint32() 1158 m.Route.Paths[j1].Path.Weight = buf.DecodeUint8() 1159 m.Route.Paths[j1].Path.Preference = buf.DecodeUint8() 1160 m.Route.Paths[j1].Path.Type = fib_types.FibPathType(buf.DecodeUint32()) 1161 m.Route.Paths[j1].Path.Flags = fib_types.FibPathFlags(buf.DecodeUint32()) 1162 m.Route.Paths[j1].Path.Proto = fib_types.FibPathNhProto(buf.DecodeUint32()) 1163 copy(m.Route.Paths[j1].Path.Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16)) 1164 m.Route.Paths[j1].Path.Nh.ViaLabel = buf.DecodeUint32() 1165 m.Route.Paths[j1].Path.Nh.ObjID = buf.DecodeUint32() 1166 m.Route.Paths[j1].Path.Nh.ClassifyTableIndex = buf.DecodeUint32() 1167 m.Route.Paths[j1].Path.NLabels = buf.DecodeUint8() 1168 for j3 := 0; j3 < 16; j3++ { 1169 m.Route.Paths[j1].Path.LabelStack[j3].IsUniform = buf.DecodeUint8() 1170 m.Route.Paths[j1].Path.LabelStack[j3].Label = buf.DecodeUint32() 1171 m.Route.Paths[j1].Path.LabelStack[j3].TTL = buf.DecodeUint8() 1172 m.Route.Paths[j1].Path.LabelStack[j3].Exp = buf.DecodeUint8() 1173 } 1174 } 1175 return nil 1176 } 1177 1178 // IPMrouteAddDelReply defines message 'ip_mroute_add_del_reply'. 1179 type IPMrouteAddDelReply struct { 1180 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1181 StatsIndex uint32 `binapi:"u32,name=stats_index" json:"stats_index,omitempty"` 1182 } 1183 1184 func (m *IPMrouteAddDelReply) Reset() { *m = IPMrouteAddDelReply{} } 1185 func (*IPMrouteAddDelReply) GetMessageName() string { return "ip_mroute_add_del_reply" } 1186 func (*IPMrouteAddDelReply) GetCrcString() string { return "1992deab" } 1187 func (*IPMrouteAddDelReply) GetMessageType() api.MessageType { 1188 return api.ReplyMessage 1189 } 1190 1191 func (m *IPMrouteAddDelReply) Size() (size int) { 1192 if m == nil { 1193 return 0 1194 } 1195 size += 4 // m.Retval 1196 size += 4 // m.StatsIndex 1197 return size 1198 } 1199 func (m *IPMrouteAddDelReply) Marshal(b []byte) ([]byte, error) { 1200 if b == nil { 1201 b = make([]byte, m.Size()) 1202 } 1203 buf := codec.NewBuffer(b) 1204 buf.EncodeInt32(m.Retval) 1205 buf.EncodeUint32(m.StatsIndex) 1206 return buf.Bytes(), nil 1207 } 1208 func (m *IPMrouteAddDelReply) Unmarshal(b []byte) error { 1209 buf := codec.NewBuffer(b) 1210 m.Retval = buf.DecodeInt32() 1211 m.StatsIndex = buf.DecodeUint32() 1212 return nil 1213 } 1214 1215 // IP Multicast Route Details 1216 // - route - Details of the route 1217 // 1218 // IPMrouteDetails defines message 'ip_mroute_details'. 1219 type IPMrouteDetails struct { 1220 Route IPMroute `binapi:"ip_mroute,name=route" json:"route,omitempty"` 1221 } 1222 1223 func (m *IPMrouteDetails) Reset() { *m = IPMrouteDetails{} } 1224 func (*IPMrouteDetails) GetMessageName() string { return "ip_mroute_details" } 1225 func (*IPMrouteDetails) GetCrcString() string { return "c5cb23fc" } 1226 func (*IPMrouteDetails) GetMessageType() api.MessageType { 1227 return api.ReplyMessage 1228 } 1229 1230 func (m *IPMrouteDetails) Size() (size int) { 1231 if m == nil { 1232 return 0 1233 } 1234 size += 4 // m.Route.TableID 1235 size += 4 // m.Route.EntryFlags 1236 size += 4 // m.Route.RpfID 1237 size += 1 // m.Route.Prefix.Af 1238 size += 2 // m.Route.Prefix.GrpAddressLength 1239 size += 1 * 16 // m.Route.Prefix.GrpAddress 1240 size += 1 * 16 // m.Route.Prefix.SrcAddress 1241 size += 1 // m.Route.NPaths 1242 for j2 := 0; j2 < len(m.Route.Paths); j2++ { 1243 var s2 mfib_types.MfibPath 1244 _ = s2 1245 if j2 < len(m.Route.Paths) { 1246 s2 = m.Route.Paths[j2] 1247 } 1248 size += 4 // s2.ItfFlags 1249 size += 4 // s2.Path.SwIfIndex 1250 size += 4 // s2.Path.TableID 1251 size += 4 // s2.Path.RpfID 1252 size += 1 // s2.Path.Weight 1253 size += 1 // s2.Path.Preference 1254 size += 4 // s2.Path.Type 1255 size += 4 // s2.Path.Flags 1256 size += 4 // s2.Path.Proto 1257 size += 1 * 16 // s2.Path.Nh.Address 1258 size += 4 // s2.Path.Nh.ViaLabel 1259 size += 4 // s2.Path.Nh.ObjID 1260 size += 4 // s2.Path.Nh.ClassifyTableIndex 1261 size += 1 // s2.Path.NLabels 1262 for j4 := 0; j4 < 16; j4++ { 1263 size += 1 // s2.Path.LabelStack[j4].IsUniform 1264 size += 4 // s2.Path.LabelStack[j4].Label 1265 size += 1 // s2.Path.LabelStack[j4].TTL 1266 size += 1 // s2.Path.LabelStack[j4].Exp 1267 } 1268 } 1269 return size 1270 } 1271 func (m *IPMrouteDetails) Marshal(b []byte) ([]byte, error) { 1272 if b == nil { 1273 b = make([]byte, m.Size()) 1274 } 1275 buf := codec.NewBuffer(b) 1276 buf.EncodeUint32(m.Route.TableID) 1277 buf.EncodeUint32(uint32(m.Route.EntryFlags)) 1278 buf.EncodeUint32(m.Route.RpfID) 1279 buf.EncodeUint8(uint8(m.Route.Prefix.Af)) 1280 buf.EncodeUint16(m.Route.Prefix.GrpAddressLength) 1281 buf.EncodeBytes(m.Route.Prefix.GrpAddress.XXX_UnionData[:], 16) 1282 buf.EncodeBytes(m.Route.Prefix.SrcAddress.XXX_UnionData[:], 16) 1283 buf.EncodeUint8(uint8(len(m.Route.Paths))) 1284 for j1 := 0; j1 < len(m.Route.Paths); j1++ { 1285 var v1 mfib_types.MfibPath // Paths 1286 if j1 < len(m.Route.Paths) { 1287 v1 = m.Route.Paths[j1] 1288 } 1289 buf.EncodeUint32(uint32(v1.ItfFlags)) 1290 buf.EncodeUint32(v1.Path.SwIfIndex) 1291 buf.EncodeUint32(v1.Path.TableID) 1292 buf.EncodeUint32(v1.Path.RpfID) 1293 buf.EncodeUint8(v1.Path.Weight) 1294 buf.EncodeUint8(v1.Path.Preference) 1295 buf.EncodeUint32(uint32(v1.Path.Type)) 1296 buf.EncodeUint32(uint32(v1.Path.Flags)) 1297 buf.EncodeUint32(uint32(v1.Path.Proto)) 1298 buf.EncodeBytes(v1.Path.Nh.Address.XXX_UnionData[:], 16) 1299 buf.EncodeUint32(v1.Path.Nh.ViaLabel) 1300 buf.EncodeUint32(v1.Path.Nh.ObjID) 1301 buf.EncodeUint32(v1.Path.Nh.ClassifyTableIndex) 1302 buf.EncodeUint8(v1.Path.NLabels) 1303 for j3 := 0; j3 < 16; j3++ { 1304 buf.EncodeUint8(v1.Path.LabelStack[j3].IsUniform) 1305 buf.EncodeUint32(v1.Path.LabelStack[j3].Label) 1306 buf.EncodeUint8(v1.Path.LabelStack[j3].TTL) 1307 buf.EncodeUint8(v1.Path.LabelStack[j3].Exp) 1308 } 1309 } 1310 return buf.Bytes(), nil 1311 } 1312 func (m *IPMrouteDetails) Unmarshal(b []byte) error { 1313 buf := codec.NewBuffer(b) 1314 m.Route.TableID = buf.DecodeUint32() 1315 m.Route.EntryFlags = mfib_types.MfibEntryFlags(buf.DecodeUint32()) 1316 m.Route.RpfID = buf.DecodeUint32() 1317 m.Route.Prefix.Af = ip_types.AddressFamily(buf.DecodeUint8()) 1318 m.Route.Prefix.GrpAddressLength = buf.DecodeUint16() 1319 copy(m.Route.Prefix.GrpAddress.XXX_UnionData[:], buf.DecodeBytes(16)) 1320 copy(m.Route.Prefix.SrcAddress.XXX_UnionData[:], buf.DecodeBytes(16)) 1321 m.Route.NPaths = buf.DecodeUint8() 1322 m.Route.Paths = make([]mfib_types.MfibPath, m.Route.NPaths) 1323 for j1 := 0; j1 < len(m.Route.Paths); j1++ { 1324 m.Route.Paths[j1].ItfFlags = mfib_types.MfibItfFlags(buf.DecodeUint32()) 1325 m.Route.Paths[j1].Path.SwIfIndex = buf.DecodeUint32() 1326 m.Route.Paths[j1].Path.TableID = buf.DecodeUint32() 1327 m.Route.Paths[j1].Path.RpfID = buf.DecodeUint32() 1328 m.Route.Paths[j1].Path.Weight = buf.DecodeUint8() 1329 m.Route.Paths[j1].Path.Preference = buf.DecodeUint8() 1330 m.Route.Paths[j1].Path.Type = fib_types.FibPathType(buf.DecodeUint32()) 1331 m.Route.Paths[j1].Path.Flags = fib_types.FibPathFlags(buf.DecodeUint32()) 1332 m.Route.Paths[j1].Path.Proto = fib_types.FibPathNhProto(buf.DecodeUint32()) 1333 copy(m.Route.Paths[j1].Path.Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16)) 1334 m.Route.Paths[j1].Path.Nh.ViaLabel = buf.DecodeUint32() 1335 m.Route.Paths[j1].Path.Nh.ObjID = buf.DecodeUint32() 1336 m.Route.Paths[j1].Path.Nh.ClassifyTableIndex = buf.DecodeUint32() 1337 m.Route.Paths[j1].Path.NLabels = buf.DecodeUint8() 1338 for j3 := 0; j3 < 16; j3++ { 1339 m.Route.Paths[j1].Path.LabelStack[j3].IsUniform = buf.DecodeUint8() 1340 m.Route.Paths[j1].Path.LabelStack[j3].Label = buf.DecodeUint32() 1341 m.Route.Paths[j1].Path.LabelStack[j3].TTL = buf.DecodeUint8() 1342 m.Route.Paths[j1].Path.LabelStack[j3].Exp = buf.DecodeUint8() 1343 } 1344 } 1345 return nil 1346 } 1347 1348 // Dump IP multicast fib table 1349 // - table - The table from which to dump routes (ony ID an AF are needed) 1350 // 1351 // IPMrouteDump defines message 'ip_mroute_dump'. 1352 type IPMrouteDump struct { 1353 Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"` 1354 } 1355 1356 func (m *IPMrouteDump) Reset() { *m = IPMrouteDump{} } 1357 func (*IPMrouteDump) GetMessageName() string { return "ip_mroute_dump" } 1358 func (*IPMrouteDump) GetCrcString() string { return "b9d2e09e" } 1359 func (*IPMrouteDump) GetMessageType() api.MessageType { 1360 return api.RequestMessage 1361 } 1362 1363 func (m *IPMrouteDump) Size() (size int) { 1364 if m == nil { 1365 return 0 1366 } 1367 size += 4 // m.Table.TableID 1368 size += 1 // m.Table.IsIP6 1369 size += 64 // m.Table.Name 1370 return size 1371 } 1372 func (m *IPMrouteDump) Marshal(b []byte) ([]byte, error) { 1373 if b == nil { 1374 b = make([]byte, m.Size()) 1375 } 1376 buf := codec.NewBuffer(b) 1377 buf.EncodeUint32(m.Table.TableID) 1378 buf.EncodeBool(m.Table.IsIP6) 1379 buf.EncodeString(m.Table.Name, 64) 1380 return buf.Bytes(), nil 1381 } 1382 func (m *IPMrouteDump) Unmarshal(b []byte) error { 1383 buf := codec.NewBuffer(b) 1384 m.Table.TableID = buf.DecodeUint32() 1385 m.Table.IsIP6 = buf.DecodeBool() 1386 m.Table.Name = buf.DecodeString(64) 1387 return nil 1388 } 1389 1390 // IPMtableDetails defines message 'ip_mtable_details'. 1391 type IPMtableDetails struct { 1392 Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"` 1393 } 1394 1395 func (m *IPMtableDetails) Reset() { *m = IPMtableDetails{} } 1396 func (*IPMtableDetails) GetMessageName() string { return "ip_mtable_details" } 1397 func (*IPMtableDetails) GetCrcString() string { return "b9d2e09e" } 1398 func (*IPMtableDetails) GetMessageType() api.MessageType { 1399 return api.RequestMessage 1400 } 1401 1402 func (m *IPMtableDetails) Size() (size int) { 1403 if m == nil { 1404 return 0 1405 } 1406 size += 4 // m.Table.TableID 1407 size += 1 // m.Table.IsIP6 1408 size += 64 // m.Table.Name 1409 return size 1410 } 1411 func (m *IPMtableDetails) Marshal(b []byte) ([]byte, error) { 1412 if b == nil { 1413 b = make([]byte, m.Size()) 1414 } 1415 buf := codec.NewBuffer(b) 1416 buf.EncodeUint32(m.Table.TableID) 1417 buf.EncodeBool(m.Table.IsIP6) 1418 buf.EncodeString(m.Table.Name, 64) 1419 return buf.Bytes(), nil 1420 } 1421 func (m *IPMtableDetails) Unmarshal(b []byte) error { 1422 buf := codec.NewBuffer(b) 1423 m.Table.TableID = buf.DecodeUint32() 1424 m.Table.IsIP6 = buf.DecodeBool() 1425 m.Table.Name = buf.DecodeString(64) 1426 return nil 1427 } 1428 1429 // Dump IP multicast fib table 1430 // IPMtableDump defines message 'ip_mtable_dump'. 1431 type IPMtableDump struct{} 1432 1433 func (m *IPMtableDump) Reset() { *m = IPMtableDump{} } 1434 func (*IPMtableDump) GetMessageName() string { return "ip_mtable_dump" } 1435 func (*IPMtableDump) GetCrcString() string { return "51077d14" } 1436 func (*IPMtableDump) GetMessageType() api.MessageType { 1437 return api.RequestMessage 1438 } 1439 1440 func (m *IPMtableDump) Size() (size int) { 1441 if m == nil { 1442 return 0 1443 } 1444 return size 1445 } 1446 func (m *IPMtableDump) Marshal(b []byte) ([]byte, error) { 1447 if b == nil { 1448 b = make([]byte, m.Size()) 1449 } 1450 buf := codec.NewBuffer(b) 1451 return buf.Bytes(), nil 1452 } 1453 func (m *IPMtableDump) Unmarshal(b []byte) error { 1454 return nil 1455 } 1456 1457 // IPPathMtuDetails defines message 'ip_path_mtu_details'. 1458 type IPPathMtuDetails struct { 1459 Pmtu IPPathMtu `binapi:"ip_path_mtu,name=pmtu" json:"pmtu,omitempty"` 1460 } 1461 1462 func (m *IPPathMtuDetails) Reset() { *m = IPPathMtuDetails{} } 1463 func (*IPPathMtuDetails) GetMessageName() string { return "ip_path_mtu_details" } 1464 func (*IPPathMtuDetails) GetCrcString() string { return "ac9539a7" } 1465 func (*IPPathMtuDetails) GetMessageType() api.MessageType { 1466 return api.ReplyMessage 1467 } 1468 1469 func (m *IPPathMtuDetails) Size() (size int) { 1470 if m == nil { 1471 return 0 1472 } 1473 size += 4 // m.Pmtu.ClientIndex 1474 size += 4 // m.Pmtu.Context 1475 size += 4 // m.Pmtu.TableID 1476 size += 1 // m.Pmtu.Nh.Af 1477 size += 1 * 16 // m.Pmtu.Nh.Un 1478 size += 2 // m.Pmtu.PathMtu 1479 return size 1480 } 1481 func (m *IPPathMtuDetails) Marshal(b []byte) ([]byte, error) { 1482 if b == nil { 1483 b = make([]byte, m.Size()) 1484 } 1485 buf := codec.NewBuffer(b) 1486 buf.EncodeUint32(m.Pmtu.ClientIndex) 1487 buf.EncodeUint32(m.Pmtu.Context) 1488 buf.EncodeUint32(m.Pmtu.TableID) 1489 buf.EncodeUint8(uint8(m.Pmtu.Nh.Af)) 1490 buf.EncodeBytes(m.Pmtu.Nh.Un.XXX_UnionData[:], 16) 1491 buf.EncodeUint16(m.Pmtu.PathMtu) 1492 return buf.Bytes(), nil 1493 } 1494 func (m *IPPathMtuDetails) Unmarshal(b []byte) error { 1495 buf := codec.NewBuffer(b) 1496 m.Pmtu.ClientIndex = buf.DecodeUint32() 1497 m.Pmtu.Context = buf.DecodeUint32() 1498 m.Pmtu.TableID = buf.DecodeUint32() 1499 m.Pmtu.Nh.Af = ip_types.AddressFamily(buf.DecodeUint8()) 1500 copy(m.Pmtu.Nh.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 1501 m.Pmtu.PathMtu = buf.DecodeUint16() 1502 return nil 1503 } 1504 1505 // IPPathMtuGet defines message 'ip_path_mtu_get'. 1506 type IPPathMtuGet struct { 1507 Cursor uint32 `binapi:"u32,name=cursor" json:"cursor,omitempty"` 1508 } 1509 1510 func (m *IPPathMtuGet) Reset() { *m = IPPathMtuGet{} } 1511 func (*IPPathMtuGet) GetMessageName() string { return "ip_path_mtu_get" } 1512 func (*IPPathMtuGet) GetCrcString() string { return "f75ba505" } 1513 func (*IPPathMtuGet) GetMessageType() api.MessageType { 1514 return api.RequestMessage 1515 } 1516 1517 func (m *IPPathMtuGet) Size() (size int) { 1518 if m == nil { 1519 return 0 1520 } 1521 size += 4 // m.Cursor 1522 return size 1523 } 1524 func (m *IPPathMtuGet) Marshal(b []byte) ([]byte, error) { 1525 if b == nil { 1526 b = make([]byte, m.Size()) 1527 } 1528 buf := codec.NewBuffer(b) 1529 buf.EncodeUint32(m.Cursor) 1530 return buf.Bytes(), nil 1531 } 1532 func (m *IPPathMtuGet) Unmarshal(b []byte) error { 1533 buf := codec.NewBuffer(b) 1534 m.Cursor = buf.DecodeUint32() 1535 return nil 1536 } 1537 1538 // IPPathMtuGetReply defines message 'ip_path_mtu_get_reply'. 1539 type IPPathMtuGetReply struct { 1540 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1541 Cursor uint32 `binapi:"u32,name=cursor" json:"cursor,omitempty"` 1542 } 1543 1544 func (m *IPPathMtuGetReply) Reset() { *m = IPPathMtuGetReply{} } 1545 func (*IPPathMtuGetReply) GetMessageName() string { return "ip_path_mtu_get_reply" } 1546 func (*IPPathMtuGetReply) GetCrcString() string { return "53b48f5d" } 1547 func (*IPPathMtuGetReply) GetMessageType() api.MessageType { 1548 return api.ReplyMessage 1549 } 1550 1551 func (m *IPPathMtuGetReply) Size() (size int) { 1552 if m == nil { 1553 return 0 1554 } 1555 size += 4 // m.Retval 1556 size += 4 // m.Cursor 1557 return size 1558 } 1559 func (m *IPPathMtuGetReply) Marshal(b []byte) ([]byte, error) { 1560 if b == nil { 1561 b = make([]byte, m.Size()) 1562 } 1563 buf := codec.NewBuffer(b) 1564 buf.EncodeInt32(m.Retval) 1565 buf.EncodeUint32(m.Cursor) 1566 return buf.Bytes(), nil 1567 } 1568 func (m *IPPathMtuGetReply) Unmarshal(b []byte) error { 1569 buf := codec.NewBuffer(b) 1570 m.Retval = buf.DecodeInt32() 1571 m.Cursor = buf.DecodeUint32() 1572 return nil 1573 } 1574 1575 // IPPathMtuReplaceBegin defines message 'ip_path_mtu_replace_begin'. 1576 type IPPathMtuReplaceBegin struct{} 1577 1578 func (m *IPPathMtuReplaceBegin) Reset() { *m = IPPathMtuReplaceBegin{} } 1579 func (*IPPathMtuReplaceBegin) GetMessageName() string { return "ip_path_mtu_replace_begin" } 1580 func (*IPPathMtuReplaceBegin) GetCrcString() string { return "51077d14" } 1581 func (*IPPathMtuReplaceBegin) GetMessageType() api.MessageType { 1582 return api.RequestMessage 1583 } 1584 1585 func (m *IPPathMtuReplaceBegin) Size() (size int) { 1586 if m == nil { 1587 return 0 1588 } 1589 return size 1590 } 1591 func (m *IPPathMtuReplaceBegin) Marshal(b []byte) ([]byte, error) { 1592 if b == nil { 1593 b = make([]byte, m.Size()) 1594 } 1595 buf := codec.NewBuffer(b) 1596 return buf.Bytes(), nil 1597 } 1598 func (m *IPPathMtuReplaceBegin) Unmarshal(b []byte) error { 1599 return nil 1600 } 1601 1602 // IPPathMtuReplaceBeginReply defines message 'ip_path_mtu_replace_begin_reply'. 1603 type IPPathMtuReplaceBeginReply struct { 1604 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1605 } 1606 1607 func (m *IPPathMtuReplaceBeginReply) Reset() { *m = IPPathMtuReplaceBeginReply{} } 1608 func (*IPPathMtuReplaceBeginReply) GetMessageName() string { return "ip_path_mtu_replace_begin_reply" } 1609 func (*IPPathMtuReplaceBeginReply) GetCrcString() string { return "e8d4e804" } 1610 func (*IPPathMtuReplaceBeginReply) GetMessageType() api.MessageType { 1611 return api.ReplyMessage 1612 } 1613 1614 func (m *IPPathMtuReplaceBeginReply) Size() (size int) { 1615 if m == nil { 1616 return 0 1617 } 1618 size += 4 // m.Retval 1619 return size 1620 } 1621 func (m *IPPathMtuReplaceBeginReply) Marshal(b []byte) ([]byte, error) { 1622 if b == nil { 1623 b = make([]byte, m.Size()) 1624 } 1625 buf := codec.NewBuffer(b) 1626 buf.EncodeInt32(m.Retval) 1627 return buf.Bytes(), nil 1628 } 1629 func (m *IPPathMtuReplaceBeginReply) Unmarshal(b []byte) error { 1630 buf := codec.NewBuffer(b) 1631 m.Retval = buf.DecodeInt32() 1632 return nil 1633 } 1634 1635 // IPPathMtuReplaceEnd defines message 'ip_path_mtu_replace_end'. 1636 type IPPathMtuReplaceEnd struct{} 1637 1638 func (m *IPPathMtuReplaceEnd) Reset() { *m = IPPathMtuReplaceEnd{} } 1639 func (*IPPathMtuReplaceEnd) GetMessageName() string { return "ip_path_mtu_replace_end" } 1640 func (*IPPathMtuReplaceEnd) GetCrcString() string { return "51077d14" } 1641 func (*IPPathMtuReplaceEnd) GetMessageType() api.MessageType { 1642 return api.RequestMessage 1643 } 1644 1645 func (m *IPPathMtuReplaceEnd) Size() (size int) { 1646 if m == nil { 1647 return 0 1648 } 1649 return size 1650 } 1651 func (m *IPPathMtuReplaceEnd) Marshal(b []byte) ([]byte, error) { 1652 if b == nil { 1653 b = make([]byte, m.Size()) 1654 } 1655 buf := codec.NewBuffer(b) 1656 return buf.Bytes(), nil 1657 } 1658 func (m *IPPathMtuReplaceEnd) Unmarshal(b []byte) error { 1659 return nil 1660 } 1661 1662 // IPPathMtuReplaceEndReply defines message 'ip_path_mtu_replace_end_reply'. 1663 type IPPathMtuReplaceEndReply struct { 1664 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1665 } 1666 1667 func (m *IPPathMtuReplaceEndReply) Reset() { *m = IPPathMtuReplaceEndReply{} } 1668 func (*IPPathMtuReplaceEndReply) GetMessageName() string { return "ip_path_mtu_replace_end_reply" } 1669 func (*IPPathMtuReplaceEndReply) GetCrcString() string { return "e8d4e804" } 1670 func (*IPPathMtuReplaceEndReply) GetMessageType() api.MessageType { 1671 return api.ReplyMessage 1672 } 1673 1674 func (m *IPPathMtuReplaceEndReply) Size() (size int) { 1675 if m == nil { 1676 return 0 1677 } 1678 size += 4 // m.Retval 1679 return size 1680 } 1681 func (m *IPPathMtuReplaceEndReply) Marshal(b []byte) ([]byte, error) { 1682 if b == nil { 1683 b = make([]byte, m.Size()) 1684 } 1685 buf := codec.NewBuffer(b) 1686 buf.EncodeInt32(m.Retval) 1687 return buf.Bytes(), nil 1688 } 1689 func (m *IPPathMtuReplaceEndReply) Unmarshal(b []byte) error { 1690 buf := codec.NewBuffer(b) 1691 m.Retval = buf.DecodeInt32() 1692 return nil 1693 } 1694 1695 // @brief Set a Path MTU value. i.e. a MTU value for a given neighbour. 1696 // 1697 // The neighbour can be described as attached (w/ interface and next-hop) 1698 // or remote (w/ table_id and next-hop); 1699 // - table_id - table-ID for next-hop 1700 // - nh - Next hop 1701 // - path_mtu - value to set, 0 is disable. 1702 // 1703 // IPPathMtuUpdate defines message 'ip_path_mtu_update'. 1704 type IPPathMtuUpdate struct { 1705 Pmtu IPPathMtu `binapi:"ip_path_mtu,name=pmtu" json:"pmtu,omitempty"` 1706 } 1707 1708 func (m *IPPathMtuUpdate) Reset() { *m = IPPathMtuUpdate{} } 1709 func (*IPPathMtuUpdate) GetMessageName() string { return "ip_path_mtu_update" } 1710 func (*IPPathMtuUpdate) GetCrcString() string { return "10bbe5cb" } 1711 func (*IPPathMtuUpdate) GetMessageType() api.MessageType { 1712 return api.RequestMessage 1713 } 1714 1715 func (m *IPPathMtuUpdate) Size() (size int) { 1716 if m == nil { 1717 return 0 1718 } 1719 size += 4 // m.Pmtu.ClientIndex 1720 size += 4 // m.Pmtu.Context 1721 size += 4 // m.Pmtu.TableID 1722 size += 1 // m.Pmtu.Nh.Af 1723 size += 1 * 16 // m.Pmtu.Nh.Un 1724 size += 2 // m.Pmtu.PathMtu 1725 return size 1726 } 1727 func (m *IPPathMtuUpdate) Marshal(b []byte) ([]byte, error) { 1728 if b == nil { 1729 b = make([]byte, m.Size()) 1730 } 1731 buf := codec.NewBuffer(b) 1732 buf.EncodeUint32(m.Pmtu.ClientIndex) 1733 buf.EncodeUint32(m.Pmtu.Context) 1734 buf.EncodeUint32(m.Pmtu.TableID) 1735 buf.EncodeUint8(uint8(m.Pmtu.Nh.Af)) 1736 buf.EncodeBytes(m.Pmtu.Nh.Un.XXX_UnionData[:], 16) 1737 buf.EncodeUint16(m.Pmtu.PathMtu) 1738 return buf.Bytes(), nil 1739 } 1740 func (m *IPPathMtuUpdate) Unmarshal(b []byte) error { 1741 buf := codec.NewBuffer(b) 1742 m.Pmtu.ClientIndex = buf.DecodeUint32() 1743 m.Pmtu.Context = buf.DecodeUint32() 1744 m.Pmtu.TableID = buf.DecodeUint32() 1745 m.Pmtu.Nh.Af = ip_types.AddressFamily(buf.DecodeUint8()) 1746 copy(m.Pmtu.Nh.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 1747 m.Pmtu.PathMtu = buf.DecodeUint16() 1748 return nil 1749 } 1750 1751 // IPPathMtuUpdateReply defines message 'ip_path_mtu_update_reply'. 1752 type IPPathMtuUpdateReply struct { 1753 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1754 } 1755 1756 func (m *IPPathMtuUpdateReply) Reset() { *m = IPPathMtuUpdateReply{} } 1757 func (*IPPathMtuUpdateReply) GetMessageName() string { return "ip_path_mtu_update_reply" } 1758 func (*IPPathMtuUpdateReply) GetCrcString() string { return "e8d4e804" } 1759 func (*IPPathMtuUpdateReply) GetMessageType() api.MessageType { 1760 return api.ReplyMessage 1761 } 1762 1763 func (m *IPPathMtuUpdateReply) Size() (size int) { 1764 if m == nil { 1765 return 0 1766 } 1767 size += 4 // m.Retval 1768 return size 1769 } 1770 func (m *IPPathMtuUpdateReply) Marshal(b []byte) ([]byte, error) { 1771 if b == nil { 1772 b = make([]byte, m.Size()) 1773 } 1774 buf := codec.NewBuffer(b) 1775 buf.EncodeInt32(m.Retval) 1776 return buf.Bytes(), nil 1777 } 1778 func (m *IPPathMtuUpdateReply) Unmarshal(b []byte) error { 1779 buf := codec.NewBuffer(b) 1780 m.Retval = buf.DecodeInt32() 1781 return nil 1782 } 1783 1784 // IP punt policer 1785 // - is_add - 1 to add neighbor, 0 to delete 1786 // - is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4 1787 // - policer_index - Index of policer to use 1788 // 1789 // IPPuntPolice defines message 'ip_punt_police'. 1790 type IPPuntPolice struct { 1791 PolicerIndex uint32 `binapi:"u32,name=policer_index" json:"policer_index,omitempty"` 1792 IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"` 1793 IsIP6 bool `binapi:"bool,name=is_ip6" json:"is_ip6,omitempty"` 1794 } 1795 1796 func (m *IPPuntPolice) Reset() { *m = IPPuntPolice{} } 1797 func (*IPPuntPolice) GetMessageName() string { return "ip_punt_police" } 1798 func (*IPPuntPolice) GetCrcString() string { return "db867cea" } 1799 func (*IPPuntPolice) GetMessageType() api.MessageType { 1800 return api.RequestMessage 1801 } 1802 1803 func (m *IPPuntPolice) Size() (size int) { 1804 if m == nil { 1805 return 0 1806 } 1807 size += 4 // m.PolicerIndex 1808 size += 1 // m.IsAdd 1809 size += 1 // m.IsIP6 1810 return size 1811 } 1812 func (m *IPPuntPolice) Marshal(b []byte) ([]byte, error) { 1813 if b == nil { 1814 b = make([]byte, m.Size()) 1815 } 1816 buf := codec.NewBuffer(b) 1817 buf.EncodeUint32(m.PolicerIndex) 1818 buf.EncodeBool(m.IsAdd) 1819 buf.EncodeBool(m.IsIP6) 1820 return buf.Bytes(), nil 1821 } 1822 func (m *IPPuntPolice) Unmarshal(b []byte) error { 1823 buf := codec.NewBuffer(b) 1824 m.PolicerIndex = buf.DecodeUint32() 1825 m.IsAdd = buf.DecodeBool() 1826 m.IsIP6 = buf.DecodeBool() 1827 return nil 1828 } 1829 1830 // IPPuntPoliceReply defines message 'ip_punt_police_reply'. 1831 type IPPuntPoliceReply struct { 1832 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1833 } 1834 1835 func (m *IPPuntPoliceReply) Reset() { *m = IPPuntPoliceReply{} } 1836 func (*IPPuntPoliceReply) GetMessageName() string { return "ip_punt_police_reply" } 1837 func (*IPPuntPoliceReply) GetCrcString() string { return "e8d4e804" } 1838 func (*IPPuntPoliceReply) GetMessageType() api.MessageType { 1839 return api.ReplyMessage 1840 } 1841 1842 func (m *IPPuntPoliceReply) Size() (size int) { 1843 if m == nil { 1844 return 0 1845 } 1846 size += 4 // m.Retval 1847 return size 1848 } 1849 func (m *IPPuntPoliceReply) Marshal(b []byte) ([]byte, error) { 1850 if b == nil { 1851 b = make([]byte, m.Size()) 1852 } 1853 buf := codec.NewBuffer(b) 1854 buf.EncodeInt32(m.Retval) 1855 return buf.Bytes(), nil 1856 } 1857 func (m *IPPuntPoliceReply) Unmarshal(b []byte) error { 1858 buf := codec.NewBuffer(b) 1859 m.Retval = buf.DecodeInt32() 1860 return nil 1861 } 1862 1863 // IP punt redirect 1864 // - punt - punt definition 1865 // - is_add - 1 to add neighbor, 0 to delete 1866 // 1867 // IPPuntRedirect defines message 'ip_punt_redirect'. 1868 // Deprecated: the message will be removed in the future versions 1869 type IPPuntRedirect struct { 1870 Punt PuntRedirect `binapi:"punt_redirect,name=punt" json:"punt,omitempty"` 1871 IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"` 1872 } 1873 1874 func (m *IPPuntRedirect) Reset() { *m = IPPuntRedirect{} } 1875 func (*IPPuntRedirect) GetMessageName() string { return "ip_punt_redirect" } 1876 func (*IPPuntRedirect) GetCrcString() string { return "6580f635" } 1877 func (*IPPuntRedirect) GetMessageType() api.MessageType { 1878 return api.RequestMessage 1879 } 1880 1881 func (m *IPPuntRedirect) Size() (size int) { 1882 if m == nil { 1883 return 0 1884 } 1885 size += 4 // m.Punt.RxSwIfIndex 1886 size += 4 // m.Punt.TxSwIfIndex 1887 size += 1 // m.Punt.Nh.Af 1888 size += 1 * 16 // m.Punt.Nh.Un 1889 size += 1 // m.IsAdd 1890 return size 1891 } 1892 func (m *IPPuntRedirect) Marshal(b []byte) ([]byte, error) { 1893 if b == nil { 1894 b = make([]byte, m.Size()) 1895 } 1896 buf := codec.NewBuffer(b) 1897 buf.EncodeUint32(uint32(m.Punt.RxSwIfIndex)) 1898 buf.EncodeUint32(uint32(m.Punt.TxSwIfIndex)) 1899 buf.EncodeUint8(uint8(m.Punt.Nh.Af)) 1900 buf.EncodeBytes(m.Punt.Nh.Un.XXX_UnionData[:], 16) 1901 buf.EncodeBool(m.IsAdd) 1902 return buf.Bytes(), nil 1903 } 1904 func (m *IPPuntRedirect) Unmarshal(b []byte) error { 1905 buf := codec.NewBuffer(b) 1906 m.Punt.RxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1907 m.Punt.TxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1908 m.Punt.Nh.Af = ip_types.AddressFamily(buf.DecodeUint8()) 1909 copy(m.Punt.Nh.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 1910 m.IsAdd = buf.DecodeBool() 1911 return nil 1912 } 1913 1914 // IPPuntRedirectDetails defines message 'ip_punt_redirect_details'. 1915 // Deprecated: the message will be removed in the future versions 1916 type IPPuntRedirectDetails struct { 1917 Punt PuntRedirect `binapi:"punt_redirect,name=punt" json:"punt,omitempty"` 1918 } 1919 1920 func (m *IPPuntRedirectDetails) Reset() { *m = IPPuntRedirectDetails{} } 1921 func (*IPPuntRedirectDetails) GetMessageName() string { return "ip_punt_redirect_details" } 1922 func (*IPPuntRedirectDetails) GetCrcString() string { return "2cef63e7" } 1923 func (*IPPuntRedirectDetails) GetMessageType() api.MessageType { 1924 return api.ReplyMessage 1925 } 1926 1927 func (m *IPPuntRedirectDetails) Size() (size int) { 1928 if m == nil { 1929 return 0 1930 } 1931 size += 4 // m.Punt.RxSwIfIndex 1932 size += 4 // m.Punt.TxSwIfIndex 1933 size += 1 // m.Punt.Nh.Af 1934 size += 1 * 16 // m.Punt.Nh.Un 1935 return size 1936 } 1937 func (m *IPPuntRedirectDetails) Marshal(b []byte) ([]byte, error) { 1938 if b == nil { 1939 b = make([]byte, m.Size()) 1940 } 1941 buf := codec.NewBuffer(b) 1942 buf.EncodeUint32(uint32(m.Punt.RxSwIfIndex)) 1943 buf.EncodeUint32(uint32(m.Punt.TxSwIfIndex)) 1944 buf.EncodeUint8(uint8(m.Punt.Nh.Af)) 1945 buf.EncodeBytes(m.Punt.Nh.Un.XXX_UnionData[:], 16) 1946 return buf.Bytes(), nil 1947 } 1948 func (m *IPPuntRedirectDetails) Unmarshal(b []byte) error { 1949 buf := codec.NewBuffer(b) 1950 m.Punt.RxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1951 m.Punt.TxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1952 m.Punt.Nh.Af = ip_types.AddressFamily(buf.DecodeUint8()) 1953 copy(m.Punt.Nh.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 1954 return nil 1955 } 1956 1957 // IPPuntRedirectDump defines message 'ip_punt_redirect_dump'. 1958 // Deprecated: the message will be removed in the future versions 1959 type IPPuntRedirectDump struct { 1960 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 1961 IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"` 1962 } 1963 1964 func (m *IPPuntRedirectDump) Reset() { *m = IPPuntRedirectDump{} } 1965 func (*IPPuntRedirectDump) GetMessageName() string { return "ip_punt_redirect_dump" } 1966 func (*IPPuntRedirectDump) GetCrcString() string { return "2d033de4" } 1967 func (*IPPuntRedirectDump) GetMessageType() api.MessageType { 1968 return api.RequestMessage 1969 } 1970 1971 func (m *IPPuntRedirectDump) Size() (size int) { 1972 if m == nil { 1973 return 0 1974 } 1975 size += 4 // m.SwIfIndex 1976 size += 1 // m.IsIPv6 1977 return size 1978 } 1979 func (m *IPPuntRedirectDump) Marshal(b []byte) ([]byte, error) { 1980 if b == nil { 1981 b = make([]byte, m.Size()) 1982 } 1983 buf := codec.NewBuffer(b) 1984 buf.EncodeUint32(uint32(m.SwIfIndex)) 1985 buf.EncodeBool(m.IsIPv6) 1986 return buf.Bytes(), nil 1987 } 1988 func (m *IPPuntRedirectDump) Unmarshal(b []byte) error { 1989 buf := codec.NewBuffer(b) 1990 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1991 m.IsIPv6 = buf.DecodeBool() 1992 return nil 1993 } 1994 1995 // IPPuntRedirectReply defines message 'ip_punt_redirect_reply'. 1996 // Deprecated: the message will be removed in the future versions 1997 type IPPuntRedirectReply struct { 1998 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1999 } 2000 2001 func (m *IPPuntRedirectReply) Reset() { *m = IPPuntRedirectReply{} } 2002 func (*IPPuntRedirectReply) GetMessageName() string { return "ip_punt_redirect_reply" } 2003 func (*IPPuntRedirectReply) GetCrcString() string { return "e8d4e804" } 2004 func (*IPPuntRedirectReply) GetMessageType() api.MessageType { 2005 return api.ReplyMessage 2006 } 2007 2008 func (m *IPPuntRedirectReply) Size() (size int) { 2009 if m == nil { 2010 return 0 2011 } 2012 size += 4 // m.Retval 2013 return size 2014 } 2015 func (m *IPPuntRedirectReply) Marshal(b []byte) ([]byte, error) { 2016 if b == nil { 2017 b = make([]byte, m.Size()) 2018 } 2019 buf := codec.NewBuffer(b) 2020 buf.EncodeInt32(m.Retval) 2021 return buf.Bytes(), nil 2022 } 2023 func (m *IPPuntRedirectReply) Unmarshal(b []byte) error { 2024 buf := codec.NewBuffer(b) 2025 m.Retval = buf.DecodeInt32() 2026 return nil 2027 } 2028 2029 // IPPuntRedirectV2Details defines message 'ip_punt_redirect_v2_details'. 2030 type IPPuntRedirectV2Details struct { 2031 Punt PuntRedirectV2 `binapi:"punt_redirect_v2,name=punt" json:"punt,omitempty"` 2032 } 2033 2034 func (m *IPPuntRedirectV2Details) Reset() { *m = IPPuntRedirectV2Details{} } 2035 func (*IPPuntRedirectV2Details) GetMessageName() string { return "ip_punt_redirect_v2_details" } 2036 func (*IPPuntRedirectV2Details) GetCrcString() string { return "7ba42e1d" } 2037 func (*IPPuntRedirectV2Details) GetMessageType() api.MessageType { 2038 return api.ReplyMessage 2039 } 2040 2041 func (m *IPPuntRedirectV2Details) Size() (size int) { 2042 if m == nil { 2043 return 0 2044 } 2045 size += 4 // m.Punt.RxSwIfIndex 2046 size += 1 // m.Punt.Af 2047 size += 4 // m.Punt.NPaths 2048 for j2 := 0; j2 < len(m.Punt.Paths); j2++ { 2049 var s2 fib_types.FibPath 2050 _ = s2 2051 if j2 < len(m.Punt.Paths) { 2052 s2 = m.Punt.Paths[j2] 2053 } 2054 size += 4 // s2.SwIfIndex 2055 size += 4 // s2.TableID 2056 size += 4 // s2.RpfID 2057 size += 1 // s2.Weight 2058 size += 1 // s2.Preference 2059 size += 4 // s2.Type 2060 size += 4 // s2.Flags 2061 size += 4 // s2.Proto 2062 size += 1 * 16 // s2.Nh.Address 2063 size += 4 // s2.Nh.ViaLabel 2064 size += 4 // s2.Nh.ObjID 2065 size += 4 // s2.Nh.ClassifyTableIndex 2066 size += 1 // s2.NLabels 2067 for j3 := 0; j3 < 16; j3++ { 2068 size += 1 // s2.LabelStack[j3].IsUniform 2069 size += 4 // s2.LabelStack[j3].Label 2070 size += 1 // s2.LabelStack[j3].TTL 2071 size += 1 // s2.LabelStack[j3].Exp 2072 } 2073 } 2074 return size 2075 } 2076 func (m *IPPuntRedirectV2Details) Marshal(b []byte) ([]byte, error) { 2077 if b == nil { 2078 b = make([]byte, m.Size()) 2079 } 2080 buf := codec.NewBuffer(b) 2081 buf.EncodeUint32(uint32(m.Punt.RxSwIfIndex)) 2082 buf.EncodeUint8(uint8(m.Punt.Af)) 2083 buf.EncodeUint32(uint32(len(m.Punt.Paths))) 2084 for j1 := 0; j1 < len(m.Punt.Paths); j1++ { 2085 var v1 fib_types.FibPath // Paths 2086 if j1 < len(m.Punt.Paths) { 2087 v1 = m.Punt.Paths[j1] 2088 } 2089 buf.EncodeUint32(v1.SwIfIndex) 2090 buf.EncodeUint32(v1.TableID) 2091 buf.EncodeUint32(v1.RpfID) 2092 buf.EncodeUint8(v1.Weight) 2093 buf.EncodeUint8(v1.Preference) 2094 buf.EncodeUint32(uint32(v1.Type)) 2095 buf.EncodeUint32(uint32(v1.Flags)) 2096 buf.EncodeUint32(uint32(v1.Proto)) 2097 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16) 2098 buf.EncodeUint32(v1.Nh.ViaLabel) 2099 buf.EncodeUint32(v1.Nh.ObjID) 2100 buf.EncodeUint32(v1.Nh.ClassifyTableIndex) 2101 buf.EncodeUint8(v1.NLabels) 2102 for j2 := 0; j2 < 16; j2++ { 2103 buf.EncodeUint8(v1.LabelStack[j2].IsUniform) 2104 buf.EncodeUint32(v1.LabelStack[j2].Label) 2105 buf.EncodeUint8(v1.LabelStack[j2].TTL) 2106 buf.EncodeUint8(v1.LabelStack[j2].Exp) 2107 } 2108 } 2109 return buf.Bytes(), nil 2110 } 2111 func (m *IPPuntRedirectV2Details) Unmarshal(b []byte) error { 2112 buf := codec.NewBuffer(b) 2113 m.Punt.RxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 2114 m.Punt.Af = ip_types.AddressFamily(buf.DecodeUint8()) 2115 m.Punt.NPaths = buf.DecodeUint32() 2116 m.Punt.Paths = make([]fib_types.FibPath, m.Punt.NPaths) 2117 for j1 := 0; j1 < len(m.Punt.Paths); j1++ { 2118 m.Punt.Paths[j1].SwIfIndex = buf.DecodeUint32() 2119 m.Punt.Paths[j1].TableID = buf.DecodeUint32() 2120 m.Punt.Paths[j1].RpfID = buf.DecodeUint32() 2121 m.Punt.Paths[j1].Weight = buf.DecodeUint8() 2122 m.Punt.Paths[j1].Preference = buf.DecodeUint8() 2123 m.Punt.Paths[j1].Type = fib_types.FibPathType(buf.DecodeUint32()) 2124 m.Punt.Paths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32()) 2125 m.Punt.Paths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32()) 2126 copy(m.Punt.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16)) 2127 m.Punt.Paths[j1].Nh.ViaLabel = buf.DecodeUint32() 2128 m.Punt.Paths[j1].Nh.ObjID = buf.DecodeUint32() 2129 m.Punt.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32() 2130 m.Punt.Paths[j1].NLabels = buf.DecodeUint8() 2131 for j2 := 0; j2 < 16; j2++ { 2132 m.Punt.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8() 2133 m.Punt.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32() 2134 m.Punt.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8() 2135 m.Punt.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8() 2136 } 2137 } 2138 return nil 2139 } 2140 2141 // IPPuntRedirectV2Dump defines message 'ip_punt_redirect_v2_dump'. 2142 type IPPuntRedirectV2Dump struct { 2143 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 2144 Af ip_types.AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"` 2145 } 2146 2147 func (m *IPPuntRedirectV2Dump) Reset() { *m = IPPuntRedirectV2Dump{} } 2148 func (*IPPuntRedirectV2Dump) GetMessageName() string { return "ip_punt_redirect_v2_dump" } 2149 func (*IPPuntRedirectV2Dump) GetCrcString() string { return "d817a484" } 2150 func (*IPPuntRedirectV2Dump) GetMessageType() api.MessageType { 2151 return api.RequestMessage 2152 } 2153 2154 func (m *IPPuntRedirectV2Dump) Size() (size int) { 2155 if m == nil { 2156 return 0 2157 } 2158 size += 4 // m.SwIfIndex 2159 size += 1 // m.Af 2160 return size 2161 } 2162 func (m *IPPuntRedirectV2Dump) Marshal(b []byte) ([]byte, error) { 2163 if b == nil { 2164 b = make([]byte, m.Size()) 2165 } 2166 buf := codec.NewBuffer(b) 2167 buf.EncodeUint32(uint32(m.SwIfIndex)) 2168 buf.EncodeUint8(uint8(m.Af)) 2169 return buf.Bytes(), nil 2170 } 2171 func (m *IPPuntRedirectV2Dump) Unmarshal(b []byte) error { 2172 buf := codec.NewBuffer(b) 2173 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 2174 m.Af = ip_types.AddressFamily(buf.DecodeUint8()) 2175 return nil 2176 } 2177 2178 // Enable/disable reassembly feature 2179 // - sw_if_index - interface to enable/disable feature on 2180 // - enable_ip4 - enable ip4 reassembly if non-zero, disable if 0 2181 // - enable_ip6 - enable ip6 reassembly if non-zero, disable if 0 2182 // 2183 // IPReassemblyEnableDisable defines message 'ip_reassembly_enable_disable'. 2184 type IPReassemblyEnableDisable struct { 2185 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 2186 EnableIP4 bool `binapi:"bool,name=enable_ip4" json:"enable_ip4,omitempty"` 2187 EnableIP6 bool `binapi:"bool,name=enable_ip6" json:"enable_ip6,omitempty"` 2188 Type IPReassType `binapi:"ip_reass_type,name=type" json:"type,omitempty"` 2189 } 2190 2191 func (m *IPReassemblyEnableDisable) Reset() { *m = IPReassemblyEnableDisable{} } 2192 func (*IPReassemblyEnableDisable) GetMessageName() string { return "ip_reassembly_enable_disable" } 2193 func (*IPReassemblyEnableDisable) GetCrcString() string { return "eb77968d" } 2194 func (*IPReassemblyEnableDisable) GetMessageType() api.MessageType { 2195 return api.RequestMessage 2196 } 2197 2198 func (m *IPReassemblyEnableDisable) Size() (size int) { 2199 if m == nil { 2200 return 0 2201 } 2202 size += 4 // m.SwIfIndex 2203 size += 1 // m.EnableIP4 2204 size += 1 // m.EnableIP6 2205 size += 4 // m.Type 2206 return size 2207 } 2208 func (m *IPReassemblyEnableDisable) Marshal(b []byte) ([]byte, error) { 2209 if b == nil { 2210 b = make([]byte, m.Size()) 2211 } 2212 buf := codec.NewBuffer(b) 2213 buf.EncodeUint32(uint32(m.SwIfIndex)) 2214 buf.EncodeBool(m.EnableIP4) 2215 buf.EncodeBool(m.EnableIP6) 2216 buf.EncodeUint32(uint32(m.Type)) 2217 return buf.Bytes(), nil 2218 } 2219 func (m *IPReassemblyEnableDisable) Unmarshal(b []byte) error { 2220 buf := codec.NewBuffer(b) 2221 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 2222 m.EnableIP4 = buf.DecodeBool() 2223 m.EnableIP6 = buf.DecodeBool() 2224 m.Type = IPReassType(buf.DecodeUint32()) 2225 return nil 2226 } 2227 2228 // IPReassemblyEnableDisableReply defines message 'ip_reassembly_enable_disable_reply'. 2229 type IPReassemblyEnableDisableReply struct { 2230 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 2231 } 2232 2233 func (m *IPReassemblyEnableDisableReply) Reset() { *m = IPReassemblyEnableDisableReply{} } 2234 func (*IPReassemblyEnableDisableReply) GetMessageName() string { 2235 return "ip_reassembly_enable_disable_reply" 2236 } 2237 func (*IPReassemblyEnableDisableReply) GetCrcString() string { return "e8d4e804" } 2238 func (*IPReassemblyEnableDisableReply) GetMessageType() api.MessageType { 2239 return api.ReplyMessage 2240 } 2241 2242 func (m *IPReassemblyEnableDisableReply) Size() (size int) { 2243 if m == nil { 2244 return 0 2245 } 2246 size += 4 // m.Retval 2247 return size 2248 } 2249 func (m *IPReassemblyEnableDisableReply) Marshal(b []byte) ([]byte, error) { 2250 if b == nil { 2251 b = make([]byte, m.Size()) 2252 } 2253 buf := codec.NewBuffer(b) 2254 buf.EncodeInt32(m.Retval) 2255 return buf.Bytes(), nil 2256 } 2257 func (m *IPReassemblyEnableDisableReply) Unmarshal(b []byte) error { 2258 buf := codec.NewBuffer(b) 2259 m.Retval = buf.DecodeInt32() 2260 return nil 2261 } 2262 2263 // IPReassemblyGet defines message 'ip_reassembly_get'. 2264 type IPReassemblyGet struct { 2265 IsIP6 bool `binapi:"bool,name=is_ip6" json:"is_ip6,omitempty"` 2266 Type IPReassType `binapi:"ip_reass_type,name=type" json:"type,omitempty"` 2267 } 2268 2269 func (m *IPReassemblyGet) Reset() { *m = IPReassemblyGet{} } 2270 func (*IPReassemblyGet) GetMessageName() string { return "ip_reassembly_get" } 2271 func (*IPReassemblyGet) GetCrcString() string { return "ea13ff63" } 2272 func (*IPReassemblyGet) GetMessageType() api.MessageType { 2273 return api.RequestMessage 2274 } 2275 2276 func (m *IPReassemblyGet) Size() (size int) { 2277 if m == nil { 2278 return 0 2279 } 2280 size += 1 // m.IsIP6 2281 size += 4 // m.Type 2282 return size 2283 } 2284 func (m *IPReassemblyGet) Marshal(b []byte) ([]byte, error) { 2285 if b == nil { 2286 b = make([]byte, m.Size()) 2287 } 2288 buf := codec.NewBuffer(b) 2289 buf.EncodeBool(m.IsIP6) 2290 buf.EncodeUint32(uint32(m.Type)) 2291 return buf.Bytes(), nil 2292 } 2293 func (m *IPReassemblyGet) Unmarshal(b []byte) error { 2294 buf := codec.NewBuffer(b) 2295 m.IsIP6 = buf.DecodeBool() 2296 m.Type = IPReassType(buf.DecodeUint32()) 2297 return nil 2298 } 2299 2300 // IPReassemblyGetReply defines message 'ip_reassembly_get_reply'. 2301 type IPReassemblyGetReply struct { 2302 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 2303 TimeoutMs uint32 `binapi:"u32,name=timeout_ms" json:"timeout_ms,omitempty"` 2304 MaxReassemblies uint32 `binapi:"u32,name=max_reassemblies" json:"max_reassemblies,omitempty"` 2305 MaxReassemblyLength uint32 `binapi:"u32,name=max_reassembly_length" json:"max_reassembly_length,omitempty"` 2306 ExpireWalkIntervalMs uint32 `binapi:"u32,name=expire_walk_interval_ms" json:"expire_walk_interval_ms,omitempty"` 2307 IsIP6 bool `binapi:"bool,name=is_ip6" json:"is_ip6,omitempty"` 2308 } 2309 2310 func (m *IPReassemblyGetReply) Reset() { *m = IPReassemblyGetReply{} } 2311 func (*IPReassemblyGetReply) GetMessageName() string { return "ip_reassembly_get_reply" } 2312 func (*IPReassemblyGetReply) GetCrcString() string { return "d5eb8d34" } 2313 func (*IPReassemblyGetReply) GetMessageType() api.MessageType { 2314 return api.ReplyMessage 2315 } 2316 2317 func (m *IPReassemblyGetReply) Size() (size int) { 2318 if m == nil { 2319 return 0 2320 } 2321 size += 4 // m.Retval 2322 size += 4 // m.TimeoutMs 2323 size += 4 // m.MaxReassemblies 2324 size += 4 // m.MaxReassemblyLength 2325 size += 4 // m.ExpireWalkIntervalMs 2326 size += 1 // m.IsIP6 2327 return size 2328 } 2329 func (m *IPReassemblyGetReply) Marshal(b []byte) ([]byte, error) { 2330 if b == nil { 2331 b = make([]byte, m.Size()) 2332 } 2333 buf := codec.NewBuffer(b) 2334 buf.EncodeInt32(m.Retval) 2335 buf.EncodeUint32(m.TimeoutMs) 2336 buf.EncodeUint32(m.MaxReassemblies) 2337 buf.EncodeUint32(m.MaxReassemblyLength) 2338 buf.EncodeUint32(m.ExpireWalkIntervalMs) 2339 buf.EncodeBool(m.IsIP6) 2340 return buf.Bytes(), nil 2341 } 2342 func (m *IPReassemblyGetReply) Unmarshal(b []byte) error { 2343 buf := codec.NewBuffer(b) 2344 m.Retval = buf.DecodeInt32() 2345 m.TimeoutMs = buf.DecodeUint32() 2346 m.MaxReassemblies = buf.DecodeUint32() 2347 m.MaxReassemblyLength = buf.DecodeUint32() 2348 m.ExpireWalkIntervalMs = buf.DecodeUint32() 2349 m.IsIP6 = buf.DecodeBool() 2350 return nil 2351 } 2352 2353 // IPReassemblySet defines message 'ip_reassembly_set'. 2354 type IPReassemblySet struct { 2355 TimeoutMs uint32 `binapi:"u32,name=timeout_ms" json:"timeout_ms,omitempty"` 2356 MaxReassemblies uint32 `binapi:"u32,name=max_reassemblies" json:"max_reassemblies,omitempty"` 2357 MaxReassemblyLength uint32 `binapi:"u32,name=max_reassembly_length" json:"max_reassembly_length,omitempty"` 2358 ExpireWalkIntervalMs uint32 `binapi:"u32,name=expire_walk_interval_ms" json:"expire_walk_interval_ms,omitempty"` 2359 IsIP6 bool `binapi:"bool,name=is_ip6" json:"is_ip6,omitempty"` 2360 Type IPReassType `binapi:"ip_reass_type,name=type" json:"type,omitempty"` 2361 } 2362 2363 func (m *IPReassemblySet) Reset() { *m = IPReassemblySet{} } 2364 func (*IPReassemblySet) GetMessageName() string { return "ip_reassembly_set" } 2365 func (*IPReassemblySet) GetCrcString() string { return "16467d25" } 2366 func (*IPReassemblySet) GetMessageType() api.MessageType { 2367 return api.RequestMessage 2368 } 2369 2370 func (m *IPReassemblySet) Size() (size int) { 2371 if m == nil { 2372 return 0 2373 } 2374 size += 4 // m.TimeoutMs 2375 size += 4 // m.MaxReassemblies 2376 size += 4 // m.MaxReassemblyLength 2377 size += 4 // m.ExpireWalkIntervalMs 2378 size += 1 // m.IsIP6 2379 size += 4 // m.Type 2380 return size 2381 } 2382 func (m *IPReassemblySet) Marshal(b []byte) ([]byte, error) { 2383 if b == nil { 2384 b = make([]byte, m.Size()) 2385 } 2386 buf := codec.NewBuffer(b) 2387 buf.EncodeUint32(m.TimeoutMs) 2388 buf.EncodeUint32(m.MaxReassemblies) 2389 buf.EncodeUint32(m.MaxReassemblyLength) 2390 buf.EncodeUint32(m.ExpireWalkIntervalMs) 2391 buf.EncodeBool(m.IsIP6) 2392 buf.EncodeUint32(uint32(m.Type)) 2393 return buf.Bytes(), nil 2394 } 2395 func (m *IPReassemblySet) Unmarshal(b []byte) error { 2396 buf := codec.NewBuffer(b) 2397 m.TimeoutMs = buf.DecodeUint32() 2398 m.MaxReassemblies = buf.DecodeUint32() 2399 m.MaxReassemblyLength = buf.DecodeUint32() 2400 m.ExpireWalkIntervalMs = buf.DecodeUint32() 2401 m.IsIP6 = buf.DecodeBool() 2402 m.Type = IPReassType(buf.DecodeUint32()) 2403 return nil 2404 } 2405 2406 // IPReassemblySetReply defines message 'ip_reassembly_set_reply'. 2407 type IPReassemblySetReply struct { 2408 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 2409 } 2410 2411 func (m *IPReassemblySetReply) Reset() { *m = IPReassemblySetReply{} } 2412 func (*IPReassemblySetReply) GetMessageName() string { return "ip_reassembly_set_reply" } 2413 func (*IPReassemblySetReply) GetCrcString() string { return "e8d4e804" } 2414 func (*IPReassemblySetReply) GetMessageType() api.MessageType { 2415 return api.ReplyMessage 2416 } 2417 2418 func (m *IPReassemblySetReply) Size() (size int) { 2419 if m == nil { 2420 return 0 2421 } 2422 size += 4 // m.Retval 2423 return size 2424 } 2425 func (m *IPReassemblySetReply) Marshal(b []byte) ([]byte, error) { 2426 if b == nil { 2427 b = make([]byte, m.Size()) 2428 } 2429 buf := codec.NewBuffer(b) 2430 buf.EncodeInt32(m.Retval) 2431 return buf.Bytes(), nil 2432 } 2433 func (m *IPReassemblySetReply) Unmarshal(b []byte) error { 2434 buf := codec.NewBuffer(b) 2435 m.Retval = buf.DecodeInt32() 2436 return nil 2437 } 2438 2439 // Add / del route request 2440 // - is_multipath - Set to 1 if these paths will be added/removed 2441 // to/from the existing set, or 0 to replace 2442 // the existing set. 2443 // is_add=0 & is_multipath=0 implies delete all paths 2444 // - is_add - Are the paths being added or removed 2445 // 2446 // IPRouteAddDel defines message 'ip_route_add_del'. 2447 type IPRouteAddDel struct { 2448 IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"` 2449 IsMultipath bool `binapi:"bool,name=is_multipath" json:"is_multipath,omitempty"` 2450 Route IPRoute `binapi:"ip_route,name=route" json:"route,omitempty"` 2451 } 2452 2453 func (m *IPRouteAddDel) Reset() { *m = IPRouteAddDel{} } 2454 func (*IPRouteAddDel) GetMessageName() string { return "ip_route_add_del" } 2455 func (*IPRouteAddDel) GetCrcString() string { return "b8ecfe0d" } 2456 func (*IPRouteAddDel) GetMessageType() api.MessageType { 2457 return api.RequestMessage 2458 } 2459 2460 func (m *IPRouteAddDel) Size() (size int) { 2461 if m == nil { 2462 return 0 2463 } 2464 size += 1 // m.IsAdd 2465 size += 1 // m.IsMultipath 2466 size += 4 // m.Route.TableID 2467 size += 4 // m.Route.StatsIndex 2468 size += 1 // m.Route.Prefix.Address.Af 2469 size += 1 * 16 // m.Route.Prefix.Address.Un 2470 size += 1 // m.Route.Prefix.Len 2471 size += 1 // m.Route.NPaths 2472 for j2 := 0; j2 < len(m.Route.Paths); j2++ { 2473 var s2 fib_types.FibPath 2474 _ = s2 2475 if j2 < len(m.Route.Paths) { 2476 s2 = m.Route.Paths[j2] 2477 } 2478 size += 4 // s2.SwIfIndex 2479 size += 4 // s2.TableID 2480 size += 4 // s2.RpfID 2481 size += 1 // s2.Weight 2482 size += 1 // s2.Preference 2483 size += 4 // s2.Type 2484 size += 4 // s2.Flags 2485 size += 4 // s2.Proto 2486 size += 1 * 16 // s2.Nh.Address 2487 size += 4 // s2.Nh.ViaLabel 2488 size += 4 // s2.Nh.ObjID 2489 size += 4 // s2.Nh.ClassifyTableIndex 2490 size += 1 // s2.NLabels 2491 for j3 := 0; j3 < 16; j3++ { 2492 size += 1 // s2.LabelStack[j3].IsUniform 2493 size += 4 // s2.LabelStack[j3].Label 2494 size += 1 // s2.LabelStack[j3].TTL 2495 size += 1 // s2.LabelStack[j3].Exp 2496 } 2497 } 2498 return size 2499 } 2500 func (m *IPRouteAddDel) Marshal(b []byte) ([]byte, error) { 2501 if b == nil { 2502 b = make([]byte, m.Size()) 2503 } 2504 buf := codec.NewBuffer(b) 2505 buf.EncodeBool(m.IsAdd) 2506 buf.EncodeBool(m.IsMultipath) 2507 buf.EncodeUint32(m.Route.TableID) 2508 buf.EncodeUint32(m.Route.StatsIndex) 2509 buf.EncodeUint8(uint8(m.Route.Prefix.Address.Af)) 2510 buf.EncodeBytes(m.Route.Prefix.Address.Un.XXX_UnionData[:], 16) 2511 buf.EncodeUint8(m.Route.Prefix.Len) 2512 buf.EncodeUint8(uint8(len(m.Route.Paths))) 2513 for j1 := 0; j1 < len(m.Route.Paths); j1++ { 2514 var v1 fib_types.FibPath // Paths 2515 if j1 < len(m.Route.Paths) { 2516 v1 = m.Route.Paths[j1] 2517 } 2518 buf.EncodeUint32(v1.SwIfIndex) 2519 buf.EncodeUint32(v1.TableID) 2520 buf.EncodeUint32(v1.RpfID) 2521 buf.EncodeUint8(v1.Weight) 2522 buf.EncodeUint8(v1.Preference) 2523 buf.EncodeUint32(uint32(v1.Type)) 2524 buf.EncodeUint32(uint32(v1.Flags)) 2525 buf.EncodeUint32(uint32(v1.Proto)) 2526 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16) 2527 buf.EncodeUint32(v1.Nh.ViaLabel) 2528 buf.EncodeUint32(v1.Nh.ObjID) 2529 buf.EncodeUint32(v1.Nh.ClassifyTableIndex) 2530 buf.EncodeUint8(v1.NLabels) 2531 for j2 := 0; j2 < 16; j2++ { 2532 buf.EncodeUint8(v1.LabelStack[j2].IsUniform) 2533 buf.EncodeUint32(v1.LabelStack[j2].Label) 2534 buf.EncodeUint8(v1.LabelStack[j2].TTL) 2535 buf.EncodeUint8(v1.LabelStack[j2].Exp) 2536 } 2537 } 2538 return buf.Bytes(), nil 2539 } 2540 func (m *IPRouteAddDel) Unmarshal(b []byte) error { 2541 buf := codec.NewBuffer(b) 2542 m.IsAdd = buf.DecodeBool() 2543 m.IsMultipath = buf.DecodeBool() 2544 m.Route.TableID = buf.DecodeUint32() 2545 m.Route.StatsIndex = buf.DecodeUint32() 2546 m.Route.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) 2547 copy(m.Route.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 2548 m.Route.Prefix.Len = buf.DecodeUint8() 2549 m.Route.NPaths = buf.DecodeUint8() 2550 m.Route.Paths = make([]fib_types.FibPath, m.Route.NPaths) 2551 for j1 := 0; j1 < len(m.Route.Paths); j1++ { 2552 m.Route.Paths[j1].SwIfIndex = buf.DecodeUint32() 2553 m.Route.Paths[j1].TableID = buf.DecodeUint32() 2554 m.Route.Paths[j1].RpfID = buf.DecodeUint32() 2555 m.Route.Paths[j1].Weight = buf.DecodeUint8() 2556 m.Route.Paths[j1].Preference = buf.DecodeUint8() 2557 m.Route.Paths[j1].Type = fib_types.FibPathType(buf.DecodeUint32()) 2558 m.Route.Paths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32()) 2559 m.Route.Paths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32()) 2560 copy(m.Route.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16)) 2561 m.Route.Paths[j1].Nh.ViaLabel = buf.DecodeUint32() 2562 m.Route.Paths[j1].Nh.ObjID = buf.DecodeUint32() 2563 m.Route.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32() 2564 m.Route.Paths[j1].NLabels = buf.DecodeUint8() 2565 for j2 := 0; j2 < 16; j2++ { 2566 m.Route.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8() 2567 m.Route.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32() 2568 m.Route.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8() 2569 m.Route.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8() 2570 } 2571 } 2572 return nil 2573 } 2574 2575 // IPRouteAddDelReply defines message 'ip_route_add_del_reply'. 2576 type IPRouteAddDelReply struct { 2577 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 2578 StatsIndex uint32 `binapi:"u32,name=stats_index" json:"stats_index,omitempty"` 2579 } 2580 2581 func (m *IPRouteAddDelReply) Reset() { *m = IPRouteAddDelReply{} } 2582 func (*IPRouteAddDelReply) GetMessageName() string { return "ip_route_add_del_reply" } 2583 func (*IPRouteAddDelReply) GetCrcString() string { return "1992deab" } 2584 func (*IPRouteAddDelReply) GetMessageType() api.MessageType { 2585 return api.ReplyMessage 2586 } 2587 2588 func (m *IPRouteAddDelReply) Size() (size int) { 2589 if m == nil { 2590 return 0 2591 } 2592 size += 4 // m.Retval 2593 size += 4 // m.StatsIndex 2594 return size 2595 } 2596 func (m *IPRouteAddDelReply) Marshal(b []byte) ([]byte, error) { 2597 if b == nil { 2598 b = make([]byte, m.Size()) 2599 } 2600 buf := codec.NewBuffer(b) 2601 buf.EncodeInt32(m.Retval) 2602 buf.EncodeUint32(m.StatsIndex) 2603 return buf.Bytes(), nil 2604 } 2605 func (m *IPRouteAddDelReply) Unmarshal(b []byte) error { 2606 buf := codec.NewBuffer(b) 2607 m.Retval = buf.DecodeInt32() 2608 m.StatsIndex = buf.DecodeUint32() 2609 return nil 2610 } 2611 2612 // IPRouteAddDelV2 defines message 'ip_route_add_del_v2'. 2613 // InProgress: the message form may change in the future versions 2614 type IPRouteAddDelV2 struct { 2615 IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"` 2616 IsMultipath bool `binapi:"bool,name=is_multipath" json:"is_multipath,omitempty"` 2617 Route IPRouteV2 `binapi:"ip_route_v2,name=route" json:"route,omitempty"` 2618 } 2619 2620 func (m *IPRouteAddDelV2) Reset() { *m = IPRouteAddDelV2{} } 2621 func (*IPRouteAddDelV2) GetMessageName() string { return "ip_route_add_del_v2" } 2622 func (*IPRouteAddDelV2) GetCrcString() string { return "521ef330" } 2623 func (*IPRouteAddDelV2) GetMessageType() api.MessageType { 2624 return api.RequestMessage 2625 } 2626 2627 func (m *IPRouteAddDelV2) Size() (size int) { 2628 if m == nil { 2629 return 0 2630 } 2631 size += 1 // m.IsAdd 2632 size += 1 // m.IsMultipath 2633 size += 4 // m.Route.TableID 2634 size += 4 // m.Route.StatsIndex 2635 size += 1 // m.Route.Prefix.Address.Af 2636 size += 1 * 16 // m.Route.Prefix.Address.Un 2637 size += 1 // m.Route.Prefix.Len 2638 size += 1 // m.Route.NPaths 2639 size += 1 // m.Route.Src 2640 for j2 := 0; j2 < len(m.Route.Paths); j2++ { 2641 var s2 fib_types.FibPath 2642 _ = s2 2643 if j2 < len(m.Route.Paths) { 2644 s2 = m.Route.Paths[j2] 2645 } 2646 size += 4 // s2.SwIfIndex 2647 size += 4 // s2.TableID 2648 size += 4 // s2.RpfID 2649 size += 1 // s2.Weight 2650 size += 1 // s2.Preference 2651 size += 4 // s2.Type 2652 size += 4 // s2.Flags 2653 size += 4 // s2.Proto 2654 size += 1 * 16 // s2.Nh.Address 2655 size += 4 // s2.Nh.ViaLabel 2656 size += 4 // s2.Nh.ObjID 2657 size += 4 // s2.Nh.ClassifyTableIndex 2658 size += 1 // s2.NLabels 2659 for j3 := 0; j3 < 16; j3++ { 2660 size += 1 // s2.LabelStack[j3].IsUniform 2661 size += 4 // s2.LabelStack[j3].Label 2662 size += 1 // s2.LabelStack[j3].TTL 2663 size += 1 // s2.LabelStack[j3].Exp 2664 } 2665 } 2666 return size 2667 } 2668 func (m *IPRouteAddDelV2) Marshal(b []byte) ([]byte, error) { 2669 if b == nil { 2670 b = make([]byte, m.Size()) 2671 } 2672 buf := codec.NewBuffer(b) 2673 buf.EncodeBool(m.IsAdd) 2674 buf.EncodeBool(m.IsMultipath) 2675 buf.EncodeUint32(m.Route.TableID) 2676 buf.EncodeUint32(m.Route.StatsIndex) 2677 buf.EncodeUint8(uint8(m.Route.Prefix.Address.Af)) 2678 buf.EncodeBytes(m.Route.Prefix.Address.Un.XXX_UnionData[:], 16) 2679 buf.EncodeUint8(m.Route.Prefix.Len) 2680 buf.EncodeUint8(uint8(len(m.Route.Paths))) 2681 buf.EncodeUint8(m.Route.Src) 2682 for j1 := 0; j1 < len(m.Route.Paths); j1++ { 2683 var v1 fib_types.FibPath // Paths 2684 if j1 < len(m.Route.Paths) { 2685 v1 = m.Route.Paths[j1] 2686 } 2687 buf.EncodeUint32(v1.SwIfIndex) 2688 buf.EncodeUint32(v1.TableID) 2689 buf.EncodeUint32(v1.RpfID) 2690 buf.EncodeUint8(v1.Weight) 2691 buf.EncodeUint8(v1.Preference) 2692 buf.EncodeUint32(uint32(v1.Type)) 2693 buf.EncodeUint32(uint32(v1.Flags)) 2694 buf.EncodeUint32(uint32(v1.Proto)) 2695 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16) 2696 buf.EncodeUint32(v1.Nh.ViaLabel) 2697 buf.EncodeUint32(v1.Nh.ObjID) 2698 buf.EncodeUint32(v1.Nh.ClassifyTableIndex) 2699 buf.EncodeUint8(v1.NLabels) 2700 for j2 := 0; j2 < 16; j2++ { 2701 buf.EncodeUint8(v1.LabelStack[j2].IsUniform) 2702 buf.EncodeUint32(v1.LabelStack[j2].Label) 2703 buf.EncodeUint8(v1.LabelStack[j2].TTL) 2704 buf.EncodeUint8(v1.LabelStack[j2].Exp) 2705 } 2706 } 2707 return buf.Bytes(), nil 2708 } 2709 func (m *IPRouteAddDelV2) Unmarshal(b []byte) error { 2710 buf := codec.NewBuffer(b) 2711 m.IsAdd = buf.DecodeBool() 2712 m.IsMultipath = buf.DecodeBool() 2713 m.Route.TableID = buf.DecodeUint32() 2714 m.Route.StatsIndex = buf.DecodeUint32() 2715 m.Route.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) 2716 copy(m.Route.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 2717 m.Route.Prefix.Len = buf.DecodeUint8() 2718 m.Route.NPaths = buf.DecodeUint8() 2719 m.Route.Src = buf.DecodeUint8() 2720 m.Route.Paths = make([]fib_types.FibPath, m.Route.NPaths) 2721 for j1 := 0; j1 < len(m.Route.Paths); j1++ { 2722 m.Route.Paths[j1].SwIfIndex = buf.DecodeUint32() 2723 m.Route.Paths[j1].TableID = buf.DecodeUint32() 2724 m.Route.Paths[j1].RpfID = buf.DecodeUint32() 2725 m.Route.Paths[j1].Weight = buf.DecodeUint8() 2726 m.Route.Paths[j1].Preference = buf.DecodeUint8() 2727 m.Route.Paths[j1].Type = fib_types.FibPathType(buf.DecodeUint32()) 2728 m.Route.Paths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32()) 2729 m.Route.Paths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32()) 2730 copy(m.Route.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16)) 2731 m.Route.Paths[j1].Nh.ViaLabel = buf.DecodeUint32() 2732 m.Route.Paths[j1].Nh.ObjID = buf.DecodeUint32() 2733 m.Route.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32() 2734 m.Route.Paths[j1].NLabels = buf.DecodeUint8() 2735 for j2 := 0; j2 < 16; j2++ { 2736 m.Route.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8() 2737 m.Route.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32() 2738 m.Route.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8() 2739 m.Route.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8() 2740 } 2741 } 2742 return nil 2743 } 2744 2745 // IPRouteAddDelV2Reply defines message 'ip_route_add_del_v2_reply'. 2746 // InProgress: the message form may change in the future versions 2747 type IPRouteAddDelV2Reply struct { 2748 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 2749 StatsIndex uint32 `binapi:"u32,name=stats_index" json:"stats_index,omitempty"` 2750 } 2751 2752 func (m *IPRouteAddDelV2Reply) Reset() { *m = IPRouteAddDelV2Reply{} } 2753 func (*IPRouteAddDelV2Reply) GetMessageName() string { return "ip_route_add_del_v2_reply" } 2754 func (*IPRouteAddDelV2Reply) GetCrcString() string { return "1992deab" } 2755 func (*IPRouteAddDelV2Reply) GetMessageType() api.MessageType { 2756 return api.ReplyMessage 2757 } 2758 2759 func (m *IPRouteAddDelV2Reply) Size() (size int) { 2760 if m == nil { 2761 return 0 2762 } 2763 size += 4 // m.Retval 2764 size += 4 // m.StatsIndex 2765 return size 2766 } 2767 func (m *IPRouteAddDelV2Reply) Marshal(b []byte) ([]byte, error) { 2768 if b == nil { 2769 b = make([]byte, m.Size()) 2770 } 2771 buf := codec.NewBuffer(b) 2772 buf.EncodeInt32(m.Retval) 2773 buf.EncodeUint32(m.StatsIndex) 2774 return buf.Bytes(), nil 2775 } 2776 func (m *IPRouteAddDelV2Reply) Unmarshal(b []byte) error { 2777 buf := codec.NewBuffer(b) 2778 m.Retval = buf.DecodeInt32() 2779 m.StatsIndex = buf.DecodeUint32() 2780 return nil 2781 } 2782 2783 // IP FIB table entry response 2784 // - route The route entry in the table 2785 // 2786 // IPRouteDetails defines message 'ip_route_details'. 2787 type IPRouteDetails struct { 2788 Route IPRoute `binapi:"ip_route,name=route" json:"route,omitempty"` 2789 } 2790 2791 func (m *IPRouteDetails) Reset() { *m = IPRouteDetails{} } 2792 func (*IPRouteDetails) GetMessageName() string { return "ip_route_details" } 2793 func (*IPRouteDetails) GetCrcString() string { return "bda8f315" } 2794 func (*IPRouteDetails) GetMessageType() api.MessageType { 2795 return api.ReplyMessage 2796 } 2797 2798 func (m *IPRouteDetails) Size() (size int) { 2799 if m == nil { 2800 return 0 2801 } 2802 size += 4 // m.Route.TableID 2803 size += 4 // m.Route.StatsIndex 2804 size += 1 // m.Route.Prefix.Address.Af 2805 size += 1 * 16 // m.Route.Prefix.Address.Un 2806 size += 1 // m.Route.Prefix.Len 2807 size += 1 // m.Route.NPaths 2808 for j2 := 0; j2 < len(m.Route.Paths); j2++ { 2809 var s2 fib_types.FibPath 2810 _ = s2 2811 if j2 < len(m.Route.Paths) { 2812 s2 = m.Route.Paths[j2] 2813 } 2814 size += 4 // s2.SwIfIndex 2815 size += 4 // s2.TableID 2816 size += 4 // s2.RpfID 2817 size += 1 // s2.Weight 2818 size += 1 // s2.Preference 2819 size += 4 // s2.Type 2820 size += 4 // s2.Flags 2821 size += 4 // s2.Proto 2822 size += 1 * 16 // s2.Nh.Address 2823 size += 4 // s2.Nh.ViaLabel 2824 size += 4 // s2.Nh.ObjID 2825 size += 4 // s2.Nh.ClassifyTableIndex 2826 size += 1 // s2.NLabels 2827 for j3 := 0; j3 < 16; j3++ { 2828 size += 1 // s2.LabelStack[j3].IsUniform 2829 size += 4 // s2.LabelStack[j3].Label 2830 size += 1 // s2.LabelStack[j3].TTL 2831 size += 1 // s2.LabelStack[j3].Exp 2832 } 2833 } 2834 return size 2835 } 2836 func (m *IPRouteDetails) Marshal(b []byte) ([]byte, error) { 2837 if b == nil { 2838 b = make([]byte, m.Size()) 2839 } 2840 buf := codec.NewBuffer(b) 2841 buf.EncodeUint32(m.Route.TableID) 2842 buf.EncodeUint32(m.Route.StatsIndex) 2843 buf.EncodeUint8(uint8(m.Route.Prefix.Address.Af)) 2844 buf.EncodeBytes(m.Route.Prefix.Address.Un.XXX_UnionData[:], 16) 2845 buf.EncodeUint8(m.Route.Prefix.Len) 2846 buf.EncodeUint8(uint8(len(m.Route.Paths))) 2847 for j1 := 0; j1 < len(m.Route.Paths); j1++ { 2848 var v1 fib_types.FibPath // Paths 2849 if j1 < len(m.Route.Paths) { 2850 v1 = m.Route.Paths[j1] 2851 } 2852 buf.EncodeUint32(v1.SwIfIndex) 2853 buf.EncodeUint32(v1.TableID) 2854 buf.EncodeUint32(v1.RpfID) 2855 buf.EncodeUint8(v1.Weight) 2856 buf.EncodeUint8(v1.Preference) 2857 buf.EncodeUint32(uint32(v1.Type)) 2858 buf.EncodeUint32(uint32(v1.Flags)) 2859 buf.EncodeUint32(uint32(v1.Proto)) 2860 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16) 2861 buf.EncodeUint32(v1.Nh.ViaLabel) 2862 buf.EncodeUint32(v1.Nh.ObjID) 2863 buf.EncodeUint32(v1.Nh.ClassifyTableIndex) 2864 buf.EncodeUint8(v1.NLabels) 2865 for j2 := 0; j2 < 16; j2++ { 2866 buf.EncodeUint8(v1.LabelStack[j2].IsUniform) 2867 buf.EncodeUint32(v1.LabelStack[j2].Label) 2868 buf.EncodeUint8(v1.LabelStack[j2].TTL) 2869 buf.EncodeUint8(v1.LabelStack[j2].Exp) 2870 } 2871 } 2872 return buf.Bytes(), nil 2873 } 2874 func (m *IPRouteDetails) Unmarshal(b []byte) error { 2875 buf := codec.NewBuffer(b) 2876 m.Route.TableID = buf.DecodeUint32() 2877 m.Route.StatsIndex = buf.DecodeUint32() 2878 m.Route.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) 2879 copy(m.Route.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 2880 m.Route.Prefix.Len = buf.DecodeUint8() 2881 m.Route.NPaths = buf.DecodeUint8() 2882 m.Route.Paths = make([]fib_types.FibPath, m.Route.NPaths) 2883 for j1 := 0; j1 < len(m.Route.Paths); j1++ { 2884 m.Route.Paths[j1].SwIfIndex = buf.DecodeUint32() 2885 m.Route.Paths[j1].TableID = buf.DecodeUint32() 2886 m.Route.Paths[j1].RpfID = buf.DecodeUint32() 2887 m.Route.Paths[j1].Weight = buf.DecodeUint8() 2888 m.Route.Paths[j1].Preference = buf.DecodeUint8() 2889 m.Route.Paths[j1].Type = fib_types.FibPathType(buf.DecodeUint32()) 2890 m.Route.Paths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32()) 2891 m.Route.Paths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32()) 2892 copy(m.Route.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16)) 2893 m.Route.Paths[j1].Nh.ViaLabel = buf.DecodeUint32() 2894 m.Route.Paths[j1].Nh.ObjID = buf.DecodeUint32() 2895 m.Route.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32() 2896 m.Route.Paths[j1].NLabels = buf.DecodeUint8() 2897 for j2 := 0; j2 < 16; j2++ { 2898 m.Route.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8() 2899 m.Route.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32() 2900 m.Route.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8() 2901 m.Route.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8() 2902 } 2903 } 2904 return nil 2905 } 2906 2907 // Dump IP routes from a table 2908 // - src The entity adding the route. either 0 for default 2909 // or a value returned from fib_source_sdd. 2910 // - table - The table from which to dump routes (ony ID an AF are needed) 2911 // 2912 // IPRouteDump defines message 'ip_route_dump'. 2913 type IPRouteDump struct { 2914 Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"` 2915 } 2916 2917 func (m *IPRouteDump) Reset() { *m = IPRouteDump{} } 2918 func (*IPRouteDump) GetMessageName() string { return "ip_route_dump" } 2919 func (*IPRouteDump) GetCrcString() string { return "b9d2e09e" } 2920 func (*IPRouteDump) GetMessageType() api.MessageType { 2921 return api.RequestMessage 2922 } 2923 2924 func (m *IPRouteDump) Size() (size int) { 2925 if m == nil { 2926 return 0 2927 } 2928 size += 4 // m.Table.TableID 2929 size += 1 // m.Table.IsIP6 2930 size += 64 // m.Table.Name 2931 return size 2932 } 2933 func (m *IPRouteDump) Marshal(b []byte) ([]byte, error) { 2934 if b == nil { 2935 b = make([]byte, m.Size()) 2936 } 2937 buf := codec.NewBuffer(b) 2938 buf.EncodeUint32(m.Table.TableID) 2939 buf.EncodeBool(m.Table.IsIP6) 2940 buf.EncodeString(m.Table.Name, 64) 2941 return buf.Bytes(), nil 2942 } 2943 func (m *IPRouteDump) Unmarshal(b []byte) error { 2944 buf := codec.NewBuffer(b) 2945 m.Table.TableID = buf.DecodeUint32() 2946 m.Table.IsIP6 = buf.DecodeBool() 2947 m.Table.Name = buf.DecodeString(64) 2948 return nil 2949 } 2950 2951 // Lookup IP route from a table 2952 // - table_id - The IP table to look the route up in 2953 // - exact - 0 for normal route lookup, 1 for exact match only 2954 // - prefix - The prefix (or host) for route lookup. 2955 // 2956 // IPRouteLookup defines message 'ip_route_lookup'. 2957 type IPRouteLookup struct { 2958 TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"` 2959 Exact uint8 `binapi:"u8,name=exact" json:"exact,omitempty"` 2960 Prefix ip_types.Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"` 2961 } 2962 2963 func (m *IPRouteLookup) Reset() { *m = IPRouteLookup{} } 2964 func (*IPRouteLookup) GetMessageName() string { return "ip_route_lookup" } 2965 func (*IPRouteLookup) GetCrcString() string { return "710d6471" } 2966 func (*IPRouteLookup) GetMessageType() api.MessageType { 2967 return api.RequestMessage 2968 } 2969 2970 func (m *IPRouteLookup) Size() (size int) { 2971 if m == nil { 2972 return 0 2973 } 2974 size += 4 // m.TableID 2975 size += 1 // m.Exact 2976 size += 1 // m.Prefix.Address.Af 2977 size += 1 * 16 // m.Prefix.Address.Un 2978 size += 1 // m.Prefix.Len 2979 return size 2980 } 2981 func (m *IPRouteLookup) Marshal(b []byte) ([]byte, error) { 2982 if b == nil { 2983 b = make([]byte, m.Size()) 2984 } 2985 buf := codec.NewBuffer(b) 2986 buf.EncodeUint32(m.TableID) 2987 buf.EncodeUint8(m.Exact) 2988 buf.EncodeUint8(uint8(m.Prefix.Address.Af)) 2989 buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16) 2990 buf.EncodeUint8(m.Prefix.Len) 2991 return buf.Bytes(), nil 2992 } 2993 func (m *IPRouteLookup) Unmarshal(b []byte) error { 2994 buf := codec.NewBuffer(b) 2995 m.TableID = buf.DecodeUint32() 2996 m.Exact = buf.DecodeUint8() 2997 m.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) 2998 copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 2999 m.Prefix.Len = buf.DecodeUint8() 3000 return nil 3001 } 3002 3003 // IP FIB table lookup response 3004 // - retval - return code of the lookup 3005 // - route - The route entry in the table if found 3006 // 3007 // IPRouteLookupReply defines message 'ip_route_lookup_reply'. 3008 type IPRouteLookupReply struct { 3009 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 3010 Route IPRoute `binapi:"ip_route,name=route" json:"route,omitempty"` 3011 } 3012 3013 func (m *IPRouteLookupReply) Reset() { *m = IPRouteLookupReply{} } 3014 func (*IPRouteLookupReply) GetMessageName() string { return "ip_route_lookup_reply" } 3015 func (*IPRouteLookupReply) GetCrcString() string { return "5d8febcb" } 3016 func (*IPRouteLookupReply) GetMessageType() api.MessageType { 3017 return api.ReplyMessage 3018 } 3019 3020 func (m *IPRouteLookupReply) Size() (size int) { 3021 if m == nil { 3022 return 0 3023 } 3024 size += 4 // m.Retval 3025 size += 4 // m.Route.TableID 3026 size += 4 // m.Route.StatsIndex 3027 size += 1 // m.Route.Prefix.Address.Af 3028 size += 1 * 16 // m.Route.Prefix.Address.Un 3029 size += 1 // m.Route.Prefix.Len 3030 size += 1 // m.Route.NPaths 3031 for j2 := 0; j2 < len(m.Route.Paths); j2++ { 3032 var s2 fib_types.FibPath 3033 _ = s2 3034 if j2 < len(m.Route.Paths) { 3035 s2 = m.Route.Paths[j2] 3036 } 3037 size += 4 // s2.SwIfIndex 3038 size += 4 // s2.TableID 3039 size += 4 // s2.RpfID 3040 size += 1 // s2.Weight 3041 size += 1 // s2.Preference 3042 size += 4 // s2.Type 3043 size += 4 // s2.Flags 3044 size += 4 // s2.Proto 3045 size += 1 * 16 // s2.Nh.Address 3046 size += 4 // s2.Nh.ViaLabel 3047 size += 4 // s2.Nh.ObjID 3048 size += 4 // s2.Nh.ClassifyTableIndex 3049 size += 1 // s2.NLabels 3050 for j3 := 0; j3 < 16; j3++ { 3051 size += 1 // s2.LabelStack[j3].IsUniform 3052 size += 4 // s2.LabelStack[j3].Label 3053 size += 1 // s2.LabelStack[j3].TTL 3054 size += 1 // s2.LabelStack[j3].Exp 3055 } 3056 } 3057 return size 3058 } 3059 func (m *IPRouteLookupReply) Marshal(b []byte) ([]byte, error) { 3060 if b == nil { 3061 b = make([]byte, m.Size()) 3062 } 3063 buf := codec.NewBuffer(b) 3064 buf.EncodeInt32(m.Retval) 3065 buf.EncodeUint32(m.Route.TableID) 3066 buf.EncodeUint32(m.Route.StatsIndex) 3067 buf.EncodeUint8(uint8(m.Route.Prefix.Address.Af)) 3068 buf.EncodeBytes(m.Route.Prefix.Address.Un.XXX_UnionData[:], 16) 3069 buf.EncodeUint8(m.Route.Prefix.Len) 3070 buf.EncodeUint8(uint8(len(m.Route.Paths))) 3071 for j1 := 0; j1 < len(m.Route.Paths); j1++ { 3072 var v1 fib_types.FibPath // Paths 3073 if j1 < len(m.Route.Paths) { 3074 v1 = m.Route.Paths[j1] 3075 } 3076 buf.EncodeUint32(v1.SwIfIndex) 3077 buf.EncodeUint32(v1.TableID) 3078 buf.EncodeUint32(v1.RpfID) 3079 buf.EncodeUint8(v1.Weight) 3080 buf.EncodeUint8(v1.Preference) 3081 buf.EncodeUint32(uint32(v1.Type)) 3082 buf.EncodeUint32(uint32(v1.Flags)) 3083 buf.EncodeUint32(uint32(v1.Proto)) 3084 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16) 3085 buf.EncodeUint32(v1.Nh.ViaLabel) 3086 buf.EncodeUint32(v1.Nh.ObjID) 3087 buf.EncodeUint32(v1.Nh.ClassifyTableIndex) 3088 buf.EncodeUint8(v1.NLabels) 3089 for j2 := 0; j2 < 16; j2++ { 3090 buf.EncodeUint8(v1.LabelStack[j2].IsUniform) 3091 buf.EncodeUint32(v1.LabelStack[j2].Label) 3092 buf.EncodeUint8(v1.LabelStack[j2].TTL) 3093 buf.EncodeUint8(v1.LabelStack[j2].Exp) 3094 } 3095 } 3096 return buf.Bytes(), nil 3097 } 3098 func (m *IPRouteLookupReply) Unmarshal(b []byte) error { 3099 buf := codec.NewBuffer(b) 3100 m.Retval = buf.DecodeInt32() 3101 m.Route.TableID = buf.DecodeUint32() 3102 m.Route.StatsIndex = buf.DecodeUint32() 3103 m.Route.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) 3104 copy(m.Route.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 3105 m.Route.Prefix.Len = buf.DecodeUint8() 3106 m.Route.NPaths = buf.DecodeUint8() 3107 m.Route.Paths = make([]fib_types.FibPath, m.Route.NPaths) 3108 for j1 := 0; j1 < len(m.Route.Paths); j1++ { 3109 m.Route.Paths[j1].SwIfIndex = buf.DecodeUint32() 3110 m.Route.Paths[j1].TableID = buf.DecodeUint32() 3111 m.Route.Paths[j1].RpfID = buf.DecodeUint32() 3112 m.Route.Paths[j1].Weight = buf.DecodeUint8() 3113 m.Route.Paths[j1].Preference = buf.DecodeUint8() 3114 m.Route.Paths[j1].Type = fib_types.FibPathType(buf.DecodeUint32()) 3115 m.Route.Paths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32()) 3116 m.Route.Paths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32()) 3117 copy(m.Route.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16)) 3118 m.Route.Paths[j1].Nh.ViaLabel = buf.DecodeUint32() 3119 m.Route.Paths[j1].Nh.ObjID = buf.DecodeUint32() 3120 m.Route.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32() 3121 m.Route.Paths[j1].NLabels = buf.DecodeUint8() 3122 for j2 := 0; j2 < 16; j2++ { 3123 m.Route.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8() 3124 m.Route.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32() 3125 m.Route.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8() 3126 m.Route.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8() 3127 } 3128 } 3129 return nil 3130 } 3131 3132 // IPRouteLookupV2 defines message 'ip_route_lookup_v2'. 3133 // InProgress: the message form may change in the future versions 3134 type IPRouteLookupV2 struct { 3135 TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"` 3136 Exact uint8 `binapi:"u8,name=exact" json:"exact,omitempty"` 3137 Prefix ip_types.Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"` 3138 } 3139 3140 func (m *IPRouteLookupV2) Reset() { *m = IPRouteLookupV2{} } 3141 func (*IPRouteLookupV2) GetMessageName() string { return "ip_route_lookup_v2" } 3142 func (*IPRouteLookupV2) GetCrcString() string { return "710d6471" } 3143 func (*IPRouteLookupV2) GetMessageType() api.MessageType { 3144 return api.RequestMessage 3145 } 3146 3147 func (m *IPRouteLookupV2) Size() (size int) { 3148 if m == nil { 3149 return 0 3150 } 3151 size += 4 // m.TableID 3152 size += 1 // m.Exact 3153 size += 1 // m.Prefix.Address.Af 3154 size += 1 * 16 // m.Prefix.Address.Un 3155 size += 1 // m.Prefix.Len 3156 return size 3157 } 3158 func (m *IPRouteLookupV2) Marshal(b []byte) ([]byte, error) { 3159 if b == nil { 3160 b = make([]byte, m.Size()) 3161 } 3162 buf := codec.NewBuffer(b) 3163 buf.EncodeUint32(m.TableID) 3164 buf.EncodeUint8(m.Exact) 3165 buf.EncodeUint8(uint8(m.Prefix.Address.Af)) 3166 buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16) 3167 buf.EncodeUint8(m.Prefix.Len) 3168 return buf.Bytes(), nil 3169 } 3170 func (m *IPRouteLookupV2) Unmarshal(b []byte) error { 3171 buf := codec.NewBuffer(b) 3172 m.TableID = buf.DecodeUint32() 3173 m.Exact = buf.DecodeUint8() 3174 m.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) 3175 copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 3176 m.Prefix.Len = buf.DecodeUint8() 3177 return nil 3178 } 3179 3180 // IPRouteLookupV2Reply defines message 'ip_route_lookup_v2_reply'. 3181 // InProgress: the message form may change in the future versions 3182 type IPRouteLookupV2Reply struct { 3183 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 3184 Route IPRouteV2 `binapi:"ip_route_v2,name=route" json:"route,omitempty"` 3185 } 3186 3187 func (m *IPRouteLookupV2Reply) Reset() { *m = IPRouteLookupV2Reply{} } 3188 func (*IPRouteLookupV2Reply) GetMessageName() string { return "ip_route_lookup_v2_reply" } 3189 func (*IPRouteLookupV2Reply) GetCrcString() string { return "84cc9e03" } 3190 func (*IPRouteLookupV2Reply) GetMessageType() api.MessageType { 3191 return api.ReplyMessage 3192 } 3193 3194 func (m *IPRouteLookupV2Reply) Size() (size int) { 3195 if m == nil { 3196 return 0 3197 } 3198 size += 4 // m.Retval 3199 size += 4 // m.Route.TableID 3200 size += 4 // m.Route.StatsIndex 3201 size += 1 // m.Route.Prefix.Address.Af 3202 size += 1 * 16 // m.Route.Prefix.Address.Un 3203 size += 1 // m.Route.Prefix.Len 3204 size += 1 // m.Route.NPaths 3205 size += 1 // m.Route.Src 3206 for j2 := 0; j2 < len(m.Route.Paths); j2++ { 3207 var s2 fib_types.FibPath 3208 _ = s2 3209 if j2 < len(m.Route.Paths) { 3210 s2 = m.Route.Paths[j2] 3211 } 3212 size += 4 // s2.SwIfIndex 3213 size += 4 // s2.TableID 3214 size += 4 // s2.RpfID 3215 size += 1 // s2.Weight 3216 size += 1 // s2.Preference 3217 size += 4 // s2.Type 3218 size += 4 // s2.Flags 3219 size += 4 // s2.Proto 3220 size += 1 * 16 // s2.Nh.Address 3221 size += 4 // s2.Nh.ViaLabel 3222 size += 4 // s2.Nh.ObjID 3223 size += 4 // s2.Nh.ClassifyTableIndex 3224 size += 1 // s2.NLabels 3225 for j3 := 0; j3 < 16; j3++ { 3226 size += 1 // s2.LabelStack[j3].IsUniform 3227 size += 4 // s2.LabelStack[j3].Label 3228 size += 1 // s2.LabelStack[j3].TTL 3229 size += 1 // s2.LabelStack[j3].Exp 3230 } 3231 } 3232 return size 3233 } 3234 func (m *IPRouteLookupV2Reply) Marshal(b []byte) ([]byte, error) { 3235 if b == nil { 3236 b = make([]byte, m.Size()) 3237 } 3238 buf := codec.NewBuffer(b) 3239 buf.EncodeInt32(m.Retval) 3240 buf.EncodeUint32(m.Route.TableID) 3241 buf.EncodeUint32(m.Route.StatsIndex) 3242 buf.EncodeUint8(uint8(m.Route.Prefix.Address.Af)) 3243 buf.EncodeBytes(m.Route.Prefix.Address.Un.XXX_UnionData[:], 16) 3244 buf.EncodeUint8(m.Route.Prefix.Len) 3245 buf.EncodeUint8(uint8(len(m.Route.Paths))) 3246 buf.EncodeUint8(m.Route.Src) 3247 for j1 := 0; j1 < len(m.Route.Paths); j1++ { 3248 var v1 fib_types.FibPath // Paths 3249 if j1 < len(m.Route.Paths) { 3250 v1 = m.Route.Paths[j1] 3251 } 3252 buf.EncodeUint32(v1.SwIfIndex) 3253 buf.EncodeUint32(v1.TableID) 3254 buf.EncodeUint32(v1.RpfID) 3255 buf.EncodeUint8(v1.Weight) 3256 buf.EncodeUint8(v1.Preference) 3257 buf.EncodeUint32(uint32(v1.Type)) 3258 buf.EncodeUint32(uint32(v1.Flags)) 3259 buf.EncodeUint32(uint32(v1.Proto)) 3260 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16) 3261 buf.EncodeUint32(v1.Nh.ViaLabel) 3262 buf.EncodeUint32(v1.Nh.ObjID) 3263 buf.EncodeUint32(v1.Nh.ClassifyTableIndex) 3264 buf.EncodeUint8(v1.NLabels) 3265 for j2 := 0; j2 < 16; j2++ { 3266 buf.EncodeUint8(v1.LabelStack[j2].IsUniform) 3267 buf.EncodeUint32(v1.LabelStack[j2].Label) 3268 buf.EncodeUint8(v1.LabelStack[j2].TTL) 3269 buf.EncodeUint8(v1.LabelStack[j2].Exp) 3270 } 3271 } 3272 return buf.Bytes(), nil 3273 } 3274 func (m *IPRouteLookupV2Reply) Unmarshal(b []byte) error { 3275 buf := codec.NewBuffer(b) 3276 m.Retval = buf.DecodeInt32() 3277 m.Route.TableID = buf.DecodeUint32() 3278 m.Route.StatsIndex = buf.DecodeUint32() 3279 m.Route.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) 3280 copy(m.Route.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 3281 m.Route.Prefix.Len = buf.DecodeUint8() 3282 m.Route.NPaths = buf.DecodeUint8() 3283 m.Route.Src = buf.DecodeUint8() 3284 m.Route.Paths = make([]fib_types.FibPath, m.Route.NPaths) 3285 for j1 := 0; j1 < len(m.Route.Paths); j1++ { 3286 m.Route.Paths[j1].SwIfIndex = buf.DecodeUint32() 3287 m.Route.Paths[j1].TableID = buf.DecodeUint32() 3288 m.Route.Paths[j1].RpfID = buf.DecodeUint32() 3289 m.Route.Paths[j1].Weight = buf.DecodeUint8() 3290 m.Route.Paths[j1].Preference = buf.DecodeUint8() 3291 m.Route.Paths[j1].Type = fib_types.FibPathType(buf.DecodeUint32()) 3292 m.Route.Paths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32()) 3293 m.Route.Paths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32()) 3294 copy(m.Route.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16)) 3295 m.Route.Paths[j1].Nh.ViaLabel = buf.DecodeUint32() 3296 m.Route.Paths[j1].Nh.ObjID = buf.DecodeUint32() 3297 m.Route.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32() 3298 m.Route.Paths[j1].NLabels = buf.DecodeUint8() 3299 for j2 := 0; j2 < 16; j2++ { 3300 m.Route.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8() 3301 m.Route.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32() 3302 m.Route.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8() 3303 m.Route.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8() 3304 } 3305 } 3306 return nil 3307 } 3308 3309 // IPRouteV2Details defines message 'ip_route_v2_details'. 3310 // InProgress: the message form may change in the future versions 3311 type IPRouteV2Details struct { 3312 Route IPRouteV2 `binapi:"ip_route_v2,name=route" json:"route,omitempty"` 3313 } 3314 3315 func (m *IPRouteV2Details) Reset() { *m = IPRouteV2Details{} } 3316 func (*IPRouteV2Details) GetMessageName() string { return "ip_route_v2_details" } 3317 func (*IPRouteV2Details) GetCrcString() string { return "b09aa6c0" } 3318 func (*IPRouteV2Details) GetMessageType() api.MessageType { 3319 return api.ReplyMessage 3320 } 3321 3322 func (m *IPRouteV2Details) Size() (size int) { 3323 if m == nil { 3324 return 0 3325 } 3326 size += 4 // m.Route.TableID 3327 size += 4 // m.Route.StatsIndex 3328 size += 1 // m.Route.Prefix.Address.Af 3329 size += 1 * 16 // m.Route.Prefix.Address.Un 3330 size += 1 // m.Route.Prefix.Len 3331 size += 1 // m.Route.NPaths 3332 size += 1 // m.Route.Src 3333 for j2 := 0; j2 < len(m.Route.Paths); j2++ { 3334 var s2 fib_types.FibPath 3335 _ = s2 3336 if j2 < len(m.Route.Paths) { 3337 s2 = m.Route.Paths[j2] 3338 } 3339 size += 4 // s2.SwIfIndex 3340 size += 4 // s2.TableID 3341 size += 4 // s2.RpfID 3342 size += 1 // s2.Weight 3343 size += 1 // s2.Preference 3344 size += 4 // s2.Type 3345 size += 4 // s2.Flags 3346 size += 4 // s2.Proto 3347 size += 1 * 16 // s2.Nh.Address 3348 size += 4 // s2.Nh.ViaLabel 3349 size += 4 // s2.Nh.ObjID 3350 size += 4 // s2.Nh.ClassifyTableIndex 3351 size += 1 // s2.NLabels 3352 for j3 := 0; j3 < 16; j3++ { 3353 size += 1 // s2.LabelStack[j3].IsUniform 3354 size += 4 // s2.LabelStack[j3].Label 3355 size += 1 // s2.LabelStack[j3].TTL 3356 size += 1 // s2.LabelStack[j3].Exp 3357 } 3358 } 3359 return size 3360 } 3361 func (m *IPRouteV2Details) Marshal(b []byte) ([]byte, error) { 3362 if b == nil { 3363 b = make([]byte, m.Size()) 3364 } 3365 buf := codec.NewBuffer(b) 3366 buf.EncodeUint32(m.Route.TableID) 3367 buf.EncodeUint32(m.Route.StatsIndex) 3368 buf.EncodeUint8(uint8(m.Route.Prefix.Address.Af)) 3369 buf.EncodeBytes(m.Route.Prefix.Address.Un.XXX_UnionData[:], 16) 3370 buf.EncodeUint8(m.Route.Prefix.Len) 3371 buf.EncodeUint8(uint8(len(m.Route.Paths))) 3372 buf.EncodeUint8(m.Route.Src) 3373 for j1 := 0; j1 < len(m.Route.Paths); j1++ { 3374 var v1 fib_types.FibPath // Paths 3375 if j1 < len(m.Route.Paths) { 3376 v1 = m.Route.Paths[j1] 3377 } 3378 buf.EncodeUint32(v1.SwIfIndex) 3379 buf.EncodeUint32(v1.TableID) 3380 buf.EncodeUint32(v1.RpfID) 3381 buf.EncodeUint8(v1.Weight) 3382 buf.EncodeUint8(v1.Preference) 3383 buf.EncodeUint32(uint32(v1.Type)) 3384 buf.EncodeUint32(uint32(v1.Flags)) 3385 buf.EncodeUint32(uint32(v1.Proto)) 3386 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16) 3387 buf.EncodeUint32(v1.Nh.ViaLabel) 3388 buf.EncodeUint32(v1.Nh.ObjID) 3389 buf.EncodeUint32(v1.Nh.ClassifyTableIndex) 3390 buf.EncodeUint8(v1.NLabels) 3391 for j2 := 0; j2 < 16; j2++ { 3392 buf.EncodeUint8(v1.LabelStack[j2].IsUniform) 3393 buf.EncodeUint32(v1.LabelStack[j2].Label) 3394 buf.EncodeUint8(v1.LabelStack[j2].TTL) 3395 buf.EncodeUint8(v1.LabelStack[j2].Exp) 3396 } 3397 } 3398 return buf.Bytes(), nil 3399 } 3400 func (m *IPRouteV2Details) Unmarshal(b []byte) error { 3401 buf := codec.NewBuffer(b) 3402 m.Route.TableID = buf.DecodeUint32() 3403 m.Route.StatsIndex = buf.DecodeUint32() 3404 m.Route.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) 3405 copy(m.Route.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 3406 m.Route.Prefix.Len = buf.DecodeUint8() 3407 m.Route.NPaths = buf.DecodeUint8() 3408 m.Route.Src = buf.DecodeUint8() 3409 m.Route.Paths = make([]fib_types.FibPath, m.Route.NPaths) 3410 for j1 := 0; j1 < len(m.Route.Paths); j1++ { 3411 m.Route.Paths[j1].SwIfIndex = buf.DecodeUint32() 3412 m.Route.Paths[j1].TableID = buf.DecodeUint32() 3413 m.Route.Paths[j1].RpfID = buf.DecodeUint32() 3414 m.Route.Paths[j1].Weight = buf.DecodeUint8() 3415 m.Route.Paths[j1].Preference = buf.DecodeUint8() 3416 m.Route.Paths[j1].Type = fib_types.FibPathType(buf.DecodeUint32()) 3417 m.Route.Paths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32()) 3418 m.Route.Paths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32()) 3419 copy(m.Route.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16)) 3420 m.Route.Paths[j1].Nh.ViaLabel = buf.DecodeUint32() 3421 m.Route.Paths[j1].Nh.ObjID = buf.DecodeUint32() 3422 m.Route.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32() 3423 m.Route.Paths[j1].NLabels = buf.DecodeUint8() 3424 for j2 := 0; j2 < 16; j2++ { 3425 m.Route.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8() 3426 m.Route.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32() 3427 m.Route.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8() 3428 m.Route.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8() 3429 } 3430 } 3431 return nil 3432 } 3433 3434 // IPRouteV2Dump defines message 'ip_route_v2_dump'. 3435 // InProgress: the message form may change in the future versions 3436 type IPRouteV2Dump struct { 3437 Src uint8 `binapi:"u8,name=src" json:"src,omitempty"` 3438 Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"` 3439 } 3440 3441 func (m *IPRouteV2Dump) Reset() { *m = IPRouteV2Dump{} } 3442 func (*IPRouteV2Dump) GetMessageName() string { return "ip_route_v2_dump" } 3443 func (*IPRouteV2Dump) GetCrcString() string { return "d16f72e6" } 3444 func (*IPRouteV2Dump) GetMessageType() api.MessageType { 3445 return api.RequestMessage 3446 } 3447 3448 func (m *IPRouteV2Dump) Size() (size int) { 3449 if m == nil { 3450 return 0 3451 } 3452 size += 1 // m.Src 3453 size += 4 // m.Table.TableID 3454 size += 1 // m.Table.IsIP6 3455 size += 64 // m.Table.Name 3456 return size 3457 } 3458 func (m *IPRouteV2Dump) Marshal(b []byte) ([]byte, error) { 3459 if b == nil { 3460 b = make([]byte, m.Size()) 3461 } 3462 buf := codec.NewBuffer(b) 3463 buf.EncodeUint8(m.Src) 3464 buf.EncodeUint32(m.Table.TableID) 3465 buf.EncodeBool(m.Table.IsIP6) 3466 buf.EncodeString(m.Table.Name, 64) 3467 return buf.Bytes(), nil 3468 } 3469 func (m *IPRouteV2Dump) Unmarshal(b []byte) error { 3470 buf := codec.NewBuffer(b) 3471 m.Src = buf.DecodeUint8() 3472 m.Table.TableID = buf.DecodeUint32() 3473 m.Table.IsIP6 = buf.DecodeBool() 3474 m.Table.Name = buf.DecodeString(64) 3475 return nil 3476 } 3477 3478 // Configure IP source and L4 port-range check 3479 // - is_ip6 - 1 if source address type is IPv6 3480 // - is_add - 1 if add, 0 if delete 3481 // - ip - prefix to match 3482 // - number_of_ranges - length of low_port and high_port arrays (must match) 3483 // - low_ports[32] - up to 32 low end of port range entries (must have corresponding high_ports entry) 3484 // - high_ports[32] - up to 32 high end of port range entries (must have corresponding low_ports entry) 3485 // - vrf_id - fib table/vrf id to associate the source and port-range check with 3486 // @note To specify a single port set low_port and high_port entry the same 3487 // 3488 // IPSourceAndPortRangeCheckAddDel defines message 'ip_source_and_port_range_check_add_del'. 3489 type IPSourceAndPortRangeCheckAddDel struct { 3490 IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"` 3491 Prefix ip_types.Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"` 3492 NumberOfRanges uint8 `binapi:"u8,name=number_of_ranges" json:"number_of_ranges,omitempty"` 3493 LowPorts []uint16 `binapi:"u16[32],name=low_ports" json:"low_ports,omitempty"` 3494 HighPorts []uint16 `binapi:"u16[32],name=high_ports" json:"high_ports,omitempty"` 3495 VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"` 3496 } 3497 3498 func (m *IPSourceAndPortRangeCheckAddDel) Reset() { *m = IPSourceAndPortRangeCheckAddDel{} } 3499 func (*IPSourceAndPortRangeCheckAddDel) GetMessageName() string { 3500 return "ip_source_and_port_range_check_add_del" 3501 } 3502 func (*IPSourceAndPortRangeCheckAddDel) GetCrcString() string { return "92a067e3" } 3503 func (*IPSourceAndPortRangeCheckAddDel) GetMessageType() api.MessageType { 3504 return api.RequestMessage 3505 } 3506 3507 func (m *IPSourceAndPortRangeCheckAddDel) Size() (size int) { 3508 if m == nil { 3509 return 0 3510 } 3511 size += 1 // m.IsAdd 3512 size += 1 // m.Prefix.Address.Af 3513 size += 1 * 16 // m.Prefix.Address.Un 3514 size += 1 // m.Prefix.Len 3515 size += 1 // m.NumberOfRanges 3516 size += 2 * 32 // m.LowPorts 3517 size += 2 * 32 // m.HighPorts 3518 size += 4 // m.VrfID 3519 return size 3520 } 3521 func (m *IPSourceAndPortRangeCheckAddDel) Marshal(b []byte) ([]byte, error) { 3522 if b == nil { 3523 b = make([]byte, m.Size()) 3524 } 3525 buf := codec.NewBuffer(b) 3526 buf.EncodeBool(m.IsAdd) 3527 buf.EncodeUint8(uint8(m.Prefix.Address.Af)) 3528 buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16) 3529 buf.EncodeUint8(m.Prefix.Len) 3530 buf.EncodeUint8(m.NumberOfRanges) 3531 for i := 0; i < 32; i++ { 3532 var x uint16 3533 if i < len(m.LowPorts) { 3534 x = uint16(m.LowPorts[i]) 3535 } 3536 buf.EncodeUint16(x) 3537 } 3538 for i := 0; i < 32; i++ { 3539 var x uint16 3540 if i < len(m.HighPorts) { 3541 x = uint16(m.HighPorts[i]) 3542 } 3543 buf.EncodeUint16(x) 3544 } 3545 buf.EncodeUint32(m.VrfID) 3546 return buf.Bytes(), nil 3547 } 3548 func (m *IPSourceAndPortRangeCheckAddDel) Unmarshal(b []byte) error { 3549 buf := codec.NewBuffer(b) 3550 m.IsAdd = buf.DecodeBool() 3551 m.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) 3552 copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 3553 m.Prefix.Len = buf.DecodeUint8() 3554 m.NumberOfRanges = buf.DecodeUint8() 3555 m.LowPorts = make([]uint16, 32) 3556 for i := 0; i < len(m.LowPorts); i++ { 3557 m.LowPorts[i] = buf.DecodeUint16() 3558 } 3559 m.HighPorts = make([]uint16, 32) 3560 for i := 0; i < len(m.HighPorts); i++ { 3561 m.HighPorts[i] = buf.DecodeUint16() 3562 } 3563 m.VrfID = buf.DecodeUint32() 3564 return nil 3565 } 3566 3567 // IPSourceAndPortRangeCheckAddDelReply defines message 'ip_source_and_port_range_check_add_del_reply'. 3568 type IPSourceAndPortRangeCheckAddDelReply struct { 3569 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 3570 } 3571 3572 func (m *IPSourceAndPortRangeCheckAddDelReply) Reset() { *m = IPSourceAndPortRangeCheckAddDelReply{} } 3573 func (*IPSourceAndPortRangeCheckAddDelReply) GetMessageName() string { 3574 return "ip_source_and_port_range_check_add_del_reply" 3575 } 3576 func (*IPSourceAndPortRangeCheckAddDelReply) GetCrcString() string { return "e8d4e804" } 3577 func (*IPSourceAndPortRangeCheckAddDelReply) GetMessageType() api.MessageType { 3578 return api.ReplyMessage 3579 } 3580 3581 func (m *IPSourceAndPortRangeCheckAddDelReply) Size() (size int) { 3582 if m == nil { 3583 return 0 3584 } 3585 size += 4 // m.Retval 3586 return size 3587 } 3588 func (m *IPSourceAndPortRangeCheckAddDelReply) Marshal(b []byte) ([]byte, error) { 3589 if b == nil { 3590 b = make([]byte, m.Size()) 3591 } 3592 buf := codec.NewBuffer(b) 3593 buf.EncodeInt32(m.Retval) 3594 return buf.Bytes(), nil 3595 } 3596 func (m *IPSourceAndPortRangeCheckAddDelReply) Unmarshal(b []byte) error { 3597 buf := codec.NewBuffer(b) 3598 m.Retval = buf.DecodeInt32() 3599 return nil 3600 } 3601 3602 // Set interface source and L4 port-range request 3603 // - interface_id - interface index 3604 // - tcp_vrf_id - VRF associated with source and TCP port-range check 3605 // - udp_vrf_id - VRF associated with source and TCP port-range check 3606 // 3607 // IPSourceAndPortRangeCheckInterfaceAddDel defines message 'ip_source_and_port_range_check_interface_add_del'. 3608 type IPSourceAndPortRangeCheckInterfaceAddDel struct { 3609 IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"` 3610 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 3611 TCPInVrfID uint32 `binapi:"u32,name=tcp_in_vrf_id" json:"tcp_in_vrf_id,omitempty"` 3612 TCPOutVrfID uint32 `binapi:"u32,name=tcp_out_vrf_id" json:"tcp_out_vrf_id,omitempty"` 3613 UDPInVrfID uint32 `binapi:"u32,name=udp_in_vrf_id" json:"udp_in_vrf_id,omitempty"` 3614 UDPOutVrfID uint32 `binapi:"u32,name=udp_out_vrf_id" json:"udp_out_vrf_id,omitempty"` 3615 } 3616 3617 func (m *IPSourceAndPortRangeCheckInterfaceAddDel) Reset() { 3618 *m = IPSourceAndPortRangeCheckInterfaceAddDel{} 3619 } 3620 func (*IPSourceAndPortRangeCheckInterfaceAddDel) GetMessageName() string { 3621 return "ip_source_and_port_range_check_interface_add_del" 3622 } 3623 func (*IPSourceAndPortRangeCheckInterfaceAddDel) GetCrcString() string { return "e1ba8987" } 3624 func (*IPSourceAndPortRangeCheckInterfaceAddDel) GetMessageType() api.MessageType { 3625 return api.RequestMessage 3626 } 3627 3628 func (m *IPSourceAndPortRangeCheckInterfaceAddDel) Size() (size int) { 3629 if m == nil { 3630 return 0 3631 } 3632 size += 1 // m.IsAdd 3633 size += 4 // m.SwIfIndex 3634 size += 4 // m.TCPInVrfID 3635 size += 4 // m.TCPOutVrfID 3636 size += 4 // m.UDPInVrfID 3637 size += 4 // m.UDPOutVrfID 3638 return size 3639 } 3640 func (m *IPSourceAndPortRangeCheckInterfaceAddDel) Marshal(b []byte) ([]byte, error) { 3641 if b == nil { 3642 b = make([]byte, m.Size()) 3643 } 3644 buf := codec.NewBuffer(b) 3645 buf.EncodeBool(m.IsAdd) 3646 buf.EncodeUint32(uint32(m.SwIfIndex)) 3647 buf.EncodeUint32(m.TCPInVrfID) 3648 buf.EncodeUint32(m.TCPOutVrfID) 3649 buf.EncodeUint32(m.UDPInVrfID) 3650 buf.EncodeUint32(m.UDPOutVrfID) 3651 return buf.Bytes(), nil 3652 } 3653 func (m *IPSourceAndPortRangeCheckInterfaceAddDel) Unmarshal(b []byte) error { 3654 buf := codec.NewBuffer(b) 3655 m.IsAdd = buf.DecodeBool() 3656 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 3657 m.TCPInVrfID = buf.DecodeUint32() 3658 m.TCPOutVrfID = buf.DecodeUint32() 3659 m.UDPInVrfID = buf.DecodeUint32() 3660 m.UDPOutVrfID = buf.DecodeUint32() 3661 return nil 3662 } 3663 3664 // IPSourceAndPortRangeCheckInterfaceAddDelReply defines message 'ip_source_and_port_range_check_interface_add_del_reply'. 3665 type IPSourceAndPortRangeCheckInterfaceAddDelReply struct { 3666 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 3667 } 3668 3669 func (m *IPSourceAndPortRangeCheckInterfaceAddDelReply) Reset() { 3670 *m = IPSourceAndPortRangeCheckInterfaceAddDelReply{} 3671 } 3672 func (*IPSourceAndPortRangeCheckInterfaceAddDelReply) GetMessageName() string { 3673 return "ip_source_and_port_range_check_interface_add_del_reply" 3674 } 3675 func (*IPSourceAndPortRangeCheckInterfaceAddDelReply) GetCrcString() string { return "e8d4e804" } 3676 func (*IPSourceAndPortRangeCheckInterfaceAddDelReply) GetMessageType() api.MessageType { 3677 return api.ReplyMessage 3678 } 3679 3680 func (m *IPSourceAndPortRangeCheckInterfaceAddDelReply) Size() (size int) { 3681 if m == nil { 3682 return 0 3683 } 3684 size += 4 // m.Retval 3685 return size 3686 } 3687 func (m *IPSourceAndPortRangeCheckInterfaceAddDelReply) Marshal(b []byte) ([]byte, error) { 3688 if b == nil { 3689 b = make([]byte, m.Size()) 3690 } 3691 buf := codec.NewBuffer(b) 3692 buf.EncodeInt32(m.Retval) 3693 return buf.Bytes(), nil 3694 } 3695 func (m *IPSourceAndPortRangeCheckInterfaceAddDelReply) Unmarshal(b []byte) error { 3696 buf := codec.NewBuffer(b) 3697 m.Retval = buf.DecodeInt32() 3698 return nil 3699 } 3700 3701 // Add / del table request 3702 // 3703 // A table can be added multiple times, but need be deleted only once. 3704 // 3705 // IPTableAddDel defines message 'ip_table_add_del'. 3706 type IPTableAddDel struct { 3707 IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"` 3708 Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"` 3709 } 3710 3711 func (m *IPTableAddDel) Reset() { *m = IPTableAddDel{} } 3712 func (*IPTableAddDel) GetMessageName() string { return "ip_table_add_del" } 3713 func (*IPTableAddDel) GetCrcString() string { return "0ffdaec0" } 3714 func (*IPTableAddDel) GetMessageType() api.MessageType { 3715 return api.RequestMessage 3716 } 3717 3718 func (m *IPTableAddDel) Size() (size int) { 3719 if m == nil { 3720 return 0 3721 } 3722 size += 1 // m.IsAdd 3723 size += 4 // m.Table.TableID 3724 size += 1 // m.Table.IsIP6 3725 size += 64 // m.Table.Name 3726 return size 3727 } 3728 func (m *IPTableAddDel) Marshal(b []byte) ([]byte, error) { 3729 if b == nil { 3730 b = make([]byte, m.Size()) 3731 } 3732 buf := codec.NewBuffer(b) 3733 buf.EncodeBool(m.IsAdd) 3734 buf.EncodeUint32(m.Table.TableID) 3735 buf.EncodeBool(m.Table.IsIP6) 3736 buf.EncodeString(m.Table.Name, 64) 3737 return buf.Bytes(), nil 3738 } 3739 func (m *IPTableAddDel) Unmarshal(b []byte) error { 3740 buf := codec.NewBuffer(b) 3741 m.IsAdd = buf.DecodeBool() 3742 m.Table.TableID = buf.DecodeUint32() 3743 m.Table.IsIP6 = buf.DecodeBool() 3744 m.Table.Name = buf.DecodeString(64) 3745 return nil 3746 } 3747 3748 // IPTableAddDelReply defines message 'ip_table_add_del_reply'. 3749 type IPTableAddDelReply struct { 3750 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 3751 } 3752 3753 func (m *IPTableAddDelReply) Reset() { *m = IPTableAddDelReply{} } 3754 func (*IPTableAddDelReply) GetMessageName() string { return "ip_table_add_del_reply" } 3755 func (*IPTableAddDelReply) GetCrcString() string { return "e8d4e804" } 3756 func (*IPTableAddDelReply) GetMessageType() api.MessageType { 3757 return api.ReplyMessage 3758 } 3759 3760 func (m *IPTableAddDelReply) Size() (size int) { 3761 if m == nil { 3762 return 0 3763 } 3764 size += 4 // m.Retval 3765 return size 3766 } 3767 func (m *IPTableAddDelReply) Marshal(b []byte) ([]byte, error) { 3768 if b == nil { 3769 b = make([]byte, m.Size()) 3770 } 3771 buf := codec.NewBuffer(b) 3772 buf.EncodeInt32(m.Retval) 3773 return buf.Bytes(), nil 3774 } 3775 func (m *IPTableAddDelReply) Unmarshal(b []byte) error { 3776 buf := codec.NewBuffer(b) 3777 m.Retval = buf.DecodeInt32() 3778 return nil 3779 } 3780 3781 // Allocate an unused table 3782 // 3783 // A table can be added multiple times. 3784 // If a large number of tables are in use (millions), this API might 3785 // fail to find a free ID with very low probability, and will return 3786 // EAGAIN. A subsequent attempt may be successful. 3787 // - table - if table.table_id == ~0, vpp allocates an unused table_id and 3788 // proceeds as in ip_table_add_del with is_add = true 3789 // if table.table_id != ~0, vpp uses the table.table_id and 3790 // proceeds as in ip_table_add_del with is_add = true 3791 // table.table_id should never be 0 3792 // 3793 // IPTableAllocate defines message 'ip_table_allocate'. 3794 type IPTableAllocate struct { 3795 Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"` 3796 } 3797 3798 func (m *IPTableAllocate) Reset() { *m = IPTableAllocate{} } 3799 func (*IPTableAllocate) GetMessageName() string { return "ip_table_allocate" } 3800 func (*IPTableAllocate) GetCrcString() string { return "b9d2e09e" } 3801 func (*IPTableAllocate) GetMessageType() api.MessageType { 3802 return api.RequestMessage 3803 } 3804 3805 func (m *IPTableAllocate) Size() (size int) { 3806 if m == nil { 3807 return 0 3808 } 3809 size += 4 // m.Table.TableID 3810 size += 1 // m.Table.IsIP6 3811 size += 64 // m.Table.Name 3812 return size 3813 } 3814 func (m *IPTableAllocate) Marshal(b []byte) ([]byte, error) { 3815 if b == nil { 3816 b = make([]byte, m.Size()) 3817 } 3818 buf := codec.NewBuffer(b) 3819 buf.EncodeUint32(m.Table.TableID) 3820 buf.EncodeBool(m.Table.IsIP6) 3821 buf.EncodeString(m.Table.Name, 64) 3822 return buf.Bytes(), nil 3823 } 3824 func (m *IPTableAllocate) Unmarshal(b []byte) error { 3825 buf := codec.NewBuffer(b) 3826 m.Table.TableID = buf.DecodeUint32() 3827 m.Table.IsIP6 = buf.DecodeBool() 3828 m.Table.Name = buf.DecodeString(64) 3829 return nil 3830 } 3831 3832 // IPTableAllocateReply defines message 'ip_table_allocate_reply'. 3833 type IPTableAllocateReply struct { 3834 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 3835 Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"` 3836 } 3837 3838 func (m *IPTableAllocateReply) Reset() { *m = IPTableAllocateReply{} } 3839 func (*IPTableAllocateReply) GetMessageName() string { return "ip_table_allocate_reply" } 3840 func (*IPTableAllocateReply) GetCrcString() string { return "1728303a" } 3841 func (*IPTableAllocateReply) GetMessageType() api.MessageType { 3842 return api.ReplyMessage 3843 } 3844 3845 func (m *IPTableAllocateReply) Size() (size int) { 3846 if m == nil { 3847 return 0 3848 } 3849 size += 4 // m.Retval 3850 size += 4 // m.Table.TableID 3851 size += 1 // m.Table.IsIP6 3852 size += 64 // m.Table.Name 3853 return size 3854 } 3855 func (m *IPTableAllocateReply) Marshal(b []byte) ([]byte, error) { 3856 if b == nil { 3857 b = make([]byte, m.Size()) 3858 } 3859 buf := codec.NewBuffer(b) 3860 buf.EncodeInt32(m.Retval) 3861 buf.EncodeUint32(m.Table.TableID) 3862 buf.EncodeBool(m.Table.IsIP6) 3863 buf.EncodeString(m.Table.Name, 64) 3864 return buf.Bytes(), nil 3865 } 3866 func (m *IPTableAllocateReply) Unmarshal(b []byte) error { 3867 buf := codec.NewBuffer(b) 3868 m.Retval = buf.DecodeInt32() 3869 m.Table.TableID = buf.DecodeUint32() 3870 m.Table.IsIP6 = buf.DecodeBool() 3871 m.Table.Name = buf.DecodeString(64) 3872 return nil 3873 } 3874 3875 // IP FIB table response 3876 // - table - description of the table 3877 // 3878 // IPTableDetails defines message 'ip_table_details'. 3879 type IPTableDetails struct { 3880 Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"` 3881 } 3882 3883 func (m *IPTableDetails) Reset() { *m = IPTableDetails{} } 3884 func (*IPTableDetails) GetMessageName() string { return "ip_table_details" } 3885 func (*IPTableDetails) GetCrcString() string { return "c79fca0f" } 3886 func (*IPTableDetails) GetMessageType() api.MessageType { 3887 return api.ReplyMessage 3888 } 3889 3890 func (m *IPTableDetails) Size() (size int) { 3891 if m == nil { 3892 return 0 3893 } 3894 size += 4 // m.Table.TableID 3895 size += 1 // m.Table.IsIP6 3896 size += 64 // m.Table.Name 3897 return size 3898 } 3899 func (m *IPTableDetails) Marshal(b []byte) ([]byte, error) { 3900 if b == nil { 3901 b = make([]byte, m.Size()) 3902 } 3903 buf := codec.NewBuffer(b) 3904 buf.EncodeUint32(m.Table.TableID) 3905 buf.EncodeBool(m.Table.IsIP6) 3906 buf.EncodeString(m.Table.Name, 64) 3907 return buf.Bytes(), nil 3908 } 3909 func (m *IPTableDetails) Unmarshal(b []byte) error { 3910 buf := codec.NewBuffer(b) 3911 m.Table.TableID = buf.DecodeUint32() 3912 m.Table.IsIP6 = buf.DecodeBool() 3913 m.Table.Name = buf.DecodeString(64) 3914 return nil 3915 } 3916 3917 // Dump IP all fib tables 3918 // IPTableDump defines message 'ip_table_dump'. 3919 type IPTableDump struct{} 3920 3921 func (m *IPTableDump) Reset() { *m = IPTableDump{} } 3922 func (*IPTableDump) GetMessageName() string { return "ip_table_dump" } 3923 func (*IPTableDump) GetCrcString() string { return "51077d14" } 3924 func (*IPTableDump) GetMessageType() api.MessageType { 3925 return api.RequestMessage 3926 } 3927 3928 func (m *IPTableDump) Size() (size int) { 3929 if m == nil { 3930 return 0 3931 } 3932 return size 3933 } 3934 func (m *IPTableDump) Marshal(b []byte) ([]byte, error) { 3935 if b == nil { 3936 b = make([]byte, m.Size()) 3937 } 3938 buf := codec.NewBuffer(b) 3939 return buf.Bytes(), nil 3940 } 3941 func (m *IPTableDump) Unmarshal(b []byte) error { 3942 return nil 3943 } 3944 3945 // IP table flush 3946 // 3947 // Flush a table of all routes 3948 // - table - The table to flush 3949 // 3950 // IPTableFlush defines message 'ip_table_flush'. 3951 type IPTableFlush struct { 3952 Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"` 3953 } 3954 3955 func (m *IPTableFlush) Reset() { *m = IPTableFlush{} } 3956 func (*IPTableFlush) GetMessageName() string { return "ip_table_flush" } 3957 func (*IPTableFlush) GetCrcString() string { return "b9d2e09e" } 3958 func (*IPTableFlush) GetMessageType() api.MessageType { 3959 return api.RequestMessage 3960 } 3961 3962 func (m *IPTableFlush) Size() (size int) { 3963 if m == nil { 3964 return 0 3965 } 3966 size += 4 // m.Table.TableID 3967 size += 1 // m.Table.IsIP6 3968 size += 64 // m.Table.Name 3969 return size 3970 } 3971 func (m *IPTableFlush) Marshal(b []byte) ([]byte, error) { 3972 if b == nil { 3973 b = make([]byte, m.Size()) 3974 } 3975 buf := codec.NewBuffer(b) 3976 buf.EncodeUint32(m.Table.TableID) 3977 buf.EncodeBool(m.Table.IsIP6) 3978 buf.EncodeString(m.Table.Name, 64) 3979 return buf.Bytes(), nil 3980 } 3981 func (m *IPTableFlush) Unmarshal(b []byte) error { 3982 buf := codec.NewBuffer(b) 3983 m.Table.TableID = buf.DecodeUint32() 3984 m.Table.IsIP6 = buf.DecodeBool() 3985 m.Table.Name = buf.DecodeString(64) 3986 return nil 3987 } 3988 3989 // IPTableFlushReply defines message 'ip_table_flush_reply'. 3990 type IPTableFlushReply struct { 3991 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 3992 } 3993 3994 func (m *IPTableFlushReply) Reset() { *m = IPTableFlushReply{} } 3995 func (*IPTableFlushReply) GetMessageName() string { return "ip_table_flush_reply" } 3996 func (*IPTableFlushReply) GetCrcString() string { return "e8d4e804" } 3997 func (*IPTableFlushReply) GetMessageType() api.MessageType { 3998 return api.ReplyMessage 3999 } 4000 4001 func (m *IPTableFlushReply) Size() (size int) { 4002 if m == nil { 4003 return 0 4004 } 4005 size += 4 // m.Retval 4006 return size 4007 } 4008 func (m *IPTableFlushReply) Marshal(b []byte) ([]byte, error) { 4009 if b == nil { 4010 b = make([]byte, m.Size()) 4011 } 4012 buf := codec.NewBuffer(b) 4013 buf.EncodeInt32(m.Retval) 4014 return buf.Bytes(), nil 4015 } 4016 func (m *IPTableFlushReply) Unmarshal(b []byte) error { 4017 buf := codec.NewBuffer(b) 4018 m.Retval = buf.DecodeInt32() 4019 return nil 4020 } 4021 4022 // IP table replace being 4023 // 4024 // The use-case is that, for some unspecified reason, the control plane 4025 // has a very different set of entries it wants in the table than VPP 4026 // currently has. The CP would thus like to 'replace' VPP's current table 4027 // only by specifying what the new set of entries shall be, i.e. it is not 4028 // going to delete anything that already exists. 4029 // the CP declares the start of this procedure with this begin_replace 4030 // API Call, and when it has populated all the entries it wants, it calls 4031 // the below end_replace API. From this point on it is of course free 4032 // to add and delete entries as usual. 4033 // The underlying mechanism by which VPP implements this replace is 4034 // purposefully left unspecified. 4035 // - table - The table to resync 4036 // 4037 // IPTableReplaceBegin defines message 'ip_table_replace_begin'. 4038 type IPTableReplaceBegin struct { 4039 Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"` 4040 } 4041 4042 func (m *IPTableReplaceBegin) Reset() { *m = IPTableReplaceBegin{} } 4043 func (*IPTableReplaceBegin) GetMessageName() string { return "ip_table_replace_begin" } 4044 func (*IPTableReplaceBegin) GetCrcString() string { return "b9d2e09e" } 4045 func (*IPTableReplaceBegin) GetMessageType() api.MessageType { 4046 return api.RequestMessage 4047 } 4048 4049 func (m *IPTableReplaceBegin) Size() (size int) { 4050 if m == nil { 4051 return 0 4052 } 4053 size += 4 // m.Table.TableID 4054 size += 1 // m.Table.IsIP6 4055 size += 64 // m.Table.Name 4056 return size 4057 } 4058 func (m *IPTableReplaceBegin) Marshal(b []byte) ([]byte, error) { 4059 if b == nil { 4060 b = make([]byte, m.Size()) 4061 } 4062 buf := codec.NewBuffer(b) 4063 buf.EncodeUint32(m.Table.TableID) 4064 buf.EncodeBool(m.Table.IsIP6) 4065 buf.EncodeString(m.Table.Name, 64) 4066 return buf.Bytes(), nil 4067 } 4068 func (m *IPTableReplaceBegin) Unmarshal(b []byte) error { 4069 buf := codec.NewBuffer(b) 4070 m.Table.TableID = buf.DecodeUint32() 4071 m.Table.IsIP6 = buf.DecodeBool() 4072 m.Table.Name = buf.DecodeString(64) 4073 return nil 4074 } 4075 4076 // IPTableReplaceBeginReply defines message 'ip_table_replace_begin_reply'. 4077 type IPTableReplaceBeginReply struct { 4078 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 4079 } 4080 4081 func (m *IPTableReplaceBeginReply) Reset() { *m = IPTableReplaceBeginReply{} } 4082 func (*IPTableReplaceBeginReply) GetMessageName() string { return "ip_table_replace_begin_reply" } 4083 func (*IPTableReplaceBeginReply) GetCrcString() string { return "e8d4e804" } 4084 func (*IPTableReplaceBeginReply) GetMessageType() api.MessageType { 4085 return api.ReplyMessage 4086 } 4087 4088 func (m *IPTableReplaceBeginReply) Size() (size int) { 4089 if m == nil { 4090 return 0 4091 } 4092 size += 4 // m.Retval 4093 return size 4094 } 4095 func (m *IPTableReplaceBeginReply) Marshal(b []byte) ([]byte, error) { 4096 if b == nil { 4097 b = make([]byte, m.Size()) 4098 } 4099 buf := codec.NewBuffer(b) 4100 buf.EncodeInt32(m.Retval) 4101 return buf.Bytes(), nil 4102 } 4103 func (m *IPTableReplaceBeginReply) Unmarshal(b []byte) error { 4104 buf := codec.NewBuffer(b) 4105 m.Retval = buf.DecodeInt32() 4106 return nil 4107 } 4108 4109 // IP table replace end 4110 // 4111 // see replace start/ 4112 // - table - The table that has converged 4113 // 4114 // IPTableReplaceEnd defines message 'ip_table_replace_end'. 4115 type IPTableReplaceEnd struct { 4116 Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"` 4117 } 4118 4119 func (m *IPTableReplaceEnd) Reset() { *m = IPTableReplaceEnd{} } 4120 func (*IPTableReplaceEnd) GetMessageName() string { return "ip_table_replace_end" } 4121 func (*IPTableReplaceEnd) GetCrcString() string { return "b9d2e09e" } 4122 func (*IPTableReplaceEnd) GetMessageType() api.MessageType { 4123 return api.RequestMessage 4124 } 4125 4126 func (m *IPTableReplaceEnd) Size() (size int) { 4127 if m == nil { 4128 return 0 4129 } 4130 size += 4 // m.Table.TableID 4131 size += 1 // m.Table.IsIP6 4132 size += 64 // m.Table.Name 4133 return size 4134 } 4135 func (m *IPTableReplaceEnd) Marshal(b []byte) ([]byte, error) { 4136 if b == nil { 4137 b = make([]byte, m.Size()) 4138 } 4139 buf := codec.NewBuffer(b) 4140 buf.EncodeUint32(m.Table.TableID) 4141 buf.EncodeBool(m.Table.IsIP6) 4142 buf.EncodeString(m.Table.Name, 64) 4143 return buf.Bytes(), nil 4144 } 4145 func (m *IPTableReplaceEnd) Unmarshal(b []byte) error { 4146 buf := codec.NewBuffer(b) 4147 m.Table.TableID = buf.DecodeUint32() 4148 m.Table.IsIP6 = buf.DecodeBool() 4149 m.Table.Name = buf.DecodeString(64) 4150 return nil 4151 } 4152 4153 // IPTableReplaceEndReply defines message 'ip_table_replace_end_reply'. 4154 type IPTableReplaceEndReply struct { 4155 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 4156 } 4157 4158 func (m *IPTableReplaceEndReply) Reset() { *m = IPTableReplaceEndReply{} } 4159 func (*IPTableReplaceEndReply) GetMessageName() string { return "ip_table_replace_end_reply" } 4160 func (*IPTableReplaceEndReply) GetCrcString() string { return "e8d4e804" } 4161 func (*IPTableReplaceEndReply) GetMessageType() api.MessageType { 4162 return api.ReplyMessage 4163 } 4164 4165 func (m *IPTableReplaceEndReply) Size() (size int) { 4166 if m == nil { 4167 return 0 4168 } 4169 size += 4 // m.Retval 4170 return size 4171 } 4172 func (m *IPTableReplaceEndReply) Marshal(b []byte) ([]byte, error) { 4173 if b == nil { 4174 b = make([]byte, m.Size()) 4175 } 4176 buf := codec.NewBuffer(b) 4177 buf.EncodeInt32(m.Retval) 4178 return buf.Bytes(), nil 4179 } 4180 func (m *IPTableReplaceEndReply) Unmarshal(b []byte) error { 4181 buf := codec.NewBuffer(b) 4182 m.Retval = buf.DecodeInt32() 4183 return nil 4184 } 4185 4186 // IP unnumbered configurations 4187 // - sw_if_index The interface that has unnumbered configuration 4188 // - ip_sw_if_index The IP interface that it is unnumbered to 4189 // 4190 // IPUnnumberedDetails defines message 'ip_unnumbered_details'. 4191 type IPUnnumberedDetails struct { 4192 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 4193 IPSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=ip_sw_if_index" json:"ip_sw_if_index,omitempty"` 4194 } 4195 4196 func (m *IPUnnumberedDetails) Reset() { *m = IPUnnumberedDetails{} } 4197 func (*IPUnnumberedDetails) GetMessageName() string { return "ip_unnumbered_details" } 4198 func (*IPUnnumberedDetails) GetCrcString() string { return "cc59bd42" } 4199 func (*IPUnnumberedDetails) GetMessageType() api.MessageType { 4200 return api.ReplyMessage 4201 } 4202 4203 func (m *IPUnnumberedDetails) Size() (size int) { 4204 if m == nil { 4205 return 0 4206 } 4207 size += 4 // m.SwIfIndex 4208 size += 4 // m.IPSwIfIndex 4209 return size 4210 } 4211 func (m *IPUnnumberedDetails) Marshal(b []byte) ([]byte, error) { 4212 if b == nil { 4213 b = make([]byte, m.Size()) 4214 } 4215 buf := codec.NewBuffer(b) 4216 buf.EncodeUint32(uint32(m.SwIfIndex)) 4217 buf.EncodeUint32(uint32(m.IPSwIfIndex)) 4218 return buf.Bytes(), nil 4219 } 4220 func (m *IPUnnumberedDetails) Unmarshal(b []byte) error { 4221 buf := codec.NewBuffer(b) 4222 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 4223 m.IPSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 4224 return nil 4225 } 4226 4227 // Dump IP unnumbered configurations 4228 // - sw_if_index ~0 for all interfaces, else the interface desired 4229 // 4230 // IPUnnumberedDump defines message 'ip_unnumbered_dump'. 4231 type IPUnnumberedDump struct { 4232 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"` 4233 } 4234 4235 func (m *IPUnnumberedDump) Reset() { *m = IPUnnumberedDump{} } 4236 func (*IPUnnumberedDump) GetMessageName() string { return "ip_unnumbered_dump" } 4237 func (*IPUnnumberedDump) GetCrcString() string { return "f9e6675e" } 4238 func (*IPUnnumberedDump) GetMessageType() api.MessageType { 4239 return api.RequestMessage 4240 } 4241 4242 func (m *IPUnnumberedDump) Size() (size int) { 4243 if m == nil { 4244 return 0 4245 } 4246 size += 4 // m.SwIfIndex 4247 return size 4248 } 4249 func (m *IPUnnumberedDump) Marshal(b []byte) ([]byte, error) { 4250 if b == nil { 4251 b = make([]byte, m.Size()) 4252 } 4253 buf := codec.NewBuffer(b) 4254 buf.EncodeUint32(uint32(m.SwIfIndex)) 4255 return buf.Bytes(), nil 4256 } 4257 func (m *IPUnnumberedDump) Unmarshal(b []byte) error { 4258 buf := codec.NewBuffer(b) 4259 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 4260 return nil 4261 } 4262 4263 // MfibSignalDetails defines message 'mfib_signal_details'. 4264 type MfibSignalDetails struct { 4265 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 4266 TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"` 4267 Prefix ip_types.Mprefix `binapi:"mprefix,name=prefix" json:"prefix,omitempty"` 4268 IPPacketLen uint16 `binapi:"u16,name=ip_packet_len" json:"ip_packet_len,omitempty"` 4269 IPPacketData []byte `binapi:"u8[256],name=ip_packet_data" json:"ip_packet_data,omitempty"` 4270 } 4271 4272 func (m *MfibSignalDetails) Reset() { *m = MfibSignalDetails{} } 4273 func (*MfibSignalDetails) GetMessageName() string { return "mfib_signal_details" } 4274 func (*MfibSignalDetails) GetCrcString() string { return "6f4a4cfb" } 4275 func (*MfibSignalDetails) GetMessageType() api.MessageType { 4276 return api.ReplyMessage 4277 } 4278 4279 func (m *MfibSignalDetails) Size() (size int) { 4280 if m == nil { 4281 return 0 4282 } 4283 size += 4 // m.SwIfIndex 4284 size += 4 // m.TableID 4285 size += 1 // m.Prefix.Af 4286 size += 2 // m.Prefix.GrpAddressLength 4287 size += 1 * 16 // m.Prefix.GrpAddress 4288 size += 1 * 16 // m.Prefix.SrcAddress 4289 size += 2 // m.IPPacketLen 4290 size += 1 * 256 // m.IPPacketData 4291 return size 4292 } 4293 func (m *MfibSignalDetails) Marshal(b []byte) ([]byte, error) { 4294 if b == nil { 4295 b = make([]byte, m.Size()) 4296 } 4297 buf := codec.NewBuffer(b) 4298 buf.EncodeUint32(uint32(m.SwIfIndex)) 4299 buf.EncodeUint32(m.TableID) 4300 buf.EncodeUint8(uint8(m.Prefix.Af)) 4301 buf.EncodeUint16(m.Prefix.GrpAddressLength) 4302 buf.EncodeBytes(m.Prefix.GrpAddress.XXX_UnionData[:], 16) 4303 buf.EncodeBytes(m.Prefix.SrcAddress.XXX_UnionData[:], 16) 4304 buf.EncodeUint16(m.IPPacketLen) 4305 buf.EncodeBytes(m.IPPacketData, 256) 4306 return buf.Bytes(), nil 4307 } 4308 func (m *MfibSignalDetails) Unmarshal(b []byte) error { 4309 buf := codec.NewBuffer(b) 4310 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 4311 m.TableID = buf.DecodeUint32() 4312 m.Prefix.Af = ip_types.AddressFamily(buf.DecodeUint8()) 4313 m.Prefix.GrpAddressLength = buf.DecodeUint16() 4314 copy(m.Prefix.GrpAddress.XXX_UnionData[:], buf.DecodeBytes(16)) 4315 copy(m.Prefix.SrcAddress.XXX_UnionData[:], buf.DecodeBytes(16)) 4316 m.IPPacketLen = buf.DecodeUint16() 4317 m.IPPacketData = make([]byte, 256) 4318 copy(m.IPPacketData, buf.DecodeBytes(len(m.IPPacketData))) 4319 return nil 4320 } 4321 4322 // MfibSignalDump defines message 'mfib_signal_dump'. 4323 type MfibSignalDump struct{} 4324 4325 func (m *MfibSignalDump) Reset() { *m = MfibSignalDump{} } 4326 func (*MfibSignalDump) GetMessageName() string { return "mfib_signal_dump" } 4327 func (*MfibSignalDump) GetCrcString() string { return "51077d14" } 4328 func (*MfibSignalDump) GetMessageType() api.MessageType { 4329 return api.RequestMessage 4330 } 4331 4332 func (m *MfibSignalDump) Size() (size int) { 4333 if m == nil { 4334 return 0 4335 } 4336 return size 4337 } 4338 func (m *MfibSignalDump) Marshal(b []byte) ([]byte, error) { 4339 if b == nil { 4340 b = make([]byte, m.Size()) 4341 } 4342 buf := codec.NewBuffer(b) 4343 return buf.Bytes(), nil 4344 } 4345 func (m *MfibSignalDump) Unmarshal(b []byte) error { 4346 return nil 4347 } 4348 4349 // Set the ip flow hash config for a fib request 4350 // - vrf_id - vrf/fib id 4351 // - is_ipv6 - if non-zero the fib is ip6, else ip4 4352 // - src - if non-zero include src in flow hash 4353 // - dst - if non-zero include dst in flow hash 4354 // - sport - if non-zero include sport in flow hash 4355 // - dport - if non-zero include dport in flow hash 4356 // - proto -if non-zero include proto in flow hash 4357 // - reverse - if non-zero include reverse in flow hash 4358 // - symmetric - if non-zero include symmetry in flow hash 4359 // 4360 // SetIPFlowHash defines message 'set_ip_flow_hash'. 4361 // Deprecated: the message will be removed in the future versions 4362 type SetIPFlowHash struct { 4363 VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"` 4364 IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"` 4365 Src bool `binapi:"bool,name=src" json:"src,omitempty"` 4366 Dst bool `binapi:"bool,name=dst" json:"dst,omitempty"` 4367 Sport bool `binapi:"bool,name=sport" json:"sport,omitempty"` 4368 Dport bool `binapi:"bool,name=dport" json:"dport,omitempty"` 4369 Proto bool `binapi:"bool,name=proto" json:"proto,omitempty"` 4370 Reverse bool `binapi:"bool,name=reverse" json:"reverse,omitempty"` 4371 Symmetric bool `binapi:"bool,name=symmetric" json:"symmetric,omitempty"` 4372 } 4373 4374 func (m *SetIPFlowHash) Reset() { *m = SetIPFlowHash{} } 4375 func (*SetIPFlowHash) GetMessageName() string { return "set_ip_flow_hash" } 4376 func (*SetIPFlowHash) GetCrcString() string { return "084ee09e" } 4377 func (*SetIPFlowHash) GetMessageType() api.MessageType { 4378 return api.RequestMessage 4379 } 4380 4381 func (m *SetIPFlowHash) Size() (size int) { 4382 if m == nil { 4383 return 0 4384 } 4385 size += 4 // m.VrfID 4386 size += 1 // m.IsIPv6 4387 size += 1 // m.Src 4388 size += 1 // m.Dst 4389 size += 1 // m.Sport 4390 size += 1 // m.Dport 4391 size += 1 // m.Proto 4392 size += 1 // m.Reverse 4393 size += 1 // m.Symmetric 4394 return size 4395 } 4396 func (m *SetIPFlowHash) Marshal(b []byte) ([]byte, error) { 4397 if b == nil { 4398 b = make([]byte, m.Size()) 4399 } 4400 buf := codec.NewBuffer(b) 4401 buf.EncodeUint32(m.VrfID) 4402 buf.EncodeBool(m.IsIPv6) 4403 buf.EncodeBool(m.Src) 4404 buf.EncodeBool(m.Dst) 4405 buf.EncodeBool(m.Sport) 4406 buf.EncodeBool(m.Dport) 4407 buf.EncodeBool(m.Proto) 4408 buf.EncodeBool(m.Reverse) 4409 buf.EncodeBool(m.Symmetric) 4410 return buf.Bytes(), nil 4411 } 4412 func (m *SetIPFlowHash) Unmarshal(b []byte) error { 4413 buf := codec.NewBuffer(b) 4414 m.VrfID = buf.DecodeUint32() 4415 m.IsIPv6 = buf.DecodeBool() 4416 m.Src = buf.DecodeBool() 4417 m.Dst = buf.DecodeBool() 4418 m.Sport = buf.DecodeBool() 4419 m.Dport = buf.DecodeBool() 4420 m.Proto = buf.DecodeBool() 4421 m.Reverse = buf.DecodeBool() 4422 m.Symmetric = buf.DecodeBool() 4423 return nil 4424 } 4425 4426 // SetIPFlowHashReply defines message 'set_ip_flow_hash_reply'. 4427 // Deprecated: the message will be removed in the future versions 4428 type SetIPFlowHashReply struct { 4429 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 4430 } 4431 4432 func (m *SetIPFlowHashReply) Reset() { *m = SetIPFlowHashReply{} } 4433 func (*SetIPFlowHashReply) GetMessageName() string { return "set_ip_flow_hash_reply" } 4434 func (*SetIPFlowHashReply) GetCrcString() string { return "e8d4e804" } 4435 func (*SetIPFlowHashReply) GetMessageType() api.MessageType { 4436 return api.ReplyMessage 4437 } 4438 4439 func (m *SetIPFlowHashReply) Size() (size int) { 4440 if m == nil { 4441 return 0 4442 } 4443 size += 4 // m.Retval 4444 return size 4445 } 4446 func (m *SetIPFlowHashReply) Marshal(b []byte) ([]byte, error) { 4447 if b == nil { 4448 b = make([]byte, m.Size()) 4449 } 4450 buf := codec.NewBuffer(b) 4451 buf.EncodeInt32(m.Retval) 4452 return buf.Bytes(), nil 4453 } 4454 func (m *SetIPFlowHashReply) Unmarshal(b []byte) error { 4455 buf := codec.NewBuffer(b) 4456 m.Retval = buf.DecodeInt32() 4457 return nil 4458 } 4459 4460 // Set the ip flow hash router ID 4461 // - router_id - The ID of the router. Mixed into the hash. 4462 // Used to prevent polarisation across a network, 4463 // since each router is assumed to have a different ID 4464 // 4465 // SetIPFlowHashRouterID defines message 'set_ip_flow_hash_router_id'. 4466 type SetIPFlowHashRouterID struct { 4467 RouterID uint32 `binapi:"u32,name=router_id" json:"router_id,omitempty"` 4468 } 4469 4470 func (m *SetIPFlowHashRouterID) Reset() { *m = SetIPFlowHashRouterID{} } 4471 func (*SetIPFlowHashRouterID) GetMessageName() string { return "set_ip_flow_hash_router_id" } 4472 func (*SetIPFlowHashRouterID) GetCrcString() string { return "03e4f48e" } 4473 func (*SetIPFlowHashRouterID) GetMessageType() api.MessageType { 4474 return api.RequestMessage 4475 } 4476 4477 func (m *SetIPFlowHashRouterID) Size() (size int) { 4478 if m == nil { 4479 return 0 4480 } 4481 size += 4 // m.RouterID 4482 return size 4483 } 4484 func (m *SetIPFlowHashRouterID) Marshal(b []byte) ([]byte, error) { 4485 if b == nil { 4486 b = make([]byte, m.Size()) 4487 } 4488 buf := codec.NewBuffer(b) 4489 buf.EncodeUint32(m.RouterID) 4490 return buf.Bytes(), nil 4491 } 4492 func (m *SetIPFlowHashRouterID) Unmarshal(b []byte) error { 4493 buf := codec.NewBuffer(b) 4494 m.RouterID = buf.DecodeUint32() 4495 return nil 4496 } 4497 4498 // SetIPFlowHashRouterIDReply defines message 'set_ip_flow_hash_router_id_reply'. 4499 type SetIPFlowHashRouterIDReply struct { 4500 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 4501 } 4502 4503 func (m *SetIPFlowHashRouterIDReply) Reset() { *m = SetIPFlowHashRouterIDReply{} } 4504 func (*SetIPFlowHashRouterIDReply) GetMessageName() string { return "set_ip_flow_hash_router_id_reply" } 4505 func (*SetIPFlowHashRouterIDReply) GetCrcString() string { return "e8d4e804" } 4506 func (*SetIPFlowHashRouterIDReply) GetMessageType() api.MessageType { 4507 return api.ReplyMessage 4508 } 4509 4510 func (m *SetIPFlowHashRouterIDReply) Size() (size int) { 4511 if m == nil { 4512 return 0 4513 } 4514 size += 4 // m.Retval 4515 return size 4516 } 4517 func (m *SetIPFlowHashRouterIDReply) Marshal(b []byte) ([]byte, error) { 4518 if b == nil { 4519 b = make([]byte, m.Size()) 4520 } 4521 buf := codec.NewBuffer(b) 4522 buf.EncodeInt32(m.Retval) 4523 return buf.Bytes(), nil 4524 } 4525 func (m *SetIPFlowHashRouterIDReply) Unmarshal(b []byte) error { 4526 buf := codec.NewBuffer(b) 4527 m.Retval = buf.DecodeInt32() 4528 return nil 4529 } 4530 4531 // @brief flow hash settings for an IP table 4532 // - src - include src in flow hash 4533 // - dst - include dst in flow hash 4534 // - sport - include sport in flow hash 4535 // - dport - include dport in flow hash 4536 // - proto - include proto in flow hash 4537 // - reverse - include reverse in flow hash 4538 // - symmetric - include symmetry in flow hash 4539 // - flowlabel - include flowlabel in flow hash 4540 // 4541 // SetIPFlowHashV2 defines message 'set_ip_flow_hash_v2'. 4542 type SetIPFlowHashV2 struct { 4543 TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"` 4544 Af ip_types.AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"` 4545 FlowHashConfig IPFlowHashConfig `binapi:"ip_flow_hash_config,name=flow_hash_config" json:"flow_hash_config,omitempty"` 4546 } 4547 4548 func (m *SetIPFlowHashV2) Reset() { *m = SetIPFlowHashV2{} } 4549 func (*SetIPFlowHashV2) GetMessageName() string { return "set_ip_flow_hash_v2" } 4550 func (*SetIPFlowHashV2) GetCrcString() string { return "6d132100" } 4551 func (*SetIPFlowHashV2) GetMessageType() api.MessageType { 4552 return api.RequestMessage 4553 } 4554 4555 func (m *SetIPFlowHashV2) Size() (size int) { 4556 if m == nil { 4557 return 0 4558 } 4559 size += 4 // m.TableID 4560 size += 1 // m.Af 4561 size += 4 // m.FlowHashConfig 4562 return size 4563 } 4564 func (m *SetIPFlowHashV2) Marshal(b []byte) ([]byte, error) { 4565 if b == nil { 4566 b = make([]byte, m.Size()) 4567 } 4568 buf := codec.NewBuffer(b) 4569 buf.EncodeUint32(m.TableID) 4570 buf.EncodeUint8(uint8(m.Af)) 4571 buf.EncodeUint32(uint32(m.FlowHashConfig)) 4572 return buf.Bytes(), nil 4573 } 4574 func (m *SetIPFlowHashV2) Unmarshal(b []byte) error { 4575 buf := codec.NewBuffer(b) 4576 m.TableID = buf.DecodeUint32() 4577 m.Af = ip_types.AddressFamily(buf.DecodeUint8()) 4578 m.FlowHashConfig = IPFlowHashConfig(buf.DecodeUint32()) 4579 return nil 4580 } 4581 4582 // SetIPFlowHashV2Reply defines message 'set_ip_flow_hash_v2_reply'. 4583 type SetIPFlowHashV2Reply struct { 4584 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 4585 } 4586 4587 func (m *SetIPFlowHashV2Reply) Reset() { *m = SetIPFlowHashV2Reply{} } 4588 func (*SetIPFlowHashV2Reply) GetMessageName() string { return "set_ip_flow_hash_v2_reply" } 4589 func (*SetIPFlowHashV2Reply) GetCrcString() string { return "e8d4e804" } 4590 func (*SetIPFlowHashV2Reply) GetMessageType() api.MessageType { 4591 return api.ReplyMessage 4592 } 4593 4594 func (m *SetIPFlowHashV2Reply) Size() (size int) { 4595 if m == nil { 4596 return 0 4597 } 4598 size += 4 // m.Retval 4599 return size 4600 } 4601 func (m *SetIPFlowHashV2Reply) Marshal(b []byte) ([]byte, error) { 4602 if b == nil { 4603 b = make([]byte, m.Size()) 4604 } 4605 buf := codec.NewBuffer(b) 4606 buf.EncodeInt32(m.Retval) 4607 return buf.Bytes(), nil 4608 } 4609 func (m *SetIPFlowHashV2Reply) Unmarshal(b []byte) error { 4610 buf := codec.NewBuffer(b) 4611 m.Retval = buf.DecodeInt32() 4612 return nil 4613 } 4614 4615 // @brief flow hash settings for an IP table 4616 // - src - include src in flow hash 4617 // - dst - include dst in flow hash 4618 // - sport - include sport in flow hash 4619 // - dport - include dport in flow hash 4620 // - proto - include proto in flow hash 4621 // - reverse - include reverse in flow hash 4622 // - symmetric - include symmetry in flow hash 4623 // - flowlabel - include flowlabel in flow hash 4624 // - gtpv1teid - include gtpv1teid in flow hash 4625 // 4626 // SetIPFlowHashV3 defines message 'set_ip_flow_hash_v3'. 4627 // InProgress: the message form may change in the future versions 4628 type SetIPFlowHashV3 struct { 4629 TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"` 4630 Af ip_types.AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"` 4631 FlowHashConfig IPFlowHashConfigV2 `binapi:"ip_flow_hash_config_v2,name=flow_hash_config" json:"flow_hash_config,omitempty"` 4632 } 4633 4634 func (m *SetIPFlowHashV3) Reset() { *m = SetIPFlowHashV3{} } 4635 func (*SetIPFlowHashV3) GetMessageName() string { return "set_ip_flow_hash_v3" } 4636 func (*SetIPFlowHashV3) GetCrcString() string { return "b7876e07" } 4637 func (*SetIPFlowHashV3) GetMessageType() api.MessageType { 4638 return api.RequestMessage 4639 } 4640 4641 func (m *SetIPFlowHashV3) Size() (size int) { 4642 if m == nil { 4643 return 0 4644 } 4645 size += 4 // m.TableID 4646 size += 1 // m.Af 4647 size += 4 // m.FlowHashConfig 4648 return size 4649 } 4650 func (m *SetIPFlowHashV3) Marshal(b []byte) ([]byte, error) { 4651 if b == nil { 4652 b = make([]byte, m.Size()) 4653 } 4654 buf := codec.NewBuffer(b) 4655 buf.EncodeUint32(m.TableID) 4656 buf.EncodeUint8(uint8(m.Af)) 4657 buf.EncodeUint32(uint32(m.FlowHashConfig)) 4658 return buf.Bytes(), nil 4659 } 4660 func (m *SetIPFlowHashV3) Unmarshal(b []byte) error { 4661 buf := codec.NewBuffer(b) 4662 m.TableID = buf.DecodeUint32() 4663 m.Af = ip_types.AddressFamily(buf.DecodeUint8()) 4664 m.FlowHashConfig = IPFlowHashConfigV2(buf.DecodeUint32()) 4665 return nil 4666 } 4667 4668 // SetIPFlowHashV3Reply defines message 'set_ip_flow_hash_v3_reply'. 4669 // InProgress: the message form may change in the future versions 4670 type SetIPFlowHashV3Reply struct { 4671 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 4672 } 4673 4674 func (m *SetIPFlowHashV3Reply) Reset() { *m = SetIPFlowHashV3Reply{} } 4675 func (*SetIPFlowHashV3Reply) GetMessageName() string { return "set_ip_flow_hash_v3_reply" } 4676 func (*SetIPFlowHashV3Reply) GetCrcString() string { return "e8d4e804" } 4677 func (*SetIPFlowHashV3Reply) GetMessageType() api.MessageType { 4678 return api.ReplyMessage 4679 } 4680 4681 func (m *SetIPFlowHashV3Reply) Size() (size int) { 4682 if m == nil { 4683 return 0 4684 } 4685 size += 4 // m.Retval 4686 return size 4687 } 4688 func (m *SetIPFlowHashV3Reply) Marshal(b []byte) ([]byte, error) { 4689 if b == nil { 4690 b = make([]byte, m.Size()) 4691 } 4692 buf := codec.NewBuffer(b) 4693 buf.EncodeInt32(m.Retval) 4694 return buf.Bytes(), nil 4695 } 4696 func (m *SetIPFlowHashV3Reply) Unmarshal(b []byte) error { 4697 buf := codec.NewBuffer(b) 4698 m.Retval = buf.DecodeInt32() 4699 return nil 4700 } 4701 4702 // IPv6 interface enable / disable request 4703 // - sw_if_index - interface used to reach neighbor 4704 // - enable - if non-zero enable ip6 on interface, else disable 4705 // 4706 // SwInterfaceIP6EnableDisable defines message 'sw_interface_ip6_enable_disable'. 4707 type SwInterfaceIP6EnableDisable struct { 4708 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 4709 Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"` 4710 } 4711 4712 func (m *SwInterfaceIP6EnableDisable) Reset() { *m = SwInterfaceIP6EnableDisable{} } 4713 func (*SwInterfaceIP6EnableDisable) GetMessageName() string { return "sw_interface_ip6_enable_disable" } 4714 func (*SwInterfaceIP6EnableDisable) GetCrcString() string { return "ae6cfcfb" } 4715 func (*SwInterfaceIP6EnableDisable) GetMessageType() api.MessageType { 4716 return api.RequestMessage 4717 } 4718 4719 func (m *SwInterfaceIP6EnableDisable) Size() (size int) { 4720 if m == nil { 4721 return 0 4722 } 4723 size += 4 // m.SwIfIndex 4724 size += 1 // m.Enable 4725 return size 4726 } 4727 func (m *SwInterfaceIP6EnableDisable) Marshal(b []byte) ([]byte, error) { 4728 if b == nil { 4729 b = make([]byte, m.Size()) 4730 } 4731 buf := codec.NewBuffer(b) 4732 buf.EncodeUint32(uint32(m.SwIfIndex)) 4733 buf.EncodeBool(m.Enable) 4734 return buf.Bytes(), nil 4735 } 4736 func (m *SwInterfaceIP6EnableDisable) Unmarshal(b []byte) error { 4737 buf := codec.NewBuffer(b) 4738 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 4739 m.Enable = buf.DecodeBool() 4740 return nil 4741 } 4742 4743 // SwInterfaceIP6EnableDisableReply defines message 'sw_interface_ip6_enable_disable_reply'. 4744 type SwInterfaceIP6EnableDisableReply struct { 4745 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 4746 } 4747 4748 func (m *SwInterfaceIP6EnableDisableReply) Reset() { *m = SwInterfaceIP6EnableDisableReply{} } 4749 func (*SwInterfaceIP6EnableDisableReply) GetMessageName() string { 4750 return "sw_interface_ip6_enable_disable_reply" 4751 } 4752 func (*SwInterfaceIP6EnableDisableReply) GetCrcString() string { return "e8d4e804" } 4753 func (*SwInterfaceIP6EnableDisableReply) GetMessageType() api.MessageType { 4754 return api.ReplyMessage 4755 } 4756 4757 func (m *SwInterfaceIP6EnableDisableReply) Size() (size int) { 4758 if m == nil { 4759 return 0 4760 } 4761 size += 4 // m.Retval 4762 return size 4763 } 4764 func (m *SwInterfaceIP6EnableDisableReply) Marshal(b []byte) ([]byte, error) { 4765 if b == nil { 4766 b = make([]byte, m.Size()) 4767 } 4768 buf := codec.NewBuffer(b) 4769 buf.EncodeInt32(m.Retval) 4770 return buf.Bytes(), nil 4771 } 4772 func (m *SwInterfaceIP6EnableDisableReply) Unmarshal(b []byte) error { 4773 buf := codec.NewBuffer(b) 4774 m.Retval = buf.DecodeInt32() 4775 return nil 4776 } 4777 4778 // IPv6 get link local address on interface request 4779 // - sw_if_index - interface to set link local on 4780 // 4781 // SwInterfaceIP6GetLinkLocalAddress defines message 'sw_interface_ip6_get_link_local_address'. 4782 type SwInterfaceIP6GetLinkLocalAddress struct { 4783 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 4784 } 4785 4786 func (m *SwInterfaceIP6GetLinkLocalAddress) Reset() { *m = SwInterfaceIP6GetLinkLocalAddress{} } 4787 func (*SwInterfaceIP6GetLinkLocalAddress) GetMessageName() string { 4788 return "sw_interface_ip6_get_link_local_address" 4789 } 4790 func (*SwInterfaceIP6GetLinkLocalAddress) GetCrcString() string { return "f9e6675e" } 4791 func (*SwInterfaceIP6GetLinkLocalAddress) GetMessageType() api.MessageType { 4792 return api.RequestMessage 4793 } 4794 4795 func (m *SwInterfaceIP6GetLinkLocalAddress) Size() (size int) { 4796 if m == nil { 4797 return 0 4798 } 4799 size += 4 // m.SwIfIndex 4800 return size 4801 } 4802 func (m *SwInterfaceIP6GetLinkLocalAddress) Marshal(b []byte) ([]byte, error) { 4803 if b == nil { 4804 b = make([]byte, m.Size()) 4805 } 4806 buf := codec.NewBuffer(b) 4807 buf.EncodeUint32(uint32(m.SwIfIndex)) 4808 return buf.Bytes(), nil 4809 } 4810 func (m *SwInterfaceIP6GetLinkLocalAddress) Unmarshal(b []byte) error { 4811 buf := codec.NewBuffer(b) 4812 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 4813 return nil 4814 } 4815 4816 // IPv6 link local address detail 4817 // - ip - the link local address 4818 // 4819 // SwInterfaceIP6GetLinkLocalAddressReply defines message 'sw_interface_ip6_get_link_local_address_reply'. 4820 type SwInterfaceIP6GetLinkLocalAddressReply struct { 4821 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 4822 IP ip_types.IP6Address `binapi:"ip6_address,name=ip" json:"ip,omitempty"` 4823 } 4824 4825 func (m *SwInterfaceIP6GetLinkLocalAddressReply) Reset() { 4826 *m = SwInterfaceIP6GetLinkLocalAddressReply{} 4827 } 4828 func (*SwInterfaceIP6GetLinkLocalAddressReply) GetMessageName() string { 4829 return "sw_interface_ip6_get_link_local_address_reply" 4830 } 4831 func (*SwInterfaceIP6GetLinkLocalAddressReply) GetCrcString() string { return "d16b7130" } 4832 func (*SwInterfaceIP6GetLinkLocalAddressReply) GetMessageType() api.MessageType { 4833 return api.ReplyMessage 4834 } 4835 4836 func (m *SwInterfaceIP6GetLinkLocalAddressReply) Size() (size int) { 4837 if m == nil { 4838 return 0 4839 } 4840 size += 4 // m.Retval 4841 size += 1 * 16 // m.IP 4842 return size 4843 } 4844 func (m *SwInterfaceIP6GetLinkLocalAddressReply) Marshal(b []byte) ([]byte, error) { 4845 if b == nil { 4846 b = make([]byte, m.Size()) 4847 } 4848 buf := codec.NewBuffer(b) 4849 buf.EncodeInt32(m.Retval) 4850 buf.EncodeBytes(m.IP[:], 16) 4851 return buf.Bytes(), nil 4852 } 4853 func (m *SwInterfaceIP6GetLinkLocalAddressReply) Unmarshal(b []byte) error { 4854 buf := codec.NewBuffer(b) 4855 m.Retval = buf.DecodeInt32() 4856 copy(m.IP[:], buf.DecodeBytes(16)) 4857 return nil 4858 } 4859 4860 // IPv6 set link local address on interface request 4861 // - sw_if_index - interface to set link local on 4862 // - ip - the new link local address 4863 // 4864 // SwInterfaceIP6SetLinkLocalAddress defines message 'sw_interface_ip6_set_link_local_address'. 4865 type SwInterfaceIP6SetLinkLocalAddress struct { 4866 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 4867 IP ip_types.IP6Address `binapi:"ip6_address,name=ip" json:"ip,omitempty"` 4868 } 4869 4870 func (m *SwInterfaceIP6SetLinkLocalAddress) Reset() { *m = SwInterfaceIP6SetLinkLocalAddress{} } 4871 func (*SwInterfaceIP6SetLinkLocalAddress) GetMessageName() string { 4872 return "sw_interface_ip6_set_link_local_address" 4873 } 4874 func (*SwInterfaceIP6SetLinkLocalAddress) GetCrcString() string { return "1c10f15f" } 4875 func (*SwInterfaceIP6SetLinkLocalAddress) GetMessageType() api.MessageType { 4876 return api.RequestMessage 4877 } 4878 4879 func (m *SwInterfaceIP6SetLinkLocalAddress) Size() (size int) { 4880 if m == nil { 4881 return 0 4882 } 4883 size += 4 // m.SwIfIndex 4884 size += 1 * 16 // m.IP 4885 return size 4886 } 4887 func (m *SwInterfaceIP6SetLinkLocalAddress) Marshal(b []byte) ([]byte, error) { 4888 if b == nil { 4889 b = make([]byte, m.Size()) 4890 } 4891 buf := codec.NewBuffer(b) 4892 buf.EncodeUint32(uint32(m.SwIfIndex)) 4893 buf.EncodeBytes(m.IP[:], 16) 4894 return buf.Bytes(), nil 4895 } 4896 func (m *SwInterfaceIP6SetLinkLocalAddress) Unmarshal(b []byte) error { 4897 buf := codec.NewBuffer(b) 4898 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 4899 copy(m.IP[:], buf.DecodeBytes(16)) 4900 return nil 4901 } 4902 4903 // SwInterfaceIP6SetLinkLocalAddressReply defines message 'sw_interface_ip6_set_link_local_address_reply'. 4904 type SwInterfaceIP6SetLinkLocalAddressReply struct { 4905 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 4906 } 4907 4908 func (m *SwInterfaceIP6SetLinkLocalAddressReply) Reset() { 4909 *m = SwInterfaceIP6SetLinkLocalAddressReply{} 4910 } 4911 func (*SwInterfaceIP6SetLinkLocalAddressReply) GetMessageName() string { 4912 return "sw_interface_ip6_set_link_local_address_reply" 4913 } 4914 func (*SwInterfaceIP6SetLinkLocalAddressReply) GetCrcString() string { return "e8d4e804" } 4915 func (*SwInterfaceIP6SetLinkLocalAddressReply) GetMessageType() api.MessageType { 4916 return api.ReplyMessage 4917 } 4918 4919 func (m *SwInterfaceIP6SetLinkLocalAddressReply) Size() (size int) { 4920 if m == nil { 4921 return 0 4922 } 4923 size += 4 // m.Retval 4924 return size 4925 } 4926 func (m *SwInterfaceIP6SetLinkLocalAddressReply) Marshal(b []byte) ([]byte, error) { 4927 if b == nil { 4928 b = make([]byte, m.Size()) 4929 } 4930 buf := codec.NewBuffer(b) 4931 buf.EncodeInt32(m.Retval) 4932 return buf.Bytes(), nil 4933 } 4934 func (m *SwInterfaceIP6SetLinkLocalAddressReply) Unmarshal(b []byte) error { 4935 buf := codec.NewBuffer(b) 4936 m.Retval = buf.DecodeInt32() 4937 return nil 4938 } 4939 4940 func init() { file_ip_binapi_init() } 4941 func file_ip_binapi_init() { 4942 api.RegisterMessage((*AddDelIPPuntRedirectV2)(nil), "add_del_ip_punt_redirect_v2_9e804227") 4943 api.RegisterMessage((*AddDelIPPuntRedirectV2Reply)(nil), "add_del_ip_punt_redirect_v2_reply_e8d4e804") 4944 api.RegisterMessage((*IoamDisable)(nil), "ioam_disable_6b16a45e") 4945 api.RegisterMessage((*IoamDisableReply)(nil), "ioam_disable_reply_e8d4e804") 4946 api.RegisterMessage((*IoamEnable)(nil), "ioam_enable_51ccd868") 4947 api.RegisterMessage((*IoamEnableReply)(nil), "ioam_enable_reply_e8d4e804") 4948 api.RegisterMessage((*IPAddressDetails)(nil), "ip_address_details_ee29b797") 4949 api.RegisterMessage((*IPAddressDump)(nil), "ip_address_dump_2d033de4") 4950 api.RegisterMessage((*IPContainerProxyAddDel)(nil), "ip_container_proxy_add_del_7df1dff1") 4951 api.RegisterMessage((*IPContainerProxyAddDelReply)(nil), "ip_container_proxy_add_del_reply_e8d4e804") 4952 api.RegisterMessage((*IPContainerProxyDetails)(nil), "ip_container_proxy_details_a8085523") 4953 api.RegisterMessage((*IPContainerProxyDump)(nil), "ip_container_proxy_dump_51077d14") 4954 api.RegisterMessage((*IPDetails)(nil), "ip_details_eb152d07") 4955 api.RegisterMessage((*IPDump)(nil), "ip_dump_98d231ca") 4956 api.RegisterMessage((*IPLocalReassEnableDisable)(nil), "ip_local_reass_enable_disable_34e2ccc4") 4957 api.RegisterMessage((*IPLocalReassEnableDisableReply)(nil), "ip_local_reass_enable_disable_reply_e8d4e804") 4958 api.RegisterMessage((*IPLocalReassGet)(nil), "ip_local_reass_get_51077d14") 4959 api.RegisterMessage((*IPLocalReassGetReply)(nil), "ip_local_reass_get_reply_3e93a702") 4960 api.RegisterMessage((*IPMrouteAddDel)(nil), "ip_mroute_add_del_0dd7e790") 4961 api.RegisterMessage((*IPMrouteAddDelReply)(nil), "ip_mroute_add_del_reply_1992deab") 4962 api.RegisterMessage((*IPMrouteDetails)(nil), "ip_mroute_details_c5cb23fc") 4963 api.RegisterMessage((*IPMrouteDump)(nil), "ip_mroute_dump_b9d2e09e") 4964 api.RegisterMessage((*IPMtableDetails)(nil), "ip_mtable_details_b9d2e09e") 4965 api.RegisterMessage((*IPMtableDump)(nil), "ip_mtable_dump_51077d14") 4966 api.RegisterMessage((*IPPathMtuDetails)(nil), "ip_path_mtu_details_ac9539a7") 4967 api.RegisterMessage((*IPPathMtuGet)(nil), "ip_path_mtu_get_f75ba505") 4968 api.RegisterMessage((*IPPathMtuGetReply)(nil), "ip_path_mtu_get_reply_53b48f5d") 4969 api.RegisterMessage((*IPPathMtuReplaceBegin)(nil), "ip_path_mtu_replace_begin_51077d14") 4970 api.RegisterMessage((*IPPathMtuReplaceBeginReply)(nil), "ip_path_mtu_replace_begin_reply_e8d4e804") 4971 api.RegisterMessage((*IPPathMtuReplaceEnd)(nil), "ip_path_mtu_replace_end_51077d14") 4972 api.RegisterMessage((*IPPathMtuReplaceEndReply)(nil), "ip_path_mtu_replace_end_reply_e8d4e804") 4973 api.RegisterMessage((*IPPathMtuUpdate)(nil), "ip_path_mtu_update_10bbe5cb") 4974 api.RegisterMessage((*IPPathMtuUpdateReply)(nil), "ip_path_mtu_update_reply_e8d4e804") 4975 api.RegisterMessage((*IPPuntPolice)(nil), "ip_punt_police_db867cea") 4976 api.RegisterMessage((*IPPuntPoliceReply)(nil), "ip_punt_police_reply_e8d4e804") 4977 api.RegisterMessage((*IPPuntRedirect)(nil), "ip_punt_redirect_6580f635") 4978 api.RegisterMessage((*IPPuntRedirectDetails)(nil), "ip_punt_redirect_details_2cef63e7") 4979 api.RegisterMessage((*IPPuntRedirectDump)(nil), "ip_punt_redirect_dump_2d033de4") 4980 api.RegisterMessage((*IPPuntRedirectReply)(nil), "ip_punt_redirect_reply_e8d4e804") 4981 api.RegisterMessage((*IPPuntRedirectV2Details)(nil), "ip_punt_redirect_v2_details_7ba42e1d") 4982 api.RegisterMessage((*IPPuntRedirectV2Dump)(nil), "ip_punt_redirect_v2_dump_d817a484") 4983 api.RegisterMessage((*IPReassemblyEnableDisable)(nil), "ip_reassembly_enable_disable_eb77968d") 4984 api.RegisterMessage((*IPReassemblyEnableDisableReply)(nil), "ip_reassembly_enable_disable_reply_e8d4e804") 4985 api.RegisterMessage((*IPReassemblyGet)(nil), "ip_reassembly_get_ea13ff63") 4986 api.RegisterMessage((*IPReassemblyGetReply)(nil), "ip_reassembly_get_reply_d5eb8d34") 4987 api.RegisterMessage((*IPReassemblySet)(nil), "ip_reassembly_set_16467d25") 4988 api.RegisterMessage((*IPReassemblySetReply)(nil), "ip_reassembly_set_reply_e8d4e804") 4989 api.RegisterMessage((*IPRouteAddDel)(nil), "ip_route_add_del_b8ecfe0d") 4990 api.RegisterMessage((*IPRouteAddDelReply)(nil), "ip_route_add_del_reply_1992deab") 4991 api.RegisterMessage((*IPRouteAddDelV2)(nil), "ip_route_add_del_v2_521ef330") 4992 api.RegisterMessage((*IPRouteAddDelV2Reply)(nil), "ip_route_add_del_v2_reply_1992deab") 4993 api.RegisterMessage((*IPRouteDetails)(nil), "ip_route_details_bda8f315") 4994 api.RegisterMessage((*IPRouteDump)(nil), "ip_route_dump_b9d2e09e") 4995 api.RegisterMessage((*IPRouteLookup)(nil), "ip_route_lookup_710d6471") 4996 api.RegisterMessage((*IPRouteLookupReply)(nil), "ip_route_lookup_reply_5d8febcb") 4997 api.RegisterMessage((*IPRouteLookupV2)(nil), "ip_route_lookup_v2_710d6471") 4998 api.RegisterMessage((*IPRouteLookupV2Reply)(nil), "ip_route_lookup_v2_reply_84cc9e03") 4999 api.RegisterMessage((*IPRouteV2Details)(nil), "ip_route_v2_details_b09aa6c0") 5000 api.RegisterMessage((*IPRouteV2Dump)(nil), "ip_route_v2_dump_d16f72e6") 5001 api.RegisterMessage((*IPSourceAndPortRangeCheckAddDel)(nil), "ip_source_and_port_range_check_add_del_92a067e3") 5002 api.RegisterMessage((*IPSourceAndPortRangeCheckAddDelReply)(nil), "ip_source_and_port_range_check_add_del_reply_e8d4e804") 5003 api.RegisterMessage((*IPSourceAndPortRangeCheckInterfaceAddDel)(nil), "ip_source_and_port_range_check_interface_add_del_e1ba8987") 5004 api.RegisterMessage((*IPSourceAndPortRangeCheckInterfaceAddDelReply)(nil), "ip_source_and_port_range_check_interface_add_del_reply_e8d4e804") 5005 api.RegisterMessage((*IPTableAddDel)(nil), "ip_table_add_del_0ffdaec0") 5006 api.RegisterMessage((*IPTableAddDelReply)(nil), "ip_table_add_del_reply_e8d4e804") 5007 api.RegisterMessage((*IPTableAllocate)(nil), "ip_table_allocate_b9d2e09e") 5008 api.RegisterMessage((*IPTableAllocateReply)(nil), "ip_table_allocate_reply_1728303a") 5009 api.RegisterMessage((*IPTableDetails)(nil), "ip_table_details_c79fca0f") 5010 api.RegisterMessage((*IPTableDump)(nil), "ip_table_dump_51077d14") 5011 api.RegisterMessage((*IPTableFlush)(nil), "ip_table_flush_b9d2e09e") 5012 api.RegisterMessage((*IPTableFlushReply)(nil), "ip_table_flush_reply_e8d4e804") 5013 api.RegisterMessage((*IPTableReplaceBegin)(nil), "ip_table_replace_begin_b9d2e09e") 5014 api.RegisterMessage((*IPTableReplaceBeginReply)(nil), "ip_table_replace_begin_reply_e8d4e804") 5015 api.RegisterMessage((*IPTableReplaceEnd)(nil), "ip_table_replace_end_b9d2e09e") 5016 api.RegisterMessage((*IPTableReplaceEndReply)(nil), "ip_table_replace_end_reply_e8d4e804") 5017 api.RegisterMessage((*IPUnnumberedDetails)(nil), "ip_unnumbered_details_cc59bd42") 5018 api.RegisterMessage((*IPUnnumberedDump)(nil), "ip_unnumbered_dump_f9e6675e") 5019 api.RegisterMessage((*MfibSignalDetails)(nil), "mfib_signal_details_6f4a4cfb") 5020 api.RegisterMessage((*MfibSignalDump)(nil), "mfib_signal_dump_51077d14") 5021 api.RegisterMessage((*SetIPFlowHash)(nil), "set_ip_flow_hash_084ee09e") 5022 api.RegisterMessage((*SetIPFlowHashReply)(nil), "set_ip_flow_hash_reply_e8d4e804") 5023 api.RegisterMessage((*SetIPFlowHashRouterID)(nil), "set_ip_flow_hash_router_id_03e4f48e") 5024 api.RegisterMessage((*SetIPFlowHashRouterIDReply)(nil), "set_ip_flow_hash_router_id_reply_e8d4e804") 5025 api.RegisterMessage((*SetIPFlowHashV2)(nil), "set_ip_flow_hash_v2_6d132100") 5026 api.RegisterMessage((*SetIPFlowHashV2Reply)(nil), "set_ip_flow_hash_v2_reply_e8d4e804") 5027 api.RegisterMessage((*SetIPFlowHashV3)(nil), "set_ip_flow_hash_v3_b7876e07") 5028 api.RegisterMessage((*SetIPFlowHashV3Reply)(nil), "set_ip_flow_hash_v3_reply_e8d4e804") 5029 api.RegisterMessage((*SwInterfaceIP6EnableDisable)(nil), "sw_interface_ip6_enable_disable_ae6cfcfb") 5030 api.RegisterMessage((*SwInterfaceIP6EnableDisableReply)(nil), "sw_interface_ip6_enable_disable_reply_e8d4e804") 5031 api.RegisterMessage((*SwInterfaceIP6GetLinkLocalAddress)(nil), "sw_interface_ip6_get_link_local_address_f9e6675e") 5032 api.RegisterMessage((*SwInterfaceIP6GetLinkLocalAddressReply)(nil), "sw_interface_ip6_get_link_local_address_reply_d16b7130") 5033 api.RegisterMessage((*SwInterfaceIP6SetLinkLocalAddress)(nil), "sw_interface_ip6_set_link_local_address_1c10f15f") 5034 api.RegisterMessage((*SwInterfaceIP6SetLinkLocalAddressReply)(nil), "sw_interface_ip6_set_link_local_address_reply_e8d4e804") 5035 } 5036 5037 // Messages returns list of all messages in this module. 5038 func AllMessages() []api.Message { 5039 return []api.Message{ 5040 (*AddDelIPPuntRedirectV2)(nil), 5041 (*AddDelIPPuntRedirectV2Reply)(nil), 5042 (*IoamDisable)(nil), 5043 (*IoamDisableReply)(nil), 5044 (*IoamEnable)(nil), 5045 (*IoamEnableReply)(nil), 5046 (*IPAddressDetails)(nil), 5047 (*IPAddressDump)(nil), 5048 (*IPContainerProxyAddDel)(nil), 5049 (*IPContainerProxyAddDelReply)(nil), 5050 (*IPContainerProxyDetails)(nil), 5051 (*IPContainerProxyDump)(nil), 5052 (*IPDetails)(nil), 5053 (*IPDump)(nil), 5054 (*IPLocalReassEnableDisable)(nil), 5055 (*IPLocalReassEnableDisableReply)(nil), 5056 (*IPLocalReassGet)(nil), 5057 (*IPLocalReassGetReply)(nil), 5058 (*IPMrouteAddDel)(nil), 5059 (*IPMrouteAddDelReply)(nil), 5060 (*IPMrouteDetails)(nil), 5061 (*IPMrouteDump)(nil), 5062 (*IPMtableDetails)(nil), 5063 (*IPMtableDump)(nil), 5064 (*IPPathMtuDetails)(nil), 5065 (*IPPathMtuGet)(nil), 5066 (*IPPathMtuGetReply)(nil), 5067 (*IPPathMtuReplaceBegin)(nil), 5068 (*IPPathMtuReplaceBeginReply)(nil), 5069 (*IPPathMtuReplaceEnd)(nil), 5070 (*IPPathMtuReplaceEndReply)(nil), 5071 (*IPPathMtuUpdate)(nil), 5072 (*IPPathMtuUpdateReply)(nil), 5073 (*IPPuntPolice)(nil), 5074 (*IPPuntPoliceReply)(nil), 5075 (*IPPuntRedirect)(nil), 5076 (*IPPuntRedirectDetails)(nil), 5077 (*IPPuntRedirectDump)(nil), 5078 (*IPPuntRedirectReply)(nil), 5079 (*IPPuntRedirectV2Details)(nil), 5080 (*IPPuntRedirectV2Dump)(nil), 5081 (*IPReassemblyEnableDisable)(nil), 5082 (*IPReassemblyEnableDisableReply)(nil), 5083 (*IPReassemblyGet)(nil), 5084 (*IPReassemblyGetReply)(nil), 5085 (*IPReassemblySet)(nil), 5086 (*IPReassemblySetReply)(nil), 5087 (*IPRouteAddDel)(nil), 5088 (*IPRouteAddDelReply)(nil), 5089 (*IPRouteAddDelV2)(nil), 5090 (*IPRouteAddDelV2Reply)(nil), 5091 (*IPRouteDetails)(nil), 5092 (*IPRouteDump)(nil), 5093 (*IPRouteLookup)(nil), 5094 (*IPRouteLookupReply)(nil), 5095 (*IPRouteLookupV2)(nil), 5096 (*IPRouteLookupV2Reply)(nil), 5097 (*IPRouteV2Details)(nil), 5098 (*IPRouteV2Dump)(nil), 5099 (*IPSourceAndPortRangeCheckAddDel)(nil), 5100 (*IPSourceAndPortRangeCheckAddDelReply)(nil), 5101 (*IPSourceAndPortRangeCheckInterfaceAddDel)(nil), 5102 (*IPSourceAndPortRangeCheckInterfaceAddDelReply)(nil), 5103 (*IPTableAddDel)(nil), 5104 (*IPTableAddDelReply)(nil), 5105 (*IPTableAllocate)(nil), 5106 (*IPTableAllocateReply)(nil), 5107 (*IPTableDetails)(nil), 5108 (*IPTableDump)(nil), 5109 (*IPTableFlush)(nil), 5110 (*IPTableFlushReply)(nil), 5111 (*IPTableReplaceBegin)(nil), 5112 (*IPTableReplaceBeginReply)(nil), 5113 (*IPTableReplaceEnd)(nil), 5114 (*IPTableReplaceEndReply)(nil), 5115 (*IPUnnumberedDetails)(nil), 5116 (*IPUnnumberedDump)(nil), 5117 (*MfibSignalDetails)(nil), 5118 (*MfibSignalDump)(nil), 5119 (*SetIPFlowHash)(nil), 5120 (*SetIPFlowHashReply)(nil), 5121 (*SetIPFlowHashRouterID)(nil), 5122 (*SetIPFlowHashRouterIDReply)(nil), 5123 (*SetIPFlowHashV2)(nil), 5124 (*SetIPFlowHashV2Reply)(nil), 5125 (*SetIPFlowHashV3)(nil), 5126 (*SetIPFlowHashV3Reply)(nil), 5127 (*SwInterfaceIP6EnableDisable)(nil), 5128 (*SwInterfaceIP6EnableDisableReply)(nil), 5129 (*SwInterfaceIP6GetLinkLocalAddress)(nil), 5130 (*SwInterfaceIP6GetLinkLocalAddressReply)(nil), 5131 (*SwInterfaceIP6SetLinkLocalAddress)(nil), 5132 (*SwInterfaceIP6SetLinkLocalAddressReply)(nil), 5133 } 5134 }