Book Image

OpenFlow Cookbook

Book Image

OpenFlow Cookbook

Overview of this book

Table of Contents (17 chapters)
16
Index

Adding a new group entry in a group table

When the controller wants to program a group table entry, the controller should send a group table modification message (OFPT_GROUP_MOD) to the switch. This group table modification message contains the information required to program the group table which includes the group identifier, bucket list and so on.

How to do it...

The message format that should be used by the controller to send OFPT_GROUP_MOD is as follows:

/* Group setup and teardown (controller -> datapath). */
struct ofp_group_mod {
struct ofp_header header;
uint16_t command;        /* One of OFPGC_*. */
uint8_t type;            /* One of OFPGT_*. */
uint8_t pad;                  /* Pad to 64 bits. */
uint32_t group_id;            /* Group identifier. */
struct ofp_bucket buckets[0]; /* The length of the bucket array
                               * is inferred from the length field
                               * in the header. */
};
How to do it...

The command field represents the operation to be...