- struct openflow_packet {
- size_t min_size;
- int (*handler)(struct datapath *, const struct sender *, const void *);
- };
-
- static const struct openflow_packet packets[] = {
- [OFPT_FEATURES_REQUEST] = {
- sizeof (struct ofp_header),
- recv_features_request,
- },
- [OFPT_GET_CONFIG_REQUEST] = {
- sizeof (struct ofp_header),
- recv_get_config_request,
- },
- [OFPT_SET_CONFIG] = {
- sizeof (struct ofp_switch_config),
- recv_set_config,
- },
- [OFPT_PACKET_OUT] = {
- sizeof (struct ofp_packet_out),
- recv_packet_out,
- },
- [OFPT_FLOW_MOD] = {
- sizeof (struct ofp_flow_mod),
- recv_flow,
- },
- [OFPT_PORT_MOD] = {
- sizeof (struct ofp_port_mod),
- recv_port_mod,
- },
- [OFPT_STATS_REQUEST] = {
- sizeof (struct ofp_stats_request),
- recv_stats_request,
- },
- [OFPT_ECHO_REQUEST] = {
- sizeof (struct ofp_header),
- recv_echo_request,
- },
- [OFPT_ECHO_REPLY] = {
- sizeof (struct ofp_header),
- recv_echo_reply,
- },
- };
-
- const struct openflow_packet *pkt;