ovs-openflowd: Setup default listener
authorJustin Pettit <jpettit@nicira.com>
Fri, 13 Nov 2009 23:51:44 +0000 (15:51 -0800)
committerJustin Pettit <jpettit@nicira.com>
Fri, 13 Nov 2009 23:51:44 +0000 (15:51 -0800)
By default, ovs-openflowd was not listening for any management
connections.  Tools such as ovs-ofctl attempt to use a default location
based on the datapath name.  This change creates that default listener.

utilities/ovs-openflowd.8.in
utilities/ovs-openflowd.c

index 3d25574..312e7f7 100644 (file)
@@ -298,11 +298,16 @@ time is 8 seconds.
 
 .TP
 \fB-l\fR, \fB--listen=\fImethod\fR
-Configures the switch to additionally listen for incoming OpenFlow
-connections for switch management with \fBovs\-ofctl\fR.  The \fImethod\fR
+By default, the switch listens for OpenFlow management connections on a
+Unix domain socket named \fB@RUNDIR@/\fIdatapath\fB.mgmt\fR.  This socket 
+can be used to perform local OpenFlow monitoring and administration with
+tools such as \fBovs\-ofctl\fR.  
+
+This option may be used to override the default listener.  The \fImethod\fR
 must be given as one of the passive OpenFlow connection methods listed
 below.  This option may be specified multiple times to listen to
-multiple connection methods.
+multiple connection methods.  If a single \fImethod\fR of \fBnone\fR is
+used, no listeners will be created.
 
 .RS
 .TP
index 20da572..d6b2c51 100644 (file)
@@ -156,6 +156,12 @@ main(int argc, char *argv[])
         ofproto_set_mgmt_id(ofproto, s.mgmt_id);
     }
     ofproto_set_desc(ofproto, s.mfr_desc, s.hw_desc, s.sw_desc, s.serial_desc);
+    if (!s.listeners.n) {
+        svec_add_nocopy(&s.listeners, xasprintf("punix:%s/%s.mgmt",
+                                              ovs_rundir, s.dp_name));
+    } else if (s.listeners.n == 1 && !strcmp(s.listeners.names[0], "none")) {
+        svec_clear(&s.listeners);
+    }
     error = ofproto_set_listeners(ofproto, &s.listeners);
     if (error) {
         ovs_fatal(error, "failed to configure management connections");