This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Re: DHCP Options Enhancements
- From: Andrew Lunn <andrew at lunn dot ch>
- To: Jay Foster <jay dot foster at systech dot com>
- Cc: "'ecos-patches at sources dot redhat dot com'" <ecos-patches at sources dot redhat dot com>
- Date: Sun, 12 Oct 2003 12:44:17 +0200
- Subject: Re: DHCP Options Enhancements
- References: <80B97DE95AEED311BA580050047FE98494F70D@mail.systech.com>
On Tue, Sep 30, 2003 at 05:53:01PM -0700, Jay Foster wrote:
> Attached is a patch for the DHCP options. The patch includes the patch
> submitted previously that adds the host name and MAC address client ID to
> the DHCP request. The patch also includes the CDL interface to configure
> the CYGOPT_NET_DHCP_PARM_REQ_LIST_REPLACE and
> CYGOPT_NET_DHCP_PARM_REQ_LIST_ADDITIONAL options. These two options have
> been in the source code for some time, but there was no CDL interface to
> configure them.
Hi Jay.
The new CDL for CYGOPT_NET_DHCP_PARM_REQ_LIST_REPLACE and
CYGOPT_NET_DHCP_PARM_REQ_LIST_ADDITIONAL is fine. I've committed that
part of the patch, with a few minor modifications.
I don't like this bit of code:
+#ifdef CYGOPT_NET_DHCP_OPTION_HOST_NAME
+{
+ extern char *cyg_get_dhcp_hostname(void);
+ char *hostname = cyg_get_dhcp_hostname();
+ if (hostname != NULL)
+ set_variable_tag( xmit, TAG_HOST_NAME, hostname, (strlen(hostname) + 1));
+}
This requires that all applications that are linked with an eCos
library with this option enabled have a function called
cyg_get_dhcp_hostname(). Think about all the test cases etc. They
don't have this function so they will not link.
Please can you change this so that the application can call a function
cyg_dhcp_set_hostname() before calling init_all_network_interfaces()
to set the hostname.
Thanks
Andrew
Index: net/common/current//ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/common/current/ChangeLog,v
retrieving revision 1.43
diff -u -r1.43 ChangeLog
--- net/common/current//ChangeLog 9 Oct 2003 16:08:31 -0000 1.43
+++ net/common/current//ChangeLog 12 Oct 2003 10:43:31 -0000
@@ -1,3 +1,9 @@
+2003-10-12 Jay Foster <jay@systech.com>
+
+ * cdl/net.cdl: Added configuration interface for
+ CYGOPT_NET_DHCP_PARM_REQ_LIST_REPLACE and
+ CYGOPT_NET_DHCP_PARM_REQ_LIST_ADDITIONAL.
+
2003-10-09 Eric Doenges <Eric.Doenges@DynaPel.com>
* src/tftp_client.c: Changed the code so that if the last packet
Index: net/common/current//cdl/net.cdl
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/common/current/cdl/net.cdl,v
retrieving revision 1.8
diff -u -r1.8 net.cdl
--- net/common/current//cdl/net.cdl 31 Jul 2003 08:56:27 -0000 1.8
+++ net/common/current//cdl/net.cdl 12 Oct 2003 10:43:33 -0000
@@ -246,6 +246,28 @@
when necessary, but it does not need to be as high as the
network thread itself."
}
+
+ cdl_option CYGOPT_NET_DHCP_PARM_REQ_LIST_REPLACE {
+ display "Replace DHCP request options"
+ flavor booldata
+ default_value 0
+ active_if CYGOPT_NET_DHCP_DHCP_THREAD
+ description "
+ This option replaces the default list of requested
+ options in the DHCP/BOOTP request list. These are a
+ comma separated list of TAG_xxx values."
+ }
+
+ cdl_option CYGOPT_NET_DHCP_PARM_REQ_LIST_ADDITIONAL {
+ display "Additional DHCP request options"
+ flavor booldata
+ default_value 0
+ active_if CYGOPT_NET_DHCP_DHCP_THREAD
+ description "
+ This option adds additional options to the list of
+ requested options in the DHCP/BOOTP request list.
+ These are a comma separated list of TAG_xxx values."
+ }
}
cdl_component CYGPKG_NET_IPV6_ROUTING {