| -- binary |
| 06 0f # version, type |
| 00 40 # length |
| 12 34 56 78 # xid |
| 00 00 # command (OFPGC_ADD) |
| 01 # type (OFPGT_SELECT) |
| 00 # pad |
| 00 00 00 01 # group_id |
| 00 28 # bucket_array_len |
| 00 00 # pad |
| ff ff ff 00 # command_bucket_id (BUCKET_MAX) -- not applicable to OFPGC_ADD command, so could be any value really |
| |
| 00 28 # len of this bucket including header, properties, and any end pad |
| 00 18 # len of this bucket's actions array |
| ff ff ff fd # bucket_id of this bucket (fd == first bucket in list) |
| |
| 00 00 # ofp_action[0].type (OFPAT_OUTPUT) |
| 00 10 # ofp_action[0].len |
| 00 00 00 01 # port |
| 00 03 # max_len |
| 00 00 00 00 00 00 # pad |
| |
| 00 16 # of_action[1].type (OFPAT_GROUP) |
| 00 08 # of_action[1].length |
| 00 00 00 01 # group_id |
| |
| 00 00 # group bucket property header prop_type == SELECT |
| 00 08 # length of SELECT prop_type |
| 00 00 # default weight of SELECT group |
| 00 00 # pad to 8 bytes |
| |
| -- java |
| builder |
| .setXid(0x12345678) |
| .setGroupType(OFGroupType.SELECT) |
| .setGroup(OFGroup.of(1)) |
| .setCommandBucketId(OFGroupBucket.BUCKET_MAX) |
| .setBuckets(ImmutableList.<OFBucket>of(factory.buildBucket() |
| .setBucketId(OFGroupBucket.BUCKET_FIRST) |
| .setActions(ImmutableList.<OFAction>of( |
| factory.actions().output(OFPort.of(1),3), |
| factory.actions().group(OFGroup.of(1)))) |
| .setProperties(ImmutableList.<OFGroupBucketProp>of(factory.buildGroupBucketPropWeight() |
| .setWeight(0) |
| .build())) |
| .build())) |
| |