Rich Lane | c9fc57d | 2013-05-16 16:39:12 -0700 | [diff] [blame] | 1 | -- binary |
| 2 | 04 0f # version, type |
| 3 | 00 70 # length |
| 4 | 12 34 56 78 # xid |
| 5 | 00 01 # command |
| 6 | 03 # group_type |
| 7 | 00 # pad |
| 8 | 00 00 00 05 # group_id |
| 9 | 00 30 # buckets[0].len |
| 10 | 00 01 # buckets[0].weight |
| 11 | 00 00 00 05 # buckets[0].watch_port |
| 12 | ff ff ff ff # buckets[0].watch_group |
| 13 | 00 00 00 00 # pad |
| 14 | 00 00 # buckets[0].actions[0].type |
| 15 | 00 10 # buckets[0].actions[0].len |
| 16 | 00 00 00 05 # buckets[0].actions[0].port |
| 17 | 00 00 # buckets[0].actions[0].max_len |
| 18 | 00 00 00 00 00 00 # pad |
| 19 | 00 00 # buckets[0].actions[1].type |
| 20 | 00 10 # buckets[0].actions[1].len |
| 21 | 00 00 00 06 # buckets[0].actions[1].port |
| 22 | 00 00 # buckets[0].actions[1].max_len |
| 23 | 00 00 00 00 00 00 # pad |
| 24 | 00 30 # buckets[1].len |
| 25 | 00 01 # buckets[1].weight |
| 26 | 00 00 00 06 # buckets[1].watch_port |
| 27 | ff ff ff ff # buckets[1].watch_group |
| 28 | 00 00 00 00 # pad |
| 29 | 00 00 # buckets[1].actions[0].type |
| 30 | 00 10 # buckets[1].actions[0].len |
| 31 | 00 00 00 05 # buckets[1].actions[0].port |
| 32 | 00 00 # buckets[1].actions[0].max_len |
| 33 | 00 00 00 00 00 00 # pad |
| 34 | 00 00 # buckets[1].actions[1].type |
| 35 | 00 10 # buckets[1].actions[1].len |
| 36 | 00 00 00 06 # buckets[1].actions[1].port |
| 37 | 00 00 # buckets[1].actions[1].max_len |
| 38 | 00 00 00 00 00 00 # pad |
| 39 | -- python |
Andreas Wundsam | 5812cf3 | 2013-11-15 13:51:24 -0800 | [diff] [blame] | 40 | ofp.message.group_modify( |
Rich Lane | c9fc57d | 2013-05-16 16:39:12 -0700 | [diff] [blame] | 41 | xid=0x12345678, |
Rich Lane | c9fc57d | 2013-05-16 16:39:12 -0700 | [diff] [blame] | 42 | group_type=ofp.OFPGT_FF, |
| 43 | group_id=5, |
| 44 | buckets=[ |
| 45 | ofp.bucket( |
| 46 | weight=1, |
| 47 | watch_port=5, |
| 48 | watch_group=0xffffffff, |
| 49 | actions=[ |
| 50 | ofp.action.output(port=5, max_len=0), |
| 51 | ofp.action.output(port=6, max_len=0)]), |
| 52 | ofp.bucket( |
| 53 | weight=1, |
| 54 | watch_port=6, |
| 55 | watch_group=0xffffffff, |
| 56 | actions=[ |
| 57 | ofp.action.output(port=5, max_len=0), |
| 58 | ofp.action.output(port=6, max_len=0)])]) |
Andreas Wundsam | 5812cf3 | 2013-11-15 13:51:24 -0800 | [diff] [blame] | 59 | -- java |
| 60 | OFActions actions = factory.actions(); |
| 61 | builder |
| 62 | .setXid(0x12345678) |
| 63 | .setGroupType(OFGroupType.FF) |
| 64 | .setGroup(OFGroup.of(5)) |
| 65 | .setBuckets(ImmutableList.<OFBucket>of( |
| 66 | factory.buildBucket() |
| 67 | .setWeight(1) |
| 68 | .setWatchPort(OFPort.of(5)) |
| 69 | .setWatchGroup(OFGroup.ANY) |
| 70 | .setActions(ImmutableList.<OFAction>of( |
| 71 | actions.output(OFPort.of(5), 0), |
| 72 | actions.output(OFPort.of(6), 0) |
| 73 | )) |
| 74 | .build(), |
| 75 | factory.buildBucket() |
| 76 | .setWeight(1) |
| 77 | .setWatchPort(OFPort.of(6)) |
| 78 | .setWatchGroup(OFGroup.ANY) |
| 79 | .setActions(ImmutableList.<OFAction>of( |
| 80 | actions.output(OFPort.of(5), 0), |
| 81 | actions.output(OFPort.of(6), 0) |
| 82 | )) |
| 83 | .build() |
| 84 | ) |
| 85 | ) |
| 86 | .build(); |