OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [doc/] [html/] [ref/] [tcpip-openbsd-tcpip-apis.html] - Blame information for rev 201

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 28 unneback
<!-- 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.               -->
9
<HTML
10
><HEAD
11
><TITLE
12
>APIs</TITLE
13
><meta name="MSSmartTagsPreventParsing" content="TRUE">
14
<META
15
NAME="GENERATOR"
16
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
17
"><LINK
18
REL="HOME"
19
TITLE="eCos Reference Manual"
20
HREF="ecos-ref.html"><LINK
21
REL="UP"
22
TITLE="OpenBSD TCP/IP Stack port for eCos"
23
HREF="tcpip-openbsd.html"><LINK
24
REL="PREVIOUS"
25
TITLE="Building the Network Stack"
26
HREF="tcpip-openbsd-building-the-network-stack.html"><LINK
27
REL="NEXT"
28
TITLE="Enhanced Select()"
29
HREF="tcpip-openbsd-enhanced-select.html"></HEAD
30
><BODY
31
CLASS="CHAPTER"
32
BGCOLOR="#FFFFFF"
33
TEXT="#000000"
34
LINK="#0000FF"
35
VLINK="#840084"
36
ALINK="#0000FF"
37
><DIV
38
CLASS="NAVHEADER"
39
><TABLE
40
SUMMARY="Header navigation table"
41
WIDTH="100%"
42
BORDER="0"
43
CELLPADDING="0"
44
CELLSPACING="0"
45
><TR
46
><TH
47
COLSPAN="3"
48
ALIGN="center"
49
>eCos Reference Manual</TH
50
></TR
51
><TR
52
><TD
53
WIDTH="10%"
54
ALIGN="left"
55
VALIGN="bottom"
56
><A
57
HREF="tcpip-openbsd-building-the-network-stack.html"
58
ACCESSKEY="P"
59
>Prev</A
60
></TD
61
><TD
62
WIDTH="80%"
63
ALIGN="center"
64
VALIGN="bottom"
65
></TD
66
><TD
67
WIDTH="10%"
68
ALIGN="right"
69
VALIGN="bottom"
70
><A
71
HREF="tcpip-openbsd-enhanced-select.html"
72
ACCESSKEY="N"
73
>Next</A
74
></TD
75
></TR
76
></TABLE
77
><HR
78
ALIGN="LEFT"
79
WIDTH="100%"></DIV
80
><DIV
81
CLASS="CHAPTER"
82
><H1
83
><A
84
NAME="TCPIP-OPENBSD-TCPIP-APIS">Chapter 44. APIs</H1
85
><DIV
86
CLASS="TOC"
87
><DL
88
><DT
89
><B
90
>Table of Contents</B
91
></DT
92
><DT
93
><A
94
HREF="tcpip-openbsd-tcpip-apis.html#TCPIP-OPENBSD-STANDARD-NETWORKING-API"
95
>Standard networking</A
96
></DT
97
><DT
98
><A
99
HREF="tcpip-openbsd-enhanced-select.html"
100
>Enhanced Select()</A
101
></DT
102
></DL
103
></DIV
104
><DIV
105
CLASS="SECT1"
106
><H1
107
CLASS="SECT1"
108
><A
109
NAME="TCPIP-OPENBSD-STANDARD-NETWORKING-API">Standard networking</H1
110
><P
111
>The APIs for the standard networking calls such as
112
<TT
113
CLASS="FUNCTION"
114
>socket()</TT
115
>, <TT
116
CLASS="FUNCTION"
117
>recv()</TT
118
> and so on, are
119
in header files relative to the top-level
120
include directory, within the standard subdirectories as conventionally
121
found in <TT
122
CLASS="FILENAME"
123
>/usr/include</TT
124
>.  For example:
125
<TABLE
126
BORDER="5"
127
BGCOLOR="#E0E0F0"
128
WIDTH="70%"
129
><TR
130
><TD
131
><PRE
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
138
></TD
139
></TR
140
></TABLE
141
></P
142
><P
143
><TT
144
CLASS="FILENAME"
145
>network.h</TT
146
> at the top level
147
defines various extensions, for example the API
148
<TT
149
CLASS="FUNCTION"
150
>init_all_network_interfaces(void)</TT
151
>
152
described
153
above.  We advise including <TT
154
CLASS="FILENAME"
155
>network.h</TT
156
> whether
157
you use these features or not.</P
158
><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
163
stack:</P
164
><TABLE
165
BORDER="5"
166
BGCOLOR="#E0E0F0"
167
WIDTH="70%"
168
><TR
169
><TD
170
><PRE
171
CLASS="PROGRAMLISTING"
172
>       -D__ECOS</PRE
173
></TD
174
></TR
175
></TABLE
176
><P
177
>To expand a little, it&#8217;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&#8217;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
188
not be necessary.</P
189
><P
190
>The include file <TT
191
CLASS="FILENAME"
192
>network.h</TT
193
> undefines _KERNEL
194
unconditionally, to provide an application-like compilation environment.
195
If you were writing code which, for example,
196
enumerates the stack&#8217;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
200
CLASS="FILENAME"
201
>network.h</TT
202
>.</P
203
></DIV
204
></DIV
205
><DIV
206
CLASS="NAVFOOTER"
207
><HR
208
ALIGN="LEFT"
209
WIDTH="100%"><TABLE
210
SUMMARY="Footer navigation table"
211
WIDTH="100%"
212
BORDER="0"
213
CELLPADDING="0"
214
CELLSPACING="0"
215
><TR
216
><TD
217
WIDTH="33%"
218
ALIGN="left"
219
VALIGN="top"
220
><A
221
HREF="tcpip-openbsd-building-the-network-stack.html"
222
ACCESSKEY="P"
223
>Prev</A
224
></TD
225
><TD
226
WIDTH="34%"
227
ALIGN="center"
228
VALIGN="top"
229
><A
230
HREF="ecos-ref.html"
231
ACCESSKEY="H"
232
>Home</A
233
></TD
234
><TD
235
WIDTH="33%"
236
ALIGN="right"
237
VALIGN="top"
238
><A
239
HREF="tcpip-openbsd-enhanced-select.html"
240
ACCESSKEY="N"
241
>Next</A
242
></TD
243
></TR
244
><TR
245
><TD
246
WIDTH="33%"
247
ALIGN="left"
248
VALIGN="top"
249
>Building the Network Stack</TD
250
><TD
251
WIDTH="34%"
252
ALIGN="center"
253
VALIGN="top"
254
><A
255
HREF="tcpip-openbsd.html"
256
ACCESSKEY="U"
257
>Up</A
258
></TD
259
><TD
260
WIDTH="33%"
261
ALIGN="right"
262
VALIGN="top"
263
>Enhanced Select()</TD
264
></TR
265
></TABLE
266
></DIV
267
></BODY
268
></HTML
269
>

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.