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. -->
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="OpenBSD TCP/IP Stack port for eCos"
23 HREF="tcpip-openbsd.html"><LINK
25 TITLE="Building the Network Stack"
26 HREF="tcpip-openbsd-building-the-network-stack.html"><LINK
28 TITLE="Enhanced Select()"
29 HREF="tcpip-openbsd-enhanced-select.html"></HEAD
40 SUMMARY="Header navigation table"
49 >eCos Reference Manual</TH
57 HREF="tcpip-openbsd-building-the-network-stack.html"
71 HREF="tcpip-openbsd-enhanced-select.html"
84 NAME="TCPIP-OPENBSD-TCPIP-APIS">Chapter 44. APIs</H1
94 HREF="tcpip-openbsd-tcpip-apis.html#TCPIP-OPENBSD-STANDARD-NETWORKING-API"
95 >Standard networking</A
99 HREF="tcpip-openbsd-enhanced-select.html"
100 >Enhanced Select()</A
109 NAME="TCPIP-OPENBSD-STANDARD-NETWORKING-API">Standard networking</H1
111 >The APIs for the standard networking calls such as
119 in header files relative to the top-level
120 include directory, within the standard subdirectories as conventionally
132 CLASS="PROGRAMLISTING"
133 > install/include/arpa/tftp.h
134 install/include/netinet/tcpip.h
135 install/include/sys/socket.h
136 install/include/sys/socketvar.h
137 install/include/sys/sockio.h</PRE
147 defines various extensions, for example the API
150 >init_all_network_interfaces(void)</TT
153 above. We advise including <TT
157 you use these features or not.</P
159 >In general, using the networking code may require definition
160 of two symbols: _KERNEL and __ECOS. _KERNEL
161 is not normally required; __ECOS is normally required.
162 So add this to your compile lines for files which use the network
171 CLASS="PROGRAMLISTING"
177 >To expand a little, it’s like this because this is
178 a port of a standard distribution external to Red Hat. One goal
179 is to perturb the sources as little as possible, so that upgrading
180 and maintenance from the external distribution is simplified. The __ECOS
181 symbol marks out Red Hat’s additions in making the port.
182 The _KERNEL symbol is traditional UNIX practice: it distinguishes
183 a compilation which is to be linked into the kernel from one which
184 is part of an application. eCos applications are fully linked,
185 so this distinction does not apply. _KERNEL can however
186 be used to control the visibility of the internals of the stack,
187 so depending on what features your application uses, it may or may
190 >The include file <TT
194 unconditionally, to provide an application-like compilation environment.
195 If you were writing code which, for example,
196 enumerates the stack’s internal
197 structures, that is a kernel-like compilation environment, so you
198 would need to define _KERNEL (in addition to __ECOS)
199 and avoid including <TT
210 SUMMARY="Footer navigation table"
221 HREF="tcpip-openbsd-building-the-network-stack.html"
239 HREF="tcpip-openbsd-enhanced-select.html"
249 >Building the Network Stack</TD
255 HREF="tcpip-openbsd.html"
263 >Enhanced Select()</TD