]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
classid -> vendorclassid to match the RFC description.
authorRoy Marples <roy@marples.name>
Wed, 13 Aug 2008 21:29:30 +0000 (21:29 +0000)
committerRoy Marples <roy@marples.name>
Wed, 13 Aug 2008 21:29:30 +0000 (21:29 +0000)
dhcp.c
dhcp.h
dhcpcd.8.in
dhcpcd.c
dhcpcd.conf.5.in
dhcpcd.h

diff --git a/dhcp.c b/dhcp.c
index 2f1a7dd9c8e1935f8f0b3ce0cd4ee3547bc9862f..460d7c5f04d10acebedac54628668fb5ce5e5d00 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -828,10 +828,11 @@ make_message(struct dhcp_message **message,
                        p += options->userclass[0] + 1;
                }
 
-               if (options->classid[0]) {
-                       *p++ = DHO_CLASSID;
-                       memcpy(p, options->classid, options->classid[0] + 1);
-                       p += options->classid[0] + 1;
+               if (options->vendorclassid[0]) {
+                       *p++ = DHO_VENDORCLASSID;
+                       memcpy(p, options->vendorclassid,
+                              options->vendorclassid[0] + 1);
+                       p += options->vendorclassid[0] + 1;
                }
        }
 
diff --git a/dhcp.h b/dhcp.h
index 2e14818acc29d30af193bd8b94427344925a1613..f135f649b0135dc0fa7241a59e918fb524d042c9 100644 (file)
--- a/dhcp.h
+++ b/dhcp.h
@@ -87,7 +87,7 @@ enum DHO
        DHO_MAXMESSAGESIZE         = 57,
        DHO_RENEWALTIME            = 58,
        DHO_REBINDTIME             = 59,
-       DHO_CLASSID                = 60,
+       DHO_VENDORCLASSID          = 60,
        DHO_CLIENTID               = 61,
        DHO_USERCLASS              = 77,  /* RFC 3004 */
        DHO_FQDN                   = 81,
index 67724a29a4f4fd8ed6c15fdfac18f1900bae7e9b..90586310f0d5d9ee504d137d360fff9f845222ea 100644 (file)
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd August 12, 2008
+.Dd August 13, 2008
 .Dt DHCPCD 8 SMM
 .Sh NAME
 .Nm dhcpcd
@@ -33,7 +33,7 @@
 .Op Fl c , -script Ar script
 .Op Fl f , -config Ar file
 .Op Fl h , -hostname Ar hostname
-.Op Fl i , -classid Ar classid
+.Op Fl i , -vendorclassid Ar vendorclassid
 .Op Fl l , -leasetime Ar seconds
 .Op Fl m , -metric Ar metric
 .Op Fl o , -option Ar option
@@ -154,9 +154,9 @@ sent, or an empty string to
 stop any
 .Ar hostname
 from being sent.
-.It Fl i , -classid Ar classid
+.It Fl i , -vendorclassid Ar vendorclassid
 Override the
-.Ar classid
+.Ar vendorclassid
 field sent. The default is
 dhcpcd <version>.
 If not set then none is sent.
index 4336f84b5d3434fab719f792ce3f5604798b0b03..c559ce58199a93354923d483f31c2dd4be4e110d 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -58,48 +58,49 @@ const char copyright[] = "Copyright (c) 2006-2008 Roy Marples";
 static int doversion = 0;
 static int dohelp = 0;
 static const struct option longopts[] = {
-       {"background",  no_argument,        NULL, 'b'},
-       {"script",      required_argument,  NULL, 'c'},
-       {"debug",       no_argument,        NULL, 'd'},
-       {"config",      required_argument,  NULL, 'f'},
-       {"hostname",    optional_argument,  NULL, 'h'},
-       {"classid",     optional_argument,  NULL, 'i'},
-       {"release",     no_argument,        NULL, 'k'},
-       {"leasetime",   required_argument,  NULL, 'l'},
-       {"metric",      required_argument,  NULL, 'm'},
-       {"renew",       no_argument,        NULL, 'n'},
-       {"option",      required_argument,  NULL, 'o'},
-       {"persistent",  no_argument,        NULL, 'p'},
-       {"quiet",       no_argument,        NULL, 'q'},
-       {"request",     optional_argument,  NULL, 'r'},
-       {"inform",      optional_argument,  NULL, 's'},
-       {"timeout",     required_argument,  NULL, 't'},
-       {"userclass",   required_argument,  NULL, 'u'},
-       {"vendor",      required_argument,  NULL, 'v'},
-       {"exit",        no_argument,        NULL, 'x'},
-       {"noarp",       no_argument,        NULL, 'A'},
-       {"nobackground",no_argument,        NULL, 'B'},
-       {"nohook",      required_argument,  NULL, 'C'},
-       {"duid",        no_argument,        NULL, 'D'},
-       {"lastlease",   no_argument,        NULL, 'E'},
-       {"fqdn",        optional_argument,  NULL, 'F'},
-       {"nogateway",   no_argument,        NULL, 'G'},
-       {"clientid",    optional_argument,  NULL, 'I'},
-       {"nolink",      no_argument,        NULL, 'K'},
-       {"noipv4ll",    no_argument,        NULL, 'L'},
-       {"nooption",    optional_argument,  NULL, 'O'},
-       {"test",        no_argument,        NULL, 'T'},
-       {"variables",   no_argument,        NULL, 'V'},
-       {"blacklist",   required_argument,  NULL, 'X'},
-       {"help",        no_argument,        &dohelp, 1},
-       {"version",     no_argument,        &doversion, 1},
+       {"background",    no_argument,        NULL, 'b'},
+       {"script",        required_argument,  NULL, 'c'},
+       {"debug",         no_argument,        NULL, 'd'},
+       {"config",        required_argument,  NULL, 'f'},
+       {"hostname",      optional_argument,  NULL, 'h'},
+       {"vendorclassid", optional_argument,  NULL, 'i'},
+       {"release",       no_argument,        NULL, 'k'},
+       {"leasetime",     required_argument,  NULL, 'l'},
+       {"metric",        required_argument,  NULL, 'm'},
+       {"renew",         no_argument,        NULL, 'n'},
+       {"option",        required_argument,  NULL, 'o'},
+       {"persistent",    no_argument,        NULL, 'p'},
+       {"quiet",         no_argument,        NULL, 'q'},
+       {"request",       optional_argument,  NULL, 'r'},
+       {"inform",        optional_argument,  NULL, 's'},
+       {"timeout",       required_argument,  NULL, 't'},
+       {"userclass",     required_argument,  NULL, 'u'},
+       {"vendor",        required_argument,  NULL, 'v'},
+       {"exit",          no_argument,        NULL, 'x'},
+       {"noarp",         no_argument,        NULL, 'A'},
+       {"nobackground",  no_argument,        NULL, 'B'},
+       {"nohook",        required_argument,  NULL, 'C'},
+       {"duid",          no_argument,        NULL, 'D'},
+       {"lastlease",     no_argument,        NULL, 'E'},
+       {"fqdn",          optional_argument,  NULL, 'F'},
+       {"nogateway",     no_argument,        NULL, 'G'},
+       {"clientid",      optional_argument,  NULL, 'I'},
+       {"nolink",        no_argument,        NULL, 'K'},
+       {"noipv4ll",      no_argument,        NULL, 'L'},
+       {"nooption",      optional_argument,  NULL, 'O'},
+       {"test",          no_argument,        NULL, 'T'},
+       {"variables",     no_argument,        NULL, 'V'},
+       {"blacklist",     required_argument,  NULL, 'X'},
+       {"help",          no_argument,        &dohelp, 1},
+       {"version",       no_argument,        &doversion, 1},
 #ifdef CMDLINE_COMPAT
-       {"nohostname",  no_argument,        NULL, 'H'},
-       {"nomtu",       no_argument,        NULL, 'M'},
-       {"nontp",       no_argument,        NULL, 'N'},
-       {"nodns",       no_argument,        NULL, 'R'},
-       {"msscr",       no_argument,        NULL, 'S'},
-       {"nonis",       no_argument,        NULL, 'Y'},
+       {"classid",       optional_argument,  NULL, 'i'},
+       {"nohostname",    no_argument,        NULL, 'H'},
+       {"nomtu",         no_argument,        NULL, 'M'},
+       {"nontp",         no_argument,        NULL, 'N'},
+       {"nodns",         no_argument,        NULL, 'R'},
+       {"msscr",         no_argument,        NULL, 'S'},
+       {"nonis",         no_argument,        NULL, 'Y'},
 #endif
        {NULL,          0,                  NULL, '\0'}
 };
@@ -329,15 +330,15 @@ parse_option(int opt, char *oarg, struct options *options)
                break;
        case 'i':
                if (oarg)
-                       s = parse_string((char *)options->classid + 1,
-                                        CLASSID_MAX_LEN, oarg);
+                       s = parse_string((char *)options->vendorclassid + 1,
+                                        VENDORCLASSID_MAX_LEN, oarg);
                else
                        s = 0;
                if (s == -1) {
-                       logger(LOG_ERR, "classid: %s", strerror(errno));
+                       logger(LOG_ERR, "vendorclassid: %s", strerror(errno));
                        return -1;
                }
-               *options->classid = (uint8_t)s;
+               *options->vendorclassid = (uint8_t)s;
                break;
        case 'l':
                if (*oarg == '-') {
@@ -507,7 +508,7 @@ parse_option(int opt, char *oarg, struct options *options)
                break;
        case 'I':
                /* Strings have a type of 0 */;
-               options->classid[1] = 0;
+               options->clientid[1] = 0;
                if (oarg)
                        s = parse_string_hwaddr((char *)options->clientid + 1,
                                                CLIENTID_MAX_LEN, oarg, 1);
@@ -611,8 +612,9 @@ main(int argc, char **argv)
        options->timeout = DEFAULT_TIMEOUT;
        strlcpy(options->script, SCRIPT, sizeof(options->script));
 
-       options->classid[0] = snprintf((char *)options->classid + 1, CLASSID_MAX_LEN,
-                                      "%s %s", PACKAGE, VERSION);
+       options->vendorclassid[0] = snprintf((char *)options->vendorclassid + 1,
+                                            VENDORCLASSID_MAX_LEN,
+                                            "%s %s", PACKAGE, VERSION);
 
 #ifdef CMDLINE_COMPAT
        add_reqmask(options->reqmask, DHCP_DNSSERVER);
index 84bb9be0991282f2373bdaaff75d735432551d2b..c7fa68a612673a7447599564f2e9c4d3709a77cf 100644 (file)
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd August 7, 2008
+.Dd August 13, 2008
 .Dt DHCPCD.CONF 5 SMM
 .Sh NAME
 .Nm dhcpcd.conf
@@ -43,8 +43,8 @@ Blank lines and lines starting with # are ignored.
 .Pp
 Here's a list of available options:
 .Bl -tag -width indent
-.It Ic classid Ar string
-Change the default classid sent from dhcpcd-version.
+.It Ic vendorclassid Ar string
+Change the default vendorclassid sent from dhcpcd-version.
 If not set then none is sent.
 .It Ic clientid Ar string
 Change the default clientid sent from the interface hardware address.
index 07ceee6e3ad1ff200550f705e04b14abe58722ca..dc7cff417877539a6fe31f29b32a3d7f16317ad8 100644 (file)
--- a/dhcpcd.h
+++ b/dhcpcd.h
@@ -42,7 +42,7 @@
 #define DEFAULT_LEASETIME      3600    /* 1 hour */
 
 #define HOSTNAME_MAX_LEN       250     /* 255 - 3 (FQDN) - 2 (DNS enc) */
-#define CLASSID_MAX_LEN                48
+#define VENDORCLASSID_MAX_LEN  48
 #define CLIENTID_MAX_LEN       48
 #define USERCLASS_MAX_LEN      255
 #define VENDOR_MAX_LEN         255
@@ -83,7 +83,7 @@ struct options {
 
        char hostname[HOSTNAME_MAX_LEN + 1];
        int fqdn;
-       uint8_t classid[CLASSID_MAX_LEN + 1];
+       uint8_t vendorclassid[VENDORCLASSID_MAX_LEN + 1];
        char clientid[CLIENTID_MAX_LEN + 1];
        uint8_t userclass[USERCLASS_MAX_LEN + 1];
        uint8_t vendor[VENDOR_MAX_LEN + 1];