Book Image

OpenFlow Cookbook

Book Image

OpenFlow Cookbook

Overview of this book

Table of Contents (17 chapters)
16
Index

Getting group description using multipart messages

When the controller wants to fetch the details of all the group entries installed in the switch, it sends an OFPMP_GROUP_DESC multipart message (ofp_multipart_request) to switch.

How to do it...

When the switch receives this OFPMP_GROUP_DESC message, the switch should first fetch all the group entries from its group table. Once it fetches all the group entries, it should insert the information as shown in the following structure and should pack this structure in the body field of the multipart reply message, and send the reply message back to the controller. For more information regarding the procedure to construct and send the multipart reply message, refer to the Introduction section in Chapter 5, Handling Multipart State Information Messages (Part 1).

The body field should take the following format:

/* Body of reply to OFPMP_GROUP_DESC request. */
struct ofp_group_desc {
uint16_t length;              /* Length of this entry. */
uint8_t type...