diff options
| author | Ben Pfaff <blp@nicira.com> | 2011-05-04 10:15:31 -0700 |
|---|---|---|
| committer | Ben Pfaff <blp@nicira.com> | 2011-05-04 10:15:31 -0700 |
| commit | b5827b24c7c136b088e719bfe2020de31032ae37 (patch) | |
| tree | 4d73e4f0f9f030f89c49c067e93de64caab34344 /utilities/ovs-openflowd.c | |
| parent | ebea37cc67751a05dbefec0246fb2a62576f4389 (diff) | |
| download | openvswitch-b5827b24c7c136b088e719bfe2020de31032ae37.tar.gz | |
bridge: Eliminate direct dependencies on dpif.
The 'ofp_portp' argument of the new function ofproto_port_add() is always
set to NULL in this commit, but a future commit will use nonnull values.
Diffstat (limited to 'utilities/ovs-openflowd.c')
| -rw-r--r-- | utilities/ovs-openflowd.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/utilities/ovs-openflowd.c b/utilities/ovs-openflowd.c index 86f5ca592..f54eb355d 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; @@ -116,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. */ @@ -131,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)); @@ -140,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); } @@ -188,7 +183,7 @@ main(int argc, char *argv[]) poll_block(); } - dpif_close(dpif); + ofproto_destroy(ofproto); return 0; } |
