[BusyBox-cvs] CVS busybox/networking/udhcp

CVS User vapier vapier at codepoet.org
Mon Dec 6 14:59:46 UTC 2004


Update of /var/cvs/busybox/networking/udhcp
In directory nail:/tmp/cvs-serv3946

Modified Files:
	README.udhcpc clientpacket.c dhcpc.c dhcpc.h dhcpd.h options.c 
Log Message:
merge from udhcp module

--- /var/cvs/busybox/networking/udhcp/README.udhcpc	2004/03/15 08:29:00	1.4
+++ /var/cvs/busybox/networking/udhcp/README.udhcpc	2004/12/06 14:59:45	1.5
@@ -12,7 +12,8 @@
 
 -c, --clientid=CLIENTID         Client identifier
 -H, --hostname=HOSTNAME         Client hostname
--h,				Alias for -H
+-h,                             Alias for -H
+-F, --fqdn=FQDN                 Client fully qualified domain name
 -f, --foreground                Do not fork after getting lease
 -b, --background                Fork to background if lease cannot be
                                 immediately negotiated.
--- /var/cvs/busybox/networking/udhcp/clientpacket.c	2004/04/14 17:51:25	1.8
+++ /var/cvs/busybox/networking/udhcp/clientpacket.c	2004/12/06 14:59:45	1.9
@@ -78,6 +78,7 @@
 	memcpy(packet->chaddr, client_config.arp, 6);
 	add_option_string(packet->options, client_config.clientid);
 	if (client_config.hostname) add_option_string(packet->options, client_config.hostname);
+	if (client_config.fqdn) add_option_string(packet->options, client_config.fqdn);
 	add_option_string(packet->options, (uint8_t *) &vendor_id);
 }
 
--- /var/cvs/busybox/networking/udhcp/dhcpc.c	2004/05/19 08:29:05	1.18
+++ /var/cvs/busybox/networking/udhcp/dhcpc.c	2004/12/06 14:59:45	1.19
@@ -67,6 +67,7 @@
 	script: DEFAULT_SCRIPT,
 	clientid: NULL,
 	hostname: NULL,
+	fqdn: NULL,
 	ifindex: 0,
 	arp: "\0\0\0\0\0\0",		/* appease gcc-3.0 */
 };
@@ -79,6 +80,7 @@
 "  -c, --clientid=CLIENTID         Client identifier\n"
 "  -H, --hostname=HOSTNAME         Client hostname\n"
 "  -h                              Alias for -H\n"
+"  -F, --fqdn=FQDN                 Client fully qualified domain name\n"
 "  -f, --foreground                Do not fork after getting lease\n"
 "  -b, --background                Fork to background if lease cannot be\n"
 "                                  immediately negotiated.\n"
@@ -197,7 +199,8 @@
 		{"foreground",	no_argument,		0, 'f'},
 		{"background",	no_argument,		0, 'b'},
 		{"hostname",	required_argument,	0, 'H'},
-		{"hostname",    required_argument,      0, 'h'},
+		{"hostname",	required_argument,	0, 'h'},
+		{"fqdn",	required_argument,	0, 'F'},
 		{"interface",	required_argument,	0, 'i'},
 		{"now", 	no_argument,		0, 'n'},
 		{"pidfile",	required_argument,	0, 'p'},
@@ -211,7 +214,7 @@
 	/* get options */
 	while (1) {
 		int option_index = 0;
-		c = getopt_long(argc, argv, "c:fbH:h:i:np:qr:s:v", arg_options, &option_index);
+		c = getopt_long(argc, argv, "c:fbH:h:F:i:np:qr:s:v", arg_options, &option_index);
 		if (c == -1) break;
 
 		switch (c) {
@@ -239,6 +242,23 @@
 			client_config.hostname[OPT_LEN] = len;
 			strncpy(client_config.hostname + 2, optarg, len);
 			break;
+		case 'F':
+			len = strlen(optarg) > 255 ? 255 : strlen(optarg);
+			if (client_config.fqdn) free(client_config.fqdn);
+			client_config.fqdn = xmalloc(len + 5);
+			client_config.fqdn[OPT_CODE] = DHCP_FQDN;
+			client_config.fqdn[OPT_LEN] = len + 3;
+			/* Flags: 0000NEOS
+			S: 1 => Client requests Server to update A RR in DNS as well as PTR
+			O: 1 => Server indicates to client that DNS has been updated regardless
+			E: 1 => Name data is DNS format, i.e. <4>host<6>domain<4>com<0> not "host.domain.com"
+			N: 1 => Client requests Server to not update DNS
+			*/
+			client_config.fqdn[OPT_LEN + 1] = 0x1;
+			client_config.fqdn[OPT_LEN + 2] = 0;
+			client_config.fqdn[OPT_LEN + 3] = 0;
+			strncpy(client_config.fqdn + 5, optarg, len);
+			break;
 		case 'i':
 			client_config.interface =  optarg;
 			break;
--- /var/cvs/busybox/networking/udhcp/dhcpc.h	2004/01/30 23:45:12	1.4
+++ /var/cvs/busybox/networking/udhcp/dhcpc.h	2004/12/06 14:59:45	1.5
@@ -27,6 +27,7 @@
 	char *script;			/* User script to run at dhcp events */
 	uint8_t *clientid;		/* Optional client id to use */
 	uint8_t *hostname;		/* Optional hostname to use */
+	uint8_t *fqdn;			/* Optional fully qualified domain name to use */
 	int ifindex;			/* Index number of the interface to use */
 	uint8_t arp[6];			/* Our arp address */
 };
--- /var/cvs/busybox/networking/udhcp/dhcpd.h	2004/10/08 08:49:26	1.7
+++ /var/cvs/busybox/networking/udhcp/dhcpd.h	2004/12/06 14:59:45	1.8
@@ -63,6 +63,7 @@
 #define DHCP_T2			0x3b
 #define DHCP_VENDOR		0x3c
 #define DHCP_CLIENT_ID		0x3d
+#define DHCP_FQDN		0x51
 
 #define DHCP_END		0xFF
 
--- /var/cvs/busybox/networking/udhcp/options.c	2004/03/15 08:29:01	1.8
+++ /var/cvs/busybox/networking/udhcp/options.c	2004/12/06 14:59:45	1.9
@@ -32,7 +32,9 @@
 	{"ipttl",	OPTION_U8,				0x17},
 	{"mtu",		OPTION_U16,				0x1a},
 	{"broadcast",	OPTION_IP | OPTION_REQ,			0x1c},
-	{"ntpsrv",	OPTION_IP | OPTION_LIST,		0x2a},
+	{"nisdomain",	OPTION_STRING | OPTION_REQ,		0x28},
+	{"nissrv",	OPTION_IP | OPTION_LIST | OPTION_REQ,	0x29},
+	{"ntpsrv",	OPTION_IP | OPTION_LIST | OPTION_REQ,	0x2a},
 	{"wins",	OPTION_IP | OPTION_LIST,		0x2c},
 	{"requestip",	OPTION_IP,				0x32},
 	{"lease",	OPTION_U32,				0x33},



More information about the busybox-cvs mailing list