- sw->lswitch = lswitch_create(sw->rconn, &cfg);
-}
-
-static int
-do_switching(struct switch_ *sw)
-{
- unsigned int packets_sent;
- struct ofpbuf *msg;
-
- packets_sent = rconn_packets_sent(sw->rconn);
-
- msg = rconn_recv(sw->rconn);
- if (msg) {
- if (!mute) {
- lswitch_process_packet(sw->lswitch, sw->rconn, msg);
- }
- ofpbuf_delete(msg);
- }
- rconn_run(sw->rconn);
-
- return (!rconn_is_alive(sw->rconn) ? EOF
- : rconn_packets_sent(sw->rconn) != packets_sent ? 0
- : EAGAIN);
-}
-
-static void
-read_flow_file(const char *name)
-{
- enum nx_flow_format flow_format;
- bool flow_mod_table_id;
- FILE *stream;
-
- stream = fopen(optarg, "r");
- if (!stream) {
- ovs_fatal(errno, "%s: open", name);
- }
-
- flow_format = NXFF_OPENFLOW10;
- flow_mod_table_id = false;
- while (parse_ofp_flow_mod_file(&default_flows,
- &flow_format, &flow_mod_table_id,
- stream, OFPFC_ADD)) {
- continue;
- }
-
- fclose(stream);