Jonathan Hart | 44bdbfc | 2020-04-14 17:45:47 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University |
| 3 | * Copyright (c) 2011, 2012 Open Networking Foundation |
| 4 | * Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler. |
| 5 | * Copyright 2018, Red Hat, Inc. |
| 6 | */ |
| 7 | // Automatically generated by LOXI from template module.go |
| 8 | // Do not modify |
| 9 | |
| 10 | package of14 |
| 11 | |
| 12 | import ( |
| 13 | "bytes" |
| 14 | "encoding/binary" |
| 15 | "encoding/json" |
| 16 | "fmt" |
| 17 | "net" |
| 18 | |
| 19 | "github.com/opencord/goloxi" |
| 20 | ) |
| 21 | |
| 22 | type Action struct { |
| 23 | Type uint16 |
| 24 | Len uint16 |
| 25 | } |
| 26 | |
| 27 | type IAction interface { |
| 28 | goloxi.Serializable |
| 29 | GetType() uint16 |
| 30 | GetLen() uint16 |
| 31 | GetActionName() string |
| 32 | GetActionFields() map[string]interface{} |
| 33 | } |
| 34 | |
| 35 | func (self *Action) GetType() uint16 { |
| 36 | return self.Type |
| 37 | } |
| 38 | |
| 39 | func (self *Action) SetType(v uint16) { |
| 40 | self.Type = v |
| 41 | } |
| 42 | |
| 43 | func (self *Action) GetLen() uint16 { |
| 44 | return self.Len |
| 45 | } |
| 46 | |
| 47 | func (self *Action) SetLen(v uint16) { |
| 48 | self.Len = v |
| 49 | } |
| 50 | |
| 51 | func (self *Action) Serialize(encoder *goloxi.Encoder) error { |
| 52 | |
| 53 | encoder.PutUint16(uint16(self.Type)) |
| 54 | encoder.PutUint16(uint16(self.Len)) |
| 55 | |
| 56 | return nil |
| 57 | } |
| 58 | |
| 59 | func DecodeAction(decoder *goloxi.Decoder) (goloxi.IAction, error) { |
| 60 | _action := &Action{} |
| 61 | if decoder.Length() < 4 { |
| 62 | return nil, fmt.Errorf("Action packet too short: %d < 4", decoder.Length()) |
| 63 | } |
| 64 | _action.Type = uint16(decoder.ReadUint16()) |
| 65 | _action.Len = uint16(decoder.ReadUint16()) |
| 66 | oldDecoder := decoder |
| 67 | defer func() { decoder = oldDecoder }() |
| 68 | decoder = decoder.SliceDecoder(int(_action.Len), 2+2) |
| 69 | |
| 70 | switch _action.Type { |
| 71 | case 0: |
| 72 | return DecodeActionOutput(_action, decoder) |
| 73 | case 11: |
| 74 | return DecodeActionCopyTtlOut(_action, decoder) |
| 75 | case 12: |
| 76 | return DecodeActionCopyTtlIn(_action, decoder) |
| 77 | case 15: |
| 78 | return DecodeActionSetMplsTtl(_action, decoder) |
| 79 | case 16: |
| 80 | return DecodeActionDecMplsTtl(_action, decoder) |
| 81 | case 17: |
| 82 | return DecodeActionPushVlan(_action, decoder) |
| 83 | case 18: |
| 84 | return DecodeActionPopVlan(_action, decoder) |
| 85 | case 19: |
| 86 | return DecodeActionPushMpls(_action, decoder) |
| 87 | case 20: |
| 88 | return DecodeActionPopMpls(_action, decoder) |
| 89 | case 21: |
| 90 | return DecodeActionSetQueue(_action, decoder) |
| 91 | case 22: |
| 92 | return DecodeActionGroup(_action, decoder) |
| 93 | case 23: |
| 94 | return DecodeActionSetNwTtl(_action, decoder) |
| 95 | case 24: |
| 96 | return DecodeActionDecNwTtl(_action, decoder) |
| 97 | case 25: |
| 98 | return DecodeActionSetField(_action, decoder) |
| 99 | case 26: |
| 100 | return DecodeActionPushPbb(_action, decoder) |
| 101 | case 27: |
| 102 | return DecodeActionPopPbb(_action, decoder) |
| 103 | case 65535: |
| 104 | return DecodeActionExperimenter(_action, decoder) |
| 105 | default: |
| 106 | return nil, fmt.Errorf("Invalid type '%d' for 'Action'", _action.Type) |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | func NewAction(_type uint16) *Action { |
| 111 | obj := &Action{} |
| 112 | obj.Type = _type |
| 113 | return obj |
| 114 | } |
| 115 | |
| 116 | type ActionExperimenter struct { |
| 117 | *Action |
| 118 | Experimenter uint32 |
| 119 | } |
| 120 | |
| 121 | type IActionExperimenter interface { |
| 122 | goloxi.IAction |
| 123 | GetExperimenter() uint32 |
| 124 | } |
| 125 | |
| 126 | func (self *ActionExperimenter) GetExperimenter() uint32 { |
| 127 | return self.Experimenter |
| 128 | } |
| 129 | |
| 130 | func (self *ActionExperimenter) SetExperimenter(v uint32) { |
| 131 | self.Experimenter = v |
| 132 | } |
| 133 | |
| 134 | func (self *ActionExperimenter) Serialize(encoder *goloxi.Encoder) error { |
| 135 | if err := self.Action.Serialize(encoder); err != nil { |
| 136 | return err |
| 137 | } |
| 138 | |
| 139 | encoder.PutUint32(uint32(self.Experimenter)) |
| 140 | |
| 141 | return nil |
| 142 | } |
| 143 | |
| 144 | func DecodeActionExperimenter(parent *Action, decoder *goloxi.Decoder) (IActionExperimenter, error) { |
| 145 | _actionexperimenter := &ActionExperimenter{Action: parent} |
| 146 | if decoder.Length() < 4 { |
| 147 | return nil, fmt.Errorf("ActionExperimenter packet too short: %d < 4", decoder.Length()) |
| 148 | } |
| 149 | _actionexperimenter.Experimenter = uint32(decoder.ReadUint32()) |
| 150 | |
| 151 | switch _actionexperimenter.Experimenter { |
| 152 | case 8992: |
| 153 | return DecodeActionNicira(_actionexperimenter, decoder) |
| 154 | case 6035143: |
| 155 | return DecodeActionBsn(_actionexperimenter, decoder) |
| 156 | default: |
| 157 | return nil, fmt.Errorf("Invalid type '%d' for 'ActionExperimenter'", _actionexperimenter.Experimenter) |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | func NewActionExperimenter(_experimenter uint32) *ActionExperimenter { |
| 162 | obj := &ActionExperimenter{ |
| 163 | Action: NewAction(65535), |
| 164 | } |
| 165 | obj.Experimenter = _experimenter |
| 166 | return obj |
| 167 | } |
| 168 | func (self *ActionExperimenter) GetActionName() string { |
| 169 | return "experimenter" |
| 170 | } |
| 171 | |
| 172 | func (self *ActionExperimenter) GetActionFields() map[string]interface{} { |
| 173 | return map[string]interface{}{ |
| 174 | "Experimenter": self.Experimenter, |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | func (self *ActionExperimenter) MarshalJSON() ([]byte, error) { |
| 179 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 180 | if err != nil { |
| 181 | return nil, err |
| 182 | } |
| 183 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 184 | } |
| 185 | |
| 186 | type ActionBsn struct { |
| 187 | *ActionExperimenter |
| 188 | Subtype uint32 |
| 189 | } |
| 190 | |
| 191 | type IActionBsn interface { |
| 192 | IActionExperimenter |
| 193 | GetSubtype() uint32 |
| 194 | } |
| 195 | |
| 196 | func (self *ActionBsn) GetSubtype() uint32 { |
| 197 | return self.Subtype |
| 198 | } |
| 199 | |
| 200 | func (self *ActionBsn) SetSubtype(v uint32) { |
| 201 | self.Subtype = v |
| 202 | } |
| 203 | |
| 204 | func (self *ActionBsn) Serialize(encoder *goloxi.Encoder) error { |
| 205 | if err := self.ActionExperimenter.Serialize(encoder); err != nil { |
| 206 | return err |
| 207 | } |
| 208 | |
| 209 | encoder.PutUint32(uint32(self.Subtype)) |
| 210 | |
| 211 | return nil |
| 212 | } |
| 213 | |
| 214 | func DecodeActionBsn(parent *ActionExperimenter, decoder *goloxi.Decoder) (IActionBsn, error) { |
| 215 | _actionbsn := &ActionBsn{ActionExperimenter: parent} |
| 216 | if decoder.Length() < 4 { |
| 217 | return nil, fmt.Errorf("ActionBsn packet too short: %d < 4", decoder.Length()) |
| 218 | } |
| 219 | _actionbsn.Subtype = uint32(decoder.ReadUint32()) |
| 220 | |
| 221 | switch _actionbsn.Subtype { |
| 222 | case 1: |
| 223 | return DecodeActionBsnMirror(_actionbsn, decoder) |
| 224 | case 2: |
| 225 | return DecodeActionBsnSetTunnelDst(_actionbsn, decoder) |
| 226 | case 4: |
| 227 | return DecodeActionBsnChecksum(_actionbsn, decoder) |
| 228 | case 5: |
| 229 | return DecodeActionBsnGentable(_actionbsn, decoder) |
| 230 | default: |
| 231 | return nil, fmt.Errorf("Invalid type '%d' for 'ActionBsn'", _actionbsn.Subtype) |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | func NewActionBsn(_subtype uint32) *ActionBsn { |
| 236 | obj := &ActionBsn{ |
| 237 | ActionExperimenter: NewActionExperimenter(6035143), |
| 238 | } |
| 239 | obj.Subtype = _subtype |
| 240 | return obj |
| 241 | } |
| 242 | func (self *ActionBsn) GetActionName() string { |
| 243 | return "bsn" |
| 244 | } |
| 245 | |
| 246 | func (self *ActionBsn) GetActionFields() map[string]interface{} { |
| 247 | return map[string]interface{}{ |
| 248 | "Subtype": self.Subtype, |
| 249 | } |
| 250 | } |
| 251 | |
| 252 | func (self *ActionBsn) MarshalJSON() ([]byte, error) { |
| 253 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 254 | if err != nil { |
| 255 | return nil, err |
| 256 | } |
| 257 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 258 | } |
| 259 | |
| 260 | type ActionBsnChecksum struct { |
| 261 | *ActionBsn |
| 262 | Checksum Checksum128 |
| 263 | } |
| 264 | |
| 265 | type IActionBsnChecksum interface { |
| 266 | IActionBsn |
| 267 | GetChecksum() Checksum128 |
| 268 | } |
| 269 | |
| 270 | func (self *ActionBsnChecksum) GetChecksum() Checksum128 { |
| 271 | return self.Checksum |
| 272 | } |
| 273 | |
| 274 | func (self *ActionBsnChecksum) SetChecksum(v Checksum128) { |
| 275 | self.Checksum = v |
| 276 | } |
| 277 | |
| 278 | func (self *ActionBsnChecksum) Serialize(encoder *goloxi.Encoder) error { |
| 279 | startIndex := len(encoder.Bytes()) |
| 280 | if err := self.ActionBsn.Serialize(encoder); err != nil { |
| 281 | return err |
| 282 | } |
| 283 | |
| 284 | self.Checksum.Serialize(encoder) |
| 285 | length := len(encoder.Bytes()) - startIndex |
| 286 | |
| 287 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 288 | |
| 289 | return nil |
| 290 | } |
| 291 | |
| 292 | func DecodeActionBsnChecksum(parent *ActionBsn, decoder *goloxi.Decoder) (*ActionBsnChecksum, error) { |
| 293 | _actionbsnchecksum := &ActionBsnChecksum{ActionBsn: parent} |
| 294 | if decoder.Length() < 16 { |
| 295 | return nil, fmt.Errorf("ActionBsnChecksum packet too short: %d < 16", decoder.Length()) |
| 296 | } |
| 297 | _actionbsnchecksum.Checksum.Decode(decoder) |
| 298 | return _actionbsnchecksum, nil |
| 299 | } |
| 300 | |
| 301 | func NewActionBsnChecksum() *ActionBsnChecksum { |
| 302 | obj := &ActionBsnChecksum{ |
| 303 | ActionBsn: NewActionBsn(4), |
| 304 | } |
| 305 | return obj |
| 306 | } |
| 307 | func (self *ActionBsnChecksum) GetActionName() string { |
| 308 | return "bsn_checksum" |
| 309 | } |
| 310 | |
| 311 | func (self *ActionBsnChecksum) GetActionFields() map[string]interface{} { |
| 312 | return map[string]interface{}{ |
| 313 | "Checksum": self.Checksum, |
| 314 | } |
| 315 | } |
| 316 | |
| 317 | func (self *ActionBsnChecksum) MarshalJSON() ([]byte, error) { |
| 318 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 319 | if err != nil { |
| 320 | return nil, err |
| 321 | } |
| 322 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 323 | } |
| 324 | |
| 325 | type ActionBsnGentable struct { |
| 326 | *ActionBsn |
| 327 | TableId uint32 |
| 328 | Key []IBsnTlv |
| 329 | } |
| 330 | |
| 331 | type IActionBsnGentable interface { |
| 332 | IActionBsn |
| 333 | GetTableId() uint32 |
| 334 | GetKey() []IBsnTlv |
| 335 | } |
| 336 | |
| 337 | func (self *ActionBsnGentable) GetTableId() uint32 { |
| 338 | return self.TableId |
| 339 | } |
| 340 | |
| 341 | func (self *ActionBsnGentable) SetTableId(v uint32) { |
| 342 | self.TableId = v |
| 343 | } |
| 344 | |
| 345 | func (self *ActionBsnGentable) GetKey() []IBsnTlv { |
| 346 | return self.Key |
| 347 | } |
| 348 | |
| 349 | func (self *ActionBsnGentable) SetKey(v []IBsnTlv) { |
| 350 | self.Key = v |
| 351 | } |
| 352 | |
| 353 | func (self *ActionBsnGentable) Serialize(encoder *goloxi.Encoder) error { |
| 354 | startIndex := len(encoder.Bytes()) |
| 355 | if err := self.ActionBsn.Serialize(encoder); err != nil { |
| 356 | return err |
| 357 | } |
| 358 | |
| 359 | encoder.PutUint32(uint32(self.TableId)) |
| 360 | for _, obj := range self.Key { |
| 361 | if err := obj.Serialize(encoder); err != nil { |
| 362 | return err |
| 363 | } |
| 364 | } |
| 365 | length := len(encoder.Bytes()) - startIndex |
| 366 | |
| 367 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 368 | |
| 369 | return nil |
| 370 | } |
| 371 | |
| 372 | func DecodeActionBsnGentable(parent *ActionBsn, decoder *goloxi.Decoder) (*ActionBsnGentable, error) { |
| 373 | _actionbsngentable := &ActionBsnGentable{ActionBsn: parent} |
| 374 | if decoder.Length() < 4 { |
| 375 | return nil, fmt.Errorf("ActionBsnGentable packet too short: %d < 4", decoder.Length()) |
| 376 | } |
| 377 | _actionbsngentable.TableId = uint32(decoder.ReadUint32()) |
| 378 | |
| 379 | for decoder.Length() >= 4 { |
| 380 | item, err := DecodeBsnTlv(decoder) |
| 381 | if err != nil { |
| 382 | return nil, err |
| 383 | } |
| 384 | if item != nil { |
| 385 | _actionbsngentable.Key = append(_actionbsngentable.Key, item) |
| 386 | } |
| 387 | } |
| 388 | return _actionbsngentable, nil |
| 389 | } |
| 390 | |
| 391 | func NewActionBsnGentable() *ActionBsnGentable { |
| 392 | obj := &ActionBsnGentable{ |
| 393 | ActionBsn: NewActionBsn(5), |
| 394 | } |
| 395 | return obj |
| 396 | } |
| 397 | func (self *ActionBsnGentable) GetActionName() string { |
| 398 | return "bsn_gentable" |
| 399 | } |
| 400 | |
| 401 | func (self *ActionBsnGentable) GetActionFields() map[string]interface{} { |
| 402 | return map[string]interface{}{ |
| 403 | "TableId": self.TableId, |
| 404 | "Key": self.Key, |
| 405 | } |
| 406 | } |
| 407 | |
| 408 | func (self *ActionBsnGentable) MarshalJSON() ([]byte, error) { |
| 409 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 410 | if err != nil { |
| 411 | return nil, err |
| 412 | } |
| 413 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 414 | } |
| 415 | |
| 416 | type ActionBsnMirror struct { |
| 417 | *ActionBsn |
| 418 | DestPort uint32 |
| 419 | VlanTag uint32 |
| 420 | CopyStage uint8 |
| 421 | } |
| 422 | |
| 423 | type IActionBsnMirror interface { |
| 424 | IActionBsn |
| 425 | GetDestPort() uint32 |
| 426 | GetVlanTag() uint32 |
| 427 | GetCopyStage() uint8 |
| 428 | } |
| 429 | |
| 430 | func (self *ActionBsnMirror) GetDestPort() uint32 { |
| 431 | return self.DestPort |
| 432 | } |
| 433 | |
| 434 | func (self *ActionBsnMirror) SetDestPort(v uint32) { |
| 435 | self.DestPort = v |
| 436 | } |
| 437 | |
| 438 | func (self *ActionBsnMirror) GetVlanTag() uint32 { |
| 439 | return self.VlanTag |
| 440 | } |
| 441 | |
| 442 | func (self *ActionBsnMirror) SetVlanTag(v uint32) { |
| 443 | self.VlanTag = v |
| 444 | } |
| 445 | |
| 446 | func (self *ActionBsnMirror) GetCopyStage() uint8 { |
| 447 | return self.CopyStage |
| 448 | } |
| 449 | |
| 450 | func (self *ActionBsnMirror) SetCopyStage(v uint8) { |
| 451 | self.CopyStage = v |
| 452 | } |
| 453 | |
| 454 | func (self *ActionBsnMirror) Serialize(encoder *goloxi.Encoder) error { |
| 455 | startIndex := len(encoder.Bytes()) |
| 456 | if err := self.ActionBsn.Serialize(encoder); err != nil { |
| 457 | return err |
| 458 | } |
| 459 | |
| 460 | encoder.PutUint32(uint32(self.DestPort)) |
| 461 | encoder.PutUint32(uint32(self.VlanTag)) |
| 462 | encoder.PutUint8(uint8(self.CopyStage)) |
| 463 | encoder.Write(bytes.Repeat([]byte{0}, 3)) |
| 464 | length := len(encoder.Bytes()) - startIndex |
| 465 | |
| 466 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 467 | |
| 468 | return nil |
| 469 | } |
| 470 | |
| 471 | func DecodeActionBsnMirror(parent *ActionBsn, decoder *goloxi.Decoder) (*ActionBsnMirror, error) { |
| 472 | _actionbsnmirror := &ActionBsnMirror{ActionBsn: parent} |
| 473 | if decoder.Length() < 12 { |
| 474 | return nil, fmt.Errorf("ActionBsnMirror packet too short: %d < 12", decoder.Length()) |
| 475 | } |
| 476 | _actionbsnmirror.DestPort = uint32(decoder.ReadUint32()) |
| 477 | _actionbsnmirror.VlanTag = uint32(decoder.ReadUint32()) |
| 478 | _actionbsnmirror.CopyStage = uint8(decoder.ReadByte()) |
| 479 | decoder.Skip(3) |
| 480 | return _actionbsnmirror, nil |
| 481 | } |
| 482 | |
| 483 | func NewActionBsnMirror() *ActionBsnMirror { |
| 484 | obj := &ActionBsnMirror{ |
| 485 | ActionBsn: NewActionBsn(1), |
| 486 | } |
| 487 | return obj |
| 488 | } |
| 489 | func (self *ActionBsnMirror) GetActionName() string { |
| 490 | return "bsn_mirror" |
| 491 | } |
| 492 | |
| 493 | func (self *ActionBsnMirror) GetActionFields() map[string]interface{} { |
| 494 | return map[string]interface{}{ |
| 495 | "DestPort": self.DestPort, |
| 496 | "VlanTag": self.VlanTag, |
| 497 | "CopyStage": self.CopyStage, |
| 498 | } |
| 499 | } |
| 500 | |
| 501 | func (self *ActionBsnMirror) MarshalJSON() ([]byte, error) { |
| 502 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 503 | if err != nil { |
| 504 | return nil, err |
| 505 | } |
| 506 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 507 | } |
| 508 | |
| 509 | type ActionBsnSetTunnelDst struct { |
| 510 | *ActionBsn |
| 511 | Dst uint32 |
| 512 | } |
| 513 | |
| 514 | type IActionBsnSetTunnelDst interface { |
| 515 | IActionBsn |
| 516 | GetDst() uint32 |
| 517 | } |
| 518 | |
| 519 | func (self *ActionBsnSetTunnelDst) GetDst() uint32 { |
| 520 | return self.Dst |
| 521 | } |
| 522 | |
| 523 | func (self *ActionBsnSetTunnelDst) SetDst(v uint32) { |
| 524 | self.Dst = v |
| 525 | } |
| 526 | |
| 527 | func (self *ActionBsnSetTunnelDst) Serialize(encoder *goloxi.Encoder) error { |
| 528 | startIndex := len(encoder.Bytes()) |
| 529 | if err := self.ActionBsn.Serialize(encoder); err != nil { |
| 530 | return err |
| 531 | } |
| 532 | |
| 533 | encoder.PutUint32(uint32(self.Dst)) |
| 534 | length := len(encoder.Bytes()) - startIndex |
| 535 | |
| 536 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 537 | |
| 538 | return nil |
| 539 | } |
| 540 | |
| 541 | func DecodeActionBsnSetTunnelDst(parent *ActionBsn, decoder *goloxi.Decoder) (*ActionBsnSetTunnelDst, error) { |
| 542 | _actionbsnsettunneldst := &ActionBsnSetTunnelDst{ActionBsn: parent} |
| 543 | if decoder.Length() < 4 { |
| 544 | return nil, fmt.Errorf("ActionBsnSetTunnelDst packet too short: %d < 4", decoder.Length()) |
| 545 | } |
| 546 | _actionbsnsettunneldst.Dst = uint32(decoder.ReadUint32()) |
| 547 | return _actionbsnsettunneldst, nil |
| 548 | } |
| 549 | |
| 550 | func NewActionBsnSetTunnelDst() *ActionBsnSetTunnelDst { |
| 551 | obj := &ActionBsnSetTunnelDst{ |
| 552 | ActionBsn: NewActionBsn(2), |
| 553 | } |
| 554 | return obj |
| 555 | } |
| 556 | func (self *ActionBsnSetTunnelDst) GetActionName() string { |
| 557 | return "bsn_set_tunnel_dst" |
| 558 | } |
| 559 | |
| 560 | func (self *ActionBsnSetTunnelDst) GetActionFields() map[string]interface{} { |
| 561 | return map[string]interface{}{ |
| 562 | "Dst": self.Dst, |
| 563 | } |
| 564 | } |
| 565 | |
| 566 | func (self *ActionBsnSetTunnelDst) MarshalJSON() ([]byte, error) { |
| 567 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 568 | if err != nil { |
| 569 | return nil, err |
| 570 | } |
| 571 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 572 | } |
| 573 | |
| 574 | type ActionCopyTtlIn struct { |
| 575 | *Action |
| 576 | } |
| 577 | |
| 578 | type IActionCopyTtlIn interface { |
| 579 | goloxi.IAction |
| 580 | } |
| 581 | |
| 582 | func (self *ActionCopyTtlIn) Serialize(encoder *goloxi.Encoder) error { |
| 583 | startIndex := len(encoder.Bytes()) |
| 584 | if err := self.Action.Serialize(encoder); err != nil { |
| 585 | return err |
| 586 | } |
| 587 | |
| 588 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 589 | length := len(encoder.Bytes()) - startIndex |
| 590 | |
| 591 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 592 | |
| 593 | return nil |
| 594 | } |
| 595 | |
| 596 | func DecodeActionCopyTtlIn(parent *Action, decoder *goloxi.Decoder) (*ActionCopyTtlIn, error) { |
| 597 | _actioncopyttlin := &ActionCopyTtlIn{Action: parent} |
| 598 | if decoder.Length() < 4 { |
| 599 | return nil, fmt.Errorf("ActionCopyTtlIn packet too short: %d < 4", decoder.Length()) |
| 600 | } |
| 601 | decoder.Skip(4) |
| 602 | return _actioncopyttlin, nil |
| 603 | } |
| 604 | |
| 605 | func NewActionCopyTtlIn() *ActionCopyTtlIn { |
| 606 | obj := &ActionCopyTtlIn{ |
| 607 | Action: NewAction(12), |
| 608 | } |
| 609 | return obj |
| 610 | } |
| 611 | func (self *ActionCopyTtlIn) GetActionName() string { |
| 612 | return "copy_ttl_in" |
| 613 | } |
| 614 | |
| 615 | func (self *ActionCopyTtlIn) GetActionFields() map[string]interface{} { |
| 616 | return map[string]interface{}{} |
| 617 | } |
| 618 | |
| 619 | func (self *ActionCopyTtlIn) MarshalJSON() ([]byte, error) { |
| 620 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 621 | if err != nil { |
| 622 | return nil, err |
| 623 | } |
| 624 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 625 | } |
| 626 | |
| 627 | type ActionCopyTtlOut struct { |
| 628 | *Action |
| 629 | } |
| 630 | |
| 631 | type IActionCopyTtlOut interface { |
| 632 | goloxi.IAction |
| 633 | } |
| 634 | |
| 635 | func (self *ActionCopyTtlOut) Serialize(encoder *goloxi.Encoder) error { |
| 636 | startIndex := len(encoder.Bytes()) |
| 637 | if err := self.Action.Serialize(encoder); err != nil { |
| 638 | return err |
| 639 | } |
| 640 | |
| 641 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 642 | length := len(encoder.Bytes()) - startIndex |
| 643 | |
| 644 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 645 | |
| 646 | return nil |
| 647 | } |
| 648 | |
| 649 | func DecodeActionCopyTtlOut(parent *Action, decoder *goloxi.Decoder) (*ActionCopyTtlOut, error) { |
| 650 | _actioncopyttlout := &ActionCopyTtlOut{Action: parent} |
| 651 | if decoder.Length() < 4 { |
| 652 | return nil, fmt.Errorf("ActionCopyTtlOut packet too short: %d < 4", decoder.Length()) |
| 653 | } |
| 654 | decoder.Skip(4) |
| 655 | return _actioncopyttlout, nil |
| 656 | } |
| 657 | |
| 658 | func NewActionCopyTtlOut() *ActionCopyTtlOut { |
| 659 | obj := &ActionCopyTtlOut{ |
| 660 | Action: NewAction(11), |
| 661 | } |
| 662 | return obj |
| 663 | } |
| 664 | func (self *ActionCopyTtlOut) GetActionName() string { |
| 665 | return "copy_ttl_out" |
| 666 | } |
| 667 | |
| 668 | func (self *ActionCopyTtlOut) GetActionFields() map[string]interface{} { |
| 669 | return map[string]interface{}{} |
| 670 | } |
| 671 | |
| 672 | func (self *ActionCopyTtlOut) MarshalJSON() ([]byte, error) { |
| 673 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 674 | if err != nil { |
| 675 | return nil, err |
| 676 | } |
| 677 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 678 | } |
| 679 | |
| 680 | type ActionDecMplsTtl struct { |
| 681 | *Action |
| 682 | } |
| 683 | |
| 684 | type IActionDecMplsTtl interface { |
| 685 | goloxi.IAction |
| 686 | } |
| 687 | |
| 688 | func (self *ActionDecMplsTtl) Serialize(encoder *goloxi.Encoder) error { |
| 689 | startIndex := len(encoder.Bytes()) |
| 690 | if err := self.Action.Serialize(encoder); err != nil { |
| 691 | return err |
| 692 | } |
| 693 | |
| 694 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 695 | length := len(encoder.Bytes()) - startIndex |
| 696 | |
| 697 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 698 | |
| 699 | return nil |
| 700 | } |
| 701 | |
| 702 | func DecodeActionDecMplsTtl(parent *Action, decoder *goloxi.Decoder) (*ActionDecMplsTtl, error) { |
| 703 | _actiondecmplsttl := &ActionDecMplsTtl{Action: parent} |
| 704 | if decoder.Length() < 4 { |
| 705 | return nil, fmt.Errorf("ActionDecMplsTtl packet too short: %d < 4", decoder.Length()) |
| 706 | } |
| 707 | decoder.Skip(4) |
| 708 | return _actiondecmplsttl, nil |
| 709 | } |
| 710 | |
| 711 | func NewActionDecMplsTtl() *ActionDecMplsTtl { |
| 712 | obj := &ActionDecMplsTtl{ |
| 713 | Action: NewAction(16), |
| 714 | } |
| 715 | return obj |
| 716 | } |
| 717 | func (self *ActionDecMplsTtl) GetActionName() string { |
| 718 | return "dec_mpls_ttl" |
| 719 | } |
| 720 | |
| 721 | func (self *ActionDecMplsTtl) GetActionFields() map[string]interface{} { |
| 722 | return map[string]interface{}{} |
| 723 | } |
| 724 | |
| 725 | func (self *ActionDecMplsTtl) MarshalJSON() ([]byte, error) { |
| 726 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 727 | if err != nil { |
| 728 | return nil, err |
| 729 | } |
| 730 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 731 | } |
| 732 | |
| 733 | type ActionDecNwTtl struct { |
| 734 | *Action |
| 735 | } |
| 736 | |
| 737 | type IActionDecNwTtl interface { |
| 738 | goloxi.IAction |
| 739 | } |
| 740 | |
| 741 | func (self *ActionDecNwTtl) Serialize(encoder *goloxi.Encoder) error { |
| 742 | startIndex := len(encoder.Bytes()) |
| 743 | if err := self.Action.Serialize(encoder); err != nil { |
| 744 | return err |
| 745 | } |
| 746 | |
| 747 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 748 | length := len(encoder.Bytes()) - startIndex |
| 749 | |
| 750 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 751 | |
| 752 | return nil |
| 753 | } |
| 754 | |
| 755 | func DecodeActionDecNwTtl(parent *Action, decoder *goloxi.Decoder) (*ActionDecNwTtl, error) { |
| 756 | _actiondecnwttl := &ActionDecNwTtl{Action: parent} |
| 757 | if decoder.Length() < 4 { |
| 758 | return nil, fmt.Errorf("ActionDecNwTtl packet too short: %d < 4", decoder.Length()) |
| 759 | } |
| 760 | decoder.Skip(4) |
| 761 | return _actiondecnwttl, nil |
| 762 | } |
| 763 | |
| 764 | func NewActionDecNwTtl() *ActionDecNwTtl { |
| 765 | obj := &ActionDecNwTtl{ |
| 766 | Action: NewAction(24), |
| 767 | } |
| 768 | return obj |
| 769 | } |
| 770 | func (self *ActionDecNwTtl) GetActionName() string { |
| 771 | return "dec_nw_ttl" |
| 772 | } |
| 773 | |
| 774 | func (self *ActionDecNwTtl) GetActionFields() map[string]interface{} { |
| 775 | return map[string]interface{}{} |
| 776 | } |
| 777 | |
| 778 | func (self *ActionDecNwTtl) MarshalJSON() ([]byte, error) { |
| 779 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 780 | if err != nil { |
| 781 | return nil, err |
| 782 | } |
| 783 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 784 | } |
| 785 | |
| 786 | type ActionGroup struct { |
| 787 | *Action |
| 788 | GroupId uint32 |
| 789 | } |
| 790 | |
| 791 | type IActionGroup interface { |
| 792 | goloxi.IAction |
| 793 | GetGroupId() uint32 |
| 794 | } |
| 795 | |
| 796 | func (self *ActionGroup) GetGroupId() uint32 { |
| 797 | return self.GroupId |
| 798 | } |
| 799 | |
| 800 | func (self *ActionGroup) SetGroupId(v uint32) { |
| 801 | self.GroupId = v |
| 802 | } |
| 803 | |
| 804 | func (self *ActionGroup) Serialize(encoder *goloxi.Encoder) error { |
| 805 | startIndex := len(encoder.Bytes()) |
| 806 | if err := self.Action.Serialize(encoder); err != nil { |
| 807 | return err |
| 808 | } |
| 809 | |
| 810 | encoder.PutUint32(uint32(self.GroupId)) |
| 811 | length := len(encoder.Bytes()) - startIndex |
| 812 | |
| 813 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 814 | |
| 815 | return nil |
| 816 | } |
| 817 | |
| 818 | func DecodeActionGroup(parent *Action, decoder *goloxi.Decoder) (*ActionGroup, error) { |
| 819 | _actiongroup := &ActionGroup{Action: parent} |
| 820 | if decoder.Length() < 4 { |
| 821 | return nil, fmt.Errorf("ActionGroup packet too short: %d < 4", decoder.Length()) |
| 822 | } |
| 823 | _actiongroup.GroupId = uint32(decoder.ReadUint32()) |
| 824 | return _actiongroup, nil |
| 825 | } |
| 826 | |
| 827 | func NewActionGroup() *ActionGroup { |
| 828 | obj := &ActionGroup{ |
| 829 | Action: NewAction(22), |
| 830 | } |
| 831 | return obj |
| 832 | } |
| 833 | func (self *ActionGroup) GetActionName() string { |
| 834 | return "group" |
| 835 | } |
| 836 | |
| 837 | func (self *ActionGroup) GetActionFields() map[string]interface{} { |
| 838 | return map[string]interface{}{ |
| 839 | "GroupId": self.GroupId, |
| 840 | } |
| 841 | } |
| 842 | |
| 843 | func (self *ActionGroup) MarshalJSON() ([]byte, error) { |
| 844 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 845 | if err != nil { |
| 846 | return nil, err |
| 847 | } |
| 848 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 849 | } |
| 850 | |
| 851 | type ActionNicira struct { |
| 852 | *ActionExperimenter |
| 853 | Subtype uint16 |
| 854 | } |
| 855 | |
| 856 | type IActionNicira interface { |
| 857 | IActionExperimenter |
| 858 | GetSubtype() uint16 |
| 859 | } |
| 860 | |
| 861 | func (self *ActionNicira) GetSubtype() uint16 { |
| 862 | return self.Subtype |
| 863 | } |
| 864 | |
| 865 | func (self *ActionNicira) SetSubtype(v uint16) { |
| 866 | self.Subtype = v |
| 867 | } |
| 868 | |
| 869 | func (self *ActionNicira) Serialize(encoder *goloxi.Encoder) error { |
| 870 | if err := self.ActionExperimenter.Serialize(encoder); err != nil { |
| 871 | return err |
| 872 | } |
| 873 | |
| 874 | encoder.PutUint16(uint16(self.Subtype)) |
| 875 | |
| 876 | return nil |
| 877 | } |
| 878 | |
| 879 | func DecodeActionNicira(parent *ActionExperimenter, decoder *goloxi.Decoder) (IActionNicira, error) { |
| 880 | _actionnicira := &ActionNicira{ActionExperimenter: parent} |
| 881 | if decoder.Length() < 2 { |
| 882 | return nil, fmt.Errorf("ActionNicira packet too short: %d < 2", decoder.Length()) |
| 883 | } |
| 884 | _actionnicira.Subtype = uint16(decoder.ReadUint16()) |
| 885 | |
| 886 | switch _actionnicira.Subtype { |
| 887 | case 1: |
| 888 | return DecodeActionNxResubmit(_actionnicira, decoder) |
| 889 | case 2: |
| 890 | return DecodeActionNxSetTunnel(_actionnicira, decoder) |
| 891 | case 4: |
| 892 | return DecodeActionNxSetQueue(_actionnicira, decoder) |
| 893 | case 5: |
| 894 | return DecodeActionNxPopQueue(_actionnicira, decoder) |
| 895 | case 6: |
| 896 | return DecodeActionNxRegMove(_actionnicira, decoder) |
| 897 | case 7: |
| 898 | return DecodeActionNxRegLoad(_actionnicira, decoder) |
| 899 | case 8: |
| 900 | return DecodeActionNxNote(_actionnicira, decoder) |
| 901 | case 9: |
| 902 | return DecodeActionNxSetTunnel64(_actionnicira, decoder) |
| 903 | case 10: |
| 904 | return DecodeActionNxMultipath(_actionnicira, decoder) |
| 905 | case 12: |
| 906 | return DecodeActionNxBundle(_actionnicira, decoder) |
| 907 | case 13: |
| 908 | return DecodeActionNxBundleLoadInPort(_actionnicira, decoder) |
| 909 | case 14: |
| 910 | return DecodeActionResubmit(_actionnicira, decoder) |
| 911 | case 15: |
| 912 | return DecodeActionNxOutputReg(_actionnicira, decoder) |
| 913 | case 16: |
| 914 | return DecodeActionNxLearn(_actionnicira, decoder) |
| 915 | case 17: |
| 916 | return DecodeActionNxExit(_actionnicira, decoder) |
| 917 | case 18: |
| 918 | return DecodeActionNiciraDecTtl(_actionnicira, decoder) |
| 919 | case 19: |
| 920 | return DecodeActionNxFinTimeout(_actionnicira, decoder) |
| 921 | case 20: |
| 922 | return DecodeActionNxController(_actionnicira, decoder) |
| 923 | case 21: |
| 924 | return DecodeActionNxDecTtlCntIds(_actionnicira, decoder) |
| 925 | case 22: |
| 926 | return DecodeActionNxWriteMetadata(_actionnicira, decoder) |
| 927 | case 23: |
| 928 | return DecodeActionNxPushMpls(_actionnicira, decoder) |
| 929 | case 24: |
| 930 | return DecodeActionNxPopMpls(_actionnicira, decoder) |
| 931 | case 25: |
| 932 | return DecodeActionNxSetMplsTtl(_actionnicira, decoder) |
| 933 | case 26: |
| 934 | return DecodeActionNxDecMplsTtl(_actionnicira, decoder) |
| 935 | case 27: |
| 936 | return DecodeActionNxStackPush(_actionnicira, decoder) |
| 937 | case 28: |
| 938 | return DecodeActionNxStackPop(_actionnicira, decoder) |
| 939 | case 29: |
| 940 | return DecodeActionNxSample(_actionnicira, decoder) |
| 941 | case 30: |
| 942 | return DecodeActionNxSetMplsLabel(_actionnicira, decoder) |
| 943 | case 31: |
| 944 | return DecodeActionNxSetMplsTc(_actionnicira, decoder) |
| 945 | case 32: |
| 946 | return DecodeActionNxOutputReg2(_actionnicira, decoder) |
| 947 | case 33: |
| 948 | return DecodeActionNxRegLoad2(_actionnicira, decoder) |
| 949 | case 34: |
| 950 | return DecodeActionNxConjunction(_actionnicira, decoder) |
| 951 | case 35: |
| 952 | return DecodeActionNxCt(_actionnicira, decoder) |
| 953 | case 36: |
| 954 | return DecodeActionNxNat(_actionnicira, decoder) |
| 955 | case 37: |
| 956 | return DecodeActionNxController2(_actionnicira, decoder) |
| 957 | case 38: |
| 958 | return DecodeActionNxSample2(_actionnicira, decoder) |
| 959 | case 39: |
| 960 | return DecodeActionNxOutputTrunc(_actionnicira, decoder) |
| 961 | case 40: |
| 962 | return DecodeActionNxGroup(_actionnicira, decoder) |
| 963 | case 41: |
| 964 | return DecodeActionNxSample3(_actionnicira, decoder) |
| 965 | case 42: |
| 966 | return DecodeActionNxClone(_actionnicira, decoder) |
| 967 | case 43: |
| 968 | return DecodeActionNxCtClear(_actionnicira, decoder) |
| 969 | case 44: |
| 970 | return DecodeActionNxResubmitTableCt(_actionnicira, decoder) |
| 971 | case 45: |
| 972 | return DecodeActionNxLearn2(_actionnicira, decoder) |
| 973 | case 46: |
| 974 | return DecodeActionNxEncap(_actionnicira, decoder) |
| 975 | case 47: |
| 976 | return DecodeActionNxDecap(_actionnicira, decoder) |
| 977 | case 48: |
| 978 | return DecodeActionNxDecNshTtl(_actionnicira, decoder) |
| 979 | case 254: |
| 980 | return DecodeActionNxDebugSlow(_actionnicira, decoder) |
| 981 | case 255: |
| 982 | return DecodeActionNxDebugRecirc(_actionnicira, decoder) |
| 983 | default: |
| 984 | return nil, fmt.Errorf("Invalid type '%d' for 'ActionNicira'", _actionnicira.Subtype) |
| 985 | } |
| 986 | } |
| 987 | |
| 988 | func NewActionNicira(_subtype uint16) *ActionNicira { |
| 989 | obj := &ActionNicira{ |
| 990 | ActionExperimenter: NewActionExperimenter(8992), |
| 991 | } |
| 992 | obj.Subtype = _subtype |
| 993 | return obj |
| 994 | } |
| 995 | func (self *ActionNicira) GetActionName() string { |
| 996 | return "nicira" |
| 997 | } |
| 998 | |
| 999 | func (self *ActionNicira) GetActionFields() map[string]interface{} { |
| 1000 | return map[string]interface{}{ |
| 1001 | "Subtype": self.Subtype, |
| 1002 | } |
| 1003 | } |
| 1004 | |
| 1005 | func (self *ActionNicira) MarshalJSON() ([]byte, error) { |
| 1006 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 1007 | if err != nil { |
| 1008 | return nil, err |
| 1009 | } |
| 1010 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 1011 | } |
| 1012 | |
| 1013 | type ActionNiciraDecTtl struct { |
| 1014 | *ActionNicira |
| 1015 | } |
| 1016 | |
| 1017 | type IActionNiciraDecTtl interface { |
| 1018 | IActionNicira |
| 1019 | } |
| 1020 | |
| 1021 | func (self *ActionNiciraDecTtl) Serialize(encoder *goloxi.Encoder) error { |
| 1022 | startIndex := len(encoder.Bytes()) |
| 1023 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 1024 | return err |
| 1025 | } |
| 1026 | |
| 1027 | encoder.Write(bytes.Repeat([]byte{0}, 2)) |
| 1028 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 1029 | length := len(encoder.Bytes()) - startIndex |
| 1030 | |
| 1031 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 1032 | |
| 1033 | return nil |
| 1034 | } |
| 1035 | |
| 1036 | func DecodeActionNiciraDecTtl(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNiciraDecTtl, error) { |
| 1037 | _actionniciradecttl := &ActionNiciraDecTtl{ActionNicira: parent} |
| 1038 | if decoder.Length() < 6 { |
| 1039 | return nil, fmt.Errorf("ActionNiciraDecTtl packet too short: %d < 6", decoder.Length()) |
| 1040 | } |
| 1041 | decoder.Skip(2) |
| 1042 | decoder.Skip(4) |
| 1043 | return _actionniciradecttl, nil |
| 1044 | } |
| 1045 | |
| 1046 | func NewActionNiciraDecTtl() *ActionNiciraDecTtl { |
| 1047 | obj := &ActionNiciraDecTtl{ |
| 1048 | ActionNicira: NewActionNicira(18), |
| 1049 | } |
| 1050 | return obj |
| 1051 | } |
| 1052 | func (self *ActionNiciraDecTtl) GetActionName() string { |
| 1053 | return "nicira_dec_ttl" |
| 1054 | } |
| 1055 | |
| 1056 | func (self *ActionNiciraDecTtl) GetActionFields() map[string]interface{} { |
| 1057 | return map[string]interface{}{} |
| 1058 | } |
| 1059 | |
| 1060 | func (self *ActionNiciraDecTtl) MarshalJSON() ([]byte, error) { |
| 1061 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 1062 | if err != nil { |
| 1063 | return nil, err |
| 1064 | } |
| 1065 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 1066 | } |
| 1067 | |
| 1068 | type ActionNxBundle struct { |
| 1069 | *ActionNicira |
| 1070 | Algorithm uint16 |
| 1071 | Fields NxHashFields |
| 1072 | Basis uint16 |
| 1073 | SlaveType ActionNxBundleSlaveType |
| 1074 | NSlaves uint16 |
| 1075 | OfsNbits uint16 |
| 1076 | Dst goloxi.IOxmId |
| 1077 | } |
| 1078 | |
| 1079 | type IActionNxBundle interface { |
| 1080 | IActionNicira |
| 1081 | GetAlgorithm() uint16 |
| 1082 | GetFields() NxHashFields |
| 1083 | GetBasis() uint16 |
| 1084 | GetSlaveType() ActionNxBundleSlaveType |
| 1085 | GetNSlaves() uint16 |
| 1086 | GetOfsNbits() uint16 |
| 1087 | GetDst() goloxi.IOxmId |
| 1088 | } |
| 1089 | |
| 1090 | func (self *ActionNxBundle) GetAlgorithm() uint16 { |
| 1091 | return self.Algorithm |
| 1092 | } |
| 1093 | |
| 1094 | func (self *ActionNxBundle) SetAlgorithm(v uint16) { |
| 1095 | self.Algorithm = v |
| 1096 | } |
| 1097 | |
| 1098 | func (self *ActionNxBundle) GetFields() NxHashFields { |
| 1099 | return self.Fields |
| 1100 | } |
| 1101 | |
| 1102 | func (self *ActionNxBundle) SetFields(v NxHashFields) { |
| 1103 | self.Fields = v |
| 1104 | } |
| 1105 | |
| 1106 | func (self *ActionNxBundle) GetBasis() uint16 { |
| 1107 | return self.Basis |
| 1108 | } |
| 1109 | |
| 1110 | func (self *ActionNxBundle) SetBasis(v uint16) { |
| 1111 | self.Basis = v |
| 1112 | } |
| 1113 | |
| 1114 | func (self *ActionNxBundle) GetSlaveType() ActionNxBundleSlaveType { |
| 1115 | return self.SlaveType |
| 1116 | } |
| 1117 | |
| 1118 | func (self *ActionNxBundle) SetSlaveType(v ActionNxBundleSlaveType) { |
| 1119 | self.SlaveType = v |
| 1120 | } |
| 1121 | |
| 1122 | func (self *ActionNxBundle) GetNSlaves() uint16 { |
| 1123 | return self.NSlaves |
| 1124 | } |
| 1125 | |
| 1126 | func (self *ActionNxBundle) SetNSlaves(v uint16) { |
| 1127 | self.NSlaves = v |
| 1128 | } |
| 1129 | |
| 1130 | func (self *ActionNxBundle) GetOfsNbits() uint16 { |
| 1131 | return self.OfsNbits |
| 1132 | } |
| 1133 | |
| 1134 | func (self *ActionNxBundle) SetOfsNbits(v uint16) { |
| 1135 | self.OfsNbits = v |
| 1136 | } |
| 1137 | |
| 1138 | func (self *ActionNxBundle) GetDst() goloxi.IOxmId { |
| 1139 | return self.Dst |
| 1140 | } |
| 1141 | |
| 1142 | func (self *ActionNxBundle) SetDst(v goloxi.IOxmId) { |
| 1143 | self.Dst = v |
| 1144 | } |
| 1145 | |
| 1146 | func (self *ActionNxBundle) Serialize(encoder *goloxi.Encoder) error { |
| 1147 | startIndex := len(encoder.Bytes()) |
| 1148 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 1149 | return err |
| 1150 | } |
| 1151 | |
| 1152 | encoder.PutUint16(uint16(self.Algorithm)) |
| 1153 | encoder.PutUint16(uint16(self.Fields)) |
| 1154 | encoder.PutUint16(uint16(self.Basis)) |
| 1155 | encoder.PutUint32(uint32(self.SlaveType)) |
| 1156 | encoder.PutUint16(uint16(self.NSlaves)) |
| 1157 | encoder.PutUint16(uint16(self.OfsNbits)) |
| 1158 | self.Dst.Serialize(encoder) |
| 1159 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 1160 | length := len(encoder.Bytes()) - startIndex |
| 1161 | |
| 1162 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 1163 | |
| 1164 | return nil |
| 1165 | } |
| 1166 | |
| 1167 | func DecodeActionNxBundle(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxBundle, error) { |
| 1168 | _actionnxbundle := &ActionNxBundle{ActionNicira: parent} |
| 1169 | if decoder.Length() < 22 { |
| 1170 | return nil, fmt.Errorf("ActionNxBundle packet too short: %d < 22", decoder.Length()) |
| 1171 | } |
| 1172 | _actionnxbundle.Algorithm = uint16(decoder.ReadUint16()) |
| 1173 | _actionnxbundle.Fields = NxHashFields(decoder.ReadUint16()) |
| 1174 | _actionnxbundle.Basis = uint16(decoder.ReadUint16()) |
| 1175 | _actionnxbundle.SlaveType = ActionNxBundleSlaveType(decoder.ReadUint32()) |
| 1176 | _actionnxbundle.NSlaves = uint16(decoder.ReadUint16()) |
| 1177 | _actionnxbundle.OfsNbits = uint16(decoder.ReadUint16()) |
| 1178 | if obj, err := DecodeOxmId(decoder); err != nil { |
| 1179 | return nil, err |
| 1180 | } else { |
| 1181 | _actionnxbundle.Dst = obj |
| 1182 | } |
| 1183 | |
| 1184 | decoder.Skip(4) |
| 1185 | return _actionnxbundle, nil |
| 1186 | } |
| 1187 | |
| 1188 | func NewActionNxBundle() *ActionNxBundle { |
| 1189 | obj := &ActionNxBundle{ |
| 1190 | ActionNicira: NewActionNicira(12), |
| 1191 | } |
| 1192 | return obj |
| 1193 | } |
| 1194 | func (self *ActionNxBundle) GetActionName() string { |
| 1195 | return "nx_bundle" |
| 1196 | } |
| 1197 | |
| 1198 | func (self *ActionNxBundle) GetActionFields() map[string]interface{} { |
| 1199 | return map[string]interface{}{ |
| 1200 | "Algorithm": self.Algorithm, |
| 1201 | "Fields": self.Fields, |
| 1202 | "Basis": self.Basis, |
| 1203 | "SlaveType": self.SlaveType, |
| 1204 | "NSlaves": self.NSlaves, |
| 1205 | "OfsNbits": self.OfsNbits, |
| 1206 | "Dst": self.Dst, |
| 1207 | } |
| 1208 | } |
| 1209 | |
| 1210 | func (self *ActionNxBundle) MarshalJSON() ([]byte, error) { |
| 1211 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 1212 | if err != nil { |
| 1213 | return nil, err |
| 1214 | } |
| 1215 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 1216 | } |
| 1217 | |
| 1218 | type ActionNxBundleLoad struct { |
| 1219 | *ActionNicira |
| 1220 | Algorithm NxBdAlgorithms |
| 1221 | Fields NxHashFields |
| 1222 | Basis uint16 |
| 1223 | SlaveType ActionNxBundleSlaveType |
| 1224 | NSlaves uint16 |
| 1225 | OfsNbits uint16 |
| 1226 | Dst goloxi.IOxmId |
| 1227 | } |
| 1228 | |
| 1229 | type IActionNxBundleLoad interface { |
| 1230 | IActionNicira |
| 1231 | GetAlgorithm() NxBdAlgorithms |
| 1232 | GetFields() NxHashFields |
| 1233 | GetBasis() uint16 |
| 1234 | GetSlaveType() ActionNxBundleSlaveType |
| 1235 | GetNSlaves() uint16 |
| 1236 | GetOfsNbits() uint16 |
| 1237 | GetDst() goloxi.IOxmId |
| 1238 | } |
| 1239 | |
| 1240 | func (self *ActionNxBundleLoad) GetAlgorithm() NxBdAlgorithms { |
| 1241 | return self.Algorithm |
| 1242 | } |
| 1243 | |
| 1244 | func (self *ActionNxBundleLoad) SetAlgorithm(v NxBdAlgorithms) { |
| 1245 | self.Algorithm = v |
| 1246 | } |
| 1247 | |
| 1248 | func (self *ActionNxBundleLoad) GetFields() NxHashFields { |
| 1249 | return self.Fields |
| 1250 | } |
| 1251 | |
| 1252 | func (self *ActionNxBundleLoad) SetFields(v NxHashFields) { |
| 1253 | self.Fields = v |
| 1254 | } |
| 1255 | |
| 1256 | func (self *ActionNxBundleLoad) GetBasis() uint16 { |
| 1257 | return self.Basis |
| 1258 | } |
| 1259 | |
| 1260 | func (self *ActionNxBundleLoad) SetBasis(v uint16) { |
| 1261 | self.Basis = v |
| 1262 | } |
| 1263 | |
| 1264 | func (self *ActionNxBundleLoad) GetSlaveType() ActionNxBundleSlaveType { |
| 1265 | return self.SlaveType |
| 1266 | } |
| 1267 | |
| 1268 | func (self *ActionNxBundleLoad) SetSlaveType(v ActionNxBundleSlaveType) { |
| 1269 | self.SlaveType = v |
| 1270 | } |
| 1271 | |
| 1272 | func (self *ActionNxBundleLoad) GetNSlaves() uint16 { |
| 1273 | return self.NSlaves |
| 1274 | } |
| 1275 | |
| 1276 | func (self *ActionNxBundleLoad) SetNSlaves(v uint16) { |
| 1277 | self.NSlaves = v |
| 1278 | } |
| 1279 | |
| 1280 | func (self *ActionNxBundleLoad) GetOfsNbits() uint16 { |
| 1281 | return self.OfsNbits |
| 1282 | } |
| 1283 | |
| 1284 | func (self *ActionNxBundleLoad) SetOfsNbits(v uint16) { |
| 1285 | self.OfsNbits = v |
| 1286 | } |
| 1287 | |
| 1288 | func (self *ActionNxBundleLoad) GetDst() goloxi.IOxmId { |
| 1289 | return self.Dst |
| 1290 | } |
| 1291 | |
| 1292 | func (self *ActionNxBundleLoad) SetDst(v goloxi.IOxmId) { |
| 1293 | self.Dst = v |
| 1294 | } |
| 1295 | |
| 1296 | func (self *ActionNxBundleLoad) Serialize(encoder *goloxi.Encoder) error { |
| 1297 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 1298 | return err |
| 1299 | } |
| 1300 | |
| 1301 | encoder.PutUint16(uint16(self.Algorithm)) |
| 1302 | encoder.PutUint16(uint16(self.Fields)) |
| 1303 | encoder.PutUint16(uint16(self.Basis)) |
| 1304 | encoder.PutUint32(uint32(self.SlaveType)) |
| 1305 | encoder.PutUint16(uint16(self.NSlaves)) |
| 1306 | encoder.PutUint16(uint16(self.OfsNbits)) |
| 1307 | self.Dst.Serialize(encoder) |
| 1308 | |
| 1309 | return nil |
| 1310 | } |
| 1311 | |
| 1312 | func DecodeActionNxBundleLoad(parent *ActionNicira, decoder *goloxi.Decoder) (IActionNxBundleLoad, error) { |
| 1313 | _actionnxbundleload := &ActionNxBundleLoad{ActionNicira: parent} |
| 1314 | if decoder.Length() < 18 { |
| 1315 | return nil, fmt.Errorf("ActionNxBundleLoad packet too short: %d < 18", decoder.Length()) |
| 1316 | } |
| 1317 | _actionnxbundleload.Algorithm = NxBdAlgorithms(decoder.ReadUint16()) |
| 1318 | _actionnxbundleload.Fields = NxHashFields(decoder.ReadUint16()) |
| 1319 | _actionnxbundleload.Basis = uint16(decoder.ReadUint16()) |
| 1320 | _actionnxbundleload.SlaveType = ActionNxBundleSlaveType(decoder.ReadUint32()) |
| 1321 | _actionnxbundleload.NSlaves = uint16(decoder.ReadUint16()) |
| 1322 | _actionnxbundleload.OfsNbits = uint16(decoder.ReadUint16()) |
| 1323 | if obj, err := DecodeOxmId(decoder); err != nil { |
| 1324 | return nil, err |
| 1325 | } else { |
| 1326 | _actionnxbundleload.Dst = obj |
| 1327 | } |
| 1328 | |
| 1329 | return _actionnxbundleload, nil |
| 1330 | } |
| 1331 | |
| 1332 | func NewActionNxBundleLoad(_slave_type ActionNxBundleSlaveType) *ActionNxBundleLoad { |
| 1333 | obj := &ActionNxBundleLoad{ |
| 1334 | ActionNicira: NewActionNicira(13), |
| 1335 | } |
| 1336 | obj.SlaveType = _slave_type |
| 1337 | return obj |
| 1338 | } |
| 1339 | func (self *ActionNxBundleLoad) GetActionName() string { |
| 1340 | return "nx_bundle_load" |
| 1341 | } |
| 1342 | |
| 1343 | func (self *ActionNxBundleLoad) GetActionFields() map[string]interface{} { |
| 1344 | return map[string]interface{}{ |
| 1345 | "Algorithm": self.Algorithm, |
| 1346 | "Fields": self.Fields, |
| 1347 | "Basis": self.Basis, |
| 1348 | "SlaveType": self.SlaveType, |
| 1349 | "NSlaves": self.NSlaves, |
| 1350 | "OfsNbits": self.OfsNbits, |
| 1351 | "Dst": self.Dst, |
| 1352 | } |
| 1353 | } |
| 1354 | |
| 1355 | func (self *ActionNxBundleLoad) MarshalJSON() ([]byte, error) { |
| 1356 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 1357 | if err != nil { |
| 1358 | return nil, err |
| 1359 | } |
| 1360 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 1361 | } |
| 1362 | |
| 1363 | type ActionNxBundleLoadInPort struct { |
| 1364 | *ActionNicira |
| 1365 | Algorithm NxBdAlgorithms |
| 1366 | Fields NxHashFields |
| 1367 | Basis uint16 |
| 1368 | SlaveType ActionNxBundleSlaveType |
| 1369 | NSlaves uint16 |
| 1370 | OfsNbits uint16 |
| 1371 | Dst goloxi.IOxmId |
| 1372 | InPorts []*ActionNxBundleLoadSlave |
| 1373 | } |
| 1374 | |
| 1375 | type IActionNxBundleLoadInPort interface { |
| 1376 | IActionNicira |
| 1377 | GetAlgorithm() NxBdAlgorithms |
| 1378 | GetFields() NxHashFields |
| 1379 | GetBasis() uint16 |
| 1380 | GetSlaveType() ActionNxBundleSlaveType |
| 1381 | GetNSlaves() uint16 |
| 1382 | GetOfsNbits() uint16 |
| 1383 | GetDst() goloxi.IOxmId |
| 1384 | GetInPorts() []*ActionNxBundleLoadSlave |
| 1385 | } |
| 1386 | |
| 1387 | func (self *ActionNxBundleLoadInPort) GetAlgorithm() NxBdAlgorithms { |
| 1388 | return self.Algorithm |
| 1389 | } |
| 1390 | |
| 1391 | func (self *ActionNxBundleLoadInPort) SetAlgorithm(v NxBdAlgorithms) { |
| 1392 | self.Algorithm = v |
| 1393 | } |
| 1394 | |
| 1395 | func (self *ActionNxBundleLoadInPort) GetFields() NxHashFields { |
| 1396 | return self.Fields |
| 1397 | } |
| 1398 | |
| 1399 | func (self *ActionNxBundleLoadInPort) SetFields(v NxHashFields) { |
| 1400 | self.Fields = v |
| 1401 | } |
| 1402 | |
| 1403 | func (self *ActionNxBundleLoadInPort) GetBasis() uint16 { |
| 1404 | return self.Basis |
| 1405 | } |
| 1406 | |
| 1407 | func (self *ActionNxBundleLoadInPort) SetBasis(v uint16) { |
| 1408 | self.Basis = v |
| 1409 | } |
| 1410 | |
| 1411 | func (self *ActionNxBundleLoadInPort) GetSlaveType() ActionNxBundleSlaveType { |
| 1412 | return self.SlaveType |
| 1413 | } |
| 1414 | |
| 1415 | func (self *ActionNxBundleLoadInPort) SetSlaveType(v ActionNxBundleSlaveType) { |
| 1416 | self.SlaveType = v |
| 1417 | } |
| 1418 | |
| 1419 | func (self *ActionNxBundleLoadInPort) GetNSlaves() uint16 { |
| 1420 | return self.NSlaves |
| 1421 | } |
| 1422 | |
| 1423 | func (self *ActionNxBundleLoadInPort) SetNSlaves(v uint16) { |
| 1424 | self.NSlaves = v |
| 1425 | } |
| 1426 | |
| 1427 | func (self *ActionNxBundleLoadInPort) GetOfsNbits() uint16 { |
| 1428 | return self.OfsNbits |
| 1429 | } |
| 1430 | |
| 1431 | func (self *ActionNxBundleLoadInPort) SetOfsNbits(v uint16) { |
| 1432 | self.OfsNbits = v |
| 1433 | } |
| 1434 | |
| 1435 | func (self *ActionNxBundleLoadInPort) GetDst() goloxi.IOxmId { |
| 1436 | return self.Dst |
| 1437 | } |
| 1438 | |
| 1439 | func (self *ActionNxBundleLoadInPort) SetDst(v goloxi.IOxmId) { |
| 1440 | self.Dst = v |
| 1441 | } |
| 1442 | |
| 1443 | func (self *ActionNxBundleLoadInPort) GetInPorts() []*ActionNxBundleLoadSlave { |
| 1444 | return self.InPorts |
| 1445 | } |
| 1446 | |
| 1447 | func (self *ActionNxBundleLoadInPort) SetInPorts(v []*ActionNxBundleLoadSlave) { |
| 1448 | self.InPorts = v |
| 1449 | } |
| 1450 | |
| 1451 | func (self *ActionNxBundleLoadInPort) Serialize(encoder *goloxi.Encoder) error { |
| 1452 | startIndex := len(encoder.Bytes()) |
| 1453 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 1454 | return err |
| 1455 | } |
| 1456 | |
| 1457 | encoder.PutUint16(uint16(self.Algorithm)) |
| 1458 | encoder.PutUint16(uint16(self.Fields)) |
| 1459 | encoder.PutUint16(uint16(self.Basis)) |
| 1460 | encoder.PutUint32(uint32(self.SlaveType)) |
| 1461 | encoder.PutUint16(uint16(self.NSlaves)) |
| 1462 | encoder.PutUint16(uint16(self.OfsNbits)) |
| 1463 | self.Dst.Serialize(encoder) |
| 1464 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 1465 | for _, obj := range self.InPorts { |
| 1466 | if err := obj.Serialize(encoder); err != nil { |
| 1467 | return err |
| 1468 | } |
| 1469 | } |
| 1470 | length := len(encoder.Bytes()) - startIndex |
| 1471 | |
| 1472 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 1473 | |
| 1474 | return nil |
| 1475 | } |
| 1476 | |
| 1477 | func DecodeActionNxBundleLoadInPort(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxBundleLoadInPort, error) { |
| 1478 | _actionnxbundleloadinport := &ActionNxBundleLoadInPort{ActionNicira: parent} |
| 1479 | if decoder.Length() < 22 { |
| 1480 | return nil, fmt.Errorf("ActionNxBundleLoadInPort packet too short: %d < 22", decoder.Length()) |
| 1481 | } |
| 1482 | _actionnxbundleloadinport.Algorithm = NxBdAlgorithms(decoder.ReadUint16()) |
| 1483 | _actionnxbundleloadinport.Fields = NxHashFields(decoder.ReadUint16()) |
| 1484 | _actionnxbundleloadinport.Basis = uint16(decoder.ReadUint16()) |
| 1485 | _actionnxbundleloadinport.SlaveType = ActionNxBundleSlaveType(decoder.ReadUint32()) |
| 1486 | _actionnxbundleloadinport.NSlaves = uint16(decoder.ReadUint16()) |
| 1487 | _actionnxbundleloadinport.OfsNbits = uint16(decoder.ReadUint16()) |
| 1488 | if obj, err := DecodeOxmId(decoder); err != nil { |
| 1489 | return nil, err |
| 1490 | } else { |
| 1491 | _actionnxbundleloadinport.Dst = obj |
| 1492 | } |
| 1493 | |
| 1494 | decoder.Skip(4) |
| 1495 | |
| 1496 | end := decoder.Offset() + int(_actionnxbundleloadinport.NSlaves) |
| 1497 | for decoder.Offset() < end { |
| 1498 | item, err := DecodeActionNxBundleLoadSlave(decoder) |
| 1499 | if err != nil { |
| 1500 | return nil, err |
| 1501 | } |
| 1502 | if item != nil { |
| 1503 | _actionnxbundleloadinport.InPorts = append(_actionnxbundleloadinport.InPorts, item) |
| 1504 | } |
| 1505 | } |
| 1506 | return _actionnxbundleloadinport, nil |
| 1507 | } |
| 1508 | |
| 1509 | func NewActionNxBundleLoadInPort() *ActionNxBundleLoadInPort { |
| 1510 | obj := &ActionNxBundleLoadInPort{ |
| 1511 | ActionNicira: NewActionNicira(13), |
| 1512 | } |
| 1513 | return obj |
| 1514 | } |
| 1515 | func (self *ActionNxBundleLoadInPort) GetActionName() string { |
| 1516 | return "nx_bundle_load_in_port" |
| 1517 | } |
| 1518 | |
| 1519 | func (self *ActionNxBundleLoadInPort) GetActionFields() map[string]interface{} { |
| 1520 | return map[string]interface{}{ |
| 1521 | "Algorithm": self.Algorithm, |
| 1522 | "Fields": self.Fields, |
| 1523 | "Basis": self.Basis, |
| 1524 | "SlaveType": self.SlaveType, |
| 1525 | "NSlaves": self.NSlaves, |
| 1526 | "OfsNbits": self.OfsNbits, |
| 1527 | "Dst": self.Dst, |
| 1528 | "InPorts": self.InPorts, |
| 1529 | } |
| 1530 | } |
| 1531 | |
| 1532 | func (self *ActionNxBundleLoadInPort) MarshalJSON() ([]byte, error) { |
| 1533 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 1534 | if err != nil { |
| 1535 | return nil, err |
| 1536 | } |
| 1537 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 1538 | } |
| 1539 | |
| 1540 | type ActionNxClone struct { |
| 1541 | *ActionNicira |
| 1542 | Actions []goloxi.IAction |
| 1543 | } |
| 1544 | |
| 1545 | type IActionNxClone interface { |
| 1546 | IActionNicira |
| 1547 | GetActions() []goloxi.IAction |
| 1548 | } |
| 1549 | |
| 1550 | func (self *ActionNxClone) GetActions() []goloxi.IAction { |
| 1551 | return self.Actions |
| 1552 | } |
| 1553 | |
| 1554 | func (self *ActionNxClone) SetActions(v []goloxi.IAction) { |
| 1555 | self.Actions = v |
| 1556 | } |
| 1557 | |
| 1558 | func (self *ActionNxClone) Serialize(encoder *goloxi.Encoder) error { |
| 1559 | startIndex := len(encoder.Bytes()) |
| 1560 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 1561 | return err |
| 1562 | } |
| 1563 | |
| 1564 | encoder.Write(bytes.Repeat([]byte{0}, 6)) |
| 1565 | for _, obj := range self.Actions { |
| 1566 | if err := obj.Serialize(encoder); err != nil { |
| 1567 | return err |
| 1568 | } |
| 1569 | } |
| 1570 | length := len(encoder.Bytes()) - startIndex |
| 1571 | |
| 1572 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 1573 | |
| 1574 | return nil |
| 1575 | } |
| 1576 | |
| 1577 | func DecodeActionNxClone(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxClone, error) { |
| 1578 | _actionnxclone := &ActionNxClone{ActionNicira: parent} |
| 1579 | if decoder.Length() < 6 { |
| 1580 | return nil, fmt.Errorf("ActionNxClone packet too short: %d < 6", decoder.Length()) |
| 1581 | } |
| 1582 | decoder.Skip(6) |
| 1583 | |
| 1584 | for decoder.Length() >= 8 { |
| 1585 | item, err := DecodeAction(decoder) |
| 1586 | if err != nil { |
| 1587 | return nil, err |
| 1588 | } |
| 1589 | if item != nil { |
| 1590 | _actionnxclone.Actions = append(_actionnxclone.Actions, item) |
| 1591 | } |
| 1592 | } |
| 1593 | return _actionnxclone, nil |
| 1594 | } |
| 1595 | |
| 1596 | func NewActionNxClone() *ActionNxClone { |
| 1597 | obj := &ActionNxClone{ |
| 1598 | ActionNicira: NewActionNicira(42), |
| 1599 | } |
| 1600 | return obj |
| 1601 | } |
| 1602 | func (self *ActionNxClone) GetActionName() string { |
| 1603 | return "nx_clone" |
| 1604 | } |
| 1605 | |
| 1606 | func (self *ActionNxClone) GetActionFields() map[string]interface{} { |
| 1607 | return map[string]interface{}{ |
| 1608 | "Actions": self.Actions, |
| 1609 | } |
| 1610 | } |
| 1611 | |
| 1612 | func (self *ActionNxClone) MarshalJSON() ([]byte, error) { |
| 1613 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 1614 | if err != nil { |
| 1615 | return nil, err |
| 1616 | } |
| 1617 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 1618 | } |
| 1619 | |
| 1620 | type ActionNxConjunction struct { |
| 1621 | *ActionNicira |
| 1622 | Clause uint8 |
| 1623 | NClauses uint8 |
| 1624 | Id uint32 |
| 1625 | } |
| 1626 | |
| 1627 | type IActionNxConjunction interface { |
| 1628 | IActionNicira |
| 1629 | GetClause() uint8 |
| 1630 | GetNClauses() uint8 |
| 1631 | GetId() uint32 |
| 1632 | } |
| 1633 | |
| 1634 | func (self *ActionNxConjunction) GetClause() uint8 { |
| 1635 | return self.Clause |
| 1636 | } |
| 1637 | |
| 1638 | func (self *ActionNxConjunction) SetClause(v uint8) { |
| 1639 | self.Clause = v |
| 1640 | } |
| 1641 | |
| 1642 | func (self *ActionNxConjunction) GetNClauses() uint8 { |
| 1643 | return self.NClauses |
| 1644 | } |
| 1645 | |
| 1646 | func (self *ActionNxConjunction) SetNClauses(v uint8) { |
| 1647 | self.NClauses = v |
| 1648 | } |
| 1649 | |
| 1650 | func (self *ActionNxConjunction) GetId() uint32 { |
| 1651 | return self.Id |
| 1652 | } |
| 1653 | |
| 1654 | func (self *ActionNxConjunction) SetId(v uint32) { |
| 1655 | self.Id = v |
| 1656 | } |
| 1657 | |
| 1658 | func (self *ActionNxConjunction) Serialize(encoder *goloxi.Encoder) error { |
| 1659 | startIndex := len(encoder.Bytes()) |
| 1660 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 1661 | return err |
| 1662 | } |
| 1663 | |
| 1664 | encoder.PutUint8(uint8(self.Clause)) |
| 1665 | encoder.PutUint8(uint8(self.NClauses)) |
| 1666 | encoder.PutUint32(uint32(self.Id)) |
| 1667 | length := len(encoder.Bytes()) - startIndex |
| 1668 | |
| 1669 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 1670 | |
| 1671 | return nil |
| 1672 | } |
| 1673 | |
| 1674 | func DecodeActionNxConjunction(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxConjunction, error) { |
| 1675 | _actionnxconjunction := &ActionNxConjunction{ActionNicira: parent} |
| 1676 | if decoder.Length() < 6 { |
| 1677 | return nil, fmt.Errorf("ActionNxConjunction packet too short: %d < 6", decoder.Length()) |
| 1678 | } |
| 1679 | _actionnxconjunction.Clause = uint8(decoder.ReadByte()) |
| 1680 | _actionnxconjunction.NClauses = uint8(decoder.ReadByte()) |
| 1681 | _actionnxconjunction.Id = uint32(decoder.ReadUint32()) |
| 1682 | return _actionnxconjunction, nil |
| 1683 | } |
| 1684 | |
| 1685 | func NewActionNxConjunction() *ActionNxConjunction { |
| 1686 | obj := &ActionNxConjunction{ |
| 1687 | ActionNicira: NewActionNicira(34), |
| 1688 | } |
| 1689 | return obj |
| 1690 | } |
| 1691 | func (self *ActionNxConjunction) GetActionName() string { |
| 1692 | return "nx_conjunction" |
| 1693 | } |
| 1694 | |
| 1695 | func (self *ActionNxConjunction) GetActionFields() map[string]interface{} { |
| 1696 | return map[string]interface{}{ |
| 1697 | "Clause": self.Clause, |
| 1698 | "NClauses": self.NClauses, |
| 1699 | "Id": self.Id, |
| 1700 | } |
| 1701 | } |
| 1702 | |
| 1703 | func (self *ActionNxConjunction) MarshalJSON() ([]byte, error) { |
| 1704 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 1705 | if err != nil { |
| 1706 | return nil, err |
| 1707 | } |
| 1708 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 1709 | } |
| 1710 | |
| 1711 | type ActionNxController struct { |
| 1712 | *ActionNicira |
| 1713 | MaxLen uint16 |
| 1714 | ControllerId uint16 |
| 1715 | Reason uint8 |
| 1716 | } |
| 1717 | |
| 1718 | type IActionNxController interface { |
| 1719 | IActionNicira |
| 1720 | GetMaxLen() uint16 |
| 1721 | GetControllerId() uint16 |
| 1722 | GetReason() uint8 |
| 1723 | } |
| 1724 | |
| 1725 | func (self *ActionNxController) GetMaxLen() uint16 { |
| 1726 | return self.MaxLen |
| 1727 | } |
| 1728 | |
| 1729 | func (self *ActionNxController) SetMaxLen(v uint16) { |
| 1730 | self.MaxLen = v |
| 1731 | } |
| 1732 | |
| 1733 | func (self *ActionNxController) GetControllerId() uint16 { |
| 1734 | return self.ControllerId |
| 1735 | } |
| 1736 | |
| 1737 | func (self *ActionNxController) SetControllerId(v uint16) { |
| 1738 | self.ControllerId = v |
| 1739 | } |
| 1740 | |
| 1741 | func (self *ActionNxController) GetReason() uint8 { |
| 1742 | return self.Reason |
| 1743 | } |
| 1744 | |
| 1745 | func (self *ActionNxController) SetReason(v uint8) { |
| 1746 | self.Reason = v |
| 1747 | } |
| 1748 | |
| 1749 | func (self *ActionNxController) Serialize(encoder *goloxi.Encoder) error { |
| 1750 | startIndex := len(encoder.Bytes()) |
| 1751 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 1752 | return err |
| 1753 | } |
| 1754 | |
| 1755 | encoder.PutUint16(uint16(self.MaxLen)) |
| 1756 | encoder.PutUint16(uint16(self.ControllerId)) |
| 1757 | encoder.PutUint8(uint8(self.Reason)) |
| 1758 | encoder.Write(bytes.Repeat([]byte{0}, 1)) |
| 1759 | length := len(encoder.Bytes()) - startIndex |
| 1760 | |
| 1761 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 1762 | |
| 1763 | return nil |
| 1764 | } |
| 1765 | |
| 1766 | func DecodeActionNxController(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxController, error) { |
| 1767 | _actionnxcontroller := &ActionNxController{ActionNicira: parent} |
| 1768 | if decoder.Length() < 6 { |
| 1769 | return nil, fmt.Errorf("ActionNxController packet too short: %d < 6", decoder.Length()) |
| 1770 | } |
| 1771 | _actionnxcontroller.MaxLen = uint16(decoder.ReadUint16()) |
| 1772 | _actionnxcontroller.ControllerId = uint16(decoder.ReadUint16()) |
| 1773 | _actionnxcontroller.Reason = uint8(decoder.ReadByte()) |
| 1774 | decoder.Skip(1) |
| 1775 | return _actionnxcontroller, nil |
| 1776 | } |
| 1777 | |
| 1778 | func NewActionNxController() *ActionNxController { |
| 1779 | obj := &ActionNxController{ |
| 1780 | ActionNicira: NewActionNicira(20), |
| 1781 | } |
| 1782 | return obj |
| 1783 | } |
| 1784 | func (self *ActionNxController) GetActionName() string { |
| 1785 | return "nx_controller" |
| 1786 | } |
| 1787 | |
| 1788 | func (self *ActionNxController) GetActionFields() map[string]interface{} { |
| 1789 | return map[string]interface{}{ |
| 1790 | "MaxLen": self.MaxLen, |
| 1791 | "ControllerId": self.ControllerId, |
| 1792 | "Reason": self.Reason, |
| 1793 | } |
| 1794 | } |
| 1795 | |
| 1796 | func (self *ActionNxController) MarshalJSON() ([]byte, error) { |
| 1797 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 1798 | if err != nil { |
| 1799 | return nil, err |
| 1800 | } |
| 1801 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 1802 | } |
| 1803 | |
| 1804 | type ActionNxController2 struct { |
| 1805 | *ActionNicira |
| 1806 | Properties []IActionNxController2Property |
| 1807 | } |
| 1808 | |
| 1809 | type IActionNxController2 interface { |
| 1810 | IActionNicira |
| 1811 | GetProperties() []IActionNxController2Property |
| 1812 | } |
| 1813 | |
| 1814 | func (self *ActionNxController2) GetProperties() []IActionNxController2Property { |
| 1815 | return self.Properties |
| 1816 | } |
| 1817 | |
| 1818 | func (self *ActionNxController2) SetProperties(v []IActionNxController2Property) { |
| 1819 | self.Properties = v |
| 1820 | } |
| 1821 | |
| 1822 | func (self *ActionNxController2) Serialize(encoder *goloxi.Encoder) error { |
| 1823 | startIndex := len(encoder.Bytes()) |
| 1824 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 1825 | return err |
| 1826 | } |
| 1827 | |
| 1828 | encoder.Write(bytes.Repeat([]byte{0}, 6)) |
| 1829 | for _, obj := range self.Properties { |
| 1830 | if err := obj.Serialize(encoder); err != nil { |
| 1831 | return err |
| 1832 | } |
| 1833 | } |
| 1834 | length := len(encoder.Bytes()) - startIndex |
| 1835 | |
| 1836 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 1837 | |
| 1838 | return nil |
| 1839 | } |
| 1840 | |
| 1841 | func DecodeActionNxController2(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxController2, error) { |
| 1842 | _actionnxcontroller2 := &ActionNxController2{ActionNicira: parent} |
| 1843 | if decoder.Length() < 6 { |
| 1844 | return nil, fmt.Errorf("ActionNxController2 packet too short: %d < 6", decoder.Length()) |
| 1845 | } |
| 1846 | decoder.Skip(6) |
| 1847 | |
| 1848 | for decoder.Length() >= 2 { |
| 1849 | item, err := DecodeActionNxController2Property(decoder) |
| 1850 | if err != nil { |
| 1851 | return nil, err |
| 1852 | } |
| 1853 | if item != nil { |
| 1854 | _actionnxcontroller2.Properties = append(_actionnxcontroller2.Properties, item) |
| 1855 | } |
| 1856 | } |
| 1857 | return _actionnxcontroller2, nil |
| 1858 | } |
| 1859 | |
| 1860 | func NewActionNxController2() *ActionNxController2 { |
| 1861 | obj := &ActionNxController2{ |
| 1862 | ActionNicira: NewActionNicira(37), |
| 1863 | } |
| 1864 | return obj |
| 1865 | } |
| 1866 | func (self *ActionNxController2) GetActionName() string { |
| 1867 | return "nx_controller2" |
| 1868 | } |
| 1869 | |
| 1870 | func (self *ActionNxController2) GetActionFields() map[string]interface{} { |
| 1871 | return map[string]interface{}{ |
| 1872 | "Properties": self.Properties, |
| 1873 | } |
| 1874 | } |
| 1875 | |
| 1876 | func (self *ActionNxController2) MarshalJSON() ([]byte, error) { |
| 1877 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 1878 | if err != nil { |
| 1879 | return nil, err |
| 1880 | } |
| 1881 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 1882 | } |
| 1883 | |
| 1884 | type ActionNxCt struct { |
| 1885 | *ActionNicira |
| 1886 | Flags NxConntrackFlags |
| 1887 | ZoneSrc goloxi.IOxmId |
| 1888 | Value uint16 |
| 1889 | RecircTable uint8 |
| 1890 | Alg uint16 |
| 1891 | Actions []goloxi.IAction |
| 1892 | } |
| 1893 | |
| 1894 | type IActionNxCt interface { |
| 1895 | IActionNicira |
| 1896 | GetFlags() NxConntrackFlags |
| 1897 | GetZoneSrc() goloxi.IOxmId |
| 1898 | GetValue() uint16 |
| 1899 | GetRecircTable() uint8 |
| 1900 | GetAlg() uint16 |
| 1901 | GetActions() []goloxi.IAction |
| 1902 | } |
| 1903 | |
| 1904 | func (self *ActionNxCt) GetFlags() NxConntrackFlags { |
| 1905 | return self.Flags |
| 1906 | } |
| 1907 | |
| 1908 | func (self *ActionNxCt) SetFlags(v NxConntrackFlags) { |
| 1909 | self.Flags = v |
| 1910 | } |
| 1911 | |
| 1912 | func (self *ActionNxCt) GetZoneSrc() goloxi.IOxmId { |
| 1913 | return self.ZoneSrc |
| 1914 | } |
| 1915 | |
| 1916 | func (self *ActionNxCt) SetZoneSrc(v goloxi.IOxmId) { |
| 1917 | self.ZoneSrc = v |
| 1918 | } |
| 1919 | |
| 1920 | func (self *ActionNxCt) GetValue() uint16 { |
| 1921 | return self.Value |
| 1922 | } |
| 1923 | |
| 1924 | func (self *ActionNxCt) SetValue(v uint16) { |
| 1925 | self.Value = v |
| 1926 | } |
| 1927 | |
| 1928 | func (self *ActionNxCt) GetRecircTable() uint8 { |
| 1929 | return self.RecircTable |
| 1930 | } |
| 1931 | |
| 1932 | func (self *ActionNxCt) SetRecircTable(v uint8) { |
| 1933 | self.RecircTable = v |
| 1934 | } |
| 1935 | |
| 1936 | func (self *ActionNxCt) GetAlg() uint16 { |
| 1937 | return self.Alg |
| 1938 | } |
| 1939 | |
| 1940 | func (self *ActionNxCt) SetAlg(v uint16) { |
| 1941 | self.Alg = v |
| 1942 | } |
| 1943 | |
| 1944 | func (self *ActionNxCt) GetActions() []goloxi.IAction { |
| 1945 | return self.Actions |
| 1946 | } |
| 1947 | |
| 1948 | func (self *ActionNxCt) SetActions(v []goloxi.IAction) { |
| 1949 | self.Actions = v |
| 1950 | } |
| 1951 | |
| 1952 | func (self *ActionNxCt) Serialize(encoder *goloxi.Encoder) error { |
| 1953 | startIndex := len(encoder.Bytes()) |
| 1954 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 1955 | return err |
| 1956 | } |
| 1957 | |
| 1958 | encoder.PutUint16(uint16(self.Flags)) |
| 1959 | self.ZoneSrc.Serialize(encoder) |
| 1960 | encoder.PutUint16(uint16(self.Value)) |
| 1961 | encoder.PutUint8(uint8(self.RecircTable)) |
| 1962 | encoder.Write(bytes.Repeat([]byte{0}, 3)) |
| 1963 | encoder.PutUint16(uint16(self.Alg)) |
| 1964 | for _, obj := range self.Actions { |
| 1965 | if err := obj.Serialize(encoder); err != nil { |
| 1966 | return err |
| 1967 | } |
| 1968 | } |
| 1969 | length := len(encoder.Bytes()) - startIndex |
| 1970 | |
| 1971 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 1972 | |
| 1973 | return nil |
| 1974 | } |
| 1975 | |
| 1976 | func DecodeActionNxCt(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxCt, error) { |
| 1977 | _actionnxct := &ActionNxCt{ActionNicira: parent} |
| 1978 | if decoder.Length() < 14 { |
| 1979 | return nil, fmt.Errorf("ActionNxCt packet too short: %d < 14", decoder.Length()) |
| 1980 | } |
| 1981 | _actionnxct.Flags = NxConntrackFlags(decoder.ReadUint16()) |
| 1982 | if obj, err := DecodeOxmId(decoder); err != nil { |
| 1983 | return nil, err |
| 1984 | } else { |
| 1985 | _actionnxct.ZoneSrc = obj |
| 1986 | } |
| 1987 | |
| 1988 | _actionnxct.Value = uint16(decoder.ReadUint16()) |
| 1989 | _actionnxct.RecircTable = uint8(decoder.ReadByte()) |
| 1990 | decoder.Skip(3) |
| 1991 | _actionnxct.Alg = uint16(decoder.ReadUint16()) |
| 1992 | |
| 1993 | for decoder.Length() >= 8 { |
| 1994 | item, err := DecodeAction(decoder) |
| 1995 | if err != nil { |
| 1996 | return nil, err |
| 1997 | } |
| 1998 | if item != nil { |
| 1999 | _actionnxct.Actions = append(_actionnxct.Actions, item) |
| 2000 | } |
| 2001 | } |
| 2002 | return _actionnxct, nil |
| 2003 | } |
| 2004 | |
| 2005 | func NewActionNxCt() *ActionNxCt { |
| 2006 | obj := &ActionNxCt{ |
| 2007 | ActionNicira: NewActionNicira(35), |
| 2008 | } |
| 2009 | return obj |
| 2010 | } |
| 2011 | func (self *ActionNxCt) GetActionName() string { |
| 2012 | return "nx_ct" |
| 2013 | } |
| 2014 | |
| 2015 | func (self *ActionNxCt) GetActionFields() map[string]interface{} { |
| 2016 | return map[string]interface{}{ |
| 2017 | "Flags": self.Flags, |
| 2018 | "ZoneSrc": self.ZoneSrc, |
| 2019 | "Value": self.Value, |
| 2020 | "RecircTable": self.RecircTable, |
| 2021 | "Alg": self.Alg, |
| 2022 | "Actions": self.Actions, |
| 2023 | } |
| 2024 | } |
| 2025 | |
| 2026 | func (self *ActionNxCt) MarshalJSON() ([]byte, error) { |
| 2027 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 2028 | if err != nil { |
| 2029 | return nil, err |
| 2030 | } |
| 2031 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 2032 | } |
| 2033 | |
| 2034 | type ActionNxCtClear struct { |
| 2035 | *ActionNicira |
| 2036 | } |
| 2037 | |
| 2038 | type IActionNxCtClear interface { |
| 2039 | IActionNicira |
| 2040 | } |
| 2041 | |
| 2042 | func (self *ActionNxCtClear) Serialize(encoder *goloxi.Encoder) error { |
| 2043 | startIndex := len(encoder.Bytes()) |
| 2044 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 2045 | return err |
| 2046 | } |
| 2047 | length := len(encoder.Bytes()) - startIndex |
| 2048 | |
| 2049 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 2050 | |
| 2051 | return nil |
| 2052 | } |
| 2053 | |
| 2054 | func DecodeActionNxCtClear(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxCtClear, error) { |
| 2055 | _actionnxctclear := &ActionNxCtClear{ActionNicira: parent} |
| 2056 | return _actionnxctclear, nil |
| 2057 | } |
| 2058 | |
| 2059 | func NewActionNxCtClear() *ActionNxCtClear { |
| 2060 | obj := &ActionNxCtClear{ |
| 2061 | ActionNicira: NewActionNicira(43), |
| 2062 | } |
| 2063 | return obj |
| 2064 | } |
| 2065 | func (self *ActionNxCtClear) GetActionName() string { |
| 2066 | return "nx_ct_clear" |
| 2067 | } |
| 2068 | |
| 2069 | func (self *ActionNxCtClear) GetActionFields() map[string]interface{} { |
| 2070 | return map[string]interface{}{} |
| 2071 | } |
| 2072 | |
| 2073 | func (self *ActionNxCtClear) MarshalJSON() ([]byte, error) { |
| 2074 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 2075 | if err != nil { |
| 2076 | return nil, err |
| 2077 | } |
| 2078 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 2079 | } |
| 2080 | |
| 2081 | type ActionNxDebugRecirc struct { |
| 2082 | *ActionNicira |
| 2083 | } |
| 2084 | |
| 2085 | type IActionNxDebugRecirc interface { |
| 2086 | IActionNicira |
| 2087 | } |
| 2088 | |
| 2089 | func (self *ActionNxDebugRecirc) Serialize(encoder *goloxi.Encoder) error { |
| 2090 | startIndex := len(encoder.Bytes()) |
| 2091 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 2092 | return err |
| 2093 | } |
| 2094 | length := len(encoder.Bytes()) - startIndex |
| 2095 | |
| 2096 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 2097 | |
| 2098 | return nil |
| 2099 | } |
| 2100 | |
| 2101 | func DecodeActionNxDebugRecirc(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxDebugRecirc, error) { |
| 2102 | _actionnxdebugrecirc := &ActionNxDebugRecirc{ActionNicira: parent} |
| 2103 | return _actionnxdebugrecirc, nil |
| 2104 | } |
| 2105 | |
| 2106 | func NewActionNxDebugRecirc() *ActionNxDebugRecirc { |
| 2107 | obj := &ActionNxDebugRecirc{ |
| 2108 | ActionNicira: NewActionNicira(255), |
| 2109 | } |
| 2110 | return obj |
| 2111 | } |
| 2112 | func (self *ActionNxDebugRecirc) GetActionName() string { |
| 2113 | return "nx_debug_recirc" |
| 2114 | } |
| 2115 | |
| 2116 | func (self *ActionNxDebugRecirc) GetActionFields() map[string]interface{} { |
| 2117 | return map[string]interface{}{} |
| 2118 | } |
| 2119 | |
| 2120 | func (self *ActionNxDebugRecirc) MarshalJSON() ([]byte, error) { |
| 2121 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 2122 | if err != nil { |
| 2123 | return nil, err |
| 2124 | } |
| 2125 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 2126 | } |
| 2127 | |
| 2128 | type ActionNxDebugSlow struct { |
| 2129 | *ActionNicira |
| 2130 | } |
| 2131 | |
| 2132 | type IActionNxDebugSlow interface { |
| 2133 | IActionNicira |
| 2134 | } |
| 2135 | |
| 2136 | func (self *ActionNxDebugSlow) Serialize(encoder *goloxi.Encoder) error { |
| 2137 | startIndex := len(encoder.Bytes()) |
| 2138 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 2139 | return err |
| 2140 | } |
| 2141 | length := len(encoder.Bytes()) - startIndex |
| 2142 | |
| 2143 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 2144 | |
| 2145 | return nil |
| 2146 | } |
| 2147 | |
| 2148 | func DecodeActionNxDebugSlow(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxDebugSlow, error) { |
| 2149 | _actionnxdebugslow := &ActionNxDebugSlow{ActionNicira: parent} |
| 2150 | return _actionnxdebugslow, nil |
| 2151 | } |
| 2152 | |
| 2153 | func NewActionNxDebugSlow() *ActionNxDebugSlow { |
| 2154 | obj := &ActionNxDebugSlow{ |
| 2155 | ActionNicira: NewActionNicira(254), |
| 2156 | } |
| 2157 | return obj |
| 2158 | } |
| 2159 | func (self *ActionNxDebugSlow) GetActionName() string { |
| 2160 | return "nx_debug_slow" |
| 2161 | } |
| 2162 | |
| 2163 | func (self *ActionNxDebugSlow) GetActionFields() map[string]interface{} { |
| 2164 | return map[string]interface{}{} |
| 2165 | } |
| 2166 | |
| 2167 | func (self *ActionNxDebugSlow) MarshalJSON() ([]byte, error) { |
| 2168 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 2169 | if err != nil { |
| 2170 | return nil, err |
| 2171 | } |
| 2172 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 2173 | } |
| 2174 | |
| 2175 | type ActionNxDecMplsTtl struct { |
| 2176 | *ActionNicira |
| 2177 | } |
| 2178 | |
| 2179 | type IActionNxDecMplsTtl interface { |
| 2180 | IActionNicira |
| 2181 | } |
| 2182 | |
| 2183 | func (self *ActionNxDecMplsTtl) Serialize(encoder *goloxi.Encoder) error { |
| 2184 | startIndex := len(encoder.Bytes()) |
| 2185 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 2186 | return err |
| 2187 | } |
| 2188 | length := len(encoder.Bytes()) - startIndex |
| 2189 | |
| 2190 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 2191 | |
| 2192 | return nil |
| 2193 | } |
| 2194 | |
| 2195 | func DecodeActionNxDecMplsTtl(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxDecMplsTtl, error) { |
| 2196 | _actionnxdecmplsttl := &ActionNxDecMplsTtl{ActionNicira: parent} |
| 2197 | return _actionnxdecmplsttl, nil |
| 2198 | } |
| 2199 | |
| 2200 | func NewActionNxDecMplsTtl() *ActionNxDecMplsTtl { |
| 2201 | obj := &ActionNxDecMplsTtl{ |
| 2202 | ActionNicira: NewActionNicira(26), |
| 2203 | } |
| 2204 | return obj |
| 2205 | } |
| 2206 | func (self *ActionNxDecMplsTtl) GetActionName() string { |
| 2207 | return "nx_dec_mpls_ttl" |
| 2208 | } |
| 2209 | |
| 2210 | func (self *ActionNxDecMplsTtl) GetActionFields() map[string]interface{} { |
| 2211 | return map[string]interface{}{} |
| 2212 | } |
| 2213 | |
| 2214 | func (self *ActionNxDecMplsTtl) MarshalJSON() ([]byte, error) { |
| 2215 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 2216 | if err != nil { |
| 2217 | return nil, err |
| 2218 | } |
| 2219 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 2220 | } |
| 2221 | |
| 2222 | type ActionNxDecNshTtl struct { |
| 2223 | *ActionNicira |
| 2224 | } |
| 2225 | |
| 2226 | type IActionNxDecNshTtl interface { |
| 2227 | IActionNicira |
| 2228 | } |
| 2229 | |
| 2230 | func (self *ActionNxDecNshTtl) Serialize(encoder *goloxi.Encoder) error { |
| 2231 | startIndex := len(encoder.Bytes()) |
| 2232 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 2233 | return err |
| 2234 | } |
| 2235 | length := len(encoder.Bytes()) - startIndex |
| 2236 | |
| 2237 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 2238 | |
| 2239 | return nil |
| 2240 | } |
| 2241 | |
| 2242 | func DecodeActionNxDecNshTtl(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxDecNshTtl, error) { |
| 2243 | _actionnxdecnshttl := &ActionNxDecNshTtl{ActionNicira: parent} |
| 2244 | return _actionnxdecnshttl, nil |
| 2245 | } |
| 2246 | |
| 2247 | func NewActionNxDecNshTtl() *ActionNxDecNshTtl { |
| 2248 | obj := &ActionNxDecNshTtl{ |
| 2249 | ActionNicira: NewActionNicira(48), |
| 2250 | } |
| 2251 | return obj |
| 2252 | } |
| 2253 | func (self *ActionNxDecNshTtl) GetActionName() string { |
| 2254 | return "nx_dec_nsh_ttl" |
| 2255 | } |
| 2256 | |
| 2257 | func (self *ActionNxDecNshTtl) GetActionFields() map[string]interface{} { |
| 2258 | return map[string]interface{}{} |
| 2259 | } |
| 2260 | |
| 2261 | func (self *ActionNxDecNshTtl) MarshalJSON() ([]byte, error) { |
| 2262 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 2263 | if err != nil { |
| 2264 | return nil, err |
| 2265 | } |
| 2266 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 2267 | } |
| 2268 | |
| 2269 | type ActionNxDecTtlCntIds struct { |
| 2270 | *ActionNicira |
| 2271 | NControllers uint16 |
| 2272 | } |
| 2273 | |
| 2274 | type IActionNxDecTtlCntIds interface { |
| 2275 | IActionNicira |
| 2276 | GetNControllers() uint16 |
| 2277 | } |
| 2278 | |
| 2279 | func (self *ActionNxDecTtlCntIds) GetNControllers() uint16 { |
| 2280 | return self.NControllers |
| 2281 | } |
| 2282 | |
| 2283 | func (self *ActionNxDecTtlCntIds) SetNControllers(v uint16) { |
| 2284 | self.NControllers = v |
| 2285 | } |
| 2286 | |
| 2287 | func (self *ActionNxDecTtlCntIds) Serialize(encoder *goloxi.Encoder) error { |
| 2288 | startIndex := len(encoder.Bytes()) |
| 2289 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 2290 | return err |
| 2291 | } |
| 2292 | |
| 2293 | encoder.PutUint16(uint16(self.NControllers)) |
| 2294 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 2295 | length := len(encoder.Bytes()) - startIndex |
| 2296 | |
| 2297 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 2298 | |
| 2299 | return nil |
| 2300 | } |
| 2301 | |
| 2302 | func DecodeActionNxDecTtlCntIds(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxDecTtlCntIds, error) { |
| 2303 | _actionnxdecttlcntids := &ActionNxDecTtlCntIds{ActionNicira: parent} |
| 2304 | if decoder.Length() < 6 { |
| 2305 | return nil, fmt.Errorf("ActionNxDecTtlCntIds packet too short: %d < 6", decoder.Length()) |
| 2306 | } |
| 2307 | _actionnxdecttlcntids.NControllers = uint16(decoder.ReadUint16()) |
| 2308 | decoder.Skip(4) |
| 2309 | return _actionnxdecttlcntids, nil |
| 2310 | } |
| 2311 | |
| 2312 | func NewActionNxDecTtlCntIds() *ActionNxDecTtlCntIds { |
| 2313 | obj := &ActionNxDecTtlCntIds{ |
| 2314 | ActionNicira: NewActionNicira(21), |
| 2315 | } |
| 2316 | return obj |
| 2317 | } |
| 2318 | func (self *ActionNxDecTtlCntIds) GetActionName() string { |
| 2319 | return "nx_dec_ttl_cnt_ids" |
| 2320 | } |
| 2321 | |
| 2322 | func (self *ActionNxDecTtlCntIds) GetActionFields() map[string]interface{} { |
| 2323 | return map[string]interface{}{ |
| 2324 | "NControllers": self.NControllers, |
| 2325 | } |
| 2326 | } |
| 2327 | |
| 2328 | func (self *ActionNxDecTtlCntIds) MarshalJSON() ([]byte, error) { |
| 2329 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 2330 | if err != nil { |
| 2331 | return nil, err |
| 2332 | } |
| 2333 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 2334 | } |
| 2335 | |
| 2336 | type ActionNxDecap struct { |
| 2337 | *ActionNicira |
| 2338 | NewPktType uint32 |
| 2339 | } |
| 2340 | |
| 2341 | type IActionNxDecap interface { |
| 2342 | IActionNicira |
| 2343 | GetNewPktType() uint32 |
| 2344 | } |
| 2345 | |
| 2346 | func (self *ActionNxDecap) GetNewPktType() uint32 { |
| 2347 | return self.NewPktType |
| 2348 | } |
| 2349 | |
| 2350 | func (self *ActionNxDecap) SetNewPktType(v uint32) { |
| 2351 | self.NewPktType = v |
| 2352 | } |
| 2353 | |
| 2354 | func (self *ActionNxDecap) Serialize(encoder *goloxi.Encoder) error { |
| 2355 | startIndex := len(encoder.Bytes()) |
| 2356 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 2357 | return err |
| 2358 | } |
| 2359 | |
| 2360 | encoder.Write(bytes.Repeat([]byte{0}, 2)) |
| 2361 | encoder.PutUint32(uint32(self.NewPktType)) |
| 2362 | length := len(encoder.Bytes()) - startIndex |
| 2363 | |
| 2364 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 2365 | |
| 2366 | return nil |
| 2367 | } |
| 2368 | |
| 2369 | func DecodeActionNxDecap(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxDecap, error) { |
| 2370 | _actionnxdecap := &ActionNxDecap{ActionNicira: parent} |
| 2371 | if decoder.Length() < 6 { |
| 2372 | return nil, fmt.Errorf("ActionNxDecap packet too short: %d < 6", decoder.Length()) |
| 2373 | } |
| 2374 | decoder.Skip(2) |
| 2375 | _actionnxdecap.NewPktType = uint32(decoder.ReadUint32()) |
| 2376 | return _actionnxdecap, nil |
| 2377 | } |
| 2378 | |
| 2379 | func NewActionNxDecap() *ActionNxDecap { |
| 2380 | obj := &ActionNxDecap{ |
| 2381 | ActionNicira: NewActionNicira(47), |
| 2382 | } |
| 2383 | return obj |
| 2384 | } |
| 2385 | func (self *ActionNxDecap) GetActionName() string { |
| 2386 | return "nx_decap" |
| 2387 | } |
| 2388 | |
| 2389 | func (self *ActionNxDecap) GetActionFields() map[string]interface{} { |
| 2390 | return map[string]interface{}{ |
| 2391 | "NewPktType": self.NewPktType, |
| 2392 | } |
| 2393 | } |
| 2394 | |
| 2395 | func (self *ActionNxDecap) MarshalJSON() ([]byte, error) { |
| 2396 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 2397 | if err != nil { |
| 2398 | return nil, err |
| 2399 | } |
| 2400 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 2401 | } |
| 2402 | |
| 2403 | type ActionNxEncap struct { |
| 2404 | *ActionNicira |
| 2405 | HdrSize uint16 |
| 2406 | PacketType PacketType |
| 2407 | Props []IEdPropHeader |
| 2408 | } |
| 2409 | |
| 2410 | type IActionNxEncap interface { |
| 2411 | IActionNicira |
| 2412 | GetHdrSize() uint16 |
| 2413 | GetPacketType() PacketType |
| 2414 | GetProps() []IEdPropHeader |
| 2415 | } |
| 2416 | |
| 2417 | func (self *ActionNxEncap) GetHdrSize() uint16 { |
| 2418 | return self.HdrSize |
| 2419 | } |
| 2420 | |
| 2421 | func (self *ActionNxEncap) SetHdrSize(v uint16) { |
| 2422 | self.HdrSize = v |
| 2423 | } |
| 2424 | |
| 2425 | func (self *ActionNxEncap) GetPacketType() PacketType { |
| 2426 | return self.PacketType |
| 2427 | } |
| 2428 | |
| 2429 | func (self *ActionNxEncap) SetPacketType(v PacketType) { |
| 2430 | self.PacketType = v |
| 2431 | } |
| 2432 | |
| 2433 | func (self *ActionNxEncap) GetProps() []IEdPropHeader { |
| 2434 | return self.Props |
| 2435 | } |
| 2436 | |
| 2437 | func (self *ActionNxEncap) SetProps(v []IEdPropHeader) { |
| 2438 | self.Props = v |
| 2439 | } |
| 2440 | |
| 2441 | func (self *ActionNxEncap) Serialize(encoder *goloxi.Encoder) error { |
| 2442 | startIndex := len(encoder.Bytes()) |
| 2443 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 2444 | return err |
| 2445 | } |
| 2446 | |
| 2447 | encoder.PutUint16(uint16(self.HdrSize)) |
| 2448 | encoder.PutUint32(uint32(self.PacketType)) |
| 2449 | for _, obj := range self.Props { |
| 2450 | if err := obj.Serialize(encoder); err != nil { |
| 2451 | return err |
| 2452 | } |
| 2453 | } |
| 2454 | length := len(encoder.Bytes()) - startIndex |
| 2455 | |
| 2456 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 2457 | |
| 2458 | return nil |
| 2459 | } |
| 2460 | |
| 2461 | func DecodeActionNxEncap(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxEncap, error) { |
| 2462 | _actionnxencap := &ActionNxEncap{ActionNicira: parent} |
| 2463 | if decoder.Length() < 6 { |
| 2464 | return nil, fmt.Errorf("ActionNxEncap packet too short: %d < 6", decoder.Length()) |
| 2465 | } |
| 2466 | _actionnxencap.HdrSize = uint16(decoder.ReadUint16()) |
| 2467 | _actionnxencap.PacketType = PacketType(decoder.ReadUint32()) |
| 2468 | |
| 2469 | for decoder.Length() >= 4 { |
| 2470 | item, err := DecodeEdPropHeader(decoder) |
| 2471 | if err != nil { |
| 2472 | return nil, err |
| 2473 | } |
| 2474 | if item != nil { |
| 2475 | _actionnxencap.Props = append(_actionnxencap.Props, item) |
| 2476 | } |
| 2477 | } |
| 2478 | return _actionnxencap, nil |
| 2479 | } |
| 2480 | |
| 2481 | func NewActionNxEncap() *ActionNxEncap { |
| 2482 | obj := &ActionNxEncap{ |
| 2483 | ActionNicira: NewActionNicira(46), |
| 2484 | } |
| 2485 | return obj |
| 2486 | } |
| 2487 | func (self *ActionNxEncap) GetActionName() string { |
| 2488 | return "nx_encap" |
| 2489 | } |
| 2490 | |
| 2491 | func (self *ActionNxEncap) GetActionFields() map[string]interface{} { |
| 2492 | return map[string]interface{}{ |
| 2493 | "HdrSize": self.HdrSize, |
| 2494 | "PacketType": self.PacketType, |
| 2495 | "Props": self.Props, |
| 2496 | } |
| 2497 | } |
| 2498 | |
| 2499 | func (self *ActionNxEncap) MarshalJSON() ([]byte, error) { |
| 2500 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 2501 | if err != nil { |
| 2502 | return nil, err |
| 2503 | } |
| 2504 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 2505 | } |
| 2506 | |
| 2507 | type ActionNxExit struct { |
| 2508 | *ActionNicira |
| 2509 | } |
| 2510 | |
| 2511 | type IActionNxExit interface { |
| 2512 | IActionNicira |
| 2513 | } |
| 2514 | |
| 2515 | func (self *ActionNxExit) Serialize(encoder *goloxi.Encoder) error { |
| 2516 | startIndex := len(encoder.Bytes()) |
| 2517 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 2518 | return err |
| 2519 | } |
| 2520 | length := len(encoder.Bytes()) - startIndex |
| 2521 | |
| 2522 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 2523 | |
| 2524 | return nil |
| 2525 | } |
| 2526 | |
| 2527 | func DecodeActionNxExit(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxExit, error) { |
| 2528 | _actionnxexit := &ActionNxExit{ActionNicira: parent} |
| 2529 | return _actionnxexit, nil |
| 2530 | } |
| 2531 | |
| 2532 | func NewActionNxExit() *ActionNxExit { |
| 2533 | obj := &ActionNxExit{ |
| 2534 | ActionNicira: NewActionNicira(17), |
| 2535 | } |
| 2536 | return obj |
| 2537 | } |
| 2538 | func (self *ActionNxExit) GetActionName() string { |
| 2539 | return "nx_exit" |
| 2540 | } |
| 2541 | |
| 2542 | func (self *ActionNxExit) GetActionFields() map[string]interface{} { |
| 2543 | return map[string]interface{}{} |
| 2544 | } |
| 2545 | |
| 2546 | func (self *ActionNxExit) MarshalJSON() ([]byte, error) { |
| 2547 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 2548 | if err != nil { |
| 2549 | return nil, err |
| 2550 | } |
| 2551 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 2552 | } |
| 2553 | |
| 2554 | type ActionNxFinTimeout struct { |
| 2555 | *ActionNicira |
| 2556 | FinIdleTimeout uint16 |
| 2557 | FinHardTimeout uint16 |
| 2558 | } |
| 2559 | |
| 2560 | type IActionNxFinTimeout interface { |
| 2561 | IActionNicira |
| 2562 | GetFinIdleTimeout() uint16 |
| 2563 | GetFinHardTimeout() uint16 |
| 2564 | } |
| 2565 | |
| 2566 | func (self *ActionNxFinTimeout) GetFinIdleTimeout() uint16 { |
| 2567 | return self.FinIdleTimeout |
| 2568 | } |
| 2569 | |
| 2570 | func (self *ActionNxFinTimeout) SetFinIdleTimeout(v uint16) { |
| 2571 | self.FinIdleTimeout = v |
| 2572 | } |
| 2573 | |
| 2574 | func (self *ActionNxFinTimeout) GetFinHardTimeout() uint16 { |
| 2575 | return self.FinHardTimeout |
| 2576 | } |
| 2577 | |
| 2578 | func (self *ActionNxFinTimeout) SetFinHardTimeout(v uint16) { |
| 2579 | self.FinHardTimeout = v |
| 2580 | } |
| 2581 | |
| 2582 | func (self *ActionNxFinTimeout) Serialize(encoder *goloxi.Encoder) error { |
| 2583 | startIndex := len(encoder.Bytes()) |
| 2584 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 2585 | return err |
| 2586 | } |
| 2587 | |
| 2588 | encoder.PutUint16(uint16(self.FinIdleTimeout)) |
| 2589 | encoder.PutUint16(uint16(self.FinHardTimeout)) |
| 2590 | encoder.Write(bytes.Repeat([]byte{0}, 2)) |
| 2591 | length := len(encoder.Bytes()) - startIndex |
| 2592 | |
| 2593 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 2594 | |
| 2595 | return nil |
| 2596 | } |
| 2597 | |
| 2598 | func DecodeActionNxFinTimeout(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxFinTimeout, error) { |
| 2599 | _actionnxfintimeout := &ActionNxFinTimeout{ActionNicira: parent} |
| 2600 | if decoder.Length() < 6 { |
| 2601 | return nil, fmt.Errorf("ActionNxFinTimeout packet too short: %d < 6", decoder.Length()) |
| 2602 | } |
| 2603 | _actionnxfintimeout.FinIdleTimeout = uint16(decoder.ReadUint16()) |
| 2604 | _actionnxfintimeout.FinHardTimeout = uint16(decoder.ReadUint16()) |
| 2605 | decoder.Skip(2) |
| 2606 | return _actionnxfintimeout, nil |
| 2607 | } |
| 2608 | |
| 2609 | func NewActionNxFinTimeout() *ActionNxFinTimeout { |
| 2610 | obj := &ActionNxFinTimeout{ |
| 2611 | ActionNicira: NewActionNicira(19), |
| 2612 | } |
| 2613 | return obj |
| 2614 | } |
| 2615 | func (self *ActionNxFinTimeout) GetActionName() string { |
| 2616 | return "nx_fin_timeout" |
| 2617 | } |
| 2618 | |
| 2619 | func (self *ActionNxFinTimeout) GetActionFields() map[string]interface{} { |
| 2620 | return map[string]interface{}{ |
| 2621 | "FinIdleTimeout": self.FinIdleTimeout, |
| 2622 | "FinHardTimeout": self.FinHardTimeout, |
| 2623 | } |
| 2624 | } |
| 2625 | |
| 2626 | func (self *ActionNxFinTimeout) MarshalJSON() ([]byte, error) { |
| 2627 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 2628 | if err != nil { |
| 2629 | return nil, err |
| 2630 | } |
| 2631 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 2632 | } |
| 2633 | |
| 2634 | type ActionNxGroup struct { |
| 2635 | *ActionNicira |
| 2636 | Value uint32 |
| 2637 | } |
| 2638 | |
| 2639 | type IActionNxGroup interface { |
| 2640 | IActionNicira |
| 2641 | GetValue() uint32 |
| 2642 | } |
| 2643 | |
| 2644 | func (self *ActionNxGroup) GetValue() uint32 { |
| 2645 | return self.Value |
| 2646 | } |
| 2647 | |
| 2648 | func (self *ActionNxGroup) SetValue(v uint32) { |
| 2649 | self.Value = v |
| 2650 | } |
| 2651 | |
| 2652 | func (self *ActionNxGroup) Serialize(encoder *goloxi.Encoder) error { |
| 2653 | startIndex := len(encoder.Bytes()) |
| 2654 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 2655 | return err |
| 2656 | } |
| 2657 | |
| 2658 | encoder.PutUint32(uint32(self.Value)) |
| 2659 | length := len(encoder.Bytes()) - startIndex |
| 2660 | |
| 2661 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 2662 | |
| 2663 | return nil |
| 2664 | } |
| 2665 | |
| 2666 | func DecodeActionNxGroup(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxGroup, error) { |
| 2667 | _actionnxgroup := &ActionNxGroup{ActionNicira: parent} |
| 2668 | if decoder.Length() < 4 { |
| 2669 | return nil, fmt.Errorf("ActionNxGroup packet too short: %d < 4", decoder.Length()) |
| 2670 | } |
| 2671 | _actionnxgroup.Value = uint32(decoder.ReadUint32()) |
| 2672 | return _actionnxgroup, nil |
| 2673 | } |
| 2674 | |
| 2675 | func NewActionNxGroup() *ActionNxGroup { |
| 2676 | obj := &ActionNxGroup{ |
| 2677 | ActionNicira: NewActionNicira(40), |
| 2678 | } |
| 2679 | return obj |
| 2680 | } |
| 2681 | func (self *ActionNxGroup) GetActionName() string { |
| 2682 | return "nx_group" |
| 2683 | } |
| 2684 | |
| 2685 | func (self *ActionNxGroup) GetActionFields() map[string]interface{} { |
| 2686 | return map[string]interface{}{ |
| 2687 | "Value": self.Value, |
| 2688 | } |
| 2689 | } |
| 2690 | |
| 2691 | func (self *ActionNxGroup) MarshalJSON() ([]byte, error) { |
| 2692 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 2693 | if err != nil { |
| 2694 | return nil, err |
| 2695 | } |
| 2696 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 2697 | } |
| 2698 | |
| 2699 | type ActionNxLearn struct { |
| 2700 | *ActionNicira |
| 2701 | IdleTimeout uint16 |
| 2702 | HardTimeout uint16 |
| 2703 | Priority uint16 |
| 2704 | Cookie uint64 |
| 2705 | Flags uint16 |
| 2706 | TableId uint8 |
| 2707 | FinIdleTimeout uint16 |
| 2708 | FinHardTimeout uint16 |
| 2709 | FlowMods []IFlowModSpec |
| 2710 | } |
| 2711 | |
| 2712 | type IActionNxLearn interface { |
| 2713 | IActionNicira |
| 2714 | GetIdleTimeout() uint16 |
| 2715 | GetHardTimeout() uint16 |
| 2716 | GetPriority() uint16 |
| 2717 | GetCookie() uint64 |
| 2718 | GetFlags() uint16 |
| 2719 | GetTableId() uint8 |
| 2720 | GetFinIdleTimeout() uint16 |
| 2721 | GetFinHardTimeout() uint16 |
| 2722 | GetFlowMods() []IFlowModSpec |
| 2723 | } |
| 2724 | |
| 2725 | func (self *ActionNxLearn) GetIdleTimeout() uint16 { |
| 2726 | return self.IdleTimeout |
| 2727 | } |
| 2728 | |
| 2729 | func (self *ActionNxLearn) SetIdleTimeout(v uint16) { |
| 2730 | self.IdleTimeout = v |
| 2731 | } |
| 2732 | |
| 2733 | func (self *ActionNxLearn) GetHardTimeout() uint16 { |
| 2734 | return self.HardTimeout |
| 2735 | } |
| 2736 | |
| 2737 | func (self *ActionNxLearn) SetHardTimeout(v uint16) { |
| 2738 | self.HardTimeout = v |
| 2739 | } |
| 2740 | |
| 2741 | func (self *ActionNxLearn) GetPriority() uint16 { |
| 2742 | return self.Priority |
| 2743 | } |
| 2744 | |
| 2745 | func (self *ActionNxLearn) SetPriority(v uint16) { |
| 2746 | self.Priority = v |
| 2747 | } |
| 2748 | |
| 2749 | func (self *ActionNxLearn) GetCookie() uint64 { |
| 2750 | return self.Cookie |
| 2751 | } |
| 2752 | |
| 2753 | func (self *ActionNxLearn) SetCookie(v uint64) { |
| 2754 | self.Cookie = v |
| 2755 | } |
| 2756 | |
| 2757 | func (self *ActionNxLearn) GetFlags() uint16 { |
| 2758 | return self.Flags |
| 2759 | } |
| 2760 | |
| 2761 | func (self *ActionNxLearn) SetFlags(v uint16) { |
| 2762 | self.Flags = v |
| 2763 | } |
| 2764 | |
| 2765 | func (self *ActionNxLearn) GetTableId() uint8 { |
| 2766 | return self.TableId |
| 2767 | } |
| 2768 | |
| 2769 | func (self *ActionNxLearn) SetTableId(v uint8) { |
| 2770 | self.TableId = v |
| 2771 | } |
| 2772 | |
| 2773 | func (self *ActionNxLearn) GetFinIdleTimeout() uint16 { |
| 2774 | return self.FinIdleTimeout |
| 2775 | } |
| 2776 | |
| 2777 | func (self *ActionNxLearn) SetFinIdleTimeout(v uint16) { |
| 2778 | self.FinIdleTimeout = v |
| 2779 | } |
| 2780 | |
| 2781 | func (self *ActionNxLearn) GetFinHardTimeout() uint16 { |
| 2782 | return self.FinHardTimeout |
| 2783 | } |
| 2784 | |
| 2785 | func (self *ActionNxLearn) SetFinHardTimeout(v uint16) { |
| 2786 | self.FinHardTimeout = v |
| 2787 | } |
| 2788 | |
| 2789 | func (self *ActionNxLearn) GetFlowMods() []IFlowModSpec { |
| 2790 | return self.FlowMods |
| 2791 | } |
| 2792 | |
| 2793 | func (self *ActionNxLearn) SetFlowMods(v []IFlowModSpec) { |
| 2794 | self.FlowMods = v |
| 2795 | } |
| 2796 | |
| 2797 | func (self *ActionNxLearn) Serialize(encoder *goloxi.Encoder) error { |
| 2798 | startIndex := len(encoder.Bytes()) |
| 2799 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 2800 | return err |
| 2801 | } |
| 2802 | |
| 2803 | encoder.PutUint16(uint16(self.IdleTimeout)) |
| 2804 | encoder.PutUint16(uint16(self.HardTimeout)) |
| 2805 | encoder.PutUint16(uint16(self.Priority)) |
| 2806 | encoder.PutUint64(uint64(self.Cookie)) |
| 2807 | encoder.PutUint16(uint16(self.Flags)) |
| 2808 | encoder.PutUint8(uint8(self.TableId)) |
| 2809 | encoder.Write(bytes.Repeat([]byte{0}, 1)) |
| 2810 | encoder.PutUint16(uint16(self.FinIdleTimeout)) |
| 2811 | encoder.PutUint16(uint16(self.FinHardTimeout)) |
| 2812 | for _, obj := range self.FlowMods { |
| 2813 | if err := obj.Serialize(encoder); err != nil { |
| 2814 | return err |
| 2815 | } |
| 2816 | } |
| 2817 | length := len(encoder.Bytes()) - startIndex |
| 2818 | |
| 2819 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 2820 | |
| 2821 | return nil |
| 2822 | } |
| 2823 | |
| 2824 | func DecodeActionNxLearn(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxLearn, error) { |
| 2825 | _actionnxlearn := &ActionNxLearn{ActionNicira: parent} |
| 2826 | if decoder.Length() < 22 { |
| 2827 | return nil, fmt.Errorf("ActionNxLearn packet too short: %d < 22", decoder.Length()) |
| 2828 | } |
| 2829 | _actionnxlearn.IdleTimeout = uint16(decoder.ReadUint16()) |
| 2830 | _actionnxlearn.HardTimeout = uint16(decoder.ReadUint16()) |
| 2831 | _actionnxlearn.Priority = uint16(decoder.ReadUint16()) |
| 2832 | _actionnxlearn.Cookie = uint64(decoder.ReadUint64()) |
| 2833 | _actionnxlearn.Flags = uint16(decoder.ReadUint16()) |
| 2834 | _actionnxlearn.TableId = uint8(decoder.ReadByte()) |
| 2835 | decoder.Skip(1) |
| 2836 | _actionnxlearn.FinIdleTimeout = uint16(decoder.ReadUint16()) |
| 2837 | _actionnxlearn.FinHardTimeout = uint16(decoder.ReadUint16()) |
| 2838 | |
| 2839 | for decoder.Length() >= 2 { |
| 2840 | item, err := DecodeFlowModSpec(decoder) |
| 2841 | if err != nil { |
| 2842 | return nil, err |
| 2843 | } |
| 2844 | if item != nil { |
| 2845 | _actionnxlearn.FlowMods = append(_actionnxlearn.FlowMods, item) |
| 2846 | } |
| 2847 | } |
| 2848 | return _actionnxlearn, nil |
| 2849 | } |
| 2850 | |
| 2851 | func NewActionNxLearn() *ActionNxLearn { |
| 2852 | obj := &ActionNxLearn{ |
| 2853 | ActionNicira: NewActionNicira(16), |
| 2854 | } |
| 2855 | return obj |
| 2856 | } |
| 2857 | func (self *ActionNxLearn) GetActionName() string { |
| 2858 | return "nx_learn" |
| 2859 | } |
| 2860 | |
| 2861 | func (self *ActionNxLearn) GetActionFields() map[string]interface{} { |
| 2862 | return map[string]interface{}{ |
| 2863 | "IdleTimeout": self.IdleTimeout, |
| 2864 | "HardTimeout": self.HardTimeout, |
| 2865 | "Priority": self.Priority, |
| 2866 | "Cookie": self.Cookie, |
| 2867 | "Flags": self.Flags, |
| 2868 | "TableId": self.TableId, |
| 2869 | "FinIdleTimeout": self.FinIdleTimeout, |
| 2870 | "FinHardTimeout": self.FinHardTimeout, |
| 2871 | "FlowMods": self.FlowMods, |
| 2872 | } |
| 2873 | } |
| 2874 | |
| 2875 | func (self *ActionNxLearn) MarshalJSON() ([]byte, error) { |
| 2876 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 2877 | if err != nil { |
| 2878 | return nil, err |
| 2879 | } |
| 2880 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 2881 | } |
| 2882 | |
| 2883 | type ActionNxLearn2 struct { |
| 2884 | *ActionNicira |
| 2885 | } |
| 2886 | |
| 2887 | type IActionNxLearn2 interface { |
| 2888 | IActionNicira |
| 2889 | } |
| 2890 | |
| 2891 | func (self *ActionNxLearn2) Serialize(encoder *goloxi.Encoder) error { |
| 2892 | startIndex := len(encoder.Bytes()) |
| 2893 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 2894 | return err |
| 2895 | } |
| 2896 | length := len(encoder.Bytes()) - startIndex |
| 2897 | |
| 2898 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 2899 | |
| 2900 | return nil |
| 2901 | } |
| 2902 | |
| 2903 | func DecodeActionNxLearn2(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxLearn2, error) { |
| 2904 | _actionnxlearn2 := &ActionNxLearn2{ActionNicira: parent} |
| 2905 | return _actionnxlearn2, nil |
| 2906 | } |
| 2907 | |
| 2908 | func NewActionNxLearn2() *ActionNxLearn2 { |
| 2909 | obj := &ActionNxLearn2{ |
| 2910 | ActionNicira: NewActionNicira(45), |
| 2911 | } |
| 2912 | return obj |
| 2913 | } |
| 2914 | func (self *ActionNxLearn2) GetActionName() string { |
| 2915 | return "nx_learn2" |
| 2916 | } |
| 2917 | |
| 2918 | func (self *ActionNxLearn2) GetActionFields() map[string]interface{} { |
| 2919 | return map[string]interface{}{} |
| 2920 | } |
| 2921 | |
| 2922 | func (self *ActionNxLearn2) MarshalJSON() ([]byte, error) { |
| 2923 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 2924 | if err != nil { |
| 2925 | return nil, err |
| 2926 | } |
| 2927 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 2928 | } |
| 2929 | |
| 2930 | type ActionNxMultipath struct { |
| 2931 | *ActionNicira |
| 2932 | Fields NxHashFields |
| 2933 | Basis uint16 |
| 2934 | Algorithm NxMpAlgorithm |
| 2935 | MaxLink uint16 |
| 2936 | Arg uint32 |
| 2937 | OfsNbits uint16 |
| 2938 | Dst goloxi.IOxmId |
| 2939 | } |
| 2940 | |
| 2941 | type IActionNxMultipath interface { |
| 2942 | IActionNicira |
| 2943 | GetFields() NxHashFields |
| 2944 | GetBasis() uint16 |
| 2945 | GetAlgorithm() NxMpAlgorithm |
| 2946 | GetMaxLink() uint16 |
| 2947 | GetArg() uint32 |
| 2948 | GetOfsNbits() uint16 |
| 2949 | GetDst() goloxi.IOxmId |
| 2950 | } |
| 2951 | |
| 2952 | func (self *ActionNxMultipath) GetFields() NxHashFields { |
| 2953 | return self.Fields |
| 2954 | } |
| 2955 | |
| 2956 | func (self *ActionNxMultipath) SetFields(v NxHashFields) { |
| 2957 | self.Fields = v |
| 2958 | } |
| 2959 | |
| 2960 | func (self *ActionNxMultipath) GetBasis() uint16 { |
| 2961 | return self.Basis |
| 2962 | } |
| 2963 | |
| 2964 | func (self *ActionNxMultipath) SetBasis(v uint16) { |
| 2965 | self.Basis = v |
| 2966 | } |
| 2967 | |
| 2968 | func (self *ActionNxMultipath) GetAlgorithm() NxMpAlgorithm { |
| 2969 | return self.Algorithm |
| 2970 | } |
| 2971 | |
| 2972 | func (self *ActionNxMultipath) SetAlgorithm(v NxMpAlgorithm) { |
| 2973 | self.Algorithm = v |
| 2974 | } |
| 2975 | |
| 2976 | func (self *ActionNxMultipath) GetMaxLink() uint16 { |
| 2977 | return self.MaxLink |
| 2978 | } |
| 2979 | |
| 2980 | func (self *ActionNxMultipath) SetMaxLink(v uint16) { |
| 2981 | self.MaxLink = v |
| 2982 | } |
| 2983 | |
| 2984 | func (self *ActionNxMultipath) GetArg() uint32 { |
| 2985 | return self.Arg |
| 2986 | } |
| 2987 | |
| 2988 | func (self *ActionNxMultipath) SetArg(v uint32) { |
| 2989 | self.Arg = v |
| 2990 | } |
| 2991 | |
| 2992 | func (self *ActionNxMultipath) GetOfsNbits() uint16 { |
| 2993 | return self.OfsNbits |
| 2994 | } |
| 2995 | |
| 2996 | func (self *ActionNxMultipath) SetOfsNbits(v uint16) { |
| 2997 | self.OfsNbits = v |
| 2998 | } |
| 2999 | |
| 3000 | func (self *ActionNxMultipath) GetDst() goloxi.IOxmId { |
| 3001 | return self.Dst |
| 3002 | } |
| 3003 | |
| 3004 | func (self *ActionNxMultipath) SetDst(v goloxi.IOxmId) { |
| 3005 | self.Dst = v |
| 3006 | } |
| 3007 | |
| 3008 | func (self *ActionNxMultipath) Serialize(encoder *goloxi.Encoder) error { |
| 3009 | startIndex := len(encoder.Bytes()) |
| 3010 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 3011 | return err |
| 3012 | } |
| 3013 | |
| 3014 | encoder.PutUint16(uint16(self.Fields)) |
| 3015 | encoder.PutUint16(uint16(self.Basis)) |
| 3016 | encoder.Write(bytes.Repeat([]byte{0}, 2)) |
| 3017 | encoder.PutUint16(uint16(self.Algorithm)) |
| 3018 | encoder.PutUint16(uint16(self.MaxLink)) |
| 3019 | encoder.PutUint32(uint32(self.Arg)) |
| 3020 | encoder.Write(bytes.Repeat([]byte{0}, 2)) |
| 3021 | encoder.PutUint16(uint16(self.OfsNbits)) |
| 3022 | self.Dst.Serialize(encoder) |
| 3023 | length := len(encoder.Bytes()) - startIndex |
| 3024 | |
| 3025 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 3026 | |
| 3027 | return nil |
| 3028 | } |
| 3029 | |
| 3030 | func DecodeActionNxMultipath(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxMultipath, error) { |
| 3031 | _actionnxmultipath := &ActionNxMultipath{ActionNicira: parent} |
| 3032 | if decoder.Length() < 22 { |
| 3033 | return nil, fmt.Errorf("ActionNxMultipath packet too short: %d < 22", decoder.Length()) |
| 3034 | } |
| 3035 | _actionnxmultipath.Fields = NxHashFields(decoder.ReadUint16()) |
| 3036 | _actionnxmultipath.Basis = uint16(decoder.ReadUint16()) |
| 3037 | decoder.Skip(2) |
| 3038 | _actionnxmultipath.Algorithm = NxMpAlgorithm(decoder.ReadUint16()) |
| 3039 | _actionnxmultipath.MaxLink = uint16(decoder.ReadUint16()) |
| 3040 | _actionnxmultipath.Arg = uint32(decoder.ReadUint32()) |
| 3041 | decoder.Skip(2) |
| 3042 | _actionnxmultipath.OfsNbits = uint16(decoder.ReadUint16()) |
| 3043 | if obj, err := DecodeOxmId(decoder); err != nil { |
| 3044 | return nil, err |
| 3045 | } else { |
| 3046 | _actionnxmultipath.Dst = obj |
| 3047 | } |
| 3048 | |
| 3049 | return _actionnxmultipath, nil |
| 3050 | } |
| 3051 | |
| 3052 | func NewActionNxMultipath() *ActionNxMultipath { |
| 3053 | obj := &ActionNxMultipath{ |
| 3054 | ActionNicira: NewActionNicira(10), |
| 3055 | } |
| 3056 | return obj |
| 3057 | } |
| 3058 | func (self *ActionNxMultipath) GetActionName() string { |
| 3059 | return "nx_multipath" |
| 3060 | } |
| 3061 | |
| 3062 | func (self *ActionNxMultipath) GetActionFields() map[string]interface{} { |
| 3063 | return map[string]interface{}{ |
| 3064 | "Fields": self.Fields, |
| 3065 | "Basis": self.Basis, |
| 3066 | "Algorithm": self.Algorithm, |
| 3067 | "MaxLink": self.MaxLink, |
| 3068 | "Arg": self.Arg, |
| 3069 | "OfsNbits": self.OfsNbits, |
| 3070 | "Dst": self.Dst, |
| 3071 | } |
| 3072 | } |
| 3073 | |
| 3074 | func (self *ActionNxMultipath) MarshalJSON() ([]byte, error) { |
| 3075 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 3076 | if err != nil { |
| 3077 | return nil, err |
| 3078 | } |
| 3079 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 3080 | } |
| 3081 | |
| 3082 | type ActionNxNat struct { |
| 3083 | *ActionNicira |
| 3084 | Flags uint16 |
| 3085 | RangePresent NxNatRange |
| 3086 | Ipv4Min net.IP |
| 3087 | Ipv4Max net.IP |
| 3088 | Ipv6Min net.IP |
| 3089 | Ipv6Max net.IP |
| 3090 | ProtoMin uint32 |
| 3091 | ProtoMax uint32 |
| 3092 | } |
| 3093 | |
| 3094 | type IActionNxNat interface { |
| 3095 | IActionNicira |
| 3096 | GetFlags() uint16 |
| 3097 | GetRangePresent() NxNatRange |
| 3098 | GetIpv4Min() net.IP |
| 3099 | GetIpv4Max() net.IP |
| 3100 | GetIpv6Min() net.IP |
| 3101 | GetIpv6Max() net.IP |
| 3102 | GetProtoMin() uint32 |
| 3103 | GetProtoMax() uint32 |
| 3104 | } |
| 3105 | |
| 3106 | func (self *ActionNxNat) GetFlags() uint16 { |
| 3107 | return self.Flags |
| 3108 | } |
| 3109 | |
| 3110 | func (self *ActionNxNat) SetFlags(v uint16) { |
| 3111 | self.Flags = v |
| 3112 | } |
| 3113 | |
| 3114 | func (self *ActionNxNat) GetRangePresent() NxNatRange { |
| 3115 | return self.RangePresent |
| 3116 | } |
| 3117 | |
| 3118 | func (self *ActionNxNat) SetRangePresent(v NxNatRange) { |
| 3119 | self.RangePresent = v |
| 3120 | } |
| 3121 | |
| 3122 | func (self *ActionNxNat) GetIpv4Min() net.IP { |
| 3123 | return self.Ipv4Min |
| 3124 | } |
| 3125 | |
| 3126 | func (self *ActionNxNat) SetIpv4Min(v net.IP) { |
| 3127 | self.Ipv4Min = v |
| 3128 | } |
| 3129 | |
| 3130 | func (self *ActionNxNat) GetIpv4Max() net.IP { |
| 3131 | return self.Ipv4Max |
| 3132 | } |
| 3133 | |
| 3134 | func (self *ActionNxNat) SetIpv4Max(v net.IP) { |
| 3135 | self.Ipv4Max = v |
| 3136 | } |
| 3137 | |
| 3138 | func (self *ActionNxNat) GetIpv6Min() net.IP { |
| 3139 | return self.Ipv6Min |
| 3140 | } |
| 3141 | |
| 3142 | func (self *ActionNxNat) SetIpv6Min(v net.IP) { |
| 3143 | self.Ipv6Min = v |
| 3144 | } |
| 3145 | |
| 3146 | func (self *ActionNxNat) GetIpv6Max() net.IP { |
| 3147 | return self.Ipv6Max |
| 3148 | } |
| 3149 | |
| 3150 | func (self *ActionNxNat) SetIpv6Max(v net.IP) { |
| 3151 | self.Ipv6Max = v |
| 3152 | } |
| 3153 | |
| 3154 | func (self *ActionNxNat) GetProtoMin() uint32 { |
| 3155 | return self.ProtoMin |
| 3156 | } |
| 3157 | |
| 3158 | func (self *ActionNxNat) SetProtoMin(v uint32) { |
| 3159 | self.ProtoMin = v |
| 3160 | } |
| 3161 | |
| 3162 | func (self *ActionNxNat) GetProtoMax() uint32 { |
| 3163 | return self.ProtoMax |
| 3164 | } |
| 3165 | |
| 3166 | func (self *ActionNxNat) SetProtoMax(v uint32) { |
| 3167 | self.ProtoMax = v |
| 3168 | } |
| 3169 | |
| 3170 | func (self *ActionNxNat) Serialize(encoder *goloxi.Encoder) error { |
| 3171 | startIndex := len(encoder.Bytes()) |
| 3172 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 3173 | return err |
| 3174 | } |
| 3175 | |
| 3176 | encoder.Write(bytes.Repeat([]byte{0}, 2)) |
| 3177 | encoder.PutUint16(uint16(self.Flags)) |
| 3178 | encoder.PutUint16(uint16(self.RangePresent)) |
| 3179 | encoder.Write(self.Ipv4Min.To4()) |
| 3180 | encoder.Write(self.Ipv4Max.To4()) |
| 3181 | encoder.Write(self.Ipv6Min.To16()) |
| 3182 | encoder.Write(self.Ipv6Max.To16()) |
| 3183 | encoder.PutUint32(uint32(self.ProtoMin)) |
| 3184 | encoder.PutUint32(uint32(self.ProtoMax)) |
| 3185 | length := len(encoder.Bytes()) - startIndex |
| 3186 | |
| 3187 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 3188 | |
| 3189 | return nil |
| 3190 | } |
| 3191 | |
| 3192 | func DecodeActionNxNat(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxNat, error) { |
| 3193 | _actionnxnat := &ActionNxNat{ActionNicira: parent} |
| 3194 | if decoder.Length() < 6 { |
| 3195 | return nil, fmt.Errorf("ActionNxNat packet too short: %d < 6", decoder.Length()) |
| 3196 | } |
| 3197 | decoder.Skip(2) |
| 3198 | _actionnxnat.Flags = uint16(decoder.ReadUint16()) |
| 3199 | _actionnxnat.RangePresent = NxNatRange(decoder.ReadUint16()) |
| 3200 | if _actionnxnat.RangePresent&1 == 1 { |
| 3201 | _actionnxnat.Ipv4Min = net.IP(decoder.Read(4)) |
| 3202 | } |
| 3203 | if _actionnxnat.RangePresent&2 == 2 { |
| 3204 | _actionnxnat.Ipv4Max = net.IP(decoder.Read(4)) |
| 3205 | } |
| 3206 | if _actionnxnat.RangePresent&4 == 4 { |
| 3207 | _actionnxnat.Ipv6Min = net.IP(decoder.Read(16)) |
| 3208 | } |
| 3209 | if _actionnxnat.RangePresent&8 == 8 { |
| 3210 | _actionnxnat.Ipv6Max = net.IP(decoder.Read(16)) |
| 3211 | } |
| 3212 | if _actionnxnat.RangePresent&16 == 16 { |
| 3213 | _actionnxnat.ProtoMin = uint32(decoder.ReadUint32()) |
| 3214 | } |
| 3215 | if _actionnxnat.RangePresent&32 == 32 { |
| 3216 | _actionnxnat.ProtoMax = uint32(decoder.ReadUint32()) |
| 3217 | } |
| 3218 | return _actionnxnat, nil |
| 3219 | } |
| 3220 | |
| 3221 | func NewActionNxNat() *ActionNxNat { |
| 3222 | obj := &ActionNxNat{ |
| 3223 | ActionNicira: NewActionNicira(36), |
| 3224 | } |
| 3225 | return obj |
| 3226 | } |
| 3227 | func (self *ActionNxNat) GetActionName() string { |
| 3228 | return "nx_nat" |
| 3229 | } |
| 3230 | |
| 3231 | func (self *ActionNxNat) GetActionFields() map[string]interface{} { |
| 3232 | return map[string]interface{}{ |
| 3233 | "Flags": self.Flags, |
| 3234 | "RangePresent": self.RangePresent, |
| 3235 | "Ipv4Min": self.Ipv4Min, |
| 3236 | "Ipv4Max": self.Ipv4Max, |
| 3237 | "Ipv6Min": self.Ipv6Min, |
| 3238 | "Ipv6Max": self.Ipv6Max, |
| 3239 | "ProtoMin": self.ProtoMin, |
| 3240 | "ProtoMax": self.ProtoMax, |
| 3241 | } |
| 3242 | } |
| 3243 | |
| 3244 | func (self *ActionNxNat) MarshalJSON() ([]byte, error) { |
| 3245 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 3246 | if err != nil { |
| 3247 | return nil, err |
| 3248 | } |
| 3249 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 3250 | } |
| 3251 | |
| 3252 | type ActionNxNote struct { |
| 3253 | *ActionNicira |
| 3254 | Note []byte |
| 3255 | } |
| 3256 | |
| 3257 | type IActionNxNote interface { |
| 3258 | IActionNicira |
| 3259 | GetNote() []byte |
| 3260 | } |
| 3261 | |
| 3262 | func (self *ActionNxNote) GetNote() []byte { |
| 3263 | return self.Note |
| 3264 | } |
| 3265 | |
| 3266 | func (self *ActionNxNote) SetNote(v []byte) { |
| 3267 | self.Note = v |
| 3268 | } |
| 3269 | |
| 3270 | func (self *ActionNxNote) Serialize(encoder *goloxi.Encoder) error { |
| 3271 | startIndex := len(encoder.Bytes()) |
| 3272 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 3273 | return err |
| 3274 | } |
| 3275 | |
| 3276 | encoder.Write(self.Note) |
| 3277 | length := len(encoder.Bytes()) - startIndex |
| 3278 | |
| 3279 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 3280 | |
| 3281 | return nil |
| 3282 | } |
| 3283 | |
| 3284 | func DecodeActionNxNote(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxNote, error) { |
| 3285 | _actionnxnote := &ActionNxNote{ActionNicira: parent} |
| 3286 | _actionnxnote.Note = decoder.Read(int(decoder.Length())) |
| 3287 | return _actionnxnote, nil |
| 3288 | } |
| 3289 | |
| 3290 | func NewActionNxNote() *ActionNxNote { |
| 3291 | obj := &ActionNxNote{ |
| 3292 | ActionNicira: NewActionNicira(8), |
| 3293 | } |
| 3294 | return obj |
| 3295 | } |
| 3296 | func (self *ActionNxNote) GetActionName() string { |
| 3297 | return "nx_note" |
| 3298 | } |
| 3299 | |
| 3300 | func (self *ActionNxNote) GetActionFields() map[string]interface{} { |
| 3301 | return map[string]interface{}{ |
| 3302 | "Note": self.Note, |
| 3303 | } |
| 3304 | } |
| 3305 | |
| 3306 | func (self *ActionNxNote) MarshalJSON() ([]byte, error) { |
| 3307 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 3308 | if err != nil { |
| 3309 | return nil, err |
| 3310 | } |
| 3311 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 3312 | } |
| 3313 | |
| 3314 | type ActionNxOutputReg struct { |
| 3315 | *ActionNicira |
| 3316 | OfsNbits uint16 |
| 3317 | Src uint32 |
| 3318 | MaxLen uint16 |
| 3319 | } |
| 3320 | |
| 3321 | type IActionNxOutputReg interface { |
| 3322 | IActionNicira |
| 3323 | GetOfsNbits() uint16 |
| 3324 | GetSrc() uint32 |
| 3325 | GetMaxLen() uint16 |
| 3326 | } |
| 3327 | |
| 3328 | func (self *ActionNxOutputReg) GetOfsNbits() uint16 { |
| 3329 | return self.OfsNbits |
| 3330 | } |
| 3331 | |
| 3332 | func (self *ActionNxOutputReg) SetOfsNbits(v uint16) { |
| 3333 | self.OfsNbits = v |
| 3334 | } |
| 3335 | |
| 3336 | func (self *ActionNxOutputReg) GetSrc() uint32 { |
| 3337 | return self.Src |
| 3338 | } |
| 3339 | |
| 3340 | func (self *ActionNxOutputReg) SetSrc(v uint32) { |
| 3341 | self.Src = v |
| 3342 | } |
| 3343 | |
| 3344 | func (self *ActionNxOutputReg) GetMaxLen() uint16 { |
| 3345 | return self.MaxLen |
| 3346 | } |
| 3347 | |
| 3348 | func (self *ActionNxOutputReg) SetMaxLen(v uint16) { |
| 3349 | self.MaxLen = v |
| 3350 | } |
| 3351 | |
| 3352 | func (self *ActionNxOutputReg) Serialize(encoder *goloxi.Encoder) error { |
| 3353 | startIndex := len(encoder.Bytes()) |
| 3354 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 3355 | return err |
| 3356 | } |
| 3357 | |
| 3358 | encoder.PutUint16(uint16(self.OfsNbits)) |
| 3359 | encoder.PutUint32(uint32(self.Src)) |
| 3360 | encoder.PutUint16(uint16(self.MaxLen)) |
| 3361 | encoder.Write(bytes.Repeat([]byte{0}, 6)) |
| 3362 | length := len(encoder.Bytes()) - startIndex |
| 3363 | |
| 3364 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 3365 | |
| 3366 | return nil |
| 3367 | } |
| 3368 | |
| 3369 | func DecodeActionNxOutputReg(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxOutputReg, error) { |
| 3370 | _actionnxoutputreg := &ActionNxOutputReg{ActionNicira: parent} |
| 3371 | if decoder.Length() < 14 { |
| 3372 | return nil, fmt.Errorf("ActionNxOutputReg packet too short: %d < 14", decoder.Length()) |
| 3373 | } |
| 3374 | _actionnxoutputreg.OfsNbits = uint16(decoder.ReadUint16()) |
| 3375 | _actionnxoutputreg.Src = uint32(decoder.ReadUint32()) |
| 3376 | _actionnxoutputreg.MaxLen = uint16(decoder.ReadUint16()) |
| 3377 | decoder.Skip(6) |
| 3378 | return _actionnxoutputreg, nil |
| 3379 | } |
| 3380 | |
| 3381 | func NewActionNxOutputReg() *ActionNxOutputReg { |
| 3382 | obj := &ActionNxOutputReg{ |
| 3383 | ActionNicira: NewActionNicira(15), |
| 3384 | } |
| 3385 | return obj |
| 3386 | } |
| 3387 | func (self *ActionNxOutputReg) GetActionName() string { |
| 3388 | return "nx_output_reg" |
| 3389 | } |
| 3390 | |
| 3391 | func (self *ActionNxOutputReg) GetActionFields() map[string]interface{} { |
| 3392 | return map[string]interface{}{ |
| 3393 | "OfsNbits": self.OfsNbits, |
| 3394 | "Src": self.Src, |
| 3395 | "MaxLen": self.MaxLen, |
| 3396 | } |
| 3397 | } |
| 3398 | |
| 3399 | func (self *ActionNxOutputReg) MarshalJSON() ([]byte, error) { |
| 3400 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 3401 | if err != nil { |
| 3402 | return nil, err |
| 3403 | } |
| 3404 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 3405 | } |
| 3406 | |
| 3407 | type ActionNxOutputReg2 struct { |
| 3408 | *ActionNicira |
| 3409 | OfsNbits uint16 |
| 3410 | MaxLen uint16 |
| 3411 | } |
| 3412 | |
| 3413 | type IActionNxOutputReg2 interface { |
| 3414 | IActionNicira |
| 3415 | GetOfsNbits() uint16 |
| 3416 | GetMaxLen() uint16 |
| 3417 | } |
| 3418 | |
| 3419 | func (self *ActionNxOutputReg2) GetOfsNbits() uint16 { |
| 3420 | return self.OfsNbits |
| 3421 | } |
| 3422 | |
| 3423 | func (self *ActionNxOutputReg2) SetOfsNbits(v uint16) { |
| 3424 | self.OfsNbits = v |
| 3425 | } |
| 3426 | |
| 3427 | func (self *ActionNxOutputReg2) GetMaxLen() uint16 { |
| 3428 | return self.MaxLen |
| 3429 | } |
| 3430 | |
| 3431 | func (self *ActionNxOutputReg2) SetMaxLen(v uint16) { |
| 3432 | self.MaxLen = v |
| 3433 | } |
| 3434 | |
| 3435 | func (self *ActionNxOutputReg2) Serialize(encoder *goloxi.Encoder) error { |
| 3436 | startIndex := len(encoder.Bytes()) |
| 3437 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 3438 | return err |
| 3439 | } |
| 3440 | |
| 3441 | encoder.PutUint16(uint16(self.OfsNbits)) |
| 3442 | encoder.PutUint16(uint16(self.MaxLen)) |
| 3443 | encoder.Write(bytes.Repeat([]byte{0}, 10)) |
| 3444 | length := len(encoder.Bytes()) - startIndex |
| 3445 | |
| 3446 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 3447 | |
| 3448 | return nil |
| 3449 | } |
| 3450 | |
| 3451 | func DecodeActionNxOutputReg2(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxOutputReg2, error) { |
| 3452 | _actionnxoutputreg2 := &ActionNxOutputReg2{ActionNicira: parent} |
| 3453 | if decoder.Length() < 14 { |
| 3454 | return nil, fmt.Errorf("ActionNxOutputReg2 packet too short: %d < 14", decoder.Length()) |
| 3455 | } |
| 3456 | _actionnxoutputreg2.OfsNbits = uint16(decoder.ReadUint16()) |
| 3457 | _actionnxoutputreg2.MaxLen = uint16(decoder.ReadUint16()) |
| 3458 | decoder.Skip(10) |
| 3459 | return _actionnxoutputreg2, nil |
| 3460 | } |
| 3461 | |
| 3462 | func NewActionNxOutputReg2() *ActionNxOutputReg2 { |
| 3463 | obj := &ActionNxOutputReg2{ |
| 3464 | ActionNicira: NewActionNicira(32), |
| 3465 | } |
| 3466 | return obj |
| 3467 | } |
| 3468 | func (self *ActionNxOutputReg2) GetActionName() string { |
| 3469 | return "nx_output_reg2" |
| 3470 | } |
| 3471 | |
| 3472 | func (self *ActionNxOutputReg2) GetActionFields() map[string]interface{} { |
| 3473 | return map[string]interface{}{ |
| 3474 | "OfsNbits": self.OfsNbits, |
| 3475 | "MaxLen": self.MaxLen, |
| 3476 | } |
| 3477 | } |
| 3478 | |
| 3479 | func (self *ActionNxOutputReg2) MarshalJSON() ([]byte, error) { |
| 3480 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 3481 | if err != nil { |
| 3482 | return nil, err |
| 3483 | } |
| 3484 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 3485 | } |
| 3486 | |
| 3487 | type ActionNxOutputTrunc struct { |
| 3488 | *ActionNicira |
| 3489 | Port uint16 |
| 3490 | MaxLen uint32 |
| 3491 | } |
| 3492 | |
| 3493 | type IActionNxOutputTrunc interface { |
| 3494 | IActionNicira |
| 3495 | GetPort() uint16 |
| 3496 | GetMaxLen() uint32 |
| 3497 | } |
| 3498 | |
| 3499 | func (self *ActionNxOutputTrunc) GetPort() uint16 { |
| 3500 | return self.Port |
| 3501 | } |
| 3502 | |
| 3503 | func (self *ActionNxOutputTrunc) SetPort(v uint16) { |
| 3504 | self.Port = v |
| 3505 | } |
| 3506 | |
| 3507 | func (self *ActionNxOutputTrunc) GetMaxLen() uint32 { |
| 3508 | return self.MaxLen |
| 3509 | } |
| 3510 | |
| 3511 | func (self *ActionNxOutputTrunc) SetMaxLen(v uint32) { |
| 3512 | self.MaxLen = v |
| 3513 | } |
| 3514 | |
| 3515 | func (self *ActionNxOutputTrunc) Serialize(encoder *goloxi.Encoder) error { |
| 3516 | startIndex := len(encoder.Bytes()) |
| 3517 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 3518 | return err |
| 3519 | } |
| 3520 | |
| 3521 | encoder.PutUint16(uint16(self.Port)) |
| 3522 | encoder.PutUint32(uint32(self.MaxLen)) |
| 3523 | length := len(encoder.Bytes()) - startIndex |
| 3524 | |
| 3525 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 3526 | |
| 3527 | return nil |
| 3528 | } |
| 3529 | |
| 3530 | func DecodeActionNxOutputTrunc(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxOutputTrunc, error) { |
| 3531 | _actionnxoutputtrunc := &ActionNxOutputTrunc{ActionNicira: parent} |
| 3532 | if decoder.Length() < 6 { |
| 3533 | return nil, fmt.Errorf("ActionNxOutputTrunc packet too short: %d < 6", decoder.Length()) |
| 3534 | } |
| 3535 | _actionnxoutputtrunc.Port = uint16(decoder.ReadUint16()) |
| 3536 | _actionnxoutputtrunc.MaxLen = uint32(decoder.ReadUint32()) |
| 3537 | return _actionnxoutputtrunc, nil |
| 3538 | } |
| 3539 | |
| 3540 | func NewActionNxOutputTrunc() *ActionNxOutputTrunc { |
| 3541 | obj := &ActionNxOutputTrunc{ |
| 3542 | ActionNicira: NewActionNicira(39), |
| 3543 | } |
| 3544 | return obj |
| 3545 | } |
| 3546 | func (self *ActionNxOutputTrunc) GetActionName() string { |
| 3547 | return "nx_output_trunc" |
| 3548 | } |
| 3549 | |
| 3550 | func (self *ActionNxOutputTrunc) GetActionFields() map[string]interface{} { |
| 3551 | return map[string]interface{}{ |
| 3552 | "Port": self.Port, |
| 3553 | "MaxLen": self.MaxLen, |
| 3554 | } |
| 3555 | } |
| 3556 | |
| 3557 | func (self *ActionNxOutputTrunc) MarshalJSON() ([]byte, error) { |
| 3558 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 3559 | if err != nil { |
| 3560 | return nil, err |
| 3561 | } |
| 3562 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 3563 | } |
| 3564 | |
| 3565 | type ActionNxPopMpls struct { |
| 3566 | *ActionNicira |
| 3567 | Value uint16 |
| 3568 | } |
| 3569 | |
| 3570 | type IActionNxPopMpls interface { |
| 3571 | IActionNicira |
| 3572 | GetValue() uint16 |
| 3573 | } |
| 3574 | |
| 3575 | func (self *ActionNxPopMpls) GetValue() uint16 { |
| 3576 | return self.Value |
| 3577 | } |
| 3578 | |
| 3579 | func (self *ActionNxPopMpls) SetValue(v uint16) { |
| 3580 | self.Value = v |
| 3581 | } |
| 3582 | |
| 3583 | func (self *ActionNxPopMpls) Serialize(encoder *goloxi.Encoder) error { |
| 3584 | startIndex := len(encoder.Bytes()) |
| 3585 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 3586 | return err |
| 3587 | } |
| 3588 | |
| 3589 | encoder.PutUint16(uint16(self.Value)) |
| 3590 | length := len(encoder.Bytes()) - startIndex |
| 3591 | |
| 3592 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 3593 | |
| 3594 | return nil |
| 3595 | } |
| 3596 | |
| 3597 | func DecodeActionNxPopMpls(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxPopMpls, error) { |
| 3598 | _actionnxpopmpls := &ActionNxPopMpls{ActionNicira: parent} |
| 3599 | if decoder.Length() < 2 { |
| 3600 | return nil, fmt.Errorf("ActionNxPopMpls packet too short: %d < 2", decoder.Length()) |
| 3601 | } |
| 3602 | _actionnxpopmpls.Value = uint16(decoder.ReadUint16()) |
| 3603 | return _actionnxpopmpls, nil |
| 3604 | } |
| 3605 | |
| 3606 | func NewActionNxPopMpls() *ActionNxPopMpls { |
| 3607 | obj := &ActionNxPopMpls{ |
| 3608 | ActionNicira: NewActionNicira(24), |
| 3609 | } |
| 3610 | return obj |
| 3611 | } |
| 3612 | func (self *ActionNxPopMpls) GetActionName() string { |
| 3613 | return "nx_pop_mpls" |
| 3614 | } |
| 3615 | |
| 3616 | func (self *ActionNxPopMpls) GetActionFields() map[string]interface{} { |
| 3617 | return map[string]interface{}{ |
| 3618 | "Value": self.Value, |
| 3619 | } |
| 3620 | } |
| 3621 | |
| 3622 | func (self *ActionNxPopMpls) MarshalJSON() ([]byte, error) { |
| 3623 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 3624 | if err != nil { |
| 3625 | return nil, err |
| 3626 | } |
| 3627 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 3628 | } |
| 3629 | |
| 3630 | type ActionNxPopQueue struct { |
| 3631 | *ActionNicira |
| 3632 | } |
| 3633 | |
| 3634 | type IActionNxPopQueue interface { |
| 3635 | IActionNicira |
| 3636 | } |
| 3637 | |
| 3638 | func (self *ActionNxPopQueue) Serialize(encoder *goloxi.Encoder) error { |
| 3639 | startIndex := len(encoder.Bytes()) |
| 3640 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 3641 | return err |
| 3642 | } |
| 3643 | length := len(encoder.Bytes()) - startIndex |
| 3644 | |
| 3645 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 3646 | |
| 3647 | return nil |
| 3648 | } |
| 3649 | |
| 3650 | func DecodeActionNxPopQueue(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxPopQueue, error) { |
| 3651 | _actionnxpopqueue := &ActionNxPopQueue{ActionNicira: parent} |
| 3652 | return _actionnxpopqueue, nil |
| 3653 | } |
| 3654 | |
| 3655 | func NewActionNxPopQueue() *ActionNxPopQueue { |
| 3656 | obj := &ActionNxPopQueue{ |
| 3657 | ActionNicira: NewActionNicira(5), |
| 3658 | } |
| 3659 | return obj |
| 3660 | } |
| 3661 | func (self *ActionNxPopQueue) GetActionName() string { |
| 3662 | return "nx_pop_queue" |
| 3663 | } |
| 3664 | |
| 3665 | func (self *ActionNxPopQueue) GetActionFields() map[string]interface{} { |
| 3666 | return map[string]interface{}{} |
| 3667 | } |
| 3668 | |
| 3669 | func (self *ActionNxPopQueue) MarshalJSON() ([]byte, error) { |
| 3670 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 3671 | if err != nil { |
| 3672 | return nil, err |
| 3673 | } |
| 3674 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 3675 | } |
| 3676 | |
| 3677 | type ActionNxPushMpls struct { |
| 3678 | *ActionNicira |
| 3679 | Value uint16 |
| 3680 | } |
| 3681 | |
| 3682 | type IActionNxPushMpls interface { |
| 3683 | IActionNicira |
| 3684 | GetValue() uint16 |
| 3685 | } |
| 3686 | |
| 3687 | func (self *ActionNxPushMpls) GetValue() uint16 { |
| 3688 | return self.Value |
| 3689 | } |
| 3690 | |
| 3691 | func (self *ActionNxPushMpls) SetValue(v uint16) { |
| 3692 | self.Value = v |
| 3693 | } |
| 3694 | |
| 3695 | func (self *ActionNxPushMpls) Serialize(encoder *goloxi.Encoder) error { |
| 3696 | startIndex := len(encoder.Bytes()) |
| 3697 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 3698 | return err |
| 3699 | } |
| 3700 | |
| 3701 | encoder.PutUint16(uint16(self.Value)) |
| 3702 | length := len(encoder.Bytes()) - startIndex |
| 3703 | |
| 3704 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 3705 | |
| 3706 | return nil |
| 3707 | } |
| 3708 | |
| 3709 | func DecodeActionNxPushMpls(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxPushMpls, error) { |
| 3710 | _actionnxpushmpls := &ActionNxPushMpls{ActionNicira: parent} |
| 3711 | if decoder.Length() < 2 { |
| 3712 | return nil, fmt.Errorf("ActionNxPushMpls packet too short: %d < 2", decoder.Length()) |
| 3713 | } |
| 3714 | _actionnxpushmpls.Value = uint16(decoder.ReadUint16()) |
| 3715 | return _actionnxpushmpls, nil |
| 3716 | } |
| 3717 | |
| 3718 | func NewActionNxPushMpls() *ActionNxPushMpls { |
| 3719 | obj := &ActionNxPushMpls{ |
| 3720 | ActionNicira: NewActionNicira(23), |
| 3721 | } |
| 3722 | return obj |
| 3723 | } |
| 3724 | func (self *ActionNxPushMpls) GetActionName() string { |
| 3725 | return "nx_push_mpls" |
| 3726 | } |
| 3727 | |
| 3728 | func (self *ActionNxPushMpls) GetActionFields() map[string]interface{} { |
| 3729 | return map[string]interface{}{ |
| 3730 | "Value": self.Value, |
| 3731 | } |
| 3732 | } |
| 3733 | |
| 3734 | func (self *ActionNxPushMpls) MarshalJSON() ([]byte, error) { |
| 3735 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 3736 | if err != nil { |
| 3737 | return nil, err |
| 3738 | } |
| 3739 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 3740 | } |
| 3741 | |
| 3742 | type ActionNxRegLoad struct { |
| 3743 | *ActionNicira |
| 3744 | OfsNbits uint16 |
| 3745 | SrcField goloxi.IOxmId |
| 3746 | Value uint64 |
| 3747 | } |
| 3748 | |
| 3749 | type IActionNxRegLoad interface { |
| 3750 | IActionNicira |
| 3751 | GetOfsNbits() uint16 |
| 3752 | GetSrcField() goloxi.IOxmId |
| 3753 | GetValue() uint64 |
| 3754 | } |
| 3755 | |
| 3756 | func (self *ActionNxRegLoad) GetOfsNbits() uint16 { |
| 3757 | return self.OfsNbits |
| 3758 | } |
| 3759 | |
| 3760 | func (self *ActionNxRegLoad) SetOfsNbits(v uint16) { |
| 3761 | self.OfsNbits = v |
| 3762 | } |
| 3763 | |
| 3764 | func (self *ActionNxRegLoad) GetSrcField() goloxi.IOxmId { |
| 3765 | return self.SrcField |
| 3766 | } |
| 3767 | |
| 3768 | func (self *ActionNxRegLoad) SetSrcField(v goloxi.IOxmId) { |
| 3769 | self.SrcField = v |
| 3770 | } |
| 3771 | |
| 3772 | func (self *ActionNxRegLoad) GetValue() uint64 { |
| 3773 | return self.Value |
| 3774 | } |
| 3775 | |
| 3776 | func (self *ActionNxRegLoad) SetValue(v uint64) { |
| 3777 | self.Value = v |
| 3778 | } |
| 3779 | |
| 3780 | func (self *ActionNxRegLoad) Serialize(encoder *goloxi.Encoder) error { |
| 3781 | startIndex := len(encoder.Bytes()) |
| 3782 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 3783 | return err |
| 3784 | } |
| 3785 | |
| 3786 | encoder.PutUint16(uint16(self.OfsNbits)) |
| 3787 | self.SrcField.Serialize(encoder) |
| 3788 | encoder.PutUint64(uint64(self.Value)) |
| 3789 | length := len(encoder.Bytes()) - startIndex |
| 3790 | |
| 3791 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 3792 | |
| 3793 | return nil |
| 3794 | } |
| 3795 | |
| 3796 | func DecodeActionNxRegLoad(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxRegLoad, error) { |
| 3797 | _actionnxregload := &ActionNxRegLoad{ActionNicira: parent} |
| 3798 | if decoder.Length() < 14 { |
| 3799 | return nil, fmt.Errorf("ActionNxRegLoad packet too short: %d < 14", decoder.Length()) |
| 3800 | } |
| 3801 | _actionnxregload.OfsNbits = uint16(decoder.ReadUint16()) |
| 3802 | if obj, err := DecodeOxmId(decoder); err != nil { |
| 3803 | return nil, err |
| 3804 | } else { |
| 3805 | _actionnxregload.SrcField = obj |
| 3806 | } |
| 3807 | |
| 3808 | _actionnxregload.Value = uint64(decoder.ReadUint64()) |
| 3809 | return _actionnxregload, nil |
| 3810 | } |
| 3811 | |
| 3812 | func NewActionNxRegLoad() *ActionNxRegLoad { |
| 3813 | obj := &ActionNxRegLoad{ |
| 3814 | ActionNicira: NewActionNicira(7), |
| 3815 | } |
| 3816 | return obj |
| 3817 | } |
| 3818 | func (self *ActionNxRegLoad) GetActionName() string { |
| 3819 | return "nx_reg_load" |
| 3820 | } |
| 3821 | |
| 3822 | func (self *ActionNxRegLoad) GetActionFields() map[string]interface{} { |
| 3823 | return map[string]interface{}{ |
| 3824 | "OfsNbits": self.OfsNbits, |
| 3825 | "SrcField": self.SrcField, |
| 3826 | "Value": self.Value, |
| 3827 | } |
| 3828 | } |
| 3829 | |
| 3830 | func (self *ActionNxRegLoad) MarshalJSON() ([]byte, error) { |
| 3831 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 3832 | if err != nil { |
| 3833 | return nil, err |
| 3834 | } |
| 3835 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 3836 | } |
| 3837 | |
| 3838 | type ActionNxRegLoad2 struct { |
| 3839 | *ActionNicira |
| 3840 | } |
| 3841 | |
| 3842 | type IActionNxRegLoad2 interface { |
| 3843 | IActionNicira |
| 3844 | } |
| 3845 | |
| 3846 | func (self *ActionNxRegLoad2) Serialize(encoder *goloxi.Encoder) error { |
| 3847 | startIndex := len(encoder.Bytes()) |
| 3848 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 3849 | return err |
| 3850 | } |
| 3851 | |
| 3852 | encoder.Write(bytes.Repeat([]byte{0}, 6)) |
| 3853 | length := len(encoder.Bytes()) - startIndex |
| 3854 | |
| 3855 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 3856 | |
| 3857 | return nil |
| 3858 | } |
| 3859 | |
| 3860 | func DecodeActionNxRegLoad2(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxRegLoad2, error) { |
| 3861 | _actionnxregload2 := &ActionNxRegLoad2{ActionNicira: parent} |
| 3862 | if decoder.Length() < 6 { |
| 3863 | return nil, fmt.Errorf("ActionNxRegLoad2 packet too short: %d < 6", decoder.Length()) |
| 3864 | } |
| 3865 | decoder.Skip(6) |
| 3866 | return _actionnxregload2, nil |
| 3867 | } |
| 3868 | |
| 3869 | func NewActionNxRegLoad2() *ActionNxRegLoad2 { |
| 3870 | obj := &ActionNxRegLoad2{ |
| 3871 | ActionNicira: NewActionNicira(33), |
| 3872 | } |
| 3873 | return obj |
| 3874 | } |
| 3875 | func (self *ActionNxRegLoad2) GetActionName() string { |
| 3876 | return "nx_reg_load2" |
| 3877 | } |
| 3878 | |
| 3879 | func (self *ActionNxRegLoad2) GetActionFields() map[string]interface{} { |
| 3880 | return map[string]interface{}{} |
| 3881 | } |
| 3882 | |
| 3883 | func (self *ActionNxRegLoad2) MarshalJSON() ([]byte, error) { |
| 3884 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 3885 | if err != nil { |
| 3886 | return nil, err |
| 3887 | } |
| 3888 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 3889 | } |
| 3890 | |
| 3891 | type ActionNxRegMove struct { |
| 3892 | *ActionNicira |
| 3893 | NBits uint16 |
| 3894 | SrcOfs uint16 |
| 3895 | DstOfs uint16 |
| 3896 | Src goloxi.IOxmId |
| 3897 | Dst goloxi.IOxmId |
| 3898 | } |
| 3899 | |
| 3900 | type IActionNxRegMove interface { |
| 3901 | IActionNicira |
| 3902 | GetNBits() uint16 |
| 3903 | GetSrcOfs() uint16 |
| 3904 | GetDstOfs() uint16 |
| 3905 | GetSrc() goloxi.IOxmId |
| 3906 | GetDst() goloxi.IOxmId |
| 3907 | } |
| 3908 | |
| 3909 | func (self *ActionNxRegMove) GetNBits() uint16 { |
| 3910 | return self.NBits |
| 3911 | } |
| 3912 | |
| 3913 | func (self *ActionNxRegMove) SetNBits(v uint16) { |
| 3914 | self.NBits = v |
| 3915 | } |
| 3916 | |
| 3917 | func (self *ActionNxRegMove) GetSrcOfs() uint16 { |
| 3918 | return self.SrcOfs |
| 3919 | } |
| 3920 | |
| 3921 | func (self *ActionNxRegMove) SetSrcOfs(v uint16) { |
| 3922 | self.SrcOfs = v |
| 3923 | } |
| 3924 | |
| 3925 | func (self *ActionNxRegMove) GetDstOfs() uint16 { |
| 3926 | return self.DstOfs |
| 3927 | } |
| 3928 | |
| 3929 | func (self *ActionNxRegMove) SetDstOfs(v uint16) { |
| 3930 | self.DstOfs = v |
| 3931 | } |
| 3932 | |
| 3933 | func (self *ActionNxRegMove) GetSrc() goloxi.IOxmId { |
| 3934 | return self.Src |
| 3935 | } |
| 3936 | |
| 3937 | func (self *ActionNxRegMove) SetSrc(v goloxi.IOxmId) { |
| 3938 | self.Src = v |
| 3939 | } |
| 3940 | |
| 3941 | func (self *ActionNxRegMove) GetDst() goloxi.IOxmId { |
| 3942 | return self.Dst |
| 3943 | } |
| 3944 | |
| 3945 | func (self *ActionNxRegMove) SetDst(v goloxi.IOxmId) { |
| 3946 | self.Dst = v |
| 3947 | } |
| 3948 | |
| 3949 | func (self *ActionNxRegMove) Serialize(encoder *goloxi.Encoder) error { |
| 3950 | startIndex := len(encoder.Bytes()) |
| 3951 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 3952 | return err |
| 3953 | } |
| 3954 | |
| 3955 | encoder.PutUint16(uint16(self.NBits)) |
| 3956 | encoder.PutUint16(uint16(self.SrcOfs)) |
| 3957 | encoder.PutUint16(uint16(self.DstOfs)) |
| 3958 | self.Src.Serialize(encoder) |
| 3959 | self.Dst.Serialize(encoder) |
| 3960 | length := len(encoder.Bytes()) - startIndex |
| 3961 | alignedLength := ((length + 7) / 8 * 8) |
| 3962 | |
| 3963 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 3964 | |
| 3965 | encoder.Write(bytes.Repeat([]byte{0}, alignedLength-length)) |
| 3966 | |
| 3967 | return nil |
| 3968 | } |
| 3969 | |
| 3970 | func DecodeActionNxRegMove(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxRegMove, error) { |
| 3971 | _actionnxregmove := &ActionNxRegMove{ActionNicira: parent} |
| 3972 | if decoder.Length() < 14 { |
| 3973 | return nil, fmt.Errorf("ActionNxRegMove packet too short: %d < 14", decoder.Length()) |
| 3974 | } |
| 3975 | _actionnxregmove.NBits = uint16(decoder.ReadUint16()) |
| 3976 | _actionnxregmove.SrcOfs = uint16(decoder.ReadUint16()) |
| 3977 | _actionnxregmove.DstOfs = uint16(decoder.ReadUint16()) |
| 3978 | if obj, err := DecodeOxmId(decoder); err != nil { |
| 3979 | return nil, err |
| 3980 | } else { |
| 3981 | _actionnxregmove.Src = obj |
| 3982 | } |
| 3983 | |
| 3984 | if obj, err := DecodeOxmId(decoder); err != nil { |
| 3985 | return nil, err |
| 3986 | } else { |
| 3987 | _actionnxregmove.Dst = obj |
| 3988 | } |
| 3989 | |
| 3990 | return _actionnxregmove, nil |
| 3991 | } |
| 3992 | |
| 3993 | func NewActionNxRegMove() *ActionNxRegMove { |
| 3994 | obj := &ActionNxRegMove{ |
| 3995 | ActionNicira: NewActionNicira(6), |
| 3996 | } |
| 3997 | return obj |
| 3998 | } |
| 3999 | func (self *ActionNxRegMove) GetActionName() string { |
| 4000 | return "nx_reg_move" |
| 4001 | } |
| 4002 | |
| 4003 | func (self *ActionNxRegMove) GetActionFields() map[string]interface{} { |
| 4004 | return map[string]interface{}{ |
| 4005 | "NBits": self.NBits, |
| 4006 | "SrcOfs": self.SrcOfs, |
| 4007 | "DstOfs": self.DstOfs, |
| 4008 | "Src": self.Src, |
| 4009 | "Dst": self.Dst, |
| 4010 | } |
| 4011 | } |
| 4012 | |
| 4013 | func (self *ActionNxRegMove) MarshalJSON() ([]byte, error) { |
| 4014 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 4015 | if err != nil { |
| 4016 | return nil, err |
| 4017 | } |
| 4018 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 4019 | } |
| 4020 | |
| 4021 | type ActionNxResubmit struct { |
| 4022 | *ActionNicira |
| 4023 | Value uint16 |
| 4024 | } |
| 4025 | |
| 4026 | type IActionNxResubmit interface { |
| 4027 | IActionNicira |
| 4028 | GetValue() uint16 |
| 4029 | } |
| 4030 | |
| 4031 | func (self *ActionNxResubmit) GetValue() uint16 { |
| 4032 | return self.Value |
| 4033 | } |
| 4034 | |
| 4035 | func (self *ActionNxResubmit) SetValue(v uint16) { |
| 4036 | self.Value = v |
| 4037 | } |
| 4038 | |
| 4039 | func (self *ActionNxResubmit) Serialize(encoder *goloxi.Encoder) error { |
| 4040 | startIndex := len(encoder.Bytes()) |
| 4041 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 4042 | return err |
| 4043 | } |
| 4044 | |
| 4045 | encoder.PutUint16(uint16(self.Value)) |
| 4046 | length := len(encoder.Bytes()) - startIndex |
| 4047 | |
| 4048 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 4049 | |
| 4050 | return nil |
| 4051 | } |
| 4052 | |
| 4053 | func DecodeActionNxResubmit(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxResubmit, error) { |
| 4054 | _actionnxresubmit := &ActionNxResubmit{ActionNicira: parent} |
| 4055 | if decoder.Length() < 2 { |
| 4056 | return nil, fmt.Errorf("ActionNxResubmit packet too short: %d < 2", decoder.Length()) |
| 4057 | } |
| 4058 | _actionnxresubmit.Value = uint16(decoder.ReadUint16()) |
| 4059 | return _actionnxresubmit, nil |
| 4060 | } |
| 4061 | |
| 4062 | func NewActionNxResubmit() *ActionNxResubmit { |
| 4063 | obj := &ActionNxResubmit{ |
| 4064 | ActionNicira: NewActionNicira(1), |
| 4065 | } |
| 4066 | return obj |
| 4067 | } |
| 4068 | func (self *ActionNxResubmit) GetActionName() string { |
| 4069 | return "nx_resubmit" |
| 4070 | } |
| 4071 | |
| 4072 | func (self *ActionNxResubmit) GetActionFields() map[string]interface{} { |
| 4073 | return map[string]interface{}{ |
| 4074 | "Value": self.Value, |
| 4075 | } |
| 4076 | } |
| 4077 | |
| 4078 | func (self *ActionNxResubmit) MarshalJSON() ([]byte, error) { |
| 4079 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 4080 | if err != nil { |
| 4081 | return nil, err |
| 4082 | } |
| 4083 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 4084 | } |
| 4085 | |
| 4086 | type ActionNxResubmitTable struct { |
| 4087 | *ActionNicira |
| 4088 | InPort uint16 |
| 4089 | Table uint8 |
| 4090 | } |
| 4091 | |
| 4092 | type IActionNxResubmitTable interface { |
| 4093 | IActionNicira |
| 4094 | GetInPort() uint16 |
| 4095 | GetTable() uint8 |
| 4096 | } |
| 4097 | |
| 4098 | func (self *ActionNxResubmitTable) GetInPort() uint16 { |
| 4099 | return self.InPort |
| 4100 | } |
| 4101 | |
| 4102 | func (self *ActionNxResubmitTable) SetInPort(v uint16) { |
| 4103 | self.InPort = v |
| 4104 | } |
| 4105 | |
| 4106 | func (self *ActionNxResubmitTable) GetTable() uint8 { |
| 4107 | return self.Table |
| 4108 | } |
| 4109 | |
| 4110 | func (self *ActionNxResubmitTable) SetTable(v uint8) { |
| 4111 | self.Table = v |
| 4112 | } |
| 4113 | |
| 4114 | func (self *ActionNxResubmitTable) Serialize(encoder *goloxi.Encoder) error { |
| 4115 | startIndex := len(encoder.Bytes()) |
| 4116 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 4117 | return err |
| 4118 | } |
| 4119 | |
| 4120 | encoder.PutUint16(uint16(self.InPort)) |
| 4121 | encoder.PutUint8(uint8(self.Table)) |
| 4122 | encoder.Write(bytes.Repeat([]byte{0}, 3)) |
| 4123 | length := len(encoder.Bytes()) - startIndex |
| 4124 | |
| 4125 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 4126 | |
| 4127 | return nil |
| 4128 | } |
| 4129 | |
| 4130 | func DecodeActionNxResubmitTable(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxResubmitTable, error) { |
| 4131 | _actionnxresubmittable := &ActionNxResubmitTable{ActionNicira: parent} |
| 4132 | if decoder.Length() < 6 { |
| 4133 | return nil, fmt.Errorf("ActionNxResubmitTable packet too short: %d < 6", decoder.Length()) |
| 4134 | } |
| 4135 | _actionnxresubmittable.InPort = uint16(decoder.ReadUint16()) |
| 4136 | _actionnxresubmittable.Table = uint8(decoder.ReadByte()) |
| 4137 | decoder.Skip(3) |
| 4138 | return _actionnxresubmittable, nil |
| 4139 | } |
| 4140 | |
| 4141 | func NewActionNxResubmitTable() *ActionNxResubmitTable { |
| 4142 | obj := &ActionNxResubmitTable{ |
| 4143 | ActionNicira: NewActionNicira(14), |
| 4144 | } |
| 4145 | return obj |
| 4146 | } |
| 4147 | func (self *ActionNxResubmitTable) GetActionName() string { |
| 4148 | return "nx_resubmit_table" |
| 4149 | } |
| 4150 | |
| 4151 | func (self *ActionNxResubmitTable) GetActionFields() map[string]interface{} { |
| 4152 | return map[string]interface{}{ |
| 4153 | "InPort": self.InPort, |
| 4154 | "Table": self.Table, |
| 4155 | } |
| 4156 | } |
| 4157 | |
| 4158 | func (self *ActionNxResubmitTable) MarshalJSON() ([]byte, error) { |
| 4159 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 4160 | if err != nil { |
| 4161 | return nil, err |
| 4162 | } |
| 4163 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 4164 | } |
| 4165 | |
| 4166 | type ActionNxResubmitTableCt struct { |
| 4167 | *ActionNicira |
| 4168 | InPort uint16 |
| 4169 | Table uint8 |
| 4170 | } |
| 4171 | |
| 4172 | type IActionNxResubmitTableCt interface { |
| 4173 | IActionNicira |
| 4174 | GetInPort() uint16 |
| 4175 | GetTable() uint8 |
| 4176 | } |
| 4177 | |
| 4178 | func (self *ActionNxResubmitTableCt) GetInPort() uint16 { |
| 4179 | return self.InPort |
| 4180 | } |
| 4181 | |
| 4182 | func (self *ActionNxResubmitTableCt) SetInPort(v uint16) { |
| 4183 | self.InPort = v |
| 4184 | } |
| 4185 | |
| 4186 | func (self *ActionNxResubmitTableCt) GetTable() uint8 { |
| 4187 | return self.Table |
| 4188 | } |
| 4189 | |
| 4190 | func (self *ActionNxResubmitTableCt) SetTable(v uint8) { |
| 4191 | self.Table = v |
| 4192 | } |
| 4193 | |
| 4194 | func (self *ActionNxResubmitTableCt) Serialize(encoder *goloxi.Encoder) error { |
| 4195 | startIndex := len(encoder.Bytes()) |
| 4196 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 4197 | return err |
| 4198 | } |
| 4199 | |
| 4200 | encoder.PutUint16(uint16(self.InPort)) |
| 4201 | encoder.PutUint8(uint8(self.Table)) |
| 4202 | encoder.Write(bytes.Repeat([]byte{0}, 3)) |
| 4203 | length := len(encoder.Bytes()) - startIndex |
| 4204 | |
| 4205 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 4206 | |
| 4207 | return nil |
| 4208 | } |
| 4209 | |
| 4210 | func DecodeActionNxResubmitTableCt(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxResubmitTableCt, error) { |
| 4211 | _actionnxresubmittablect := &ActionNxResubmitTableCt{ActionNicira: parent} |
| 4212 | if decoder.Length() < 6 { |
| 4213 | return nil, fmt.Errorf("ActionNxResubmitTableCt packet too short: %d < 6", decoder.Length()) |
| 4214 | } |
| 4215 | _actionnxresubmittablect.InPort = uint16(decoder.ReadUint16()) |
| 4216 | _actionnxresubmittablect.Table = uint8(decoder.ReadByte()) |
| 4217 | decoder.Skip(3) |
| 4218 | return _actionnxresubmittablect, nil |
| 4219 | } |
| 4220 | |
| 4221 | func NewActionNxResubmitTableCt() *ActionNxResubmitTableCt { |
| 4222 | obj := &ActionNxResubmitTableCt{ |
| 4223 | ActionNicira: NewActionNicira(44), |
| 4224 | } |
| 4225 | return obj |
| 4226 | } |
| 4227 | func (self *ActionNxResubmitTableCt) GetActionName() string { |
| 4228 | return "nx_resubmit_table_ct" |
| 4229 | } |
| 4230 | |
| 4231 | func (self *ActionNxResubmitTableCt) GetActionFields() map[string]interface{} { |
| 4232 | return map[string]interface{}{ |
| 4233 | "InPort": self.InPort, |
| 4234 | "Table": self.Table, |
| 4235 | } |
| 4236 | } |
| 4237 | |
| 4238 | func (self *ActionNxResubmitTableCt) MarshalJSON() ([]byte, error) { |
| 4239 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 4240 | if err != nil { |
| 4241 | return nil, err |
| 4242 | } |
| 4243 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 4244 | } |
| 4245 | |
| 4246 | type ActionNxSample struct { |
| 4247 | *ActionNicira |
| 4248 | Probability uint16 |
| 4249 | CollectorSetId uint32 |
| 4250 | ObsDomainId uint32 |
| 4251 | ObsPointId uint32 |
| 4252 | } |
| 4253 | |
| 4254 | type IActionNxSample interface { |
| 4255 | IActionNicira |
| 4256 | GetProbability() uint16 |
| 4257 | GetCollectorSetId() uint32 |
| 4258 | GetObsDomainId() uint32 |
| 4259 | GetObsPointId() uint32 |
| 4260 | } |
| 4261 | |
| 4262 | func (self *ActionNxSample) GetProbability() uint16 { |
| 4263 | return self.Probability |
| 4264 | } |
| 4265 | |
| 4266 | func (self *ActionNxSample) SetProbability(v uint16) { |
| 4267 | self.Probability = v |
| 4268 | } |
| 4269 | |
| 4270 | func (self *ActionNxSample) GetCollectorSetId() uint32 { |
| 4271 | return self.CollectorSetId |
| 4272 | } |
| 4273 | |
| 4274 | func (self *ActionNxSample) SetCollectorSetId(v uint32) { |
| 4275 | self.CollectorSetId = v |
| 4276 | } |
| 4277 | |
| 4278 | func (self *ActionNxSample) GetObsDomainId() uint32 { |
| 4279 | return self.ObsDomainId |
| 4280 | } |
| 4281 | |
| 4282 | func (self *ActionNxSample) SetObsDomainId(v uint32) { |
| 4283 | self.ObsDomainId = v |
| 4284 | } |
| 4285 | |
| 4286 | func (self *ActionNxSample) GetObsPointId() uint32 { |
| 4287 | return self.ObsPointId |
| 4288 | } |
| 4289 | |
| 4290 | func (self *ActionNxSample) SetObsPointId(v uint32) { |
| 4291 | self.ObsPointId = v |
| 4292 | } |
| 4293 | |
| 4294 | func (self *ActionNxSample) Serialize(encoder *goloxi.Encoder) error { |
| 4295 | startIndex := len(encoder.Bytes()) |
| 4296 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 4297 | return err |
| 4298 | } |
| 4299 | |
| 4300 | encoder.PutUint16(uint16(self.Probability)) |
| 4301 | encoder.PutUint32(uint32(self.CollectorSetId)) |
| 4302 | encoder.PutUint32(uint32(self.ObsDomainId)) |
| 4303 | encoder.PutUint32(uint32(self.ObsPointId)) |
| 4304 | length := len(encoder.Bytes()) - startIndex |
| 4305 | |
| 4306 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 4307 | |
| 4308 | return nil |
| 4309 | } |
| 4310 | |
| 4311 | func DecodeActionNxSample(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxSample, error) { |
| 4312 | _actionnxsample := &ActionNxSample{ActionNicira: parent} |
| 4313 | if decoder.Length() < 14 { |
| 4314 | return nil, fmt.Errorf("ActionNxSample packet too short: %d < 14", decoder.Length()) |
| 4315 | } |
| 4316 | _actionnxsample.Probability = uint16(decoder.ReadUint16()) |
| 4317 | _actionnxsample.CollectorSetId = uint32(decoder.ReadUint32()) |
| 4318 | _actionnxsample.ObsDomainId = uint32(decoder.ReadUint32()) |
| 4319 | _actionnxsample.ObsPointId = uint32(decoder.ReadUint32()) |
| 4320 | return _actionnxsample, nil |
| 4321 | } |
| 4322 | |
| 4323 | func NewActionNxSample() *ActionNxSample { |
| 4324 | obj := &ActionNxSample{ |
| 4325 | ActionNicira: NewActionNicira(29), |
| 4326 | } |
| 4327 | return obj |
| 4328 | } |
| 4329 | func (self *ActionNxSample) GetActionName() string { |
| 4330 | return "nx_sample" |
| 4331 | } |
| 4332 | |
| 4333 | func (self *ActionNxSample) GetActionFields() map[string]interface{} { |
| 4334 | return map[string]interface{}{ |
| 4335 | "Probability": self.Probability, |
| 4336 | "CollectorSetId": self.CollectorSetId, |
| 4337 | "ObsDomainId": self.ObsDomainId, |
| 4338 | "ObsPointId": self.ObsPointId, |
| 4339 | } |
| 4340 | } |
| 4341 | |
| 4342 | func (self *ActionNxSample) MarshalJSON() ([]byte, error) { |
| 4343 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 4344 | if err != nil { |
| 4345 | return nil, err |
| 4346 | } |
| 4347 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 4348 | } |
| 4349 | |
| 4350 | type ActionNxSample2 struct { |
| 4351 | *ActionNicira |
| 4352 | Probability uint16 |
| 4353 | CollectorSetId uint32 |
| 4354 | ObsDomainId uint32 |
| 4355 | ObsPointId uint32 |
| 4356 | SamplingPort uint16 |
| 4357 | Direction uint8 |
| 4358 | } |
| 4359 | |
| 4360 | type IActionNxSample2 interface { |
| 4361 | IActionNicira |
| 4362 | GetProbability() uint16 |
| 4363 | GetCollectorSetId() uint32 |
| 4364 | GetObsDomainId() uint32 |
| 4365 | GetObsPointId() uint32 |
| 4366 | GetSamplingPort() uint16 |
| 4367 | GetDirection() uint8 |
| 4368 | } |
| 4369 | |
| 4370 | func (self *ActionNxSample2) GetProbability() uint16 { |
| 4371 | return self.Probability |
| 4372 | } |
| 4373 | |
| 4374 | func (self *ActionNxSample2) SetProbability(v uint16) { |
| 4375 | self.Probability = v |
| 4376 | } |
| 4377 | |
| 4378 | func (self *ActionNxSample2) GetCollectorSetId() uint32 { |
| 4379 | return self.CollectorSetId |
| 4380 | } |
| 4381 | |
| 4382 | func (self *ActionNxSample2) SetCollectorSetId(v uint32) { |
| 4383 | self.CollectorSetId = v |
| 4384 | } |
| 4385 | |
| 4386 | func (self *ActionNxSample2) GetObsDomainId() uint32 { |
| 4387 | return self.ObsDomainId |
| 4388 | } |
| 4389 | |
| 4390 | func (self *ActionNxSample2) SetObsDomainId(v uint32) { |
| 4391 | self.ObsDomainId = v |
| 4392 | } |
| 4393 | |
| 4394 | func (self *ActionNxSample2) GetObsPointId() uint32 { |
| 4395 | return self.ObsPointId |
| 4396 | } |
| 4397 | |
| 4398 | func (self *ActionNxSample2) SetObsPointId(v uint32) { |
| 4399 | self.ObsPointId = v |
| 4400 | } |
| 4401 | |
| 4402 | func (self *ActionNxSample2) GetSamplingPort() uint16 { |
| 4403 | return self.SamplingPort |
| 4404 | } |
| 4405 | |
| 4406 | func (self *ActionNxSample2) SetSamplingPort(v uint16) { |
| 4407 | self.SamplingPort = v |
| 4408 | } |
| 4409 | |
| 4410 | func (self *ActionNxSample2) GetDirection() uint8 { |
| 4411 | return self.Direction |
| 4412 | } |
| 4413 | |
| 4414 | func (self *ActionNxSample2) SetDirection(v uint8) { |
| 4415 | self.Direction = v |
| 4416 | } |
| 4417 | |
| 4418 | func (self *ActionNxSample2) Serialize(encoder *goloxi.Encoder) error { |
| 4419 | startIndex := len(encoder.Bytes()) |
| 4420 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 4421 | return err |
| 4422 | } |
| 4423 | |
| 4424 | encoder.PutUint16(uint16(self.Probability)) |
| 4425 | encoder.PutUint32(uint32(self.CollectorSetId)) |
| 4426 | encoder.PutUint32(uint32(self.ObsDomainId)) |
| 4427 | encoder.PutUint32(uint32(self.ObsPointId)) |
| 4428 | encoder.PutUint16(uint16(self.SamplingPort)) |
| 4429 | encoder.PutUint8(uint8(self.Direction)) |
| 4430 | encoder.Write(bytes.Repeat([]byte{0}, 5)) |
| 4431 | length := len(encoder.Bytes()) - startIndex |
| 4432 | |
| 4433 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 4434 | |
| 4435 | return nil |
| 4436 | } |
| 4437 | |
| 4438 | func DecodeActionNxSample2(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxSample2, error) { |
| 4439 | _actionnxsample2 := &ActionNxSample2{ActionNicira: parent} |
| 4440 | if decoder.Length() < 22 { |
| 4441 | return nil, fmt.Errorf("ActionNxSample2 packet too short: %d < 22", decoder.Length()) |
| 4442 | } |
| 4443 | _actionnxsample2.Probability = uint16(decoder.ReadUint16()) |
| 4444 | _actionnxsample2.CollectorSetId = uint32(decoder.ReadUint32()) |
| 4445 | _actionnxsample2.ObsDomainId = uint32(decoder.ReadUint32()) |
| 4446 | _actionnxsample2.ObsPointId = uint32(decoder.ReadUint32()) |
| 4447 | _actionnxsample2.SamplingPort = uint16(decoder.ReadUint16()) |
| 4448 | _actionnxsample2.Direction = uint8(decoder.ReadByte()) |
| 4449 | decoder.Skip(5) |
| 4450 | return _actionnxsample2, nil |
| 4451 | } |
| 4452 | |
| 4453 | func NewActionNxSample2() *ActionNxSample2 { |
| 4454 | obj := &ActionNxSample2{ |
| 4455 | ActionNicira: NewActionNicira(38), |
| 4456 | } |
| 4457 | return obj |
| 4458 | } |
| 4459 | func (self *ActionNxSample2) GetActionName() string { |
| 4460 | return "nx_sample2" |
| 4461 | } |
| 4462 | |
| 4463 | func (self *ActionNxSample2) GetActionFields() map[string]interface{} { |
| 4464 | return map[string]interface{}{ |
| 4465 | "Probability": self.Probability, |
| 4466 | "CollectorSetId": self.CollectorSetId, |
| 4467 | "ObsDomainId": self.ObsDomainId, |
| 4468 | "ObsPointId": self.ObsPointId, |
| 4469 | "SamplingPort": self.SamplingPort, |
| 4470 | "Direction": self.Direction, |
| 4471 | } |
| 4472 | } |
| 4473 | |
| 4474 | func (self *ActionNxSample2) MarshalJSON() ([]byte, error) { |
| 4475 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 4476 | if err != nil { |
| 4477 | return nil, err |
| 4478 | } |
| 4479 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 4480 | } |
| 4481 | |
| 4482 | type ActionNxSample3 struct { |
| 4483 | *ActionNicira |
| 4484 | Probability uint16 |
| 4485 | CollectorSetId uint32 |
| 4486 | ObsDomainId uint32 |
| 4487 | ObsPointId uint32 |
| 4488 | SamplingPort uint16 |
| 4489 | Direction uint8 |
| 4490 | } |
| 4491 | |
| 4492 | type IActionNxSample3 interface { |
| 4493 | IActionNicira |
| 4494 | GetProbability() uint16 |
| 4495 | GetCollectorSetId() uint32 |
| 4496 | GetObsDomainId() uint32 |
| 4497 | GetObsPointId() uint32 |
| 4498 | GetSamplingPort() uint16 |
| 4499 | GetDirection() uint8 |
| 4500 | } |
| 4501 | |
| 4502 | func (self *ActionNxSample3) GetProbability() uint16 { |
| 4503 | return self.Probability |
| 4504 | } |
| 4505 | |
| 4506 | func (self *ActionNxSample3) SetProbability(v uint16) { |
| 4507 | self.Probability = v |
| 4508 | } |
| 4509 | |
| 4510 | func (self *ActionNxSample3) GetCollectorSetId() uint32 { |
| 4511 | return self.CollectorSetId |
| 4512 | } |
| 4513 | |
| 4514 | func (self *ActionNxSample3) SetCollectorSetId(v uint32) { |
| 4515 | self.CollectorSetId = v |
| 4516 | } |
| 4517 | |
| 4518 | func (self *ActionNxSample3) GetObsDomainId() uint32 { |
| 4519 | return self.ObsDomainId |
| 4520 | } |
| 4521 | |
| 4522 | func (self *ActionNxSample3) SetObsDomainId(v uint32) { |
| 4523 | self.ObsDomainId = v |
| 4524 | } |
| 4525 | |
| 4526 | func (self *ActionNxSample3) GetObsPointId() uint32 { |
| 4527 | return self.ObsPointId |
| 4528 | } |
| 4529 | |
| 4530 | func (self *ActionNxSample3) SetObsPointId(v uint32) { |
| 4531 | self.ObsPointId = v |
| 4532 | } |
| 4533 | |
| 4534 | func (self *ActionNxSample3) GetSamplingPort() uint16 { |
| 4535 | return self.SamplingPort |
| 4536 | } |
| 4537 | |
| 4538 | func (self *ActionNxSample3) SetSamplingPort(v uint16) { |
| 4539 | self.SamplingPort = v |
| 4540 | } |
| 4541 | |
| 4542 | func (self *ActionNxSample3) GetDirection() uint8 { |
| 4543 | return self.Direction |
| 4544 | } |
| 4545 | |
| 4546 | func (self *ActionNxSample3) SetDirection(v uint8) { |
| 4547 | self.Direction = v |
| 4548 | } |
| 4549 | |
| 4550 | func (self *ActionNxSample3) Serialize(encoder *goloxi.Encoder) error { |
| 4551 | startIndex := len(encoder.Bytes()) |
| 4552 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 4553 | return err |
| 4554 | } |
| 4555 | |
| 4556 | encoder.PutUint16(uint16(self.Probability)) |
| 4557 | encoder.PutUint32(uint32(self.CollectorSetId)) |
| 4558 | encoder.PutUint32(uint32(self.ObsDomainId)) |
| 4559 | encoder.PutUint32(uint32(self.ObsPointId)) |
| 4560 | encoder.PutUint16(uint16(self.SamplingPort)) |
| 4561 | encoder.PutUint8(uint8(self.Direction)) |
| 4562 | encoder.Write(bytes.Repeat([]byte{0}, 5)) |
| 4563 | length := len(encoder.Bytes()) - startIndex |
| 4564 | |
| 4565 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 4566 | |
| 4567 | return nil |
| 4568 | } |
| 4569 | |
| 4570 | func DecodeActionNxSample3(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxSample3, error) { |
| 4571 | _actionnxsample3 := &ActionNxSample3{ActionNicira: parent} |
| 4572 | if decoder.Length() < 22 { |
| 4573 | return nil, fmt.Errorf("ActionNxSample3 packet too short: %d < 22", decoder.Length()) |
| 4574 | } |
| 4575 | _actionnxsample3.Probability = uint16(decoder.ReadUint16()) |
| 4576 | _actionnxsample3.CollectorSetId = uint32(decoder.ReadUint32()) |
| 4577 | _actionnxsample3.ObsDomainId = uint32(decoder.ReadUint32()) |
| 4578 | _actionnxsample3.ObsPointId = uint32(decoder.ReadUint32()) |
| 4579 | _actionnxsample3.SamplingPort = uint16(decoder.ReadUint16()) |
| 4580 | _actionnxsample3.Direction = uint8(decoder.ReadByte()) |
| 4581 | decoder.Skip(5) |
| 4582 | return _actionnxsample3, nil |
| 4583 | } |
| 4584 | |
| 4585 | func NewActionNxSample3() *ActionNxSample3 { |
| 4586 | obj := &ActionNxSample3{ |
| 4587 | ActionNicira: NewActionNicira(41), |
| 4588 | } |
| 4589 | return obj |
| 4590 | } |
| 4591 | func (self *ActionNxSample3) GetActionName() string { |
| 4592 | return "nx_sample3" |
| 4593 | } |
| 4594 | |
| 4595 | func (self *ActionNxSample3) GetActionFields() map[string]interface{} { |
| 4596 | return map[string]interface{}{ |
| 4597 | "Probability": self.Probability, |
| 4598 | "CollectorSetId": self.CollectorSetId, |
| 4599 | "ObsDomainId": self.ObsDomainId, |
| 4600 | "ObsPointId": self.ObsPointId, |
| 4601 | "SamplingPort": self.SamplingPort, |
| 4602 | "Direction": self.Direction, |
| 4603 | } |
| 4604 | } |
| 4605 | |
| 4606 | func (self *ActionNxSample3) MarshalJSON() ([]byte, error) { |
| 4607 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 4608 | if err != nil { |
| 4609 | return nil, err |
| 4610 | } |
| 4611 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 4612 | } |
| 4613 | |
| 4614 | type ActionNxSetMplsLabel struct { |
| 4615 | *ActionNicira |
| 4616 | Value uint32 |
| 4617 | } |
| 4618 | |
| 4619 | type IActionNxSetMplsLabel interface { |
| 4620 | IActionNicira |
| 4621 | GetValue() uint32 |
| 4622 | } |
| 4623 | |
| 4624 | func (self *ActionNxSetMplsLabel) GetValue() uint32 { |
| 4625 | return self.Value |
| 4626 | } |
| 4627 | |
| 4628 | func (self *ActionNxSetMplsLabel) SetValue(v uint32) { |
| 4629 | self.Value = v |
| 4630 | } |
| 4631 | |
| 4632 | func (self *ActionNxSetMplsLabel) Serialize(encoder *goloxi.Encoder) error { |
| 4633 | startIndex := len(encoder.Bytes()) |
| 4634 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 4635 | return err |
| 4636 | } |
| 4637 | |
| 4638 | encoder.PutUint32(uint32(self.Value)) |
| 4639 | length := len(encoder.Bytes()) - startIndex |
| 4640 | |
| 4641 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 4642 | |
| 4643 | return nil |
| 4644 | } |
| 4645 | |
| 4646 | func DecodeActionNxSetMplsLabel(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxSetMplsLabel, error) { |
| 4647 | _actionnxsetmplslabel := &ActionNxSetMplsLabel{ActionNicira: parent} |
| 4648 | if decoder.Length() < 4 { |
| 4649 | return nil, fmt.Errorf("ActionNxSetMplsLabel packet too short: %d < 4", decoder.Length()) |
| 4650 | } |
| 4651 | _actionnxsetmplslabel.Value = uint32(decoder.ReadUint32()) |
| 4652 | return _actionnxsetmplslabel, nil |
| 4653 | } |
| 4654 | |
| 4655 | func NewActionNxSetMplsLabel() *ActionNxSetMplsLabel { |
| 4656 | obj := &ActionNxSetMplsLabel{ |
| 4657 | ActionNicira: NewActionNicira(30), |
| 4658 | } |
| 4659 | return obj |
| 4660 | } |
| 4661 | func (self *ActionNxSetMplsLabel) GetActionName() string { |
| 4662 | return "nx_set_mpls_label" |
| 4663 | } |
| 4664 | |
| 4665 | func (self *ActionNxSetMplsLabel) GetActionFields() map[string]interface{} { |
| 4666 | return map[string]interface{}{ |
| 4667 | "Value": self.Value, |
| 4668 | } |
| 4669 | } |
| 4670 | |
| 4671 | func (self *ActionNxSetMplsLabel) MarshalJSON() ([]byte, error) { |
| 4672 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 4673 | if err != nil { |
| 4674 | return nil, err |
| 4675 | } |
| 4676 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 4677 | } |
| 4678 | |
| 4679 | type ActionNxSetMplsTc struct { |
| 4680 | *ActionNicira |
| 4681 | Value uint8 |
| 4682 | } |
| 4683 | |
| 4684 | type IActionNxSetMplsTc interface { |
| 4685 | IActionNicira |
| 4686 | GetValue() uint8 |
| 4687 | } |
| 4688 | |
| 4689 | func (self *ActionNxSetMplsTc) GetValue() uint8 { |
| 4690 | return self.Value |
| 4691 | } |
| 4692 | |
| 4693 | func (self *ActionNxSetMplsTc) SetValue(v uint8) { |
| 4694 | self.Value = v |
| 4695 | } |
| 4696 | |
| 4697 | func (self *ActionNxSetMplsTc) Serialize(encoder *goloxi.Encoder) error { |
| 4698 | startIndex := len(encoder.Bytes()) |
| 4699 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 4700 | return err |
| 4701 | } |
| 4702 | |
| 4703 | encoder.PutUint8(uint8(self.Value)) |
| 4704 | length := len(encoder.Bytes()) - startIndex |
| 4705 | |
| 4706 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 4707 | |
| 4708 | return nil |
| 4709 | } |
| 4710 | |
| 4711 | func DecodeActionNxSetMplsTc(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxSetMplsTc, error) { |
| 4712 | _actionnxsetmplstc := &ActionNxSetMplsTc{ActionNicira: parent} |
| 4713 | if decoder.Length() < 1 { |
| 4714 | return nil, fmt.Errorf("ActionNxSetMplsTc packet too short: %d < 1", decoder.Length()) |
| 4715 | } |
| 4716 | _actionnxsetmplstc.Value = uint8(decoder.ReadByte()) |
| 4717 | return _actionnxsetmplstc, nil |
| 4718 | } |
| 4719 | |
| 4720 | func NewActionNxSetMplsTc() *ActionNxSetMplsTc { |
| 4721 | obj := &ActionNxSetMplsTc{ |
| 4722 | ActionNicira: NewActionNicira(31), |
| 4723 | } |
| 4724 | return obj |
| 4725 | } |
| 4726 | func (self *ActionNxSetMplsTc) GetActionName() string { |
| 4727 | return "nx_set_mpls_tc" |
| 4728 | } |
| 4729 | |
| 4730 | func (self *ActionNxSetMplsTc) GetActionFields() map[string]interface{} { |
| 4731 | return map[string]interface{}{ |
| 4732 | "Value": self.Value, |
| 4733 | } |
| 4734 | } |
| 4735 | |
| 4736 | func (self *ActionNxSetMplsTc) MarshalJSON() ([]byte, error) { |
| 4737 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 4738 | if err != nil { |
| 4739 | return nil, err |
| 4740 | } |
| 4741 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 4742 | } |
| 4743 | |
| 4744 | type ActionNxSetMplsTtl struct { |
| 4745 | *ActionNicira |
| 4746 | Value uint8 |
| 4747 | } |
| 4748 | |
| 4749 | type IActionNxSetMplsTtl interface { |
| 4750 | IActionNicira |
| 4751 | GetValue() uint8 |
| 4752 | } |
| 4753 | |
| 4754 | func (self *ActionNxSetMplsTtl) GetValue() uint8 { |
| 4755 | return self.Value |
| 4756 | } |
| 4757 | |
| 4758 | func (self *ActionNxSetMplsTtl) SetValue(v uint8) { |
| 4759 | self.Value = v |
| 4760 | } |
| 4761 | |
| 4762 | func (self *ActionNxSetMplsTtl) Serialize(encoder *goloxi.Encoder) error { |
| 4763 | startIndex := len(encoder.Bytes()) |
| 4764 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 4765 | return err |
| 4766 | } |
| 4767 | |
| 4768 | encoder.PutUint8(uint8(self.Value)) |
| 4769 | length := len(encoder.Bytes()) - startIndex |
| 4770 | |
| 4771 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 4772 | |
| 4773 | return nil |
| 4774 | } |
| 4775 | |
| 4776 | func DecodeActionNxSetMplsTtl(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxSetMplsTtl, error) { |
| 4777 | _actionnxsetmplsttl := &ActionNxSetMplsTtl{ActionNicira: parent} |
| 4778 | if decoder.Length() < 1 { |
| 4779 | return nil, fmt.Errorf("ActionNxSetMplsTtl packet too short: %d < 1", decoder.Length()) |
| 4780 | } |
| 4781 | _actionnxsetmplsttl.Value = uint8(decoder.ReadByte()) |
| 4782 | return _actionnxsetmplsttl, nil |
| 4783 | } |
| 4784 | |
| 4785 | func NewActionNxSetMplsTtl() *ActionNxSetMplsTtl { |
| 4786 | obj := &ActionNxSetMplsTtl{ |
| 4787 | ActionNicira: NewActionNicira(25), |
| 4788 | } |
| 4789 | return obj |
| 4790 | } |
| 4791 | func (self *ActionNxSetMplsTtl) GetActionName() string { |
| 4792 | return "nx_set_mpls_ttl" |
| 4793 | } |
| 4794 | |
| 4795 | func (self *ActionNxSetMplsTtl) GetActionFields() map[string]interface{} { |
| 4796 | return map[string]interface{}{ |
| 4797 | "Value": self.Value, |
| 4798 | } |
| 4799 | } |
| 4800 | |
| 4801 | func (self *ActionNxSetMplsTtl) MarshalJSON() ([]byte, error) { |
| 4802 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 4803 | if err != nil { |
| 4804 | return nil, err |
| 4805 | } |
| 4806 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 4807 | } |
| 4808 | |
| 4809 | type ActionNxSetQueue struct { |
| 4810 | *ActionNicira |
| 4811 | Value uint32 |
| 4812 | } |
| 4813 | |
| 4814 | type IActionNxSetQueue interface { |
| 4815 | IActionNicira |
| 4816 | GetValue() uint32 |
| 4817 | } |
| 4818 | |
| 4819 | func (self *ActionNxSetQueue) GetValue() uint32 { |
| 4820 | return self.Value |
| 4821 | } |
| 4822 | |
| 4823 | func (self *ActionNxSetQueue) SetValue(v uint32) { |
| 4824 | self.Value = v |
| 4825 | } |
| 4826 | |
| 4827 | func (self *ActionNxSetQueue) Serialize(encoder *goloxi.Encoder) error { |
| 4828 | startIndex := len(encoder.Bytes()) |
| 4829 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 4830 | return err |
| 4831 | } |
| 4832 | |
| 4833 | encoder.PutUint32(uint32(self.Value)) |
| 4834 | length := len(encoder.Bytes()) - startIndex |
| 4835 | |
| 4836 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 4837 | |
| 4838 | return nil |
| 4839 | } |
| 4840 | |
| 4841 | func DecodeActionNxSetQueue(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxSetQueue, error) { |
| 4842 | _actionnxsetqueue := &ActionNxSetQueue{ActionNicira: parent} |
| 4843 | if decoder.Length() < 4 { |
| 4844 | return nil, fmt.Errorf("ActionNxSetQueue packet too short: %d < 4", decoder.Length()) |
| 4845 | } |
| 4846 | _actionnxsetqueue.Value = uint32(decoder.ReadUint32()) |
| 4847 | return _actionnxsetqueue, nil |
| 4848 | } |
| 4849 | |
| 4850 | func NewActionNxSetQueue() *ActionNxSetQueue { |
| 4851 | obj := &ActionNxSetQueue{ |
| 4852 | ActionNicira: NewActionNicira(4), |
| 4853 | } |
| 4854 | return obj |
| 4855 | } |
| 4856 | func (self *ActionNxSetQueue) GetActionName() string { |
| 4857 | return "nx_set_queue" |
| 4858 | } |
| 4859 | |
| 4860 | func (self *ActionNxSetQueue) GetActionFields() map[string]interface{} { |
| 4861 | return map[string]interface{}{ |
| 4862 | "Value": self.Value, |
| 4863 | } |
| 4864 | } |
| 4865 | |
| 4866 | func (self *ActionNxSetQueue) MarshalJSON() ([]byte, error) { |
| 4867 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 4868 | if err != nil { |
| 4869 | return nil, err |
| 4870 | } |
| 4871 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 4872 | } |
| 4873 | |
| 4874 | type ActionNxSetTunnel struct { |
| 4875 | *ActionNicira |
| 4876 | Value uint32 |
| 4877 | } |
| 4878 | |
| 4879 | type IActionNxSetTunnel interface { |
| 4880 | IActionNicira |
| 4881 | GetValue() uint32 |
| 4882 | } |
| 4883 | |
| 4884 | func (self *ActionNxSetTunnel) GetValue() uint32 { |
| 4885 | return self.Value |
| 4886 | } |
| 4887 | |
| 4888 | func (self *ActionNxSetTunnel) SetValue(v uint32) { |
| 4889 | self.Value = v |
| 4890 | } |
| 4891 | |
| 4892 | func (self *ActionNxSetTunnel) Serialize(encoder *goloxi.Encoder) error { |
| 4893 | startIndex := len(encoder.Bytes()) |
| 4894 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 4895 | return err |
| 4896 | } |
| 4897 | |
| 4898 | encoder.PutUint32(uint32(self.Value)) |
| 4899 | length := len(encoder.Bytes()) - startIndex |
| 4900 | |
| 4901 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 4902 | |
| 4903 | return nil |
| 4904 | } |
| 4905 | |
| 4906 | func DecodeActionNxSetTunnel(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxSetTunnel, error) { |
| 4907 | _actionnxsettunnel := &ActionNxSetTunnel{ActionNicira: parent} |
| 4908 | if decoder.Length() < 4 { |
| 4909 | return nil, fmt.Errorf("ActionNxSetTunnel packet too short: %d < 4", decoder.Length()) |
| 4910 | } |
| 4911 | _actionnxsettunnel.Value = uint32(decoder.ReadUint32()) |
| 4912 | return _actionnxsettunnel, nil |
| 4913 | } |
| 4914 | |
| 4915 | func NewActionNxSetTunnel() *ActionNxSetTunnel { |
| 4916 | obj := &ActionNxSetTunnel{ |
| 4917 | ActionNicira: NewActionNicira(2), |
| 4918 | } |
| 4919 | return obj |
| 4920 | } |
| 4921 | func (self *ActionNxSetTunnel) GetActionName() string { |
| 4922 | return "nx_set_tunnel" |
| 4923 | } |
| 4924 | |
| 4925 | func (self *ActionNxSetTunnel) GetActionFields() map[string]interface{} { |
| 4926 | return map[string]interface{}{ |
| 4927 | "Value": self.Value, |
| 4928 | } |
| 4929 | } |
| 4930 | |
| 4931 | func (self *ActionNxSetTunnel) MarshalJSON() ([]byte, error) { |
| 4932 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 4933 | if err != nil { |
| 4934 | return nil, err |
| 4935 | } |
| 4936 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 4937 | } |
| 4938 | |
| 4939 | type ActionNxSetTunnel64 struct { |
| 4940 | *ActionNicira |
| 4941 | Value uint64 |
| 4942 | } |
| 4943 | |
| 4944 | type IActionNxSetTunnel64 interface { |
| 4945 | IActionNicira |
| 4946 | GetValue() uint64 |
| 4947 | } |
| 4948 | |
| 4949 | func (self *ActionNxSetTunnel64) GetValue() uint64 { |
| 4950 | return self.Value |
| 4951 | } |
| 4952 | |
| 4953 | func (self *ActionNxSetTunnel64) SetValue(v uint64) { |
| 4954 | self.Value = v |
| 4955 | } |
| 4956 | |
| 4957 | func (self *ActionNxSetTunnel64) Serialize(encoder *goloxi.Encoder) error { |
| 4958 | startIndex := len(encoder.Bytes()) |
| 4959 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 4960 | return err |
| 4961 | } |
| 4962 | |
| 4963 | encoder.PutUint64(uint64(self.Value)) |
| 4964 | length := len(encoder.Bytes()) - startIndex |
| 4965 | |
| 4966 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 4967 | |
| 4968 | return nil |
| 4969 | } |
| 4970 | |
| 4971 | func DecodeActionNxSetTunnel64(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxSetTunnel64, error) { |
| 4972 | _actionnxsettunnel64 := &ActionNxSetTunnel64{ActionNicira: parent} |
| 4973 | if decoder.Length() < 8 { |
| 4974 | return nil, fmt.Errorf("ActionNxSetTunnel64 packet too short: %d < 8", decoder.Length()) |
| 4975 | } |
| 4976 | _actionnxsettunnel64.Value = uint64(decoder.ReadUint64()) |
| 4977 | return _actionnxsettunnel64, nil |
| 4978 | } |
| 4979 | |
| 4980 | func NewActionNxSetTunnel64() *ActionNxSetTunnel64 { |
| 4981 | obj := &ActionNxSetTunnel64{ |
| 4982 | ActionNicira: NewActionNicira(9), |
| 4983 | } |
| 4984 | return obj |
| 4985 | } |
| 4986 | func (self *ActionNxSetTunnel64) GetActionName() string { |
| 4987 | return "nx_set_tunnel64" |
| 4988 | } |
| 4989 | |
| 4990 | func (self *ActionNxSetTunnel64) GetActionFields() map[string]interface{} { |
| 4991 | return map[string]interface{}{ |
| 4992 | "Value": self.Value, |
| 4993 | } |
| 4994 | } |
| 4995 | |
| 4996 | func (self *ActionNxSetTunnel64) MarshalJSON() ([]byte, error) { |
| 4997 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 4998 | if err != nil { |
| 4999 | return nil, err |
| 5000 | } |
| 5001 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 5002 | } |
| 5003 | |
| 5004 | type ActionNxStackPop struct { |
| 5005 | *ActionNicira |
| 5006 | Offset uint16 |
| 5007 | Field goloxi.IOxmId |
| 5008 | NBits uint16 |
| 5009 | } |
| 5010 | |
| 5011 | type IActionNxStackPop interface { |
| 5012 | IActionNicira |
| 5013 | GetOffset() uint16 |
| 5014 | GetField() goloxi.IOxmId |
| 5015 | GetNBits() uint16 |
| 5016 | } |
| 5017 | |
| 5018 | func (self *ActionNxStackPop) GetOffset() uint16 { |
| 5019 | return self.Offset |
| 5020 | } |
| 5021 | |
| 5022 | func (self *ActionNxStackPop) SetOffset(v uint16) { |
| 5023 | self.Offset = v |
| 5024 | } |
| 5025 | |
| 5026 | func (self *ActionNxStackPop) GetField() goloxi.IOxmId { |
| 5027 | return self.Field |
| 5028 | } |
| 5029 | |
| 5030 | func (self *ActionNxStackPop) SetField(v goloxi.IOxmId) { |
| 5031 | self.Field = v |
| 5032 | } |
| 5033 | |
| 5034 | func (self *ActionNxStackPop) GetNBits() uint16 { |
| 5035 | return self.NBits |
| 5036 | } |
| 5037 | |
| 5038 | func (self *ActionNxStackPop) SetNBits(v uint16) { |
| 5039 | self.NBits = v |
| 5040 | } |
| 5041 | |
| 5042 | func (self *ActionNxStackPop) Serialize(encoder *goloxi.Encoder) error { |
| 5043 | startIndex := len(encoder.Bytes()) |
| 5044 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 5045 | return err |
| 5046 | } |
| 5047 | |
| 5048 | encoder.PutUint16(uint16(self.Offset)) |
| 5049 | self.Field.Serialize(encoder) |
| 5050 | encoder.PutUint16(uint16(self.NBits)) |
| 5051 | length := len(encoder.Bytes()) - startIndex |
| 5052 | |
| 5053 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 5054 | |
| 5055 | return nil |
| 5056 | } |
| 5057 | |
| 5058 | func DecodeActionNxStackPop(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxStackPop, error) { |
| 5059 | _actionnxstackpop := &ActionNxStackPop{ActionNicira: parent} |
| 5060 | if decoder.Length() < 8 { |
| 5061 | return nil, fmt.Errorf("ActionNxStackPop packet too short: %d < 8", decoder.Length()) |
| 5062 | } |
| 5063 | _actionnxstackpop.Offset = uint16(decoder.ReadUint16()) |
| 5064 | if obj, err := DecodeOxmId(decoder); err != nil { |
| 5065 | return nil, err |
| 5066 | } else { |
| 5067 | _actionnxstackpop.Field = obj |
| 5068 | } |
| 5069 | |
| 5070 | _actionnxstackpop.NBits = uint16(decoder.ReadUint16()) |
| 5071 | return _actionnxstackpop, nil |
| 5072 | } |
| 5073 | |
| 5074 | func NewActionNxStackPop() *ActionNxStackPop { |
| 5075 | obj := &ActionNxStackPop{ |
| 5076 | ActionNicira: NewActionNicira(28), |
| 5077 | } |
| 5078 | return obj |
| 5079 | } |
| 5080 | func (self *ActionNxStackPop) GetActionName() string { |
| 5081 | return "nx_stack_pop" |
| 5082 | } |
| 5083 | |
| 5084 | func (self *ActionNxStackPop) GetActionFields() map[string]interface{} { |
| 5085 | return map[string]interface{}{ |
| 5086 | "Offset": self.Offset, |
| 5087 | "Field": self.Field, |
| 5088 | "NBits": self.NBits, |
| 5089 | } |
| 5090 | } |
| 5091 | |
| 5092 | func (self *ActionNxStackPop) MarshalJSON() ([]byte, error) { |
| 5093 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 5094 | if err != nil { |
| 5095 | return nil, err |
| 5096 | } |
| 5097 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 5098 | } |
| 5099 | |
| 5100 | type ActionNxStackPush struct { |
| 5101 | *ActionNicira |
| 5102 | Offset uint16 |
| 5103 | Field goloxi.IOxmId |
| 5104 | NBits uint16 |
| 5105 | } |
| 5106 | |
| 5107 | type IActionNxStackPush interface { |
| 5108 | IActionNicira |
| 5109 | GetOffset() uint16 |
| 5110 | GetField() goloxi.IOxmId |
| 5111 | GetNBits() uint16 |
| 5112 | } |
| 5113 | |
| 5114 | func (self *ActionNxStackPush) GetOffset() uint16 { |
| 5115 | return self.Offset |
| 5116 | } |
| 5117 | |
| 5118 | func (self *ActionNxStackPush) SetOffset(v uint16) { |
| 5119 | self.Offset = v |
| 5120 | } |
| 5121 | |
| 5122 | func (self *ActionNxStackPush) GetField() goloxi.IOxmId { |
| 5123 | return self.Field |
| 5124 | } |
| 5125 | |
| 5126 | func (self *ActionNxStackPush) SetField(v goloxi.IOxmId) { |
| 5127 | self.Field = v |
| 5128 | } |
| 5129 | |
| 5130 | func (self *ActionNxStackPush) GetNBits() uint16 { |
| 5131 | return self.NBits |
| 5132 | } |
| 5133 | |
| 5134 | func (self *ActionNxStackPush) SetNBits(v uint16) { |
| 5135 | self.NBits = v |
| 5136 | } |
| 5137 | |
| 5138 | func (self *ActionNxStackPush) Serialize(encoder *goloxi.Encoder) error { |
| 5139 | startIndex := len(encoder.Bytes()) |
| 5140 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 5141 | return err |
| 5142 | } |
| 5143 | |
| 5144 | encoder.PutUint16(uint16(self.Offset)) |
| 5145 | self.Field.Serialize(encoder) |
| 5146 | encoder.PutUint16(uint16(self.NBits)) |
| 5147 | length := len(encoder.Bytes()) - startIndex |
| 5148 | alignedLength := ((length + 23) / 24 * 24) |
| 5149 | |
| 5150 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 5151 | |
| 5152 | encoder.Write(bytes.Repeat([]byte{0}, alignedLength-length)) |
| 5153 | |
| 5154 | return nil |
| 5155 | } |
| 5156 | |
| 5157 | func DecodeActionNxStackPush(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxStackPush, error) { |
| 5158 | _actionnxstackpush := &ActionNxStackPush{ActionNicira: parent} |
| 5159 | if decoder.Length() < 8 { |
| 5160 | return nil, fmt.Errorf("ActionNxStackPush packet too short: %d < 8", decoder.Length()) |
| 5161 | } |
| 5162 | _actionnxstackpush.Offset = uint16(decoder.ReadUint16()) |
| 5163 | if obj, err := DecodeOxmId(decoder); err != nil { |
| 5164 | return nil, err |
| 5165 | } else { |
| 5166 | _actionnxstackpush.Field = obj |
| 5167 | } |
| 5168 | |
| 5169 | _actionnxstackpush.NBits = uint16(decoder.ReadUint16()) |
| 5170 | return _actionnxstackpush, nil |
| 5171 | } |
| 5172 | |
| 5173 | func NewActionNxStackPush() *ActionNxStackPush { |
| 5174 | obj := &ActionNxStackPush{ |
| 5175 | ActionNicira: NewActionNicira(27), |
| 5176 | } |
| 5177 | return obj |
| 5178 | } |
| 5179 | func (self *ActionNxStackPush) GetActionName() string { |
| 5180 | return "nx_stack_push" |
| 5181 | } |
| 5182 | |
| 5183 | func (self *ActionNxStackPush) GetActionFields() map[string]interface{} { |
| 5184 | return map[string]interface{}{ |
| 5185 | "Offset": self.Offset, |
| 5186 | "Field": self.Field, |
| 5187 | "NBits": self.NBits, |
| 5188 | } |
| 5189 | } |
| 5190 | |
| 5191 | func (self *ActionNxStackPush) MarshalJSON() ([]byte, error) { |
| 5192 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 5193 | if err != nil { |
| 5194 | return nil, err |
| 5195 | } |
| 5196 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 5197 | } |
| 5198 | |
| 5199 | type ActionNxWriteMetadata struct { |
| 5200 | *ActionNicira |
| 5201 | Metadata uint64 |
| 5202 | Mask uint64 |
| 5203 | } |
| 5204 | |
| 5205 | type IActionNxWriteMetadata interface { |
| 5206 | IActionNicira |
| 5207 | GetMetadata() uint64 |
| 5208 | GetMask() uint64 |
| 5209 | } |
| 5210 | |
| 5211 | func (self *ActionNxWriteMetadata) GetMetadata() uint64 { |
| 5212 | return self.Metadata |
| 5213 | } |
| 5214 | |
| 5215 | func (self *ActionNxWriteMetadata) SetMetadata(v uint64) { |
| 5216 | self.Metadata = v |
| 5217 | } |
| 5218 | |
| 5219 | func (self *ActionNxWriteMetadata) GetMask() uint64 { |
| 5220 | return self.Mask |
| 5221 | } |
| 5222 | |
| 5223 | func (self *ActionNxWriteMetadata) SetMask(v uint64) { |
| 5224 | self.Mask = v |
| 5225 | } |
| 5226 | |
| 5227 | func (self *ActionNxWriteMetadata) Serialize(encoder *goloxi.Encoder) error { |
| 5228 | startIndex := len(encoder.Bytes()) |
| 5229 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 5230 | return err |
| 5231 | } |
| 5232 | |
| 5233 | encoder.Write(bytes.Repeat([]byte{0}, 6)) |
| 5234 | encoder.PutUint64(uint64(self.Metadata)) |
| 5235 | encoder.PutUint64(uint64(self.Mask)) |
| 5236 | length := len(encoder.Bytes()) - startIndex |
| 5237 | |
| 5238 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 5239 | |
| 5240 | return nil |
| 5241 | } |
| 5242 | |
| 5243 | func DecodeActionNxWriteMetadata(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxWriteMetadata, error) { |
| 5244 | _actionnxwritemetadata := &ActionNxWriteMetadata{ActionNicira: parent} |
| 5245 | if decoder.Length() < 22 { |
| 5246 | return nil, fmt.Errorf("ActionNxWriteMetadata packet too short: %d < 22", decoder.Length()) |
| 5247 | } |
| 5248 | decoder.Skip(6) |
| 5249 | _actionnxwritemetadata.Metadata = uint64(decoder.ReadUint64()) |
| 5250 | _actionnxwritemetadata.Mask = uint64(decoder.ReadUint64()) |
| 5251 | return _actionnxwritemetadata, nil |
| 5252 | } |
| 5253 | |
| 5254 | func NewActionNxWriteMetadata() *ActionNxWriteMetadata { |
| 5255 | obj := &ActionNxWriteMetadata{ |
| 5256 | ActionNicira: NewActionNicira(22), |
| 5257 | } |
| 5258 | return obj |
| 5259 | } |
| 5260 | func (self *ActionNxWriteMetadata) GetActionName() string { |
| 5261 | return "nx_write_metadata" |
| 5262 | } |
| 5263 | |
| 5264 | func (self *ActionNxWriteMetadata) GetActionFields() map[string]interface{} { |
| 5265 | return map[string]interface{}{ |
| 5266 | "Metadata": self.Metadata, |
| 5267 | "Mask": self.Mask, |
| 5268 | } |
| 5269 | } |
| 5270 | |
| 5271 | func (self *ActionNxWriteMetadata) MarshalJSON() ([]byte, error) { |
| 5272 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 5273 | if err != nil { |
| 5274 | return nil, err |
| 5275 | } |
| 5276 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 5277 | } |
| 5278 | |
| 5279 | type ActionOutput struct { |
| 5280 | *Action |
| 5281 | Port Port |
| 5282 | MaxLen uint16 |
| 5283 | } |
| 5284 | |
| 5285 | type IActionOutput interface { |
| 5286 | goloxi.IAction |
| 5287 | GetPort() Port |
| 5288 | GetMaxLen() uint16 |
| 5289 | } |
| 5290 | |
| 5291 | func (self *ActionOutput) GetPort() Port { |
| 5292 | return self.Port |
| 5293 | } |
| 5294 | |
| 5295 | func (self *ActionOutput) SetPort(v Port) { |
| 5296 | self.Port = v |
| 5297 | } |
| 5298 | |
| 5299 | func (self *ActionOutput) GetMaxLen() uint16 { |
| 5300 | return self.MaxLen |
| 5301 | } |
| 5302 | |
| 5303 | func (self *ActionOutput) SetMaxLen(v uint16) { |
| 5304 | self.MaxLen = v |
| 5305 | } |
| 5306 | |
| 5307 | func (self *ActionOutput) Serialize(encoder *goloxi.Encoder) error { |
| 5308 | startIndex := len(encoder.Bytes()) |
| 5309 | if err := self.Action.Serialize(encoder); err != nil { |
| 5310 | return err |
| 5311 | } |
| 5312 | |
| 5313 | self.Port.Serialize(encoder) |
| 5314 | encoder.PutUint16(uint16(self.MaxLen)) |
| 5315 | encoder.Write(bytes.Repeat([]byte{0}, 6)) |
| 5316 | length := len(encoder.Bytes()) - startIndex |
| 5317 | |
| 5318 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 5319 | |
| 5320 | return nil |
| 5321 | } |
| 5322 | |
| 5323 | func DecodeActionOutput(parent *Action, decoder *goloxi.Decoder) (*ActionOutput, error) { |
| 5324 | _actionoutput := &ActionOutput{Action: parent} |
| 5325 | if decoder.Length() < 12 { |
| 5326 | return nil, fmt.Errorf("ActionOutput packet too short: %d < 12", decoder.Length()) |
| 5327 | } |
| 5328 | _actionoutput.Port.Decode(decoder) |
| 5329 | _actionoutput.MaxLen = uint16(decoder.ReadUint16()) |
| 5330 | decoder.Skip(6) |
| 5331 | return _actionoutput, nil |
| 5332 | } |
| 5333 | |
| 5334 | func NewActionOutput() *ActionOutput { |
| 5335 | obj := &ActionOutput{ |
| 5336 | Action: NewAction(0), |
| 5337 | } |
| 5338 | return obj |
| 5339 | } |
| 5340 | func (self *ActionOutput) GetActionName() string { |
| 5341 | return "output" |
| 5342 | } |
| 5343 | |
| 5344 | func (self *ActionOutput) GetActionFields() map[string]interface{} { |
| 5345 | return map[string]interface{}{ |
| 5346 | "Port": self.Port, |
| 5347 | "MaxLen": self.MaxLen, |
| 5348 | } |
| 5349 | } |
| 5350 | |
| 5351 | func (self *ActionOutput) MarshalJSON() ([]byte, error) { |
| 5352 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 5353 | if err != nil { |
| 5354 | return nil, err |
| 5355 | } |
| 5356 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 5357 | } |
| 5358 | |
| 5359 | type ActionPopMpls struct { |
| 5360 | *Action |
| 5361 | Ethertype uint16 |
| 5362 | } |
| 5363 | |
| 5364 | type IActionPopMpls interface { |
| 5365 | goloxi.IAction |
| 5366 | GetEthertype() uint16 |
| 5367 | } |
| 5368 | |
| 5369 | func (self *ActionPopMpls) GetEthertype() uint16 { |
| 5370 | return self.Ethertype |
| 5371 | } |
| 5372 | |
| 5373 | func (self *ActionPopMpls) SetEthertype(v uint16) { |
| 5374 | self.Ethertype = v |
| 5375 | } |
| 5376 | |
| 5377 | func (self *ActionPopMpls) Serialize(encoder *goloxi.Encoder) error { |
| 5378 | startIndex := len(encoder.Bytes()) |
| 5379 | if err := self.Action.Serialize(encoder); err != nil { |
| 5380 | return err |
| 5381 | } |
| 5382 | |
| 5383 | encoder.PutUint16(uint16(self.Ethertype)) |
| 5384 | encoder.Write(bytes.Repeat([]byte{0}, 2)) |
| 5385 | length := len(encoder.Bytes()) - startIndex |
| 5386 | |
| 5387 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 5388 | |
| 5389 | return nil |
| 5390 | } |
| 5391 | |
| 5392 | func DecodeActionPopMpls(parent *Action, decoder *goloxi.Decoder) (*ActionPopMpls, error) { |
| 5393 | _actionpopmpls := &ActionPopMpls{Action: parent} |
| 5394 | if decoder.Length() < 4 { |
| 5395 | return nil, fmt.Errorf("ActionPopMpls packet too short: %d < 4", decoder.Length()) |
| 5396 | } |
| 5397 | _actionpopmpls.Ethertype = uint16(decoder.ReadUint16()) |
| 5398 | decoder.Skip(2) |
| 5399 | return _actionpopmpls, nil |
| 5400 | } |
| 5401 | |
| 5402 | func NewActionPopMpls() *ActionPopMpls { |
| 5403 | obj := &ActionPopMpls{ |
| 5404 | Action: NewAction(20), |
| 5405 | } |
| 5406 | return obj |
| 5407 | } |
| 5408 | func (self *ActionPopMpls) GetActionName() string { |
| 5409 | return "pop_mpls" |
| 5410 | } |
| 5411 | |
| 5412 | func (self *ActionPopMpls) GetActionFields() map[string]interface{} { |
| 5413 | return map[string]interface{}{ |
| 5414 | "Ethertype": self.Ethertype, |
| 5415 | } |
| 5416 | } |
| 5417 | |
| 5418 | func (self *ActionPopMpls) MarshalJSON() ([]byte, error) { |
| 5419 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 5420 | if err != nil { |
| 5421 | return nil, err |
| 5422 | } |
| 5423 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 5424 | } |
| 5425 | |
| 5426 | type ActionPopPbb struct { |
| 5427 | *Action |
| 5428 | } |
| 5429 | |
| 5430 | type IActionPopPbb interface { |
| 5431 | goloxi.IAction |
| 5432 | } |
| 5433 | |
| 5434 | func (self *ActionPopPbb) Serialize(encoder *goloxi.Encoder) error { |
| 5435 | startIndex := len(encoder.Bytes()) |
| 5436 | if err := self.Action.Serialize(encoder); err != nil { |
| 5437 | return err |
| 5438 | } |
| 5439 | |
| 5440 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 5441 | length := len(encoder.Bytes()) - startIndex |
| 5442 | |
| 5443 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 5444 | |
| 5445 | return nil |
| 5446 | } |
| 5447 | |
| 5448 | func DecodeActionPopPbb(parent *Action, decoder *goloxi.Decoder) (*ActionPopPbb, error) { |
| 5449 | _actionpoppbb := &ActionPopPbb{Action: parent} |
| 5450 | if decoder.Length() < 4 { |
| 5451 | return nil, fmt.Errorf("ActionPopPbb packet too short: %d < 4", decoder.Length()) |
| 5452 | } |
| 5453 | decoder.Skip(4) |
| 5454 | return _actionpoppbb, nil |
| 5455 | } |
| 5456 | |
| 5457 | func NewActionPopPbb() *ActionPopPbb { |
| 5458 | obj := &ActionPopPbb{ |
| 5459 | Action: NewAction(27), |
| 5460 | } |
| 5461 | return obj |
| 5462 | } |
| 5463 | func (self *ActionPopPbb) GetActionName() string { |
| 5464 | return "pop_pbb" |
| 5465 | } |
| 5466 | |
| 5467 | func (self *ActionPopPbb) GetActionFields() map[string]interface{} { |
| 5468 | return map[string]interface{}{} |
| 5469 | } |
| 5470 | |
| 5471 | func (self *ActionPopPbb) MarshalJSON() ([]byte, error) { |
| 5472 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 5473 | if err != nil { |
| 5474 | return nil, err |
| 5475 | } |
| 5476 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 5477 | } |
| 5478 | |
| 5479 | type ActionPopVlan struct { |
| 5480 | *Action |
| 5481 | } |
| 5482 | |
| 5483 | type IActionPopVlan interface { |
| 5484 | goloxi.IAction |
| 5485 | } |
| 5486 | |
| 5487 | func (self *ActionPopVlan) Serialize(encoder *goloxi.Encoder) error { |
| 5488 | startIndex := len(encoder.Bytes()) |
| 5489 | if err := self.Action.Serialize(encoder); err != nil { |
| 5490 | return err |
| 5491 | } |
| 5492 | |
| 5493 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 5494 | length := len(encoder.Bytes()) - startIndex |
| 5495 | |
| 5496 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 5497 | |
| 5498 | return nil |
| 5499 | } |
| 5500 | |
| 5501 | func DecodeActionPopVlan(parent *Action, decoder *goloxi.Decoder) (*ActionPopVlan, error) { |
| 5502 | _actionpopvlan := &ActionPopVlan{Action: parent} |
| 5503 | if decoder.Length() < 4 { |
| 5504 | return nil, fmt.Errorf("ActionPopVlan packet too short: %d < 4", decoder.Length()) |
| 5505 | } |
| 5506 | decoder.Skip(4) |
| 5507 | return _actionpopvlan, nil |
| 5508 | } |
| 5509 | |
| 5510 | func NewActionPopVlan() *ActionPopVlan { |
| 5511 | obj := &ActionPopVlan{ |
| 5512 | Action: NewAction(18), |
| 5513 | } |
| 5514 | return obj |
| 5515 | } |
| 5516 | func (self *ActionPopVlan) GetActionName() string { |
| 5517 | return "pop_vlan" |
| 5518 | } |
| 5519 | |
| 5520 | func (self *ActionPopVlan) GetActionFields() map[string]interface{} { |
| 5521 | return map[string]interface{}{} |
| 5522 | } |
| 5523 | |
| 5524 | func (self *ActionPopVlan) MarshalJSON() ([]byte, error) { |
| 5525 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 5526 | if err != nil { |
| 5527 | return nil, err |
| 5528 | } |
| 5529 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 5530 | } |
| 5531 | |
| 5532 | type ActionPushMpls struct { |
| 5533 | *Action |
| 5534 | Ethertype uint16 |
| 5535 | } |
| 5536 | |
| 5537 | type IActionPushMpls interface { |
| 5538 | goloxi.IAction |
| 5539 | GetEthertype() uint16 |
| 5540 | } |
| 5541 | |
| 5542 | func (self *ActionPushMpls) GetEthertype() uint16 { |
| 5543 | return self.Ethertype |
| 5544 | } |
| 5545 | |
| 5546 | func (self *ActionPushMpls) SetEthertype(v uint16) { |
| 5547 | self.Ethertype = v |
| 5548 | } |
| 5549 | |
| 5550 | func (self *ActionPushMpls) Serialize(encoder *goloxi.Encoder) error { |
| 5551 | startIndex := len(encoder.Bytes()) |
| 5552 | if err := self.Action.Serialize(encoder); err != nil { |
| 5553 | return err |
| 5554 | } |
| 5555 | |
| 5556 | encoder.PutUint16(uint16(self.Ethertype)) |
| 5557 | encoder.Write(bytes.Repeat([]byte{0}, 2)) |
| 5558 | length := len(encoder.Bytes()) - startIndex |
| 5559 | |
| 5560 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 5561 | |
| 5562 | return nil |
| 5563 | } |
| 5564 | |
| 5565 | func DecodeActionPushMpls(parent *Action, decoder *goloxi.Decoder) (*ActionPushMpls, error) { |
| 5566 | _actionpushmpls := &ActionPushMpls{Action: parent} |
| 5567 | if decoder.Length() < 4 { |
| 5568 | return nil, fmt.Errorf("ActionPushMpls packet too short: %d < 4", decoder.Length()) |
| 5569 | } |
| 5570 | _actionpushmpls.Ethertype = uint16(decoder.ReadUint16()) |
| 5571 | decoder.Skip(2) |
| 5572 | return _actionpushmpls, nil |
| 5573 | } |
| 5574 | |
| 5575 | func NewActionPushMpls() *ActionPushMpls { |
| 5576 | obj := &ActionPushMpls{ |
| 5577 | Action: NewAction(19), |
| 5578 | } |
| 5579 | return obj |
| 5580 | } |
| 5581 | func (self *ActionPushMpls) GetActionName() string { |
| 5582 | return "push_mpls" |
| 5583 | } |
| 5584 | |
| 5585 | func (self *ActionPushMpls) GetActionFields() map[string]interface{} { |
| 5586 | return map[string]interface{}{ |
| 5587 | "Ethertype": self.Ethertype, |
| 5588 | } |
| 5589 | } |
| 5590 | |
| 5591 | func (self *ActionPushMpls) MarshalJSON() ([]byte, error) { |
| 5592 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 5593 | if err != nil { |
| 5594 | return nil, err |
| 5595 | } |
| 5596 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 5597 | } |
| 5598 | |
| 5599 | type ActionPushPbb struct { |
| 5600 | *Action |
| 5601 | Ethertype uint16 |
| 5602 | } |
| 5603 | |
| 5604 | type IActionPushPbb interface { |
| 5605 | goloxi.IAction |
| 5606 | GetEthertype() uint16 |
| 5607 | } |
| 5608 | |
| 5609 | func (self *ActionPushPbb) GetEthertype() uint16 { |
| 5610 | return self.Ethertype |
| 5611 | } |
| 5612 | |
| 5613 | func (self *ActionPushPbb) SetEthertype(v uint16) { |
| 5614 | self.Ethertype = v |
| 5615 | } |
| 5616 | |
| 5617 | func (self *ActionPushPbb) Serialize(encoder *goloxi.Encoder) error { |
| 5618 | startIndex := len(encoder.Bytes()) |
| 5619 | if err := self.Action.Serialize(encoder); err != nil { |
| 5620 | return err |
| 5621 | } |
| 5622 | |
| 5623 | encoder.PutUint16(uint16(self.Ethertype)) |
| 5624 | encoder.Write(bytes.Repeat([]byte{0}, 2)) |
| 5625 | length := len(encoder.Bytes()) - startIndex |
| 5626 | |
| 5627 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 5628 | |
| 5629 | return nil |
| 5630 | } |
| 5631 | |
| 5632 | func DecodeActionPushPbb(parent *Action, decoder *goloxi.Decoder) (*ActionPushPbb, error) { |
| 5633 | _actionpushpbb := &ActionPushPbb{Action: parent} |
| 5634 | if decoder.Length() < 4 { |
| 5635 | return nil, fmt.Errorf("ActionPushPbb packet too short: %d < 4", decoder.Length()) |
| 5636 | } |
| 5637 | _actionpushpbb.Ethertype = uint16(decoder.ReadUint16()) |
| 5638 | decoder.Skip(2) |
| 5639 | return _actionpushpbb, nil |
| 5640 | } |
| 5641 | |
| 5642 | func NewActionPushPbb() *ActionPushPbb { |
| 5643 | obj := &ActionPushPbb{ |
| 5644 | Action: NewAction(26), |
| 5645 | } |
| 5646 | return obj |
| 5647 | } |
| 5648 | func (self *ActionPushPbb) GetActionName() string { |
| 5649 | return "push_pbb" |
| 5650 | } |
| 5651 | |
| 5652 | func (self *ActionPushPbb) GetActionFields() map[string]interface{} { |
| 5653 | return map[string]interface{}{ |
| 5654 | "Ethertype": self.Ethertype, |
| 5655 | } |
| 5656 | } |
| 5657 | |
| 5658 | func (self *ActionPushPbb) MarshalJSON() ([]byte, error) { |
| 5659 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 5660 | if err != nil { |
| 5661 | return nil, err |
| 5662 | } |
| 5663 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 5664 | } |
| 5665 | |
| 5666 | type ActionPushVlan struct { |
| 5667 | *Action |
| 5668 | Ethertype uint16 |
| 5669 | } |
| 5670 | |
| 5671 | type IActionPushVlan interface { |
| 5672 | goloxi.IAction |
| 5673 | GetEthertype() uint16 |
| 5674 | } |
| 5675 | |
| 5676 | func (self *ActionPushVlan) GetEthertype() uint16 { |
| 5677 | return self.Ethertype |
| 5678 | } |
| 5679 | |
| 5680 | func (self *ActionPushVlan) SetEthertype(v uint16) { |
| 5681 | self.Ethertype = v |
| 5682 | } |
| 5683 | |
| 5684 | func (self *ActionPushVlan) Serialize(encoder *goloxi.Encoder) error { |
| 5685 | startIndex := len(encoder.Bytes()) |
| 5686 | if err := self.Action.Serialize(encoder); err != nil { |
| 5687 | return err |
| 5688 | } |
| 5689 | |
| 5690 | encoder.PutUint16(uint16(self.Ethertype)) |
| 5691 | encoder.Write(bytes.Repeat([]byte{0}, 2)) |
| 5692 | length := len(encoder.Bytes()) - startIndex |
| 5693 | |
| 5694 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 5695 | |
| 5696 | return nil |
| 5697 | } |
| 5698 | |
| 5699 | func DecodeActionPushVlan(parent *Action, decoder *goloxi.Decoder) (*ActionPushVlan, error) { |
| 5700 | _actionpushvlan := &ActionPushVlan{Action: parent} |
| 5701 | if decoder.Length() < 4 { |
| 5702 | return nil, fmt.Errorf("ActionPushVlan packet too short: %d < 4", decoder.Length()) |
| 5703 | } |
| 5704 | _actionpushvlan.Ethertype = uint16(decoder.ReadUint16()) |
| 5705 | decoder.Skip(2) |
| 5706 | return _actionpushvlan, nil |
| 5707 | } |
| 5708 | |
| 5709 | func NewActionPushVlan() *ActionPushVlan { |
| 5710 | obj := &ActionPushVlan{ |
| 5711 | Action: NewAction(17), |
| 5712 | } |
| 5713 | return obj |
| 5714 | } |
| 5715 | func (self *ActionPushVlan) GetActionName() string { |
| 5716 | return "push_vlan" |
| 5717 | } |
| 5718 | |
| 5719 | func (self *ActionPushVlan) GetActionFields() map[string]interface{} { |
| 5720 | return map[string]interface{}{ |
| 5721 | "Ethertype": self.Ethertype, |
| 5722 | } |
| 5723 | } |
| 5724 | |
| 5725 | func (self *ActionPushVlan) MarshalJSON() ([]byte, error) { |
| 5726 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 5727 | if err != nil { |
| 5728 | return nil, err |
| 5729 | } |
| 5730 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 5731 | } |
| 5732 | |
| 5733 | type ActionResubmit struct { |
| 5734 | *ActionNicira |
| 5735 | InPort uint16 |
| 5736 | Table uint8 |
| 5737 | } |
| 5738 | |
| 5739 | type IActionResubmit interface { |
| 5740 | IActionNicira |
| 5741 | GetInPort() uint16 |
| 5742 | GetTable() uint8 |
| 5743 | } |
| 5744 | |
| 5745 | func (self *ActionResubmit) GetInPort() uint16 { |
| 5746 | return self.InPort |
| 5747 | } |
| 5748 | |
| 5749 | func (self *ActionResubmit) SetInPort(v uint16) { |
| 5750 | self.InPort = v |
| 5751 | } |
| 5752 | |
| 5753 | func (self *ActionResubmit) GetTable() uint8 { |
| 5754 | return self.Table |
| 5755 | } |
| 5756 | |
| 5757 | func (self *ActionResubmit) SetTable(v uint8) { |
| 5758 | self.Table = v |
| 5759 | } |
| 5760 | |
| 5761 | func (self *ActionResubmit) Serialize(encoder *goloxi.Encoder) error { |
| 5762 | startIndex := len(encoder.Bytes()) |
| 5763 | if err := self.ActionNicira.Serialize(encoder); err != nil { |
| 5764 | return err |
| 5765 | } |
| 5766 | |
| 5767 | encoder.PutUint16(uint16(self.InPort)) |
| 5768 | encoder.PutUint8(uint8(self.Table)) |
| 5769 | encoder.Write(bytes.Repeat([]byte{0}, 3)) |
| 5770 | length := len(encoder.Bytes()) - startIndex |
| 5771 | |
| 5772 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 5773 | |
| 5774 | return nil |
| 5775 | } |
| 5776 | |
| 5777 | func DecodeActionResubmit(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionResubmit, error) { |
| 5778 | _actionresubmit := &ActionResubmit{ActionNicira: parent} |
| 5779 | if decoder.Length() < 6 { |
| 5780 | return nil, fmt.Errorf("ActionResubmit packet too short: %d < 6", decoder.Length()) |
| 5781 | } |
| 5782 | _actionresubmit.InPort = uint16(decoder.ReadUint16()) |
| 5783 | _actionresubmit.Table = uint8(decoder.ReadByte()) |
| 5784 | decoder.Skip(3) |
| 5785 | return _actionresubmit, nil |
| 5786 | } |
| 5787 | |
| 5788 | func NewActionResubmit() *ActionResubmit { |
| 5789 | obj := &ActionResubmit{ |
| 5790 | ActionNicira: NewActionNicira(14), |
| 5791 | } |
| 5792 | return obj |
| 5793 | } |
| 5794 | func (self *ActionResubmit) GetActionName() string { |
| 5795 | return "resubmit" |
| 5796 | } |
| 5797 | |
| 5798 | func (self *ActionResubmit) GetActionFields() map[string]interface{} { |
| 5799 | return map[string]interface{}{ |
| 5800 | "InPort": self.InPort, |
| 5801 | "Table": self.Table, |
| 5802 | } |
| 5803 | } |
| 5804 | |
| 5805 | func (self *ActionResubmit) MarshalJSON() ([]byte, error) { |
| 5806 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 5807 | if err != nil { |
| 5808 | return nil, err |
| 5809 | } |
| 5810 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 5811 | } |
| 5812 | |
| 5813 | type ActionSetField struct { |
| 5814 | *Action |
| 5815 | Field goloxi.IOxm |
| 5816 | } |
| 5817 | |
| 5818 | type IActionSetField interface { |
| 5819 | goloxi.IAction |
| 5820 | GetField() goloxi.IOxm |
| 5821 | } |
| 5822 | |
| 5823 | func (self *ActionSetField) GetField() goloxi.IOxm { |
| 5824 | return self.Field |
| 5825 | } |
| 5826 | |
| 5827 | func (self *ActionSetField) SetField(v goloxi.IOxm) { |
| 5828 | self.Field = v |
| 5829 | } |
| 5830 | |
| 5831 | func (self *ActionSetField) Serialize(encoder *goloxi.Encoder) error { |
| 5832 | startIndex := len(encoder.Bytes()) |
| 5833 | if err := self.Action.Serialize(encoder); err != nil { |
| 5834 | return err |
| 5835 | } |
| 5836 | |
| 5837 | self.Field.Serialize(encoder) |
| 5838 | length := len(encoder.Bytes()) - startIndex |
| 5839 | alignedLength := ((length + 7) / 8 * 8) |
| 5840 | |
| 5841 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(alignedLength)) |
| 5842 | |
| 5843 | encoder.Write(bytes.Repeat([]byte{0}, alignedLength-length)) |
| 5844 | |
| 5845 | return nil |
| 5846 | } |
| 5847 | |
| 5848 | func DecodeActionSetField(parent *Action, decoder *goloxi.Decoder) (*ActionSetField, error) { |
| 5849 | _actionsetfield := &ActionSetField{Action: parent} |
| 5850 | if decoder.Length() < 4 { |
| 5851 | return nil, fmt.Errorf("ActionSetField packet too short: %d < 4", decoder.Length()) |
| 5852 | } |
| 5853 | if obj, err := DecodeOxm(decoder); err != nil { |
| 5854 | return nil, err |
| 5855 | } else { |
| 5856 | _actionsetfield.Field = obj |
| 5857 | } |
| 5858 | |
| 5859 | return _actionsetfield, nil |
| 5860 | } |
| 5861 | |
| 5862 | func NewActionSetField() *ActionSetField { |
| 5863 | obj := &ActionSetField{ |
| 5864 | Action: NewAction(25), |
| 5865 | } |
| 5866 | return obj |
| 5867 | } |
| 5868 | func (self *ActionSetField) GetActionName() string { |
| 5869 | return "set_field" |
| 5870 | } |
| 5871 | |
| 5872 | func (self *ActionSetField) GetActionFields() map[string]interface{} { |
| 5873 | return map[string]interface{}{ |
| 5874 | "Field": self.Field, |
| 5875 | } |
| 5876 | } |
| 5877 | |
| 5878 | func (self *ActionSetField) MarshalJSON() ([]byte, error) { |
| 5879 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 5880 | if err != nil { |
| 5881 | return nil, err |
| 5882 | } |
| 5883 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 5884 | } |
| 5885 | |
| 5886 | type ActionSetMplsTtl struct { |
| 5887 | *Action |
| 5888 | MplsTtl uint8 |
| 5889 | } |
| 5890 | |
| 5891 | type IActionSetMplsTtl interface { |
| 5892 | goloxi.IAction |
| 5893 | GetMplsTtl() uint8 |
| 5894 | } |
| 5895 | |
| 5896 | func (self *ActionSetMplsTtl) GetMplsTtl() uint8 { |
| 5897 | return self.MplsTtl |
| 5898 | } |
| 5899 | |
| 5900 | func (self *ActionSetMplsTtl) SetMplsTtl(v uint8) { |
| 5901 | self.MplsTtl = v |
| 5902 | } |
| 5903 | |
| 5904 | func (self *ActionSetMplsTtl) Serialize(encoder *goloxi.Encoder) error { |
| 5905 | startIndex := len(encoder.Bytes()) |
| 5906 | if err := self.Action.Serialize(encoder); err != nil { |
| 5907 | return err |
| 5908 | } |
| 5909 | |
| 5910 | encoder.PutUint8(uint8(self.MplsTtl)) |
| 5911 | encoder.Write(bytes.Repeat([]byte{0}, 3)) |
| 5912 | length := len(encoder.Bytes()) - startIndex |
| 5913 | |
| 5914 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 5915 | |
| 5916 | return nil |
| 5917 | } |
| 5918 | |
| 5919 | func DecodeActionSetMplsTtl(parent *Action, decoder *goloxi.Decoder) (*ActionSetMplsTtl, error) { |
| 5920 | _actionsetmplsttl := &ActionSetMplsTtl{Action: parent} |
| 5921 | if decoder.Length() < 4 { |
| 5922 | return nil, fmt.Errorf("ActionSetMplsTtl packet too short: %d < 4", decoder.Length()) |
| 5923 | } |
| 5924 | _actionsetmplsttl.MplsTtl = uint8(decoder.ReadByte()) |
| 5925 | decoder.Skip(3) |
| 5926 | return _actionsetmplsttl, nil |
| 5927 | } |
| 5928 | |
| 5929 | func NewActionSetMplsTtl() *ActionSetMplsTtl { |
| 5930 | obj := &ActionSetMplsTtl{ |
| 5931 | Action: NewAction(15), |
| 5932 | } |
| 5933 | return obj |
| 5934 | } |
| 5935 | func (self *ActionSetMplsTtl) GetActionName() string { |
| 5936 | return "set_mpls_ttl" |
| 5937 | } |
| 5938 | |
| 5939 | func (self *ActionSetMplsTtl) GetActionFields() map[string]interface{} { |
| 5940 | return map[string]interface{}{ |
| 5941 | "MplsTtl": self.MplsTtl, |
| 5942 | } |
| 5943 | } |
| 5944 | |
| 5945 | func (self *ActionSetMplsTtl) MarshalJSON() ([]byte, error) { |
| 5946 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 5947 | if err != nil { |
| 5948 | return nil, err |
| 5949 | } |
| 5950 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 5951 | } |
| 5952 | |
| 5953 | type ActionSetNwTtl struct { |
| 5954 | *Action |
| 5955 | NwTtl uint8 |
| 5956 | } |
| 5957 | |
| 5958 | type IActionSetNwTtl interface { |
| 5959 | goloxi.IAction |
| 5960 | GetNwTtl() uint8 |
| 5961 | } |
| 5962 | |
| 5963 | func (self *ActionSetNwTtl) GetNwTtl() uint8 { |
| 5964 | return self.NwTtl |
| 5965 | } |
| 5966 | |
| 5967 | func (self *ActionSetNwTtl) SetNwTtl(v uint8) { |
| 5968 | self.NwTtl = v |
| 5969 | } |
| 5970 | |
| 5971 | func (self *ActionSetNwTtl) Serialize(encoder *goloxi.Encoder) error { |
| 5972 | startIndex := len(encoder.Bytes()) |
| 5973 | if err := self.Action.Serialize(encoder); err != nil { |
| 5974 | return err |
| 5975 | } |
| 5976 | |
| 5977 | encoder.PutUint8(uint8(self.NwTtl)) |
| 5978 | encoder.Write(bytes.Repeat([]byte{0}, 3)) |
| 5979 | length := len(encoder.Bytes()) - startIndex |
| 5980 | |
| 5981 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 5982 | |
| 5983 | return nil |
| 5984 | } |
| 5985 | |
| 5986 | func DecodeActionSetNwTtl(parent *Action, decoder *goloxi.Decoder) (*ActionSetNwTtl, error) { |
| 5987 | _actionsetnwttl := &ActionSetNwTtl{Action: parent} |
| 5988 | if decoder.Length() < 4 { |
| 5989 | return nil, fmt.Errorf("ActionSetNwTtl packet too short: %d < 4", decoder.Length()) |
| 5990 | } |
| 5991 | _actionsetnwttl.NwTtl = uint8(decoder.ReadByte()) |
| 5992 | decoder.Skip(3) |
| 5993 | return _actionsetnwttl, nil |
| 5994 | } |
| 5995 | |
| 5996 | func NewActionSetNwTtl() *ActionSetNwTtl { |
| 5997 | obj := &ActionSetNwTtl{ |
| 5998 | Action: NewAction(23), |
| 5999 | } |
| 6000 | return obj |
| 6001 | } |
| 6002 | func (self *ActionSetNwTtl) GetActionName() string { |
| 6003 | return "set_nw_ttl" |
| 6004 | } |
| 6005 | |
| 6006 | func (self *ActionSetNwTtl) GetActionFields() map[string]interface{} { |
| 6007 | return map[string]interface{}{ |
| 6008 | "NwTtl": self.NwTtl, |
| 6009 | } |
| 6010 | } |
| 6011 | |
| 6012 | func (self *ActionSetNwTtl) MarshalJSON() ([]byte, error) { |
| 6013 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 6014 | if err != nil { |
| 6015 | return nil, err |
| 6016 | } |
| 6017 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 6018 | } |
| 6019 | |
| 6020 | type ActionSetQueue struct { |
| 6021 | *Action |
| 6022 | QueueId uint32 |
| 6023 | } |
| 6024 | |
| 6025 | type IActionSetQueue interface { |
| 6026 | goloxi.IAction |
| 6027 | GetQueueId() uint32 |
| 6028 | } |
| 6029 | |
| 6030 | func (self *ActionSetQueue) GetQueueId() uint32 { |
| 6031 | return self.QueueId |
| 6032 | } |
| 6033 | |
| 6034 | func (self *ActionSetQueue) SetQueueId(v uint32) { |
| 6035 | self.QueueId = v |
| 6036 | } |
| 6037 | |
| 6038 | func (self *ActionSetQueue) Serialize(encoder *goloxi.Encoder) error { |
| 6039 | startIndex := len(encoder.Bytes()) |
| 6040 | if err := self.Action.Serialize(encoder); err != nil { |
| 6041 | return err |
| 6042 | } |
| 6043 | |
| 6044 | encoder.PutUint32(uint32(self.QueueId)) |
| 6045 | length := len(encoder.Bytes()) - startIndex |
| 6046 | |
| 6047 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 6048 | |
| 6049 | return nil |
| 6050 | } |
| 6051 | |
| 6052 | func DecodeActionSetQueue(parent *Action, decoder *goloxi.Decoder) (*ActionSetQueue, error) { |
| 6053 | _actionsetqueue := &ActionSetQueue{Action: parent} |
| 6054 | if decoder.Length() < 4 { |
| 6055 | return nil, fmt.Errorf("ActionSetQueue packet too short: %d < 4", decoder.Length()) |
| 6056 | } |
| 6057 | _actionsetqueue.QueueId = uint32(decoder.ReadUint32()) |
| 6058 | return _actionsetqueue, nil |
| 6059 | } |
| 6060 | |
| 6061 | func NewActionSetQueue() *ActionSetQueue { |
| 6062 | obj := &ActionSetQueue{ |
| 6063 | Action: NewAction(21), |
| 6064 | } |
| 6065 | return obj |
| 6066 | } |
| 6067 | func (self *ActionSetQueue) GetActionName() string { |
| 6068 | return "set_queue" |
| 6069 | } |
| 6070 | |
| 6071 | func (self *ActionSetQueue) GetActionFields() map[string]interface{} { |
| 6072 | return map[string]interface{}{ |
| 6073 | "QueueId": self.QueueId, |
| 6074 | } |
| 6075 | } |
| 6076 | |
| 6077 | func (self *ActionSetQueue) MarshalJSON() ([]byte, error) { |
| 6078 | jsonValue, err := json.Marshal(self.GetActionFields()) |
| 6079 | if err != nil { |
| 6080 | return nil, err |
| 6081 | } |
| 6082 | return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil |
| 6083 | } |