]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - doc/html/ref/net-ftpclient-features.html
RedBoot TX53 Release 2012-02-15
[karo-tx-redboot.git] / doc / html / ref / net-ftpclient-features.html
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.               -->
9 <HTML
10 ><HEAD
11 ><TITLE
12 >FTP Client Features</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="FTP Client for eCos TCP/IP Stack"
23 HREF="net-ftpclient.html"><LINK
24 REL="PREVIOUS"
25 TITLE="FTP Client for eCos TCP/IP Stack"
26 HREF="net-ftpclient.html"><LINK
27 REL="NEXT"
28 TITLE="CRC Algorithms"
29 HREF="services-crc.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="net-ftpclient.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="services-crc.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="NET-FTPCLIENT-FEATURES">Chapter 49. FTP Client Features</H1
85 ><DIV
86 CLASS="SECT1"
87 ><H1
88 CLASS="SECT1"
89 ><A
90 NAME="NET-FTPCLIENT-FEATURES-API">FTP Client API</H1
91 ><P
92 >This package implements an FTP client.  The API is in include file
93 <TT
94 CLASS="FILENAME"
95 >install/include/ftpclient.h</TT
96 > and it can be used thus:
97 <TABLE
98 BORDER="5"
99 BGCOLOR="#E0E0F0"
100 WIDTH="70%"
101 ><TR
102 ><TD
103 ><PRE
104 CLASS="PROGRAMLISTING"
105 >#include &lt;network.h&gt;
106 #include &lt;ftpclient.h&gt;</PRE
107 ></TD
108 ></TR
109 ></TABLE
110 >
111 It looks like this:</P
112 ><DIV
113 CLASS="SECT2"
114 ><H2
115 CLASS="SECT2"
116 ><A
117 NAME="NET-FTPCLIENT-FEATURES-API-GET">ftp_get</H2
118 ><TABLE
119 BORDER="5"
120 BGCOLOR="#E0E0F0"
121 WIDTH="70%"
122 ><TR
123 ><TD
124 ><PRE
125 CLASS="PROGRAMLISTING"
126 >int ftp_get(char &#0042; hostname, 
127             char &#0042; username, 
128             char &#0042; passwd, 
129             char &#0042; filename, 
130             char &#0042; buf, 
131             unsigned buf_size,
132             ftp_printf_t ftp_printf);</PRE
133 ></TD
134 ></TR
135 ></TABLE
136 ><P
137 >Use the FTP protocol to retrieve a file from a server. Only binary
138 mode is supported. The filename can include a directory name. Only
139 use unix style &#8216;/&#8217; file separators,
140 not &#8216;\&#8217;.
141 The file is placed into <TT
142 CLASS="PARAMETER"
143 ><I
144 >buf</I
145 ></TT
146 >.
147 <TT
148 CLASS="PARAMETER"
149 ><I
150 >buf</I
151 ></TT
152 > has maximum size <TT
153 CLASS="PARAMETER"
154 ><I
155 >buf_size</I
156 ></TT
157 >.
158 If the file is bigger than this, the
159 transfer fails and <SPAN
160 CLASS="ERRORCODE"
161 >FTP_TOOBIG</SPAN
162 > is returned.
163 Other error codes listed in the header can also be returned.
164 If the transfer is successful the number of bytes received is returned.</P
165 ></DIV
166 ><DIV
167 CLASS="SECT2"
168 ><H2
169 CLASS="SECT2"
170 ><A
171 NAME="NET-FTPCLIENT-FEATURES-API-PUT">ftp_put</H2
172 ><TABLE
173 BORDER="5"
174 BGCOLOR="#E0E0F0"
175 WIDTH="70%"
176 ><TR
177 ><TD
178 ><PRE
179 CLASS="PROGRAMLISTING"
180 >int ftp_put(char &#0042; hostname, 
181             char &#0042; username, 
182             char &#0042; passwd, 
183             char &#0042; filename, 
184             char &#0042; buf, 
185             unsigned buf_size,
186             ftp_printf_t ftp_printf);</PRE
187 ></TD
188 ></TR
189 ></TABLE
190 ><P
191 >Use the FTP protocol to send a file to a server.
192 Only binary
193 mode is supported. The filename can include a directory name. Only
194 use unix style &#8216;/&#8217; file separators,
195 not &#8216;\&#8217;.
196 The contents of <TT
197 CLASS="PARAMETER"
198 ><I
199 >buf</I
200 ></TT
201 > are placed into the file on the
202 server. If an error occurs one of the codes listed will be returned. If the
203 transfer is successful zero is returned.</P
204 ></DIV
205 ><DIV
206 CLASS="SECT2"
207 ><H2
208 CLASS="SECT2"
209 ><A
210 NAME="NET-FTPCLIENT-FEATURES-API-PRINTF">ftpclient_printf</H2
211 ><TABLE
212 BORDER="5"
213 BGCOLOR="#E0E0F0"
214 WIDTH="70%"
215 ><TR
216 ><TD
217 ><PRE
218 CLASS="PROGRAMLISTING"
219 >void ftpclient_printf(unsigned error, const char *fmt, ...);</PRE
220 ></TD
221 ></TR
222 ></TABLE
223 ><P
224 ><TT
225 CLASS="FUNCTION"
226 >ftp_get()</TT
227 > and <TT
228 CLASS="FUNCTION"
229 >ftp_put</TT
230 >
231 take a pointer to a function to use for printing
232 out diagnostic and error messages. This is a sample implementation
233 which can be used if you don't want to implement the function
234 yourself.
235 <TT
236 CLASS="PARAMETER"
237 ><I
238 >error</I
239 ></TT
240 > will be true when the message to print is an
241 error message. Otherwise the message is diagnostic, eg. the commands sent
242 and received from the server.</P
243 ></DIV
244 ></DIV
245 ></DIV
246 ><DIV
247 CLASS="NAVFOOTER"
248 ><HR
249 ALIGN="LEFT"
250 WIDTH="100%"><TABLE
251 SUMMARY="Footer navigation table"
252 WIDTH="100%"
253 BORDER="0"
254 CELLPADDING="0"
255 CELLSPACING="0"
256 ><TR
257 ><TD
258 WIDTH="33%"
259 ALIGN="left"
260 VALIGN="top"
261 ><A
262 HREF="net-ftpclient.html"
263 ACCESSKEY="P"
264 >Prev</A
265 ></TD
266 ><TD
267 WIDTH="34%"
268 ALIGN="center"
269 VALIGN="top"
270 ><A
271 HREF="ecos-ref.html"
272 ACCESSKEY="H"
273 >Home</A
274 ></TD
275 ><TD
276 WIDTH="33%"
277 ALIGN="right"
278 VALIGN="top"
279 ><A
280 HREF="services-crc.html"
281 ACCESSKEY="N"
282 >Next</A
283 ></TD
284 ></TR
285 ><TR
286 ><TD
287 WIDTH="33%"
288 ALIGN="left"
289 VALIGN="top"
290 >FTP Client for eCos TCP/IP Stack</TD
291 ><TD
292 WIDTH="34%"
293 ALIGN="center"
294 VALIGN="top"
295 ><A
296 HREF="net-ftpclient.html"
297 ACCESSKEY="U"
298 >Up</A
299 ></TD
300 ><TD
301 WIDTH="33%"
302 ALIGN="right"
303 VALIGN="top"
304 >CRC Algorithms</TD
305 ></TR
306 ></TABLE
307 ></DIV
308 ></BODY
309 ></HTML
310 >