struct ofpbuf * set_config(enum ofputil_protocol proto) { struct ofputil_switch_config sc; memset(&sc, 0, sizeof(sc)); sc.frag = OFPUTIL_FRAG_NORMAL; // sc.invalid_ttl_to_controller is for only OFP11 and OFP12 sc.miss_send_len = 128; // The default of OpenFlow Spec return ofputil_encode_set_config( &sc, ofputil_protocol_to_ofp_version(proto)); }
static void send_features_request(struct lswitch *sw) { struct ofpbuf *b; int ofp_version = rconn_get_version(sw->rconn); ovs_assert(ofp_version > 0 && ofp_version < 0xff); /* Send OFPT_FEATURES_REQUEST. */ b = ofpraw_alloc(OFPRAW_OFPT_FEATURES_REQUEST, ofp_version, 0); queue_tx(sw, b); /* Send OFPT_SET_CONFIG. */ struct ofputil_switch_config config = { .miss_send_len = OFP_DEFAULT_MISS_SEND_LEN }; queue_tx(sw, ofputil_encode_set_config(&config, ofp_version)); }