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 |
| 40 | ofp.message.group_mod( |
| 41 | xid=0x12345678, |
| 42 | command=ofp.OFPGC_MODIFY, |
| 43 | group_type=ofp.OFPGT_FF, |
| 44 | group_id=5, |
| 45 | buckets=[ |
| 46 | ofp.bucket( |
| 47 | weight=1, |
| 48 | watch_port=5, |
| 49 | watch_group=0xffffffff, |
| 50 | actions=[ |
| 51 | ofp.action.output(port=5, max_len=0), |
| 52 | ofp.action.output(port=6, max_len=0)]), |
| 53 | ofp.bucket( |
| 54 | weight=1, |
| 55 | watch_port=6, |
| 56 | watch_group=0xffffffff, |
| 57 | actions=[ |
| 58 | ofp.action.output(port=5, max_len=0), |
| 59 | ofp.action.output(port=6, max_len=0)])]) |