This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Re: [ECOS] build_bootp_record() support dns server address
- From: Motoya Kurotsu <kurotsu at allied-telesis dot co dot jp>
- To: ecos-patches at sources dot redhat dot com
- Date: Thu, 9 Jan 2003 18:56:47 +0900
- Subject: Re: [ECOS] build_bootp_record() support dns server address
- References: <20030109151441.A16152@white.office1> <3E1D1CC3.5070004@eCosCentric.com>
Hi, jifl;
I would like to submit the patch. Please check it.
Motoya Kurotsu
Allied Telesis K.K.
===============================================================
diff -uNr common.orig/current/ChangeLog common/current/ChangeLog
--- common.orig/current/ChangeLog Sun Jan 5 03:46:39 2003
+++ common/current/ChangeLog Thu Jan 9 18:44:17 2003
@@ -1,3 +1,9 @@
+2003-01-09 Motoya Kurotsu <kurotsu@allied-telesis.co.jp>
+
+ * src/network_support.c (build_bootp_record):
+ * include/bootp.h:
+ * cdl/net.cdl: Add statical dns server address support
+
2003-01-04 Jonathan Larmour <jifl@eCosCentric.com>
* doc/tcpip.sgml: Use new entity name for tcpip manpages.
diff -uNr common.orig/current/cdl/net.cdl common/current/cdl/net.cdl
--- common.orig/current/cdl/net.cdl Tue May 21 07:25:03 2002
+++ common/current/cdl/net.cdl Thu Jan 9 18:27:41 2003
@@ -509,6 +509,12 @@
flavor data
default_value { "192.168.1.101" }
}
+
+ cdl_option CYGHWR_NET_DRIVER_ETH0_ADDRS_DNS_SERVER {
+ display "DNS server IP address for 'eth0'"
+ flavor data
+ default_value { "192.168.1.102" }
+ }
}
}
@@ -637,6 +643,12 @@
display "Server IP address for 'eth1'"
flavor data
default_value { "192.168.1.101" }
+ }
+
+ cdl_option CYGHWR_NET_DRIVER_ETH1_ADDRS_DNS_SERVER {
+ display "DNS server IP address for 'eth1'"
+ flavor data
+ default_value { "192.168.1.102" }
}
}
}
diff -uNr common.orig/current/include/bootp.h common/current/include/bootp.h
--- common.orig/current/include/bootp.h Tue May 21 07:25:03 2002
+++ common/current/include/bootp.h Thu Jan 9 18:19:32 2003
@@ -325,7 +325,8 @@
const char *addrs_netmask,
const char *addrs_broadcast,
const char *addrs_gateway,
- const char *addrs_server);
+ const char *addrs_server,
+ const char *addrs_dns_server);
// Do bootp to fill in the bootp record from the net (other interfaces must
// be down for this to work, because of the "half-up" state of the
diff -uNr common.orig/current/src/network_support.c common/current/src/network_support.c
--- common.orig/current/src/network_support.c Tue May 21 07:25:05 2002
+++ common/current/src/network_support.c Thu Jan 9 18:17:52 2003
@@ -201,7 +201,8 @@
const char *addrs_netmask,
const char *addrs_broadcast,
const char *addrs_gateway,
- const char *addrs_server)
+ const char *addrs_server,
+ const char *addrs_dns_server)
{
int i, s;
in_addr_t addr;
@@ -241,6 +242,8 @@
vp = add_tag(vp, TAG_IP_BROADCAST, &addr, sizeof(in_addr_t));
addr = inet_addr(addrs_gateway);
vp = add_tag(vp, TAG_GATEWAY, &addr, sizeof(in_addr_t));
+ addr = inet_addr(addrs_dns_server);
+ vp = add_tag(vp, TAG_DOMAIN_SERVER, &addr, sizeof(in_addr_t));
*vp = TAG_END;
}
@@ -312,7 +315,8 @@
string(CYGHWR_NET_DRIVER_ETH0_ADDRS_NETMASK),
string(CYGHWR_NET_DRIVER_ETH0_ADDRS_BROADCAST),
string(CYGHWR_NET_DRIVER_ETH0_ADDRS_GATEWAY),
- string(CYGHWR_NET_DRIVER_ETH0_ADDRS_SERVER));
+ string(CYGHWR_NET_DRIVER_ETH0_ADDRS_SERVER),
+ string(CYGHWR_NET_DRIVER_ETH0_ADDRS_DNS_SERVER));
show_bootp(eth0_name, ð0_bootp_data);
#endif
#ifdef CYGPKG_IO_PCMCIA
@@ -366,7 +370,8 @@
string(CYGHWR_NET_DRIVER_ETH1_ADDRS_NETMASK),
string(CYGHWR_NET_DRIVER_ETH1_ADDRS_BROADCAST),
string(CYGHWR_NET_DRIVER_ETH1_ADDRS_GATEWAY),
- string(CYGHWR_NET_DRIVER_ETH1_ADDRS_SERVER));
+ string(CYGHWR_NET_DRIVER_ETH1_ADDRS_SERVER),
+ string(CYGHWR_NET_DRIVER_ETH1_ADDRS_DNS_SERVER));
show_bootp(eth1_name, ð1_bootp_data);
#endif
#ifdef CYGPKG_IO_PCMCIA
On Thu, Jan 09, 2003 at 06:54:59AM +0000, Jonathan Larmour wrote:
> Motoya Kurotsu wrote:
> > Hi, all;
> >
> > I would like to hear your advice about my idea regarding
> > init_all_network_interfaces().
> >
> > When ip address is staticaly set (i.e. CYGHWR_NET_DRIVER_ETHX_BOOTP is
> > undefined), init_net() doesn't call cyg_dns_res_init(). So I think it is
> > better to modify build_bootp_record() to have the dns server address
> > like in the following:
> >
> > build_bootp_record(struct bootp *bp,
> > const char *if_name,
> > const char *addrs_ip,
> > const char *addrs_netmask,
> > const char *addrs_broadcast,
> > const char *addrs_gateway,
> > const char *addrs_server,
> > const char *addrs_dns_server); <---
> >
> > Also the dns server address might be added in cdl script like other addresses.
> > The attachment is my patch for network_support.c for reference.
>
> Looks pretty reasonable to me. All that remains is to add the CDL option
> for CYGHWR_NET_DRIVER_ETH1_ADDRS_DNS_SERVER, write a ChangeLog entry and
> submit it to <ecos-patches@sources.redhat.com> and I'll commit it for you.
>