ovs-openflowd: Standardize on OpenFlow description option
authorJustin Pettit <jpettit@nicira.com>
Fri, 29 Jan 2010 23:45:46 +0000 (15:45 -0800)
committerJustin Pettit <jpettit@nicira.com>
Sat, 20 Feb 2010 10:22:30 +0000 (02:22 -0800)
ovs-vswitchd used a slightly different way to set the manufacturer,
hardware revision, software revision, serial number, and datapath
description than ovs-openflowd.  This standardizes on the ovs-vswitch
style and describes how to use them in the man page.

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

index f817cf6..b98e07d 100644 (file)
@@ -155,6 +155,53 @@ the local port network device, and start the DHCP client afterward.
 .RE
 
 .SH OPTIONS
+.SS "OpenFlow Options"
+.TP
+\fB--datapath-id=\fIdpid\fR
+Sets \fIdpid\fR, which must consist of exactly 16 hexadecimal digits,
+as the datapath ID that the switch will use to identify itself to the
+OpenFlow controller.
+
+If this option is omitted, the default datapath ID is taken from the
+Ethernet address of the datapath's local port (which is typically
+randomly generated) in the lower 48 bits and zeros in the upper 16.
+
+.TP
+\fB--mgmt-id=\fImgmtid\fR
+Sets \fImgmtid\fR, which must consist of exactly 12 hexadecimal
+digits, as the switch's management ID.
+
+If this option is omitted, the management ID defaults to 0, signaling
+to the controller that management is supported but not configured.
+
+.TP
+\fB--mfr-desc=\fIdesc\fR
+Set the description of the switch's manufacturer to \fIdesc\fR, which
+may contain up to 255 ASCII characters.
+
+.TP
+\fB--hw-desc=\fIdesc\fR
+Set the description of the switch's hardware revision to \fIdesc\fR, which
+may contain up to 255 ASCII characters.
+
+.TP
+\fB--sw-desc=\fIdesc\fR
+Set the description of the switch's software revision to \fIdesc\fR, which
+may contain up to 255 ASCII characters.
+
+.TP
+\fB--serial-desc=\fIdesc\fR
+Set the description of the switch's serial number to \fIdesc\fR, which
+may contain up to 31 ASCII characters.
+
+.TP
+\fB--dp-desc=\fIdesc\fR
+Set the description of the datapath to \fIdesc\fR, which may contain up to
+255 ASCII characters.  Note that this field is intended for debugging
+purposes and is not guaranteed to be unique and should not be used as
+the primary identifier of the datapath.
+
+
 .SS "Controller Discovery Options"
 .TP
 \fB--accept-vconn=\fIregex\fR
index 0a65498..858770d 100644 (file)
@@ -240,10 +240,10 @@ parse_options(int argc, char *argv[], struct ofsettings *s)
 {
     enum {
         OPT_DATAPATH_ID = UCHAR_MAX + 1,
-        OPT_MANUFACTURER,
-        OPT_HARDWARE,
-        OPT_SOFTWARE,
-        OPT_SERIAL,
+        OPT_MFR_DESC,
+        OPT_HW_DESC,
+        OPT_SW_DESC,
+        OPT_SERIAL_DESC,
         OPT_DP_DESC,
         OPT_ACCEPT_VCONN,
         OPT_NO_RESOLV_CONF,
@@ -268,11 +268,11 @@ parse_options(int argc, char *argv[], struct ofsettings *s)
     };
     static struct option long_options[] = {
         {"datapath-id", required_argument, 0, OPT_DATAPATH_ID},
-        {"manufacturer", required_argument, 0, OPT_MANUFACTURER},
-        {"hardware", required_argument, 0, OPT_HARDWARE},
-        {"software", required_argument, 0, OPT_SOFTWARE},
-        {"serial", required_argument, 0, OPT_SERIAL},
-        {"dp_desc", required_argument, 0, OPT_DP_DESC},
+        {"mfr-desc", required_argument, 0, OPT_MFR_DESC},
+        {"hw-desc", required_argument, 0, OPT_HW_DESC},
+        {"sw-desc", required_argument, 0, OPT_SW_DESC},
+        {"serial-desc", required_argument, 0, OPT_SERIAL_DESC},
+        {"dp-desc", required_argument, 0, OPT_DP_DESC},
         {"accept-vconn", required_argument, 0, OPT_ACCEPT_VCONN},
         {"no-resolv-conf", no_argument, 0, OPT_NO_RESOLV_CONF},
         {"config",      required_argument, 0, 'F'},
@@ -342,19 +342,19 @@ parse_options(int argc, char *argv[], struct ofsettings *s)
             }
             break;
 
-        case OPT_MANUFACTURER:
+        case OPT_MFR_DESC:
             s->mfr_desc = optarg;
             break;
 
-        case OPT_HARDWARE:
+        case OPT_HW_DESC:
             s->hw_desc = optarg;
             break;
 
-        case OPT_SOFTWARE:
+        case OPT_SW_DESC:
             s->sw_desc = optarg;
             break;
 
-        case OPT_SERIAL:
+        case OPT_SERIAL_DESC:
             s->serial_desc = optarg;
             break;
 
@@ -531,11 +531,11 @@ usage(void)
     printf("\nOpenFlow options:\n"
            "  -d, --datapath-id=ID    Use ID as the OpenFlow switch ID\n"
            "                          (ID must consist of 16 hex digits)\n"
-           "  --manufacturer=MFR      Identify manufacturer as MFR\n"
-           "  --hardware=HW           Identify hardware as HW\n"
-           "  --software=SW           Identify software as SW\n"
-           "  --serial=SERIAL         Identify serial number as SERIAL\n"
-           "  --dp_desc=DP_DESC       Identify dp description as DP_DESC\n"
+           "  --mfr-desc=MFR          Identify manufacturer as MFR\n"
+           "  --hw-desc=HW            Identify hardware as HW\n"
+           "  --sw-desc=SW            Identify software as SW\n"
+           "  --serial-desc=SERIAL    Identify serial number as SERIAL\n"
+           "  --dp-desc=DP_DESC       Identify dp description as DP_DESC\n"
            "\nController discovery options:\n"
            "  --accept-vconn=REGEX    accept matching discovered controllers\n"
            "  --no-resolv-conf        do not update /etc/resolv.conf\n"