github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/lisp_gpe/lisp_gpe.ba.go (about) 1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT. 2 // versions: 3 // binapi-generator: v0.10.0-dev 4 // VPP: 23.10-rc0~170-g6f1548434 5 // source: plugins/lisp_gpe.api.json 6 7 // Package lisp_gpe contains generated bindings for API file lisp_gpe.api. 8 // 9 // Contents: 10 // - 3 structs 11 // - 20 messages 12 package lisp_gpe 13 14 import ( 15 _ "github.com/networkservicemesh/govpp/binapi/ethernet_types" 16 interface_types "github.com/networkservicemesh/govpp/binapi/interface_types" 17 ip_types "github.com/networkservicemesh/govpp/binapi/ip_types" 18 lisp_types "github.com/networkservicemesh/govpp/binapi/lisp_types" 19 api "go.fd.io/govpp/api" 20 codec "go.fd.io/govpp/codec" 21 ) 22 23 // This is a compile-time assertion to ensure that this generated file 24 // is compatible with the GoVPP api package it is being compiled against. 25 // A compilation error at this line likely means your copy of the 26 // GoVPP api package needs to be updated. 27 const _ = api.GoVppAPIPackageIsVersion2 28 29 const ( 30 APIFile = "lisp_gpe" 31 APIVersion = "2.0.0" 32 VersionCrc = 0x92611b0 33 ) 34 35 // GpeFwdEntry defines type 'gpe_fwd_entry'. 36 type GpeFwdEntry struct { 37 FwdEntryIndex uint32 `binapi:"u32,name=fwd_entry_index" json:"fwd_entry_index,omitempty"` 38 DpTable uint32 `binapi:"u32,name=dp_table" json:"dp_table,omitempty"` 39 Leid lisp_types.Eid `binapi:"eid,name=leid" json:"leid,omitempty"` 40 Reid lisp_types.Eid `binapi:"eid,name=reid" json:"reid,omitempty"` 41 Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"` 42 Action uint8 `binapi:"u8,name=action" json:"action,omitempty"` 43 } 44 45 // GpeLocator defines type 'gpe_locator'. 46 type GpeLocator struct { 47 Weight uint8 `binapi:"u8,name=weight" json:"weight,omitempty"` 48 Addr ip_types.Address `binapi:"address,name=addr" json:"addr,omitempty"` 49 } 50 51 // GpeNativeFwdRpath defines type 'gpe_native_fwd_rpath'. 52 type GpeNativeFwdRpath struct { 53 FibIndex uint32 `binapi:"u32,name=fib_index" json:"fib_index,omitempty"` 54 NhSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=nh_sw_if_index" json:"nh_sw_if_index,omitempty"` 55 NhAddr ip_types.Address `binapi:"address,name=nh_addr" json:"nh_addr,omitempty"` 56 } 57 58 // add or delete GPE tunnel 59 // - is_add - add address if non-zero, else delete 60 // - rmt_eid - remote eid 61 // - lcl_eid - local eid 62 // - vni - virtual network identifier 63 // - dp_table - vrf/bridge domain id 64 // - action - negative action when 0 locators configured 65 // - loc_num - number of locators 66 // - locs - array of remote locators 67 // 68 // GpeAddDelFwdEntry defines message 'gpe_add_del_fwd_entry'. 69 type GpeAddDelFwdEntry struct { 70 IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"` 71 RmtEid lisp_types.Eid `binapi:"eid,name=rmt_eid" json:"rmt_eid,omitempty"` 72 LclEid lisp_types.Eid `binapi:"eid,name=lcl_eid" json:"lcl_eid,omitempty"` 73 Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"` 74 DpTable uint32 `binapi:"u32,name=dp_table" json:"dp_table,omitempty"` 75 Action uint8 `binapi:"u8,name=action" json:"action,omitempty"` 76 LocNum uint32 `binapi:"u32,name=loc_num" json:"-"` 77 Locs []GpeLocator `binapi:"gpe_locator[loc_num],name=locs" json:"locs,omitempty"` 78 } 79 80 func (m *GpeAddDelFwdEntry) Reset() { *m = GpeAddDelFwdEntry{} } 81 func (*GpeAddDelFwdEntry) GetMessageName() string { return "gpe_add_del_fwd_entry" } 82 func (*GpeAddDelFwdEntry) GetCrcString() string { return "f0847644" } 83 func (*GpeAddDelFwdEntry) GetMessageType() api.MessageType { 84 return api.RequestMessage 85 } 86 87 func (m *GpeAddDelFwdEntry) Size() (size int) { 88 if m == nil { 89 return 0 90 } 91 size += 1 // m.IsAdd 92 size += 1 // m.RmtEid.Type 93 size += 1 * 18 // m.RmtEid.Address 94 size += 1 // m.LclEid.Type 95 size += 1 * 18 // m.LclEid.Address 96 size += 4 // m.Vni 97 size += 4 // m.DpTable 98 size += 1 // m.Action 99 size += 4 // m.LocNum 100 for j1 := 0; j1 < len(m.Locs); j1++ { 101 var s1 GpeLocator 102 _ = s1 103 if j1 < len(m.Locs) { 104 s1 = m.Locs[j1] 105 } 106 size += 1 // s1.Weight 107 size += 1 // s1.Addr.Af 108 size += 1 * 16 // s1.Addr.Un 109 } 110 return size 111 } 112 func (m *GpeAddDelFwdEntry) Marshal(b []byte) ([]byte, error) { 113 if b == nil { 114 b = make([]byte, m.Size()) 115 } 116 buf := codec.NewBuffer(b) 117 buf.EncodeBool(m.IsAdd) 118 buf.EncodeUint8(uint8(m.RmtEid.Type)) 119 buf.EncodeBytes(m.RmtEid.Address.XXX_UnionData[:], 18) 120 buf.EncodeUint8(uint8(m.LclEid.Type)) 121 buf.EncodeBytes(m.LclEid.Address.XXX_UnionData[:], 18) 122 buf.EncodeUint32(m.Vni) 123 buf.EncodeUint32(m.DpTable) 124 buf.EncodeUint8(m.Action) 125 buf.EncodeUint32(uint32(len(m.Locs))) 126 for j0 := 0; j0 < len(m.Locs); j0++ { 127 var v0 GpeLocator // Locs 128 if j0 < len(m.Locs) { 129 v0 = m.Locs[j0] 130 } 131 buf.EncodeUint8(v0.Weight) 132 buf.EncodeUint8(uint8(v0.Addr.Af)) 133 buf.EncodeBytes(v0.Addr.Un.XXX_UnionData[:], 16) 134 } 135 return buf.Bytes(), nil 136 } 137 func (m *GpeAddDelFwdEntry) Unmarshal(b []byte) error { 138 buf := codec.NewBuffer(b) 139 m.IsAdd = buf.DecodeBool() 140 m.RmtEid.Type = lisp_types.EidType(buf.DecodeUint8()) 141 copy(m.RmtEid.Address.XXX_UnionData[:], buf.DecodeBytes(18)) 142 m.LclEid.Type = lisp_types.EidType(buf.DecodeUint8()) 143 copy(m.LclEid.Address.XXX_UnionData[:], buf.DecodeBytes(18)) 144 m.Vni = buf.DecodeUint32() 145 m.DpTable = buf.DecodeUint32() 146 m.Action = buf.DecodeUint8() 147 m.LocNum = buf.DecodeUint32() 148 m.Locs = make([]GpeLocator, m.LocNum) 149 for j0 := 0; j0 < len(m.Locs); j0++ { 150 m.Locs[j0].Weight = buf.DecodeUint8() 151 m.Locs[j0].Addr.Af = ip_types.AddressFamily(buf.DecodeUint8()) 152 copy(m.Locs[j0].Addr.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 153 } 154 return nil 155 } 156 157 // GpeAddDelFwdEntryReply defines message 'gpe_add_del_fwd_entry_reply'. 158 type GpeAddDelFwdEntryReply struct { 159 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 160 FwdEntryIndex uint32 `binapi:"u32,name=fwd_entry_index" json:"fwd_entry_index,omitempty"` 161 } 162 163 func (m *GpeAddDelFwdEntryReply) Reset() { *m = GpeAddDelFwdEntryReply{} } 164 func (*GpeAddDelFwdEntryReply) GetMessageName() string { return "gpe_add_del_fwd_entry_reply" } 165 func (*GpeAddDelFwdEntryReply) GetCrcString() string { return "efe5f176" } 166 func (*GpeAddDelFwdEntryReply) GetMessageType() api.MessageType { 167 return api.ReplyMessage 168 } 169 170 func (m *GpeAddDelFwdEntryReply) Size() (size int) { 171 if m == nil { 172 return 0 173 } 174 size += 4 // m.Retval 175 size += 4 // m.FwdEntryIndex 176 return size 177 } 178 func (m *GpeAddDelFwdEntryReply) Marshal(b []byte) ([]byte, error) { 179 if b == nil { 180 b = make([]byte, m.Size()) 181 } 182 buf := codec.NewBuffer(b) 183 buf.EncodeInt32(m.Retval) 184 buf.EncodeUint32(m.FwdEntryIndex) 185 return buf.Bytes(), nil 186 } 187 func (m *GpeAddDelFwdEntryReply) Unmarshal(b []byte) error { 188 buf := codec.NewBuffer(b) 189 m.Retval = buf.DecodeInt32() 190 m.FwdEntryIndex = buf.DecodeUint32() 191 return nil 192 } 193 194 // add or delete gpe_iface 195 // - is_add - add address if non-zero, else delete 196 // 197 // GpeAddDelIface defines message 'gpe_add_del_iface'. 198 type GpeAddDelIface struct { 199 IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"` 200 IsL2 bool `binapi:"bool,name=is_l2" json:"is_l2,omitempty"` 201 DpTable uint32 `binapi:"u32,name=dp_table" json:"dp_table,omitempty"` 202 Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"` 203 } 204 205 func (m *GpeAddDelIface) Reset() { *m = GpeAddDelIface{} } 206 func (*GpeAddDelIface) GetMessageName() string { return "gpe_add_del_iface" } 207 func (*GpeAddDelIface) GetCrcString() string { return "3ccff273" } 208 func (*GpeAddDelIface) GetMessageType() api.MessageType { 209 return api.RequestMessage 210 } 211 212 func (m *GpeAddDelIface) Size() (size int) { 213 if m == nil { 214 return 0 215 } 216 size += 1 // m.IsAdd 217 size += 1 // m.IsL2 218 size += 4 // m.DpTable 219 size += 4 // m.Vni 220 return size 221 } 222 func (m *GpeAddDelIface) Marshal(b []byte) ([]byte, error) { 223 if b == nil { 224 b = make([]byte, m.Size()) 225 } 226 buf := codec.NewBuffer(b) 227 buf.EncodeBool(m.IsAdd) 228 buf.EncodeBool(m.IsL2) 229 buf.EncodeUint32(m.DpTable) 230 buf.EncodeUint32(m.Vni) 231 return buf.Bytes(), nil 232 } 233 func (m *GpeAddDelIface) Unmarshal(b []byte) error { 234 buf := codec.NewBuffer(b) 235 m.IsAdd = buf.DecodeBool() 236 m.IsL2 = buf.DecodeBool() 237 m.DpTable = buf.DecodeUint32() 238 m.Vni = buf.DecodeUint32() 239 return nil 240 } 241 242 // GpeAddDelIfaceReply defines message 'gpe_add_del_iface_reply'. 243 type GpeAddDelIfaceReply struct { 244 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 245 } 246 247 func (m *GpeAddDelIfaceReply) Reset() { *m = GpeAddDelIfaceReply{} } 248 func (*GpeAddDelIfaceReply) GetMessageName() string { return "gpe_add_del_iface_reply" } 249 func (*GpeAddDelIfaceReply) GetCrcString() string { return "e8d4e804" } 250 func (*GpeAddDelIfaceReply) GetMessageType() api.MessageType { 251 return api.ReplyMessage 252 } 253 254 func (m *GpeAddDelIfaceReply) Size() (size int) { 255 if m == nil { 256 return 0 257 } 258 size += 4 // m.Retval 259 return size 260 } 261 func (m *GpeAddDelIfaceReply) Marshal(b []byte) ([]byte, error) { 262 if b == nil { 263 b = make([]byte, m.Size()) 264 } 265 buf := codec.NewBuffer(b) 266 buf.EncodeInt32(m.Retval) 267 return buf.Bytes(), nil 268 } 269 func (m *GpeAddDelIfaceReply) Unmarshal(b []byte) error { 270 buf := codec.NewBuffer(b) 271 m.Retval = buf.DecodeInt32() 272 return nil 273 } 274 275 // Add native fwd rpath 276 // - retval - return code 277 // - is_add - flag to indicate add or del 278 // - table_id - table id for route path 279 // - nh_sw_if_index - next-hop sw_if_index (~0 if not set) 280 // - is_ip4 - flag to indicate if nh is ip4 281 // - nh_addr - next hop ip address 282 // 283 // GpeAddDelNativeFwdRpath defines message 'gpe_add_del_native_fwd_rpath'. 284 type GpeAddDelNativeFwdRpath struct { 285 IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"` 286 TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"` 287 NhSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=nh_sw_if_index" json:"nh_sw_if_index,omitempty"` 288 NhAddr ip_types.Address `binapi:"address,name=nh_addr" json:"nh_addr,omitempty"` 289 } 290 291 func (m *GpeAddDelNativeFwdRpath) Reset() { *m = GpeAddDelNativeFwdRpath{} } 292 func (*GpeAddDelNativeFwdRpath) GetMessageName() string { return "gpe_add_del_native_fwd_rpath" } 293 func (*GpeAddDelNativeFwdRpath) GetCrcString() string { return "43fc8b54" } 294 func (*GpeAddDelNativeFwdRpath) GetMessageType() api.MessageType { 295 return api.RequestMessage 296 } 297 298 func (m *GpeAddDelNativeFwdRpath) Size() (size int) { 299 if m == nil { 300 return 0 301 } 302 size += 1 // m.IsAdd 303 size += 4 // m.TableID 304 size += 4 // m.NhSwIfIndex 305 size += 1 // m.NhAddr.Af 306 size += 1 * 16 // m.NhAddr.Un 307 return size 308 } 309 func (m *GpeAddDelNativeFwdRpath) Marshal(b []byte) ([]byte, error) { 310 if b == nil { 311 b = make([]byte, m.Size()) 312 } 313 buf := codec.NewBuffer(b) 314 buf.EncodeBool(m.IsAdd) 315 buf.EncodeUint32(m.TableID) 316 buf.EncodeUint32(uint32(m.NhSwIfIndex)) 317 buf.EncodeUint8(uint8(m.NhAddr.Af)) 318 buf.EncodeBytes(m.NhAddr.Un.XXX_UnionData[:], 16) 319 return buf.Bytes(), nil 320 } 321 func (m *GpeAddDelNativeFwdRpath) Unmarshal(b []byte) error { 322 buf := codec.NewBuffer(b) 323 m.IsAdd = buf.DecodeBool() 324 m.TableID = buf.DecodeUint32() 325 m.NhSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 326 m.NhAddr.Af = ip_types.AddressFamily(buf.DecodeUint8()) 327 copy(m.NhAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 328 return nil 329 } 330 331 // GpeAddDelNativeFwdRpathReply defines message 'gpe_add_del_native_fwd_rpath_reply'. 332 type GpeAddDelNativeFwdRpathReply struct { 333 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 334 } 335 336 func (m *GpeAddDelNativeFwdRpathReply) Reset() { *m = GpeAddDelNativeFwdRpathReply{} } 337 func (*GpeAddDelNativeFwdRpathReply) GetMessageName() string { 338 return "gpe_add_del_native_fwd_rpath_reply" 339 } 340 func (*GpeAddDelNativeFwdRpathReply) GetCrcString() string { return "e8d4e804" } 341 func (*GpeAddDelNativeFwdRpathReply) GetMessageType() api.MessageType { 342 return api.ReplyMessage 343 } 344 345 func (m *GpeAddDelNativeFwdRpathReply) Size() (size int) { 346 if m == nil { 347 return 0 348 } 349 size += 4 // m.Retval 350 return size 351 } 352 func (m *GpeAddDelNativeFwdRpathReply) Marshal(b []byte) ([]byte, error) { 353 if b == nil { 354 b = make([]byte, m.Size()) 355 } 356 buf := codec.NewBuffer(b) 357 buf.EncodeInt32(m.Retval) 358 return buf.Bytes(), nil 359 } 360 func (m *GpeAddDelNativeFwdRpathReply) Unmarshal(b []byte) error { 361 buf := codec.NewBuffer(b) 362 m.Retval = buf.DecodeInt32() 363 return nil 364 } 365 366 // enable or disable gpe protocol 367 // - is_enable [default=true] - enable protocol if non-zero, else disable 368 // 369 // GpeEnableDisable defines message 'gpe_enable_disable'. 370 type GpeEnableDisable struct { 371 IsEnable bool `binapi:"bool,name=is_enable,default=true" json:"is_enable,omitempty"` 372 } 373 374 func (m *GpeEnableDisable) Reset() { *m = GpeEnableDisable{} } 375 func (*GpeEnableDisable) GetMessageName() string { return "gpe_enable_disable" } 376 func (*GpeEnableDisable) GetCrcString() string { return "c264d7bf" } 377 func (*GpeEnableDisable) GetMessageType() api.MessageType { 378 return api.RequestMessage 379 } 380 381 func (m *GpeEnableDisable) Size() (size int) { 382 if m == nil { 383 return 0 384 } 385 size += 1 // m.IsEnable 386 return size 387 } 388 func (m *GpeEnableDisable) Marshal(b []byte) ([]byte, error) { 389 if b == nil { 390 b = make([]byte, m.Size()) 391 } 392 buf := codec.NewBuffer(b) 393 buf.EncodeBool(m.IsEnable) 394 return buf.Bytes(), nil 395 } 396 func (m *GpeEnableDisable) Unmarshal(b []byte) error { 397 buf := codec.NewBuffer(b) 398 m.IsEnable = buf.DecodeBool() 399 return nil 400 } 401 402 // GpeEnableDisableReply defines message 'gpe_enable_disable_reply'. 403 type GpeEnableDisableReply struct { 404 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 405 } 406 407 func (m *GpeEnableDisableReply) Reset() { *m = GpeEnableDisableReply{} } 408 func (*GpeEnableDisableReply) GetMessageName() string { return "gpe_enable_disable_reply" } 409 func (*GpeEnableDisableReply) GetCrcString() string { return "e8d4e804" } 410 func (*GpeEnableDisableReply) GetMessageType() api.MessageType { 411 return api.ReplyMessage 412 } 413 414 func (m *GpeEnableDisableReply) Size() (size int) { 415 if m == nil { 416 return 0 417 } 418 size += 4 // m.Retval 419 return size 420 } 421 func (m *GpeEnableDisableReply) Marshal(b []byte) ([]byte, error) { 422 if b == nil { 423 b = make([]byte, m.Size()) 424 } 425 buf := codec.NewBuffer(b) 426 buf.EncodeInt32(m.Retval) 427 return buf.Bytes(), nil 428 } 429 func (m *GpeEnableDisableReply) Unmarshal(b []byte) error { 430 buf := codec.NewBuffer(b) 431 m.Retval = buf.DecodeInt32() 432 return nil 433 } 434 435 // GpeFwdEntriesGet defines message 'gpe_fwd_entries_get'. 436 type GpeFwdEntriesGet struct { 437 Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"` 438 } 439 440 func (m *GpeFwdEntriesGet) Reset() { *m = GpeFwdEntriesGet{} } 441 func (*GpeFwdEntriesGet) GetMessageName() string { return "gpe_fwd_entries_get" } 442 func (*GpeFwdEntriesGet) GetCrcString() string { return "8d1f2fe9" } 443 func (*GpeFwdEntriesGet) GetMessageType() api.MessageType { 444 return api.RequestMessage 445 } 446 447 func (m *GpeFwdEntriesGet) Size() (size int) { 448 if m == nil { 449 return 0 450 } 451 size += 4 // m.Vni 452 return size 453 } 454 func (m *GpeFwdEntriesGet) Marshal(b []byte) ([]byte, error) { 455 if b == nil { 456 b = make([]byte, m.Size()) 457 } 458 buf := codec.NewBuffer(b) 459 buf.EncodeUint32(m.Vni) 460 return buf.Bytes(), nil 461 } 462 func (m *GpeFwdEntriesGet) Unmarshal(b []byte) error { 463 buf := codec.NewBuffer(b) 464 m.Vni = buf.DecodeUint32() 465 return nil 466 } 467 468 // GpeFwdEntriesGetReply defines message 'gpe_fwd_entries_get_reply'. 469 type GpeFwdEntriesGetReply struct { 470 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 471 Count uint32 `binapi:"u32,name=count" json:"-"` 472 Entries []GpeFwdEntry `binapi:"gpe_fwd_entry[count],name=entries" json:"entries,omitempty"` 473 } 474 475 func (m *GpeFwdEntriesGetReply) Reset() { *m = GpeFwdEntriesGetReply{} } 476 func (*GpeFwdEntriesGetReply) GetMessageName() string { return "gpe_fwd_entries_get_reply" } 477 func (*GpeFwdEntriesGetReply) GetCrcString() string { return "c4844876" } 478 func (*GpeFwdEntriesGetReply) GetMessageType() api.MessageType { 479 return api.ReplyMessage 480 } 481 482 func (m *GpeFwdEntriesGetReply) Size() (size int) { 483 if m == nil { 484 return 0 485 } 486 size += 4 // m.Retval 487 size += 4 // m.Count 488 for j1 := 0; j1 < len(m.Entries); j1++ { 489 var s1 GpeFwdEntry 490 _ = s1 491 if j1 < len(m.Entries) { 492 s1 = m.Entries[j1] 493 } 494 size += 4 // s1.FwdEntryIndex 495 size += 4 // s1.DpTable 496 size += 1 // s1.Leid.Type 497 size += 1 * 18 // s1.Leid.Address 498 size += 1 // s1.Reid.Type 499 size += 1 * 18 // s1.Reid.Address 500 size += 4 // s1.Vni 501 size += 1 // s1.Action 502 } 503 return size 504 } 505 func (m *GpeFwdEntriesGetReply) Marshal(b []byte) ([]byte, error) { 506 if b == nil { 507 b = make([]byte, m.Size()) 508 } 509 buf := codec.NewBuffer(b) 510 buf.EncodeInt32(m.Retval) 511 buf.EncodeUint32(uint32(len(m.Entries))) 512 for j0 := 0; j0 < len(m.Entries); j0++ { 513 var v0 GpeFwdEntry // Entries 514 if j0 < len(m.Entries) { 515 v0 = m.Entries[j0] 516 } 517 buf.EncodeUint32(v0.FwdEntryIndex) 518 buf.EncodeUint32(v0.DpTable) 519 buf.EncodeUint8(uint8(v0.Leid.Type)) 520 buf.EncodeBytes(v0.Leid.Address.XXX_UnionData[:], 18) 521 buf.EncodeUint8(uint8(v0.Reid.Type)) 522 buf.EncodeBytes(v0.Reid.Address.XXX_UnionData[:], 18) 523 buf.EncodeUint32(v0.Vni) 524 buf.EncodeUint8(v0.Action) 525 } 526 return buf.Bytes(), nil 527 } 528 func (m *GpeFwdEntriesGetReply) Unmarshal(b []byte) error { 529 buf := codec.NewBuffer(b) 530 m.Retval = buf.DecodeInt32() 531 m.Count = buf.DecodeUint32() 532 m.Entries = make([]GpeFwdEntry, m.Count) 533 for j0 := 0; j0 < len(m.Entries); j0++ { 534 m.Entries[j0].FwdEntryIndex = buf.DecodeUint32() 535 m.Entries[j0].DpTable = buf.DecodeUint32() 536 m.Entries[j0].Leid.Type = lisp_types.EidType(buf.DecodeUint8()) 537 copy(m.Entries[j0].Leid.Address.XXX_UnionData[:], buf.DecodeBytes(18)) 538 m.Entries[j0].Reid.Type = lisp_types.EidType(buf.DecodeUint8()) 539 copy(m.Entries[j0].Reid.Address.XXX_UnionData[:], buf.DecodeBytes(18)) 540 m.Entries[j0].Vni = buf.DecodeUint32() 541 m.Entries[j0].Action = buf.DecodeUint8() 542 } 543 return nil 544 } 545 546 // GpeFwdEntryPathDetails defines message 'gpe_fwd_entry_path_details'. 547 type GpeFwdEntryPathDetails struct { 548 LclLoc GpeLocator `binapi:"gpe_locator,name=lcl_loc" json:"lcl_loc,omitempty"` 549 RmtLoc GpeLocator `binapi:"gpe_locator,name=rmt_loc" json:"rmt_loc,omitempty"` 550 } 551 552 func (m *GpeFwdEntryPathDetails) Reset() { *m = GpeFwdEntryPathDetails{} } 553 func (*GpeFwdEntryPathDetails) GetMessageName() string { return "gpe_fwd_entry_path_details" } 554 func (*GpeFwdEntryPathDetails) GetCrcString() string { return "483df51a" } 555 func (*GpeFwdEntryPathDetails) GetMessageType() api.MessageType { 556 return api.ReplyMessage 557 } 558 559 func (m *GpeFwdEntryPathDetails) Size() (size int) { 560 if m == nil { 561 return 0 562 } 563 size += 1 // m.LclLoc.Weight 564 size += 1 // m.LclLoc.Addr.Af 565 size += 1 * 16 // m.LclLoc.Addr.Un 566 size += 1 // m.RmtLoc.Weight 567 size += 1 // m.RmtLoc.Addr.Af 568 size += 1 * 16 // m.RmtLoc.Addr.Un 569 return size 570 } 571 func (m *GpeFwdEntryPathDetails) Marshal(b []byte) ([]byte, error) { 572 if b == nil { 573 b = make([]byte, m.Size()) 574 } 575 buf := codec.NewBuffer(b) 576 buf.EncodeUint8(m.LclLoc.Weight) 577 buf.EncodeUint8(uint8(m.LclLoc.Addr.Af)) 578 buf.EncodeBytes(m.LclLoc.Addr.Un.XXX_UnionData[:], 16) 579 buf.EncodeUint8(m.RmtLoc.Weight) 580 buf.EncodeUint8(uint8(m.RmtLoc.Addr.Af)) 581 buf.EncodeBytes(m.RmtLoc.Addr.Un.XXX_UnionData[:], 16) 582 return buf.Bytes(), nil 583 } 584 func (m *GpeFwdEntryPathDetails) Unmarshal(b []byte) error { 585 buf := codec.NewBuffer(b) 586 m.LclLoc.Weight = buf.DecodeUint8() 587 m.LclLoc.Addr.Af = ip_types.AddressFamily(buf.DecodeUint8()) 588 copy(m.LclLoc.Addr.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 589 m.RmtLoc.Weight = buf.DecodeUint8() 590 m.RmtLoc.Addr.Af = ip_types.AddressFamily(buf.DecodeUint8()) 591 copy(m.RmtLoc.Addr.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 592 return nil 593 } 594 595 // GpeFwdEntryPathDump defines message 'gpe_fwd_entry_path_dump'. 596 type GpeFwdEntryPathDump struct { 597 FwdEntryIndex uint32 `binapi:"u32,name=fwd_entry_index" json:"fwd_entry_index,omitempty"` 598 } 599 600 func (m *GpeFwdEntryPathDump) Reset() { *m = GpeFwdEntryPathDump{} } 601 func (*GpeFwdEntryPathDump) GetMessageName() string { return "gpe_fwd_entry_path_dump" } 602 func (*GpeFwdEntryPathDump) GetCrcString() string { return "39bce980" } 603 func (*GpeFwdEntryPathDump) GetMessageType() api.MessageType { 604 return api.RequestMessage 605 } 606 607 func (m *GpeFwdEntryPathDump) Size() (size int) { 608 if m == nil { 609 return 0 610 } 611 size += 4 // m.FwdEntryIndex 612 return size 613 } 614 func (m *GpeFwdEntryPathDump) Marshal(b []byte) ([]byte, error) { 615 if b == nil { 616 b = make([]byte, m.Size()) 617 } 618 buf := codec.NewBuffer(b) 619 buf.EncodeUint32(m.FwdEntryIndex) 620 return buf.Bytes(), nil 621 } 622 func (m *GpeFwdEntryPathDump) Unmarshal(b []byte) error { 623 buf := codec.NewBuffer(b) 624 m.FwdEntryIndex = buf.DecodeUint32() 625 return nil 626 } 627 628 // GpeFwdEntryVnisGet defines message 'gpe_fwd_entry_vnis_get'. 629 type GpeFwdEntryVnisGet struct{} 630 631 func (m *GpeFwdEntryVnisGet) Reset() { *m = GpeFwdEntryVnisGet{} } 632 func (*GpeFwdEntryVnisGet) GetMessageName() string { return "gpe_fwd_entry_vnis_get" } 633 func (*GpeFwdEntryVnisGet) GetCrcString() string { return "51077d14" } 634 func (*GpeFwdEntryVnisGet) GetMessageType() api.MessageType { 635 return api.RequestMessage 636 } 637 638 func (m *GpeFwdEntryVnisGet) Size() (size int) { 639 if m == nil { 640 return 0 641 } 642 return size 643 } 644 func (m *GpeFwdEntryVnisGet) Marshal(b []byte) ([]byte, error) { 645 if b == nil { 646 b = make([]byte, m.Size()) 647 } 648 buf := codec.NewBuffer(b) 649 return buf.Bytes(), nil 650 } 651 func (m *GpeFwdEntryVnisGet) Unmarshal(b []byte) error { 652 return nil 653 } 654 655 // GpeFwdEntryVnisGetReply defines message 'gpe_fwd_entry_vnis_get_reply'. 656 type GpeFwdEntryVnisGetReply struct { 657 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 658 Count uint32 `binapi:"u32,name=count" json:"-"` 659 Vnis []uint32 `binapi:"u32[count],name=vnis" json:"vnis,omitempty"` 660 } 661 662 func (m *GpeFwdEntryVnisGetReply) Reset() { *m = GpeFwdEntryVnisGetReply{} } 663 func (*GpeFwdEntryVnisGetReply) GetMessageName() string { return "gpe_fwd_entry_vnis_get_reply" } 664 func (*GpeFwdEntryVnisGetReply) GetCrcString() string { return "aa70da20" } 665 func (*GpeFwdEntryVnisGetReply) GetMessageType() api.MessageType { 666 return api.ReplyMessage 667 } 668 669 func (m *GpeFwdEntryVnisGetReply) Size() (size int) { 670 if m == nil { 671 return 0 672 } 673 size += 4 // m.Retval 674 size += 4 // m.Count 675 size += 4 * len(m.Vnis) // m.Vnis 676 return size 677 } 678 func (m *GpeFwdEntryVnisGetReply) Marshal(b []byte) ([]byte, error) { 679 if b == nil { 680 b = make([]byte, m.Size()) 681 } 682 buf := codec.NewBuffer(b) 683 buf.EncodeInt32(m.Retval) 684 buf.EncodeUint32(uint32(len(m.Vnis))) 685 for i := 0; i < len(m.Vnis); i++ { 686 var x uint32 687 if i < len(m.Vnis) { 688 x = uint32(m.Vnis[i]) 689 } 690 buf.EncodeUint32(x) 691 } 692 return buf.Bytes(), nil 693 } 694 func (m *GpeFwdEntryVnisGetReply) Unmarshal(b []byte) error { 695 buf := codec.NewBuffer(b) 696 m.Retval = buf.DecodeInt32() 697 m.Count = buf.DecodeUint32() 698 m.Vnis = make([]uint32, m.Count) 699 for i := 0; i < len(m.Vnis); i++ { 700 m.Vnis[i] = buf.DecodeUint32() 701 } 702 return nil 703 } 704 705 // get GPE encapsulation mode 706 // - mode - LISP (value 0) or VXLAN (value 1) 707 // 708 // GpeGetEncapMode defines message 'gpe_get_encap_mode'. 709 type GpeGetEncapMode struct{} 710 711 func (m *GpeGetEncapMode) Reset() { *m = GpeGetEncapMode{} } 712 func (*GpeGetEncapMode) GetMessageName() string { return "gpe_get_encap_mode" } 713 func (*GpeGetEncapMode) GetCrcString() string { return "51077d14" } 714 func (*GpeGetEncapMode) GetMessageType() api.MessageType { 715 return api.RequestMessage 716 } 717 718 func (m *GpeGetEncapMode) Size() (size int) { 719 if m == nil { 720 return 0 721 } 722 return size 723 } 724 func (m *GpeGetEncapMode) Marshal(b []byte) ([]byte, error) { 725 if b == nil { 726 b = make([]byte, m.Size()) 727 } 728 buf := codec.NewBuffer(b) 729 return buf.Bytes(), nil 730 } 731 func (m *GpeGetEncapMode) Unmarshal(b []byte) error { 732 return nil 733 } 734 735 // Reply for set_encap_mode 736 // - retval - return code 737 // - encap_mode - GPE encapsulation mode 738 // 739 // GpeGetEncapModeReply defines message 'gpe_get_encap_mode_reply'. 740 type GpeGetEncapModeReply struct { 741 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 742 EncapMode uint8 `binapi:"u8,name=encap_mode" json:"encap_mode,omitempty"` 743 } 744 745 func (m *GpeGetEncapModeReply) Reset() { *m = GpeGetEncapModeReply{} } 746 func (*GpeGetEncapModeReply) GetMessageName() string { return "gpe_get_encap_mode_reply" } 747 func (*GpeGetEncapModeReply) GetCrcString() string { return "36e3f7ca" } 748 func (*GpeGetEncapModeReply) GetMessageType() api.MessageType { 749 return api.ReplyMessage 750 } 751 752 func (m *GpeGetEncapModeReply) Size() (size int) { 753 if m == nil { 754 return 0 755 } 756 size += 4 // m.Retval 757 size += 1 // m.EncapMode 758 return size 759 } 760 func (m *GpeGetEncapModeReply) Marshal(b []byte) ([]byte, error) { 761 if b == nil { 762 b = make([]byte, m.Size()) 763 } 764 buf := codec.NewBuffer(b) 765 buf.EncodeInt32(m.Retval) 766 buf.EncodeUint8(m.EncapMode) 767 return buf.Bytes(), nil 768 } 769 func (m *GpeGetEncapModeReply) Unmarshal(b []byte) error { 770 buf := codec.NewBuffer(b) 771 m.Retval = buf.DecodeInt32() 772 m.EncapMode = buf.DecodeUint8() 773 return nil 774 } 775 776 // get GPE native fwd rpath 777 // GpeNativeFwdRpathsGet defines message 'gpe_native_fwd_rpaths_get'. 778 type GpeNativeFwdRpathsGet struct { 779 IsIP4 bool `binapi:"bool,name=is_ip4" json:"is_ip4,omitempty"` 780 } 781 782 func (m *GpeNativeFwdRpathsGet) Reset() { *m = GpeNativeFwdRpathsGet{} } 783 func (*GpeNativeFwdRpathsGet) GetMessageName() string { return "gpe_native_fwd_rpaths_get" } 784 func (*GpeNativeFwdRpathsGet) GetCrcString() string { return "f652ceb4" } 785 func (*GpeNativeFwdRpathsGet) GetMessageType() api.MessageType { 786 return api.RequestMessage 787 } 788 789 func (m *GpeNativeFwdRpathsGet) Size() (size int) { 790 if m == nil { 791 return 0 792 } 793 size += 1 // m.IsIP4 794 return size 795 } 796 func (m *GpeNativeFwdRpathsGet) Marshal(b []byte) ([]byte, error) { 797 if b == nil { 798 b = make([]byte, m.Size()) 799 } 800 buf := codec.NewBuffer(b) 801 buf.EncodeBool(m.IsIP4) 802 return buf.Bytes(), nil 803 } 804 func (m *GpeNativeFwdRpathsGet) Unmarshal(b []byte) error { 805 buf := codec.NewBuffer(b) 806 m.IsIP4 = buf.DecodeBool() 807 return nil 808 } 809 810 // Reply for get native fwd rpath 811 // - retval - return code 812 // - table_id - table id for route path 813 // - nh_sw_if_index - next-hop sw_if_index (~0 if not set) 814 // - nh_addr - next hop address 815 // 816 // GpeNativeFwdRpathsGetReply defines message 'gpe_native_fwd_rpaths_get_reply'. 817 type GpeNativeFwdRpathsGetReply struct { 818 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 819 Count uint32 `binapi:"u32,name=count" json:"-"` 820 Entries []GpeNativeFwdRpath `binapi:"gpe_native_fwd_rpath[count],name=entries" json:"entries,omitempty"` 821 } 822 823 func (m *GpeNativeFwdRpathsGetReply) Reset() { *m = GpeNativeFwdRpathsGetReply{} } 824 func (*GpeNativeFwdRpathsGetReply) GetMessageName() string { return "gpe_native_fwd_rpaths_get_reply" } 825 func (*GpeNativeFwdRpathsGetReply) GetCrcString() string { return "7a1ca5a2" } 826 func (*GpeNativeFwdRpathsGetReply) GetMessageType() api.MessageType { 827 return api.ReplyMessage 828 } 829 830 func (m *GpeNativeFwdRpathsGetReply) Size() (size int) { 831 if m == nil { 832 return 0 833 } 834 size += 4 // m.Retval 835 size += 4 // m.Count 836 for j1 := 0; j1 < len(m.Entries); j1++ { 837 var s1 GpeNativeFwdRpath 838 _ = s1 839 if j1 < len(m.Entries) { 840 s1 = m.Entries[j1] 841 } 842 size += 4 // s1.FibIndex 843 size += 4 // s1.NhSwIfIndex 844 size += 1 // s1.NhAddr.Af 845 size += 1 * 16 // s1.NhAddr.Un 846 } 847 return size 848 } 849 func (m *GpeNativeFwdRpathsGetReply) Marshal(b []byte) ([]byte, error) { 850 if b == nil { 851 b = make([]byte, m.Size()) 852 } 853 buf := codec.NewBuffer(b) 854 buf.EncodeInt32(m.Retval) 855 buf.EncodeUint32(uint32(len(m.Entries))) 856 for j0 := 0; j0 < len(m.Entries); j0++ { 857 var v0 GpeNativeFwdRpath // Entries 858 if j0 < len(m.Entries) { 859 v0 = m.Entries[j0] 860 } 861 buf.EncodeUint32(v0.FibIndex) 862 buf.EncodeUint32(uint32(v0.NhSwIfIndex)) 863 buf.EncodeUint8(uint8(v0.NhAddr.Af)) 864 buf.EncodeBytes(v0.NhAddr.Un.XXX_UnionData[:], 16) 865 } 866 return buf.Bytes(), nil 867 } 868 func (m *GpeNativeFwdRpathsGetReply) Unmarshal(b []byte) error { 869 buf := codec.NewBuffer(b) 870 m.Retval = buf.DecodeInt32() 871 m.Count = buf.DecodeUint32() 872 m.Entries = make([]GpeNativeFwdRpath, m.Count) 873 for j0 := 0; j0 < len(m.Entries); j0++ { 874 m.Entries[j0].FibIndex = buf.DecodeUint32() 875 m.Entries[j0].NhSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 876 m.Entries[j0].NhAddr.Af = ip_types.AddressFamily(buf.DecodeUint8()) 877 copy(m.Entries[j0].NhAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 878 } 879 return nil 880 } 881 882 // Set GPE encapsulation mode 883 // - mode - LISP (value 0) or VXLAN (value 1) 884 // 885 // GpeSetEncapMode defines message 'gpe_set_encap_mode'. 886 type GpeSetEncapMode struct { 887 IsVxlan bool `binapi:"bool,name=is_vxlan" json:"is_vxlan,omitempty"` 888 } 889 890 func (m *GpeSetEncapMode) Reset() { *m = GpeSetEncapMode{} } 891 func (*GpeSetEncapMode) GetMessageName() string { return "gpe_set_encap_mode" } 892 func (*GpeSetEncapMode) GetCrcString() string { return "bd819eac" } 893 func (*GpeSetEncapMode) GetMessageType() api.MessageType { 894 return api.RequestMessage 895 } 896 897 func (m *GpeSetEncapMode) Size() (size int) { 898 if m == nil { 899 return 0 900 } 901 size += 1 // m.IsVxlan 902 return size 903 } 904 func (m *GpeSetEncapMode) Marshal(b []byte) ([]byte, error) { 905 if b == nil { 906 b = make([]byte, m.Size()) 907 } 908 buf := codec.NewBuffer(b) 909 buf.EncodeBool(m.IsVxlan) 910 return buf.Bytes(), nil 911 } 912 func (m *GpeSetEncapMode) Unmarshal(b []byte) error { 913 buf := codec.NewBuffer(b) 914 m.IsVxlan = buf.DecodeBool() 915 return nil 916 } 917 918 // GpeSetEncapModeReply defines message 'gpe_set_encap_mode_reply'. 919 type GpeSetEncapModeReply struct { 920 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 921 } 922 923 func (m *GpeSetEncapModeReply) Reset() { *m = GpeSetEncapModeReply{} } 924 func (*GpeSetEncapModeReply) GetMessageName() string { return "gpe_set_encap_mode_reply" } 925 func (*GpeSetEncapModeReply) GetCrcString() string { return "e8d4e804" } 926 func (*GpeSetEncapModeReply) GetMessageType() api.MessageType { 927 return api.ReplyMessage 928 } 929 930 func (m *GpeSetEncapModeReply) Size() (size int) { 931 if m == nil { 932 return 0 933 } 934 size += 4 // m.Retval 935 return size 936 } 937 func (m *GpeSetEncapModeReply) Marshal(b []byte) ([]byte, error) { 938 if b == nil { 939 b = make([]byte, m.Size()) 940 } 941 buf := codec.NewBuffer(b) 942 buf.EncodeInt32(m.Retval) 943 return buf.Bytes(), nil 944 } 945 func (m *GpeSetEncapModeReply) Unmarshal(b []byte) error { 946 buf := codec.NewBuffer(b) 947 m.Retval = buf.DecodeInt32() 948 return nil 949 } 950 951 func init() { file_lisp_gpe_binapi_init() } 952 func file_lisp_gpe_binapi_init() { 953 api.RegisterMessage((*GpeAddDelFwdEntry)(nil), "gpe_add_del_fwd_entry_f0847644") 954 api.RegisterMessage((*GpeAddDelFwdEntryReply)(nil), "gpe_add_del_fwd_entry_reply_efe5f176") 955 api.RegisterMessage((*GpeAddDelIface)(nil), "gpe_add_del_iface_3ccff273") 956 api.RegisterMessage((*GpeAddDelIfaceReply)(nil), "gpe_add_del_iface_reply_e8d4e804") 957 api.RegisterMessage((*GpeAddDelNativeFwdRpath)(nil), "gpe_add_del_native_fwd_rpath_43fc8b54") 958 api.RegisterMessage((*GpeAddDelNativeFwdRpathReply)(nil), "gpe_add_del_native_fwd_rpath_reply_e8d4e804") 959 api.RegisterMessage((*GpeEnableDisable)(nil), "gpe_enable_disable_c264d7bf") 960 api.RegisterMessage((*GpeEnableDisableReply)(nil), "gpe_enable_disable_reply_e8d4e804") 961 api.RegisterMessage((*GpeFwdEntriesGet)(nil), "gpe_fwd_entries_get_8d1f2fe9") 962 api.RegisterMessage((*GpeFwdEntriesGetReply)(nil), "gpe_fwd_entries_get_reply_c4844876") 963 api.RegisterMessage((*GpeFwdEntryPathDetails)(nil), "gpe_fwd_entry_path_details_483df51a") 964 api.RegisterMessage((*GpeFwdEntryPathDump)(nil), "gpe_fwd_entry_path_dump_39bce980") 965 api.RegisterMessage((*GpeFwdEntryVnisGet)(nil), "gpe_fwd_entry_vnis_get_51077d14") 966 api.RegisterMessage((*GpeFwdEntryVnisGetReply)(nil), "gpe_fwd_entry_vnis_get_reply_aa70da20") 967 api.RegisterMessage((*GpeGetEncapMode)(nil), "gpe_get_encap_mode_51077d14") 968 api.RegisterMessage((*GpeGetEncapModeReply)(nil), "gpe_get_encap_mode_reply_36e3f7ca") 969 api.RegisterMessage((*GpeNativeFwdRpathsGet)(nil), "gpe_native_fwd_rpaths_get_f652ceb4") 970 api.RegisterMessage((*GpeNativeFwdRpathsGetReply)(nil), "gpe_native_fwd_rpaths_get_reply_7a1ca5a2") 971 api.RegisterMessage((*GpeSetEncapMode)(nil), "gpe_set_encap_mode_bd819eac") 972 api.RegisterMessage((*GpeSetEncapModeReply)(nil), "gpe_set_encap_mode_reply_e8d4e804") 973 } 974 975 // Messages returns list of all messages in this module. 976 func AllMessages() []api.Message { 977 return []api.Message{ 978 (*GpeAddDelFwdEntry)(nil), 979 (*GpeAddDelFwdEntryReply)(nil), 980 (*GpeAddDelIface)(nil), 981 (*GpeAddDelIfaceReply)(nil), 982 (*GpeAddDelNativeFwdRpath)(nil), 983 (*GpeAddDelNativeFwdRpathReply)(nil), 984 (*GpeEnableDisable)(nil), 985 (*GpeEnableDisableReply)(nil), 986 (*GpeFwdEntriesGet)(nil), 987 (*GpeFwdEntriesGetReply)(nil), 988 (*GpeFwdEntryPathDetails)(nil), 989 (*GpeFwdEntryPathDump)(nil), 990 (*GpeFwdEntryVnisGet)(nil), 991 (*GpeFwdEntryVnisGetReply)(nil), 992 (*GpeGetEncapMode)(nil), 993 (*GpeGetEncapModeReply)(nil), 994 (*GpeNativeFwdRpathsGet)(nil), 995 (*GpeNativeFwdRpathsGetReply)(nil), 996 (*GpeSetEncapMode)(nil), 997 (*GpeSetEncapModeReply)(nil), 998 } 999 }