1 <!-- Copyright (C) 2003 Red Hat, Inc. -->
2 <!-- This material may be distributed only subject to the terms -->
3 <!-- and conditions set forth in the Open Publication License, v1.0 -->
4 <!-- or later (the latest version is presently available at -->
5 <!-- http://www.opencontent.org/openpub/). -->
6 <!-- Distribution of the work or derivative of the work in any -->
7 <!-- standard (paper) book form is prohibited unless prior -->
8 <!-- permission is obtained from the copyright holder. -->
12 >Configuring IP Addresses</TITLE
13 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
16 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
19 TITLE="eCos Reference Manual"
20 HREF="ecos-ref.html"><LINK
22 TITLE="TCP/IP Stack Support for eCos"
23 HREF="net-common-tcpip.html"><LINK
26 HREF="net-common-sample-code.html"><LINK
28 TITLE="Tests and Demonstrations"
29 HREF="net-common-tests-and-demonstrations.html"></HEAD
40 SUMMARY="Header navigation table"
49 >eCos Reference Manual</TH
57 HREF="net-common-sample-code.html"
71 HREF="net-common-tests-and-demonstrations.html"
84 NAME="NET-COMMON-CONFIGURING-IP-ADDRESSES">Chapter 35. Configuring IP Addresses</H1
86 >Each interface (“eth0” and “eth1”)
87 has independent configuration of its setup. Each can be set up
88 manually (in which case you must write code to do this), or by using
93 or explicitly, with configured values. If additional
94 interfaces are added, these must be configured manually.</P
96 >The configurable values are: </P
110 >broadcast address</P
122 >Server address is the DHCP server if applicable, but in addition,
123 many test cases use it as “the machine to talk to” in
124 whatever manner the test exercises the protocol stack.</P
126 >The initialization is invoked by calling the C routine
134 CLASS="PROGRAMLISTING"
137 >init_all_network_interfaces</TT
144 >Additionally, if the system is configured to support IPv6 then each
145 interface may have an address assigned which is a composite of a 64 bit
146 prefix and the 32 bit IPv4 address for that interface.
147 The prefix is controlled by the CDL setting
148 CYGHWR_NET_DRIVER_ETH0_IPV6_PREFIX for “eth0”, etc.
149 This is a CDL booldata type, allowing this address to be suppressed if
152 >Refer to the test cases,
155 >…/packages/net/common/<TT
160 >/tests/ftp_test.c</TT
162 for example usage, and the source files in
165 >…/packages/net/common/<TT
170 >/src/bootp_support.c</TT
175 >network_support.c</TT
177 to see what that call does.</P
179 >This assumes that the MAC address (also known as
183 > or Ethernet Station Address)
184 is already defined in the
185 serial EEPROM or however the particular target implements this;
186 support for setting the MAC address is hardware dependent.</P
188 >DHCP support is active by default, and there are configuration
189 options to control it. Firstly, in the top level of the
190 “Networking” configuration
191 tree, “Use full DHCP instead of BOOTP” enables
192 DHCP, and it contains an option to have the system provide a thread
193 to renew DHCP leases and manage lease expiry. Secondly, the individual
194 interfaces “eth0” and “eth1” each
195 have new options within the “Use BOOTP/DHCP to
196 initialize ‘<SPAN
203 select whether to use DHCP rather than BOOTP.</P
205 >Note that you are completely at liberty to ignore this startup code and its
206 configuration in building your application.
209 >init_all_network_interfaces()</TT
211 is provided for three main purposes:
217 >For use by Red Hat's own test programs.</P
221 >As an easy “get you going” utility for
229 >As readable example code from which further development
235 >If your application has different requirements for bringing up
236 available network interfaces, setting up routes, determining IP addresses
237 and the like from the defaults that the example code provides, you can
238 write your own initialization code to use whatever sequence of
243 calls carries out the desired setup. Analogously, in larger systems,
244 a sequence of “ifconfig” invocations is used; these mostly
248 > calls to manipulate the state of
249 the interface in question.</P
256 SUMMARY="Footer navigation table"
267 HREF="net-common-sample-code.html"
285 HREF="net-common-tests-and-demonstrations.html"
301 HREF="net-common-tcpip.html"
309 >Tests and Demonstrations</TD