X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=utilities%2Fovs-openflowd.c;h=f54eb355d30694b51cb48d6266b26784d26166d4;hb=d08a2e920631099d68f4efd4e72f6c14987520ce;hp=a58a9d219467b7f034523b6fb1196f193125270b;hpb=279c9e030818e039bb1c26be76e2cc1e8f6b13a6;p=openvswitch diff --git a/utilities/ovs-openflowd.c b/utilities/ovs-openflowd.c index a58a9d21..f54eb355 100644 --- a/utilities/ovs-openflowd.c +++ b/utilities/ovs-openflowd.c @@ -93,7 +93,6 @@ main(int argc, char *argv[]) struct ofproto *ofproto; struct ofsettings s; int error; - struct dpif *dpif; struct netflow_options nf_options; const char *port; bool exiting; @@ -103,7 +102,6 @@ main(int argc, char *argv[]) parse_options(argc, argv, &s); signal(SIGPIPE, SIG_IGN); - die_if_already_running(); daemonize_start(); /* Start listening for ovs-appctl requests. */ @@ -117,9 +115,10 @@ main(int argc, char *argv[]) VLOG_INFO("Open vSwitch version %s", VERSION BUILDNR); VLOG_INFO("OpenFlow protocol version 0x%02x", OFP_VERSION); - error = dpif_create_and_open(s.dp_name, s.dp_type, &dpif); + error = ofproto_create(s.dp_name, s.dp_type, NULL, NULL, &ofproto); if (error) { - VLOG_FATAL("could not create datapath (%s)", strerror(error)); + VLOG_FATAL("could not initialize OpenFlow switch (%s)", + strerror(error)); } /* Add ports to the datapath if requested by the user. */ @@ -132,7 +131,7 @@ main(int argc, char *argv[]) port, strerror(error)); } - error = dpif_port_add(dpif, netdev, NULL); + error = ofproto_port_add(ofproto, netdev, NULL); if (error) { VLOG_FATAL("failed to add %s as a port (%s)", port, strerror(error)); @@ -141,12 +140,7 @@ main(int argc, char *argv[]) netdev_close(netdev); } - /* Start OpenFlow processing. */ - error = ofproto_create(s.dp_name, s.dp_type, NULL, NULL, &ofproto); - if (error) { - VLOG_FATAL("could not initialize openflow switch (%s)", - strerror(error)); - } + /* Configure OpenFlow switch. */ if (s.datapath_id) { ofproto_set_datapath_id(ofproto, s.datapath_id); } @@ -189,7 +183,7 @@ main(int argc, char *argv[]) poll_block(); } - dpif_close(dpif); + ofproto_destroy(ofproto); return 0; }