This section talks about generic OpenFlow structures that are used by the controller and switch while processing OpenFlow messages.
This section describes the port structures defined in the OpenFlow specification:
/* Description of a port */ struct ofp_port { uint32_t port_no; /* Unique identity of port */ uint16_t length; uint8_t pad[2]; uint8_t hw_addr[OFP_ETH_ALEN]; /* mac addr field */ uint8_t pad2[2]; /* Align to 64 bits. */ char name[OFP_MAX_PORT_NAME_LEN]; /* Null-terminated name field*/ uint32_t config; /* Bitmap of OFPPC_* flags. */ uint32_t state; /* Bitmap of OFPPS_* flags. */ /* Port description property list - 0 or more properties */ struct ofp_port_desc_prop_header properties[0]; };
The port_no
field uses the following convention:
/* Port numbering. Ports are numbered starting from 1. */ enum ofp_port_no { /* Maximum number of physical and logical switch...