github.com/edwarnicke/govpp@v0.0.0-20230130211138-14ef5d20b1d0/binapi/mpls/mpls.ba.go (about) 1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT. 2 // versions: 3 // binapi-generator: v0.4.0-dev 4 // VPP: 23.02-rc0~189-g57127b32a 5 // source: /usr/share/vpp/api/core/mpls.api.json 6 7 // Package mpls contains generated bindings for API file mpls.api. 8 // 9 // Contents: 10 // 3 structs 11 // 16 messages 12 // 13 package mpls 14 15 import ( 16 api "git.fd.io/govpp.git/api" 17 codec "git.fd.io/govpp.git/codec" 18 fib_types "github.com/edwarnicke/govpp/binapi/fib_types" 19 interface_types "github.com/edwarnicke/govpp/binapi/interface_types" 20 ip_types "github.com/edwarnicke/govpp/binapi/ip_types" 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 = "mpls" 31 APIVersion = "1.1.1" 32 VersionCrc = 0x46824f02 33 ) 34 35 // MplsRoute defines type 'mpls_route'. 36 type MplsRoute struct { 37 MrTableID uint32 `binapi:"u32,name=mr_table_id" json:"mr_table_id,omitempty"` 38 MrLabel uint32 `binapi:"u32,name=mr_label" json:"mr_label,omitempty"` 39 MrEos uint8 `binapi:"u8,name=mr_eos" json:"mr_eos,omitempty"` 40 MrEosProto uint8 `binapi:"u8,name=mr_eos_proto" json:"mr_eos_proto,omitempty"` 41 MrIsMulticast bool `binapi:"bool,name=mr_is_multicast" json:"mr_is_multicast,omitempty"` 42 MrNPaths uint8 `binapi:"u8,name=mr_n_paths" json:"-"` 43 MrPaths []fib_types.FibPath `binapi:"fib_path[mr_n_paths],name=mr_paths" json:"mr_paths,omitempty"` 44 } 45 46 // MplsTable defines type 'mpls_table'. 47 type MplsTable struct { 48 MtTableID uint32 `binapi:"u32,name=mt_table_id" json:"mt_table_id,omitempty"` 49 MtName string `binapi:"string[64],name=mt_name" json:"mt_name,omitempty"` 50 } 51 52 // MplsTunnel defines type 'mpls_tunnel'. 53 type MplsTunnel struct { 54 MtSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=mt_sw_if_index" json:"mt_sw_if_index,omitempty"` 55 MtTunnelIndex uint32 `binapi:"u32,name=mt_tunnel_index" json:"mt_tunnel_index,omitempty"` 56 MtL2Only bool `binapi:"bool,name=mt_l2_only" json:"mt_l2_only,omitempty"` 57 MtIsMulticast bool `binapi:"bool,name=mt_is_multicast" json:"mt_is_multicast,omitempty"` 58 MtTag string `binapi:"string[64],name=mt_tag" json:"mt_tag,omitempty"` 59 MtNPaths uint8 `binapi:"u8,name=mt_n_paths" json:"-"` 60 MtPaths []fib_types.FibPath `binapi:"fib_path[mt_n_paths],name=mt_paths" json:"mt_paths,omitempty"` 61 } 62 63 // MplsIPBindUnbind defines message 'mpls_ip_bind_unbind'. 64 type MplsIPBindUnbind struct { 65 MbMplsTableID uint32 `binapi:"u32,name=mb_mpls_table_id" json:"mb_mpls_table_id,omitempty"` 66 MbLabel uint32 `binapi:"u32,name=mb_label" json:"mb_label,omitempty"` 67 MbIPTableID uint32 `binapi:"u32,name=mb_ip_table_id" json:"mb_ip_table_id,omitempty"` 68 MbIsBind bool `binapi:"bool,name=mb_is_bind" json:"mb_is_bind,omitempty"` 69 MbPrefix ip_types.Prefix `binapi:"prefix,name=mb_prefix" json:"mb_prefix,omitempty"` 70 } 71 72 func (m *MplsIPBindUnbind) Reset() { *m = MplsIPBindUnbind{} } 73 func (*MplsIPBindUnbind) GetMessageName() string { return "mpls_ip_bind_unbind" } 74 func (*MplsIPBindUnbind) GetCrcString() string { return "c7533b32" } 75 func (*MplsIPBindUnbind) GetMessageType() api.MessageType { 76 return api.RequestMessage 77 } 78 79 func (m *MplsIPBindUnbind) Size() (size int) { 80 if m == nil { 81 return 0 82 } 83 size += 4 // m.MbMplsTableID 84 size += 4 // m.MbLabel 85 size += 4 // m.MbIPTableID 86 size += 1 // m.MbIsBind 87 size += 1 // m.MbPrefix.Address.Af 88 size += 1 * 16 // m.MbPrefix.Address.Un 89 size += 1 // m.MbPrefix.Len 90 return size 91 } 92 func (m *MplsIPBindUnbind) Marshal(b []byte) ([]byte, error) { 93 if b == nil { 94 b = make([]byte, m.Size()) 95 } 96 buf := codec.NewBuffer(b) 97 buf.EncodeUint32(m.MbMplsTableID) 98 buf.EncodeUint32(m.MbLabel) 99 buf.EncodeUint32(m.MbIPTableID) 100 buf.EncodeBool(m.MbIsBind) 101 buf.EncodeUint8(uint8(m.MbPrefix.Address.Af)) 102 buf.EncodeBytes(m.MbPrefix.Address.Un.XXX_UnionData[:], 16) 103 buf.EncodeUint8(m.MbPrefix.Len) 104 return buf.Bytes(), nil 105 } 106 func (m *MplsIPBindUnbind) Unmarshal(b []byte) error { 107 buf := codec.NewBuffer(b) 108 m.MbMplsTableID = buf.DecodeUint32() 109 m.MbLabel = buf.DecodeUint32() 110 m.MbIPTableID = buf.DecodeUint32() 111 m.MbIsBind = buf.DecodeBool() 112 m.MbPrefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) 113 copy(m.MbPrefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 114 m.MbPrefix.Len = buf.DecodeUint8() 115 return nil 116 } 117 118 // MplsIPBindUnbindReply defines message 'mpls_ip_bind_unbind_reply'. 119 type MplsIPBindUnbindReply struct { 120 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 121 } 122 123 func (m *MplsIPBindUnbindReply) Reset() { *m = MplsIPBindUnbindReply{} } 124 func (*MplsIPBindUnbindReply) GetMessageName() string { return "mpls_ip_bind_unbind_reply" } 125 func (*MplsIPBindUnbindReply) GetCrcString() string { return "e8d4e804" } 126 func (*MplsIPBindUnbindReply) GetMessageType() api.MessageType { 127 return api.ReplyMessage 128 } 129 130 func (m *MplsIPBindUnbindReply) Size() (size int) { 131 if m == nil { 132 return 0 133 } 134 size += 4 // m.Retval 135 return size 136 } 137 func (m *MplsIPBindUnbindReply) Marshal(b []byte) ([]byte, error) { 138 if b == nil { 139 b = make([]byte, m.Size()) 140 } 141 buf := codec.NewBuffer(b) 142 buf.EncodeInt32(m.Retval) 143 return buf.Bytes(), nil 144 } 145 func (m *MplsIPBindUnbindReply) Unmarshal(b []byte) error { 146 buf := codec.NewBuffer(b) 147 m.Retval = buf.DecodeInt32() 148 return nil 149 } 150 151 // MplsRouteAddDel defines message 'mpls_route_add_del'. 152 type MplsRouteAddDel struct { 153 MrIsAdd bool `binapi:"bool,name=mr_is_add" json:"mr_is_add,omitempty"` 154 MrIsMultipath bool `binapi:"bool,name=mr_is_multipath" json:"mr_is_multipath,omitempty"` 155 MrRoute MplsRoute `binapi:"mpls_route,name=mr_route" json:"mr_route,omitempty"` 156 } 157 158 func (m *MplsRouteAddDel) Reset() { *m = MplsRouteAddDel{} } 159 func (*MplsRouteAddDel) GetMessageName() string { return "mpls_route_add_del" } 160 func (*MplsRouteAddDel) GetCrcString() string { return "8e1d1e07" } 161 func (*MplsRouteAddDel) GetMessageType() api.MessageType { 162 return api.RequestMessage 163 } 164 165 func (m *MplsRouteAddDel) Size() (size int) { 166 if m == nil { 167 return 0 168 } 169 size += 1 // m.MrIsAdd 170 size += 1 // m.MrIsMultipath 171 size += 4 // m.MrRoute.MrTableID 172 size += 4 // m.MrRoute.MrLabel 173 size += 1 // m.MrRoute.MrEos 174 size += 1 // m.MrRoute.MrEosProto 175 size += 1 // m.MrRoute.MrIsMulticast 176 size += 1 // m.MrRoute.MrNPaths 177 for j2 := 0; j2 < len(m.MrRoute.MrPaths); j2++ { 178 var s2 fib_types.FibPath 179 _ = s2 180 if j2 < len(m.MrRoute.MrPaths) { 181 s2 = m.MrRoute.MrPaths[j2] 182 } 183 size += 4 // s2.SwIfIndex 184 size += 4 // s2.TableID 185 size += 4 // s2.RpfID 186 size += 1 // s2.Weight 187 size += 1 // s2.Preference 188 size += 4 // s2.Type 189 size += 4 // s2.Flags 190 size += 4 // s2.Proto 191 size += 1 * 16 // s2.Nh.Address 192 size += 4 // s2.Nh.ViaLabel 193 size += 4 // s2.Nh.ObjID 194 size += 4 // s2.Nh.ClassifyTableIndex 195 size += 1 // s2.NLabels 196 for j3 := 0; j3 < 16; j3++ { 197 size += 1 // s2.LabelStack[j3].IsUniform 198 size += 4 // s2.LabelStack[j3].Label 199 size += 1 // s2.LabelStack[j3].TTL 200 size += 1 // s2.LabelStack[j3].Exp 201 } 202 } 203 return size 204 } 205 func (m *MplsRouteAddDel) Marshal(b []byte) ([]byte, error) { 206 if b == nil { 207 b = make([]byte, m.Size()) 208 } 209 buf := codec.NewBuffer(b) 210 buf.EncodeBool(m.MrIsAdd) 211 buf.EncodeBool(m.MrIsMultipath) 212 buf.EncodeUint32(m.MrRoute.MrTableID) 213 buf.EncodeUint32(m.MrRoute.MrLabel) 214 buf.EncodeUint8(m.MrRoute.MrEos) 215 buf.EncodeUint8(m.MrRoute.MrEosProto) 216 buf.EncodeBool(m.MrRoute.MrIsMulticast) 217 buf.EncodeUint8(uint8(len(m.MrRoute.MrPaths))) 218 for j1 := 0; j1 < len(m.MrRoute.MrPaths); j1++ { 219 var v1 fib_types.FibPath // MrPaths 220 if j1 < len(m.MrRoute.MrPaths) { 221 v1 = m.MrRoute.MrPaths[j1] 222 } 223 buf.EncodeUint32(v1.SwIfIndex) 224 buf.EncodeUint32(v1.TableID) 225 buf.EncodeUint32(v1.RpfID) 226 buf.EncodeUint8(v1.Weight) 227 buf.EncodeUint8(v1.Preference) 228 buf.EncodeUint32(uint32(v1.Type)) 229 buf.EncodeUint32(uint32(v1.Flags)) 230 buf.EncodeUint32(uint32(v1.Proto)) 231 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16) 232 buf.EncodeUint32(v1.Nh.ViaLabel) 233 buf.EncodeUint32(v1.Nh.ObjID) 234 buf.EncodeUint32(v1.Nh.ClassifyTableIndex) 235 buf.EncodeUint8(v1.NLabels) 236 for j2 := 0; j2 < 16; j2++ { 237 buf.EncodeUint8(v1.LabelStack[j2].IsUniform) 238 buf.EncodeUint32(v1.LabelStack[j2].Label) 239 buf.EncodeUint8(v1.LabelStack[j2].TTL) 240 buf.EncodeUint8(v1.LabelStack[j2].Exp) 241 } 242 } 243 return buf.Bytes(), nil 244 } 245 func (m *MplsRouteAddDel) Unmarshal(b []byte) error { 246 buf := codec.NewBuffer(b) 247 m.MrIsAdd = buf.DecodeBool() 248 m.MrIsMultipath = buf.DecodeBool() 249 m.MrRoute.MrTableID = buf.DecodeUint32() 250 m.MrRoute.MrLabel = buf.DecodeUint32() 251 m.MrRoute.MrEos = buf.DecodeUint8() 252 m.MrRoute.MrEosProto = buf.DecodeUint8() 253 m.MrRoute.MrIsMulticast = buf.DecodeBool() 254 m.MrRoute.MrNPaths = buf.DecodeUint8() 255 m.MrRoute.MrPaths = make([]fib_types.FibPath, m.MrRoute.MrNPaths) 256 for j1 := 0; j1 < len(m.MrRoute.MrPaths); j1++ { 257 m.MrRoute.MrPaths[j1].SwIfIndex = buf.DecodeUint32() 258 m.MrRoute.MrPaths[j1].TableID = buf.DecodeUint32() 259 m.MrRoute.MrPaths[j1].RpfID = buf.DecodeUint32() 260 m.MrRoute.MrPaths[j1].Weight = buf.DecodeUint8() 261 m.MrRoute.MrPaths[j1].Preference = buf.DecodeUint8() 262 m.MrRoute.MrPaths[j1].Type = fib_types.FibPathType(buf.DecodeUint32()) 263 m.MrRoute.MrPaths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32()) 264 m.MrRoute.MrPaths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32()) 265 copy(m.MrRoute.MrPaths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16)) 266 m.MrRoute.MrPaths[j1].Nh.ViaLabel = buf.DecodeUint32() 267 m.MrRoute.MrPaths[j1].Nh.ObjID = buf.DecodeUint32() 268 m.MrRoute.MrPaths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32() 269 m.MrRoute.MrPaths[j1].NLabels = buf.DecodeUint8() 270 for j2 := 0; j2 < 16; j2++ { 271 m.MrRoute.MrPaths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8() 272 m.MrRoute.MrPaths[j1].LabelStack[j2].Label = buf.DecodeUint32() 273 m.MrRoute.MrPaths[j1].LabelStack[j2].TTL = buf.DecodeUint8() 274 m.MrRoute.MrPaths[j1].LabelStack[j2].Exp = buf.DecodeUint8() 275 } 276 } 277 return nil 278 } 279 280 // MplsRouteAddDelReply defines message 'mpls_route_add_del_reply'. 281 type MplsRouteAddDelReply struct { 282 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 283 StatsIndex uint32 `binapi:"u32,name=stats_index" json:"stats_index,omitempty"` 284 } 285 286 func (m *MplsRouteAddDelReply) Reset() { *m = MplsRouteAddDelReply{} } 287 func (*MplsRouteAddDelReply) GetMessageName() string { return "mpls_route_add_del_reply" } 288 func (*MplsRouteAddDelReply) GetCrcString() string { return "1992deab" } 289 func (*MplsRouteAddDelReply) GetMessageType() api.MessageType { 290 return api.ReplyMessage 291 } 292 293 func (m *MplsRouteAddDelReply) Size() (size int) { 294 if m == nil { 295 return 0 296 } 297 size += 4 // m.Retval 298 size += 4 // m.StatsIndex 299 return size 300 } 301 func (m *MplsRouteAddDelReply) Marshal(b []byte) ([]byte, error) { 302 if b == nil { 303 b = make([]byte, m.Size()) 304 } 305 buf := codec.NewBuffer(b) 306 buf.EncodeInt32(m.Retval) 307 buf.EncodeUint32(m.StatsIndex) 308 return buf.Bytes(), nil 309 } 310 func (m *MplsRouteAddDelReply) Unmarshal(b []byte) error { 311 buf := codec.NewBuffer(b) 312 m.Retval = buf.DecodeInt32() 313 m.StatsIndex = buf.DecodeUint32() 314 return nil 315 } 316 317 // MplsRouteDetails defines message 'mpls_route_details'. 318 type MplsRouteDetails struct { 319 MrRoute MplsRoute `binapi:"mpls_route,name=mr_route" json:"mr_route,omitempty"` 320 } 321 322 func (m *MplsRouteDetails) Reset() { *m = MplsRouteDetails{} } 323 func (*MplsRouteDetails) GetMessageName() string { return "mpls_route_details" } 324 func (*MplsRouteDetails) GetCrcString() string { return "9b5043dc" } 325 func (*MplsRouteDetails) GetMessageType() api.MessageType { 326 return api.ReplyMessage 327 } 328 329 func (m *MplsRouteDetails) Size() (size int) { 330 if m == nil { 331 return 0 332 } 333 size += 4 // m.MrRoute.MrTableID 334 size += 4 // m.MrRoute.MrLabel 335 size += 1 // m.MrRoute.MrEos 336 size += 1 // m.MrRoute.MrEosProto 337 size += 1 // m.MrRoute.MrIsMulticast 338 size += 1 // m.MrRoute.MrNPaths 339 for j2 := 0; j2 < len(m.MrRoute.MrPaths); j2++ { 340 var s2 fib_types.FibPath 341 _ = s2 342 if j2 < len(m.MrRoute.MrPaths) { 343 s2 = m.MrRoute.MrPaths[j2] 344 } 345 size += 4 // s2.SwIfIndex 346 size += 4 // s2.TableID 347 size += 4 // s2.RpfID 348 size += 1 // s2.Weight 349 size += 1 // s2.Preference 350 size += 4 // s2.Type 351 size += 4 // s2.Flags 352 size += 4 // s2.Proto 353 size += 1 * 16 // s2.Nh.Address 354 size += 4 // s2.Nh.ViaLabel 355 size += 4 // s2.Nh.ObjID 356 size += 4 // s2.Nh.ClassifyTableIndex 357 size += 1 // s2.NLabels 358 for j3 := 0; j3 < 16; j3++ { 359 size += 1 // s2.LabelStack[j3].IsUniform 360 size += 4 // s2.LabelStack[j3].Label 361 size += 1 // s2.LabelStack[j3].TTL 362 size += 1 // s2.LabelStack[j3].Exp 363 } 364 } 365 return size 366 } 367 func (m *MplsRouteDetails) Marshal(b []byte) ([]byte, error) { 368 if b == nil { 369 b = make([]byte, m.Size()) 370 } 371 buf := codec.NewBuffer(b) 372 buf.EncodeUint32(m.MrRoute.MrTableID) 373 buf.EncodeUint32(m.MrRoute.MrLabel) 374 buf.EncodeUint8(m.MrRoute.MrEos) 375 buf.EncodeUint8(m.MrRoute.MrEosProto) 376 buf.EncodeBool(m.MrRoute.MrIsMulticast) 377 buf.EncodeUint8(uint8(len(m.MrRoute.MrPaths))) 378 for j1 := 0; j1 < len(m.MrRoute.MrPaths); j1++ { 379 var v1 fib_types.FibPath // MrPaths 380 if j1 < len(m.MrRoute.MrPaths) { 381 v1 = m.MrRoute.MrPaths[j1] 382 } 383 buf.EncodeUint32(v1.SwIfIndex) 384 buf.EncodeUint32(v1.TableID) 385 buf.EncodeUint32(v1.RpfID) 386 buf.EncodeUint8(v1.Weight) 387 buf.EncodeUint8(v1.Preference) 388 buf.EncodeUint32(uint32(v1.Type)) 389 buf.EncodeUint32(uint32(v1.Flags)) 390 buf.EncodeUint32(uint32(v1.Proto)) 391 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16) 392 buf.EncodeUint32(v1.Nh.ViaLabel) 393 buf.EncodeUint32(v1.Nh.ObjID) 394 buf.EncodeUint32(v1.Nh.ClassifyTableIndex) 395 buf.EncodeUint8(v1.NLabels) 396 for j2 := 0; j2 < 16; j2++ { 397 buf.EncodeUint8(v1.LabelStack[j2].IsUniform) 398 buf.EncodeUint32(v1.LabelStack[j2].Label) 399 buf.EncodeUint8(v1.LabelStack[j2].TTL) 400 buf.EncodeUint8(v1.LabelStack[j2].Exp) 401 } 402 } 403 return buf.Bytes(), nil 404 } 405 func (m *MplsRouteDetails) Unmarshal(b []byte) error { 406 buf := codec.NewBuffer(b) 407 m.MrRoute.MrTableID = buf.DecodeUint32() 408 m.MrRoute.MrLabel = buf.DecodeUint32() 409 m.MrRoute.MrEos = buf.DecodeUint8() 410 m.MrRoute.MrEosProto = buf.DecodeUint8() 411 m.MrRoute.MrIsMulticast = buf.DecodeBool() 412 m.MrRoute.MrNPaths = buf.DecodeUint8() 413 m.MrRoute.MrPaths = make([]fib_types.FibPath, m.MrRoute.MrNPaths) 414 for j1 := 0; j1 < len(m.MrRoute.MrPaths); j1++ { 415 m.MrRoute.MrPaths[j1].SwIfIndex = buf.DecodeUint32() 416 m.MrRoute.MrPaths[j1].TableID = buf.DecodeUint32() 417 m.MrRoute.MrPaths[j1].RpfID = buf.DecodeUint32() 418 m.MrRoute.MrPaths[j1].Weight = buf.DecodeUint8() 419 m.MrRoute.MrPaths[j1].Preference = buf.DecodeUint8() 420 m.MrRoute.MrPaths[j1].Type = fib_types.FibPathType(buf.DecodeUint32()) 421 m.MrRoute.MrPaths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32()) 422 m.MrRoute.MrPaths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32()) 423 copy(m.MrRoute.MrPaths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16)) 424 m.MrRoute.MrPaths[j1].Nh.ViaLabel = buf.DecodeUint32() 425 m.MrRoute.MrPaths[j1].Nh.ObjID = buf.DecodeUint32() 426 m.MrRoute.MrPaths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32() 427 m.MrRoute.MrPaths[j1].NLabels = buf.DecodeUint8() 428 for j2 := 0; j2 < 16; j2++ { 429 m.MrRoute.MrPaths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8() 430 m.MrRoute.MrPaths[j1].LabelStack[j2].Label = buf.DecodeUint32() 431 m.MrRoute.MrPaths[j1].LabelStack[j2].TTL = buf.DecodeUint8() 432 m.MrRoute.MrPaths[j1].LabelStack[j2].Exp = buf.DecodeUint8() 433 } 434 } 435 return nil 436 } 437 438 // MplsRouteDump defines message 'mpls_route_dump'. 439 type MplsRouteDump struct { 440 Table MplsTable `binapi:"mpls_table,name=table" json:"table,omitempty"` 441 } 442 443 func (m *MplsRouteDump) Reset() { *m = MplsRouteDump{} } 444 func (*MplsRouteDump) GetMessageName() string { return "mpls_route_dump" } 445 func (*MplsRouteDump) GetCrcString() string { return "935fdefa" } 446 func (*MplsRouteDump) GetMessageType() api.MessageType { 447 return api.RequestMessage 448 } 449 450 func (m *MplsRouteDump) Size() (size int) { 451 if m == nil { 452 return 0 453 } 454 size += 4 // m.Table.MtTableID 455 size += 64 // m.Table.MtName 456 return size 457 } 458 func (m *MplsRouteDump) Marshal(b []byte) ([]byte, error) { 459 if b == nil { 460 b = make([]byte, m.Size()) 461 } 462 buf := codec.NewBuffer(b) 463 buf.EncodeUint32(m.Table.MtTableID) 464 buf.EncodeString(m.Table.MtName, 64) 465 return buf.Bytes(), nil 466 } 467 func (m *MplsRouteDump) Unmarshal(b []byte) error { 468 buf := codec.NewBuffer(b) 469 m.Table.MtTableID = buf.DecodeUint32() 470 m.Table.MtName = buf.DecodeString(64) 471 return nil 472 } 473 474 // MplsTableAddDel defines message 'mpls_table_add_del'. 475 type MplsTableAddDel struct { 476 MtIsAdd bool `binapi:"bool,name=mt_is_add,default=true" json:"mt_is_add,omitempty"` 477 MtTable MplsTable `binapi:"mpls_table,name=mt_table" json:"mt_table,omitempty"` 478 } 479 480 func (m *MplsTableAddDel) Reset() { *m = MplsTableAddDel{} } 481 func (*MplsTableAddDel) GetMessageName() string { return "mpls_table_add_del" } 482 func (*MplsTableAddDel) GetCrcString() string { return "57817512" } 483 func (*MplsTableAddDel) GetMessageType() api.MessageType { 484 return api.RequestMessage 485 } 486 487 func (m *MplsTableAddDel) Size() (size int) { 488 if m == nil { 489 return 0 490 } 491 size += 1 // m.MtIsAdd 492 size += 4 // m.MtTable.MtTableID 493 size += 64 // m.MtTable.MtName 494 return size 495 } 496 func (m *MplsTableAddDel) Marshal(b []byte) ([]byte, error) { 497 if b == nil { 498 b = make([]byte, m.Size()) 499 } 500 buf := codec.NewBuffer(b) 501 buf.EncodeBool(m.MtIsAdd) 502 buf.EncodeUint32(m.MtTable.MtTableID) 503 buf.EncodeString(m.MtTable.MtName, 64) 504 return buf.Bytes(), nil 505 } 506 func (m *MplsTableAddDel) Unmarshal(b []byte) error { 507 buf := codec.NewBuffer(b) 508 m.MtIsAdd = buf.DecodeBool() 509 m.MtTable.MtTableID = buf.DecodeUint32() 510 m.MtTable.MtName = buf.DecodeString(64) 511 return nil 512 } 513 514 // MplsTableAddDelReply defines message 'mpls_table_add_del_reply'. 515 type MplsTableAddDelReply struct { 516 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 517 } 518 519 func (m *MplsTableAddDelReply) Reset() { *m = MplsTableAddDelReply{} } 520 func (*MplsTableAddDelReply) GetMessageName() string { return "mpls_table_add_del_reply" } 521 func (*MplsTableAddDelReply) GetCrcString() string { return "e8d4e804" } 522 func (*MplsTableAddDelReply) GetMessageType() api.MessageType { 523 return api.ReplyMessage 524 } 525 526 func (m *MplsTableAddDelReply) Size() (size int) { 527 if m == nil { 528 return 0 529 } 530 size += 4 // m.Retval 531 return size 532 } 533 func (m *MplsTableAddDelReply) Marshal(b []byte) ([]byte, error) { 534 if b == nil { 535 b = make([]byte, m.Size()) 536 } 537 buf := codec.NewBuffer(b) 538 buf.EncodeInt32(m.Retval) 539 return buf.Bytes(), nil 540 } 541 func (m *MplsTableAddDelReply) Unmarshal(b []byte) error { 542 buf := codec.NewBuffer(b) 543 m.Retval = buf.DecodeInt32() 544 return nil 545 } 546 547 // MplsTableDetails defines message 'mpls_table_details'. 548 type MplsTableDetails struct { 549 MtTable MplsTable `binapi:"mpls_table,name=mt_table" json:"mt_table,omitempty"` 550 } 551 552 func (m *MplsTableDetails) Reset() { *m = MplsTableDetails{} } 553 func (*MplsTableDetails) GetMessageName() string { return "mpls_table_details" } 554 func (*MplsTableDetails) GetCrcString() string { return "f03ecdc8" } 555 func (*MplsTableDetails) GetMessageType() api.MessageType { 556 return api.ReplyMessage 557 } 558 559 func (m *MplsTableDetails) Size() (size int) { 560 if m == nil { 561 return 0 562 } 563 size += 4 // m.MtTable.MtTableID 564 size += 64 // m.MtTable.MtName 565 return size 566 } 567 func (m *MplsTableDetails) Marshal(b []byte) ([]byte, error) { 568 if b == nil { 569 b = make([]byte, m.Size()) 570 } 571 buf := codec.NewBuffer(b) 572 buf.EncodeUint32(m.MtTable.MtTableID) 573 buf.EncodeString(m.MtTable.MtName, 64) 574 return buf.Bytes(), nil 575 } 576 func (m *MplsTableDetails) Unmarshal(b []byte) error { 577 buf := codec.NewBuffer(b) 578 m.MtTable.MtTableID = buf.DecodeUint32() 579 m.MtTable.MtName = buf.DecodeString(64) 580 return nil 581 } 582 583 // MplsTableDump defines message 'mpls_table_dump'. 584 type MplsTableDump struct{} 585 586 func (m *MplsTableDump) Reset() { *m = MplsTableDump{} } 587 func (*MplsTableDump) GetMessageName() string { return "mpls_table_dump" } 588 func (*MplsTableDump) GetCrcString() string { return "51077d14" } 589 func (*MplsTableDump) GetMessageType() api.MessageType { 590 return api.RequestMessage 591 } 592 593 func (m *MplsTableDump) Size() (size int) { 594 if m == nil { 595 return 0 596 } 597 return size 598 } 599 func (m *MplsTableDump) Marshal(b []byte) ([]byte, error) { 600 if b == nil { 601 b = make([]byte, m.Size()) 602 } 603 buf := codec.NewBuffer(b) 604 return buf.Bytes(), nil 605 } 606 func (m *MplsTableDump) Unmarshal(b []byte) error { 607 return nil 608 } 609 610 // MplsTunnelAddDel defines message 'mpls_tunnel_add_del'. 611 type MplsTunnelAddDel struct { 612 MtIsAdd bool `binapi:"bool,name=mt_is_add,default=true" json:"mt_is_add,omitempty"` 613 MtTunnel MplsTunnel `binapi:"mpls_tunnel,name=mt_tunnel" json:"mt_tunnel,omitempty"` 614 } 615 616 func (m *MplsTunnelAddDel) Reset() { *m = MplsTunnelAddDel{} } 617 func (*MplsTunnelAddDel) GetMessageName() string { return "mpls_tunnel_add_del" } 618 func (*MplsTunnelAddDel) GetCrcString() string { return "44350ac1" } 619 func (*MplsTunnelAddDel) GetMessageType() api.MessageType { 620 return api.RequestMessage 621 } 622 623 func (m *MplsTunnelAddDel) Size() (size int) { 624 if m == nil { 625 return 0 626 } 627 size += 1 // m.MtIsAdd 628 size += 4 // m.MtTunnel.MtSwIfIndex 629 size += 4 // m.MtTunnel.MtTunnelIndex 630 size += 1 // m.MtTunnel.MtL2Only 631 size += 1 // m.MtTunnel.MtIsMulticast 632 size += 64 // m.MtTunnel.MtTag 633 size += 1 // m.MtTunnel.MtNPaths 634 for j2 := 0; j2 < len(m.MtTunnel.MtPaths); j2++ { 635 var s2 fib_types.FibPath 636 _ = s2 637 if j2 < len(m.MtTunnel.MtPaths) { 638 s2 = m.MtTunnel.MtPaths[j2] 639 } 640 size += 4 // s2.SwIfIndex 641 size += 4 // s2.TableID 642 size += 4 // s2.RpfID 643 size += 1 // s2.Weight 644 size += 1 // s2.Preference 645 size += 4 // s2.Type 646 size += 4 // s2.Flags 647 size += 4 // s2.Proto 648 size += 1 * 16 // s2.Nh.Address 649 size += 4 // s2.Nh.ViaLabel 650 size += 4 // s2.Nh.ObjID 651 size += 4 // s2.Nh.ClassifyTableIndex 652 size += 1 // s2.NLabels 653 for j3 := 0; j3 < 16; j3++ { 654 size += 1 // s2.LabelStack[j3].IsUniform 655 size += 4 // s2.LabelStack[j3].Label 656 size += 1 // s2.LabelStack[j3].TTL 657 size += 1 // s2.LabelStack[j3].Exp 658 } 659 } 660 return size 661 } 662 func (m *MplsTunnelAddDel) Marshal(b []byte) ([]byte, error) { 663 if b == nil { 664 b = make([]byte, m.Size()) 665 } 666 buf := codec.NewBuffer(b) 667 buf.EncodeBool(m.MtIsAdd) 668 buf.EncodeUint32(uint32(m.MtTunnel.MtSwIfIndex)) 669 buf.EncodeUint32(m.MtTunnel.MtTunnelIndex) 670 buf.EncodeBool(m.MtTunnel.MtL2Only) 671 buf.EncodeBool(m.MtTunnel.MtIsMulticast) 672 buf.EncodeString(m.MtTunnel.MtTag, 64) 673 buf.EncodeUint8(uint8(len(m.MtTunnel.MtPaths))) 674 for j1 := 0; j1 < len(m.MtTunnel.MtPaths); j1++ { 675 var v1 fib_types.FibPath // MtPaths 676 if j1 < len(m.MtTunnel.MtPaths) { 677 v1 = m.MtTunnel.MtPaths[j1] 678 } 679 buf.EncodeUint32(v1.SwIfIndex) 680 buf.EncodeUint32(v1.TableID) 681 buf.EncodeUint32(v1.RpfID) 682 buf.EncodeUint8(v1.Weight) 683 buf.EncodeUint8(v1.Preference) 684 buf.EncodeUint32(uint32(v1.Type)) 685 buf.EncodeUint32(uint32(v1.Flags)) 686 buf.EncodeUint32(uint32(v1.Proto)) 687 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16) 688 buf.EncodeUint32(v1.Nh.ViaLabel) 689 buf.EncodeUint32(v1.Nh.ObjID) 690 buf.EncodeUint32(v1.Nh.ClassifyTableIndex) 691 buf.EncodeUint8(v1.NLabels) 692 for j2 := 0; j2 < 16; j2++ { 693 buf.EncodeUint8(v1.LabelStack[j2].IsUniform) 694 buf.EncodeUint32(v1.LabelStack[j2].Label) 695 buf.EncodeUint8(v1.LabelStack[j2].TTL) 696 buf.EncodeUint8(v1.LabelStack[j2].Exp) 697 } 698 } 699 return buf.Bytes(), nil 700 } 701 func (m *MplsTunnelAddDel) Unmarshal(b []byte) error { 702 buf := codec.NewBuffer(b) 703 m.MtIsAdd = buf.DecodeBool() 704 m.MtTunnel.MtSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 705 m.MtTunnel.MtTunnelIndex = buf.DecodeUint32() 706 m.MtTunnel.MtL2Only = buf.DecodeBool() 707 m.MtTunnel.MtIsMulticast = buf.DecodeBool() 708 m.MtTunnel.MtTag = buf.DecodeString(64) 709 m.MtTunnel.MtNPaths = buf.DecodeUint8() 710 m.MtTunnel.MtPaths = make([]fib_types.FibPath, m.MtTunnel.MtNPaths) 711 for j1 := 0; j1 < len(m.MtTunnel.MtPaths); j1++ { 712 m.MtTunnel.MtPaths[j1].SwIfIndex = buf.DecodeUint32() 713 m.MtTunnel.MtPaths[j1].TableID = buf.DecodeUint32() 714 m.MtTunnel.MtPaths[j1].RpfID = buf.DecodeUint32() 715 m.MtTunnel.MtPaths[j1].Weight = buf.DecodeUint8() 716 m.MtTunnel.MtPaths[j1].Preference = buf.DecodeUint8() 717 m.MtTunnel.MtPaths[j1].Type = fib_types.FibPathType(buf.DecodeUint32()) 718 m.MtTunnel.MtPaths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32()) 719 m.MtTunnel.MtPaths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32()) 720 copy(m.MtTunnel.MtPaths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16)) 721 m.MtTunnel.MtPaths[j1].Nh.ViaLabel = buf.DecodeUint32() 722 m.MtTunnel.MtPaths[j1].Nh.ObjID = buf.DecodeUint32() 723 m.MtTunnel.MtPaths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32() 724 m.MtTunnel.MtPaths[j1].NLabels = buf.DecodeUint8() 725 for j2 := 0; j2 < 16; j2++ { 726 m.MtTunnel.MtPaths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8() 727 m.MtTunnel.MtPaths[j1].LabelStack[j2].Label = buf.DecodeUint32() 728 m.MtTunnel.MtPaths[j1].LabelStack[j2].TTL = buf.DecodeUint8() 729 m.MtTunnel.MtPaths[j1].LabelStack[j2].Exp = buf.DecodeUint8() 730 } 731 } 732 return nil 733 } 734 735 // MplsTunnelAddDelReply defines message 'mpls_tunnel_add_del_reply'. 736 type MplsTunnelAddDelReply struct { 737 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 738 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 739 TunnelIndex uint32 `binapi:"u32,name=tunnel_index" json:"tunnel_index,omitempty"` 740 } 741 742 func (m *MplsTunnelAddDelReply) Reset() { *m = MplsTunnelAddDelReply{} } 743 func (*MplsTunnelAddDelReply) GetMessageName() string { return "mpls_tunnel_add_del_reply" } 744 func (*MplsTunnelAddDelReply) GetCrcString() string { return "afb01472" } 745 func (*MplsTunnelAddDelReply) GetMessageType() api.MessageType { 746 return api.ReplyMessage 747 } 748 749 func (m *MplsTunnelAddDelReply) Size() (size int) { 750 if m == nil { 751 return 0 752 } 753 size += 4 // m.Retval 754 size += 4 // m.SwIfIndex 755 size += 4 // m.TunnelIndex 756 return size 757 } 758 func (m *MplsTunnelAddDelReply) Marshal(b []byte) ([]byte, error) { 759 if b == nil { 760 b = make([]byte, m.Size()) 761 } 762 buf := codec.NewBuffer(b) 763 buf.EncodeInt32(m.Retval) 764 buf.EncodeUint32(uint32(m.SwIfIndex)) 765 buf.EncodeUint32(m.TunnelIndex) 766 return buf.Bytes(), nil 767 } 768 func (m *MplsTunnelAddDelReply) Unmarshal(b []byte) error { 769 buf := codec.NewBuffer(b) 770 m.Retval = buf.DecodeInt32() 771 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 772 m.TunnelIndex = buf.DecodeUint32() 773 return nil 774 } 775 776 // MplsTunnelDetails defines message 'mpls_tunnel_details'. 777 type MplsTunnelDetails struct { 778 MtTunnel MplsTunnel `binapi:"mpls_tunnel,name=mt_tunnel" json:"mt_tunnel,omitempty"` 779 } 780 781 func (m *MplsTunnelDetails) Reset() { *m = MplsTunnelDetails{} } 782 func (*MplsTunnelDetails) GetMessageName() string { return "mpls_tunnel_details" } 783 func (*MplsTunnelDetails) GetCrcString() string { return "57118ae3" } 784 func (*MplsTunnelDetails) GetMessageType() api.MessageType { 785 return api.ReplyMessage 786 } 787 788 func (m *MplsTunnelDetails) Size() (size int) { 789 if m == nil { 790 return 0 791 } 792 size += 4 // m.MtTunnel.MtSwIfIndex 793 size += 4 // m.MtTunnel.MtTunnelIndex 794 size += 1 // m.MtTunnel.MtL2Only 795 size += 1 // m.MtTunnel.MtIsMulticast 796 size += 64 // m.MtTunnel.MtTag 797 size += 1 // m.MtTunnel.MtNPaths 798 for j2 := 0; j2 < len(m.MtTunnel.MtPaths); j2++ { 799 var s2 fib_types.FibPath 800 _ = s2 801 if j2 < len(m.MtTunnel.MtPaths) { 802 s2 = m.MtTunnel.MtPaths[j2] 803 } 804 size += 4 // s2.SwIfIndex 805 size += 4 // s2.TableID 806 size += 4 // s2.RpfID 807 size += 1 // s2.Weight 808 size += 1 // s2.Preference 809 size += 4 // s2.Type 810 size += 4 // s2.Flags 811 size += 4 // s2.Proto 812 size += 1 * 16 // s2.Nh.Address 813 size += 4 // s2.Nh.ViaLabel 814 size += 4 // s2.Nh.ObjID 815 size += 4 // s2.Nh.ClassifyTableIndex 816 size += 1 // s2.NLabels 817 for j3 := 0; j3 < 16; j3++ { 818 size += 1 // s2.LabelStack[j3].IsUniform 819 size += 4 // s2.LabelStack[j3].Label 820 size += 1 // s2.LabelStack[j3].TTL 821 size += 1 // s2.LabelStack[j3].Exp 822 } 823 } 824 return size 825 } 826 func (m *MplsTunnelDetails) Marshal(b []byte) ([]byte, error) { 827 if b == nil { 828 b = make([]byte, m.Size()) 829 } 830 buf := codec.NewBuffer(b) 831 buf.EncodeUint32(uint32(m.MtTunnel.MtSwIfIndex)) 832 buf.EncodeUint32(m.MtTunnel.MtTunnelIndex) 833 buf.EncodeBool(m.MtTunnel.MtL2Only) 834 buf.EncodeBool(m.MtTunnel.MtIsMulticast) 835 buf.EncodeString(m.MtTunnel.MtTag, 64) 836 buf.EncodeUint8(uint8(len(m.MtTunnel.MtPaths))) 837 for j1 := 0; j1 < len(m.MtTunnel.MtPaths); j1++ { 838 var v1 fib_types.FibPath // MtPaths 839 if j1 < len(m.MtTunnel.MtPaths) { 840 v1 = m.MtTunnel.MtPaths[j1] 841 } 842 buf.EncodeUint32(v1.SwIfIndex) 843 buf.EncodeUint32(v1.TableID) 844 buf.EncodeUint32(v1.RpfID) 845 buf.EncodeUint8(v1.Weight) 846 buf.EncodeUint8(v1.Preference) 847 buf.EncodeUint32(uint32(v1.Type)) 848 buf.EncodeUint32(uint32(v1.Flags)) 849 buf.EncodeUint32(uint32(v1.Proto)) 850 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16) 851 buf.EncodeUint32(v1.Nh.ViaLabel) 852 buf.EncodeUint32(v1.Nh.ObjID) 853 buf.EncodeUint32(v1.Nh.ClassifyTableIndex) 854 buf.EncodeUint8(v1.NLabels) 855 for j2 := 0; j2 < 16; j2++ { 856 buf.EncodeUint8(v1.LabelStack[j2].IsUniform) 857 buf.EncodeUint32(v1.LabelStack[j2].Label) 858 buf.EncodeUint8(v1.LabelStack[j2].TTL) 859 buf.EncodeUint8(v1.LabelStack[j2].Exp) 860 } 861 } 862 return buf.Bytes(), nil 863 } 864 func (m *MplsTunnelDetails) Unmarshal(b []byte) error { 865 buf := codec.NewBuffer(b) 866 m.MtTunnel.MtSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 867 m.MtTunnel.MtTunnelIndex = buf.DecodeUint32() 868 m.MtTunnel.MtL2Only = buf.DecodeBool() 869 m.MtTunnel.MtIsMulticast = buf.DecodeBool() 870 m.MtTunnel.MtTag = buf.DecodeString(64) 871 m.MtTunnel.MtNPaths = buf.DecodeUint8() 872 m.MtTunnel.MtPaths = make([]fib_types.FibPath, m.MtTunnel.MtNPaths) 873 for j1 := 0; j1 < len(m.MtTunnel.MtPaths); j1++ { 874 m.MtTunnel.MtPaths[j1].SwIfIndex = buf.DecodeUint32() 875 m.MtTunnel.MtPaths[j1].TableID = buf.DecodeUint32() 876 m.MtTunnel.MtPaths[j1].RpfID = buf.DecodeUint32() 877 m.MtTunnel.MtPaths[j1].Weight = buf.DecodeUint8() 878 m.MtTunnel.MtPaths[j1].Preference = buf.DecodeUint8() 879 m.MtTunnel.MtPaths[j1].Type = fib_types.FibPathType(buf.DecodeUint32()) 880 m.MtTunnel.MtPaths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32()) 881 m.MtTunnel.MtPaths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32()) 882 copy(m.MtTunnel.MtPaths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16)) 883 m.MtTunnel.MtPaths[j1].Nh.ViaLabel = buf.DecodeUint32() 884 m.MtTunnel.MtPaths[j1].Nh.ObjID = buf.DecodeUint32() 885 m.MtTunnel.MtPaths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32() 886 m.MtTunnel.MtPaths[j1].NLabels = buf.DecodeUint8() 887 for j2 := 0; j2 < 16; j2++ { 888 m.MtTunnel.MtPaths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8() 889 m.MtTunnel.MtPaths[j1].LabelStack[j2].Label = buf.DecodeUint32() 890 m.MtTunnel.MtPaths[j1].LabelStack[j2].TTL = buf.DecodeUint8() 891 m.MtTunnel.MtPaths[j1].LabelStack[j2].Exp = buf.DecodeUint8() 892 } 893 } 894 return nil 895 } 896 897 // MplsTunnelDump defines message 'mpls_tunnel_dump'. 898 type MplsTunnelDump struct { 899 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"` 900 } 901 902 func (m *MplsTunnelDump) Reset() { *m = MplsTunnelDump{} } 903 func (*MplsTunnelDump) GetMessageName() string { return "mpls_tunnel_dump" } 904 func (*MplsTunnelDump) GetCrcString() string { return "f9e6675e" } 905 func (*MplsTunnelDump) GetMessageType() api.MessageType { 906 return api.RequestMessage 907 } 908 909 func (m *MplsTunnelDump) Size() (size int) { 910 if m == nil { 911 return 0 912 } 913 size += 4 // m.SwIfIndex 914 return size 915 } 916 func (m *MplsTunnelDump) Marshal(b []byte) ([]byte, error) { 917 if b == nil { 918 b = make([]byte, m.Size()) 919 } 920 buf := codec.NewBuffer(b) 921 buf.EncodeUint32(uint32(m.SwIfIndex)) 922 return buf.Bytes(), nil 923 } 924 func (m *MplsTunnelDump) Unmarshal(b []byte) error { 925 buf := codec.NewBuffer(b) 926 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 927 return nil 928 } 929 930 // SwInterfaceSetMplsEnable defines message 'sw_interface_set_mpls_enable'. 931 type SwInterfaceSetMplsEnable struct { 932 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 933 Enable bool `binapi:"bool,name=enable,default=true" json:"enable,omitempty"` 934 } 935 936 func (m *SwInterfaceSetMplsEnable) Reset() { *m = SwInterfaceSetMplsEnable{} } 937 func (*SwInterfaceSetMplsEnable) GetMessageName() string { return "sw_interface_set_mpls_enable" } 938 func (*SwInterfaceSetMplsEnable) GetCrcString() string { return "ae6cfcfb" } 939 func (*SwInterfaceSetMplsEnable) GetMessageType() api.MessageType { 940 return api.RequestMessage 941 } 942 943 func (m *SwInterfaceSetMplsEnable) Size() (size int) { 944 if m == nil { 945 return 0 946 } 947 size += 4 // m.SwIfIndex 948 size += 1 // m.Enable 949 return size 950 } 951 func (m *SwInterfaceSetMplsEnable) Marshal(b []byte) ([]byte, error) { 952 if b == nil { 953 b = make([]byte, m.Size()) 954 } 955 buf := codec.NewBuffer(b) 956 buf.EncodeUint32(uint32(m.SwIfIndex)) 957 buf.EncodeBool(m.Enable) 958 return buf.Bytes(), nil 959 } 960 func (m *SwInterfaceSetMplsEnable) Unmarshal(b []byte) error { 961 buf := codec.NewBuffer(b) 962 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 963 m.Enable = buf.DecodeBool() 964 return nil 965 } 966 967 // SwInterfaceSetMplsEnableReply defines message 'sw_interface_set_mpls_enable_reply'. 968 type SwInterfaceSetMplsEnableReply struct { 969 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 970 } 971 972 func (m *SwInterfaceSetMplsEnableReply) Reset() { *m = SwInterfaceSetMplsEnableReply{} } 973 func (*SwInterfaceSetMplsEnableReply) GetMessageName() string { 974 return "sw_interface_set_mpls_enable_reply" 975 } 976 func (*SwInterfaceSetMplsEnableReply) GetCrcString() string { return "e8d4e804" } 977 func (*SwInterfaceSetMplsEnableReply) GetMessageType() api.MessageType { 978 return api.ReplyMessage 979 } 980 981 func (m *SwInterfaceSetMplsEnableReply) Size() (size int) { 982 if m == nil { 983 return 0 984 } 985 size += 4 // m.Retval 986 return size 987 } 988 func (m *SwInterfaceSetMplsEnableReply) Marshal(b []byte) ([]byte, error) { 989 if b == nil { 990 b = make([]byte, m.Size()) 991 } 992 buf := codec.NewBuffer(b) 993 buf.EncodeInt32(m.Retval) 994 return buf.Bytes(), nil 995 } 996 func (m *SwInterfaceSetMplsEnableReply) Unmarshal(b []byte) error { 997 buf := codec.NewBuffer(b) 998 m.Retval = buf.DecodeInt32() 999 return nil 1000 } 1001 1002 func init() { file_mpls_binapi_init() } 1003 func file_mpls_binapi_init() { 1004 api.RegisterMessage((*MplsIPBindUnbind)(nil), "mpls_ip_bind_unbind_c7533b32") 1005 api.RegisterMessage((*MplsIPBindUnbindReply)(nil), "mpls_ip_bind_unbind_reply_e8d4e804") 1006 api.RegisterMessage((*MplsRouteAddDel)(nil), "mpls_route_add_del_8e1d1e07") 1007 api.RegisterMessage((*MplsRouteAddDelReply)(nil), "mpls_route_add_del_reply_1992deab") 1008 api.RegisterMessage((*MplsRouteDetails)(nil), "mpls_route_details_9b5043dc") 1009 api.RegisterMessage((*MplsRouteDump)(nil), "mpls_route_dump_935fdefa") 1010 api.RegisterMessage((*MplsTableAddDel)(nil), "mpls_table_add_del_57817512") 1011 api.RegisterMessage((*MplsTableAddDelReply)(nil), "mpls_table_add_del_reply_e8d4e804") 1012 api.RegisterMessage((*MplsTableDetails)(nil), "mpls_table_details_f03ecdc8") 1013 api.RegisterMessage((*MplsTableDump)(nil), "mpls_table_dump_51077d14") 1014 api.RegisterMessage((*MplsTunnelAddDel)(nil), "mpls_tunnel_add_del_44350ac1") 1015 api.RegisterMessage((*MplsTunnelAddDelReply)(nil), "mpls_tunnel_add_del_reply_afb01472") 1016 api.RegisterMessage((*MplsTunnelDetails)(nil), "mpls_tunnel_details_57118ae3") 1017 api.RegisterMessage((*MplsTunnelDump)(nil), "mpls_tunnel_dump_f9e6675e") 1018 api.RegisterMessage((*SwInterfaceSetMplsEnable)(nil), "sw_interface_set_mpls_enable_ae6cfcfb") 1019 api.RegisterMessage((*SwInterfaceSetMplsEnableReply)(nil), "sw_interface_set_mpls_enable_reply_e8d4e804") 1020 } 1021 1022 // Messages returns list of all messages in this module. 1023 func AllMessages() []api.Message { 1024 return []api.Message{ 1025 (*MplsIPBindUnbind)(nil), 1026 (*MplsIPBindUnbindReply)(nil), 1027 (*MplsRouteAddDel)(nil), 1028 (*MplsRouteAddDelReply)(nil), 1029 (*MplsRouteDetails)(nil), 1030 (*MplsRouteDump)(nil), 1031 (*MplsTableAddDel)(nil), 1032 (*MplsTableAddDelReply)(nil), 1033 (*MplsTableDetails)(nil), 1034 (*MplsTableDump)(nil), 1035 (*MplsTunnelAddDel)(nil), 1036 (*MplsTunnelAddDelReply)(nil), 1037 (*MplsTunnelDetails)(nil), 1038 (*MplsTunnelDump)(nil), 1039 (*SwInterfaceSetMplsEnable)(nil), 1040 (*SwInterfaceSetMplsEnableReply)(nil), 1041 } 1042 }