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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [doc/] [html/] [ref/] [net-ftpclient-features.html] - Diff between revs 28 and 174

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 28 Rev 174
<!-- Copyright (C) 2003 Red Hat, Inc.                                -->
<!-- Copyright (C) 2003 Red Hat, Inc.                                -->
<!-- This material may be distributed only subject to the terms      -->
<!-- This material may be distributed only subject to the terms      -->
<!-- and conditions set forth in the Open Publication License, v1.0  -->
<!-- and conditions set forth in the Open Publication License, v1.0  -->
<!-- or later (the latest version is presently available at          -->
<!-- or later (the latest version is presently available at          -->
<!-- http://www.opencontent.org/openpub/).                           -->
<!-- http://www.opencontent.org/openpub/).                           -->
<!-- Distribution of the work or derivative of the work in any       -->
<!-- Distribution of the work or derivative of the work in any       -->
<!-- standard (paper) book form is prohibited unless prior           -->
<!-- standard (paper) book form is prohibited unless prior           -->
<!-- permission is obtained from the copyright holder.               -->
<!-- permission is obtained from the copyright holder.               -->
<HTML
<HTML
><HEAD
><HEAD
><TITLE
><TITLE
>FTP Client Features</TITLE
>FTP Client Features</TITLE
><meta name="MSSmartTagsPreventParsing" content="TRUE">
><meta name="MSSmartTagsPreventParsing" content="TRUE">
<META
<META
NAME="GENERATOR"
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
"><LINK
REL="HOME"
REL="HOME"
TITLE="eCos Reference Manual"
TITLE="eCos Reference Manual"
HREF="ecos-ref.html"><LINK
HREF="ecos-ref.html"><LINK
REL="UP"
REL="UP"
TITLE="FTP Client for eCos TCP/IP Stack"
TITLE="FTP Client for eCos TCP/IP Stack"
HREF="net-ftpclient.html"><LINK
HREF="net-ftpclient.html"><LINK
REL="PREVIOUS"
REL="PREVIOUS"
TITLE="FTP Client for eCos TCP/IP Stack"
TITLE="FTP Client for eCos TCP/IP Stack"
HREF="net-ftpclient.html"><LINK
HREF="net-ftpclient.html"><LINK
REL="NEXT"
REL="NEXT"
TITLE="CRC Algorithms"
TITLE="CRC Algorithms"
HREF="services-crc.html"></HEAD
HREF="services-crc.html"></HEAD
><BODY
><BODY
CLASS="CHAPTER"
CLASS="CHAPTER"
BGCOLOR="#FFFFFF"
BGCOLOR="#FFFFFF"
TEXT="#000000"
TEXT="#000000"
LINK="#0000FF"
LINK="#0000FF"
VLINK="#840084"
VLINK="#840084"
ALINK="#0000FF"
ALINK="#0000FF"
><DIV
><DIV
CLASS="NAVHEADER"
CLASS="NAVHEADER"
><TABLE
><TABLE
SUMMARY="Header navigation table"
SUMMARY="Header navigation table"
WIDTH="100%"
WIDTH="100%"
BORDER="0"
BORDER="0"
CELLPADDING="0"
CELLPADDING="0"
CELLSPACING="0"
CELLSPACING="0"
><TR
><TR
><TH
><TH
COLSPAN="3"
COLSPAN="3"
ALIGN="center"
ALIGN="center"
>eCos Reference Manual</TH
>eCos Reference Manual</TH
></TR
></TR
><TR
><TR
><TD
><TD
WIDTH="10%"
WIDTH="10%"
ALIGN="left"
ALIGN="left"
VALIGN="bottom"
VALIGN="bottom"
><A
><A
HREF="net-ftpclient.html"
HREF="net-ftpclient.html"
ACCESSKEY="P"
ACCESSKEY="P"
>Prev</A
>Prev</A
></TD
></TD
><TD
><TD
WIDTH="80%"
WIDTH="80%"
ALIGN="center"
ALIGN="center"
VALIGN="bottom"
VALIGN="bottom"
></TD
></TD
><TD
><TD
WIDTH="10%"
WIDTH="10%"
ALIGN="right"
ALIGN="right"
VALIGN="bottom"
VALIGN="bottom"
><A
><A
HREF="services-crc.html"
HREF="services-crc.html"
ACCESSKEY="N"
ACCESSKEY="N"
>Next</A
>Next</A
></TD
></TD
></TR
></TR
></TABLE
></TABLE
><HR
><HR
ALIGN="LEFT"
ALIGN="LEFT"
WIDTH="100%"></DIV
WIDTH="100%"></DIV
><DIV
><DIV
CLASS="CHAPTER"
CLASS="CHAPTER"
><H1
><H1
><A
><A
NAME="NET-FTPCLIENT-FEATURES">Chapter 49. FTP Client Features</H1
NAME="NET-FTPCLIENT-FEATURES">Chapter 49. FTP Client Features</H1
><DIV
><DIV
CLASS="SECT1"
CLASS="SECT1"
><H1
><H1
CLASS="SECT1"
CLASS="SECT1"
><A
><A
NAME="NET-FTPCLIENT-FEATURES-API">FTP Client API</H1
NAME="NET-FTPCLIENT-FEATURES-API">FTP Client API</H1
><P
><P
>This package implements an FTP client.  The API is in include file
>This package implements an FTP client.  The API is in include file
<TT
<TT
CLASS="FILENAME"
CLASS="FILENAME"
>install/include/ftpclient.h</TT
>install/include/ftpclient.h</TT
> and it can be used thus:
> and it can be used thus:
<TABLE
<TABLE
BORDER="5"
BORDER="5"
BGCOLOR="#E0E0F0"
BGCOLOR="#E0E0F0"
WIDTH="70%"
WIDTH="70%"
><TR
><TR
><TD
><TD
><PRE
><PRE
CLASS="PROGRAMLISTING"
CLASS="PROGRAMLISTING"
>#include &lt;network.h&gt;
>#include &lt;network.h&gt;
#include &lt;ftpclient.h&gt;</PRE
#include &lt;ftpclient.h&gt;</PRE
></TD
></TD
></TR
></TR
></TABLE
></TABLE
>
>
It looks like this:</P
It looks like this:</P
><DIV
><DIV
CLASS="SECT2"
CLASS="SECT2"
><H2
><H2
CLASS="SECT2"
CLASS="SECT2"
><A
><A
NAME="NET-FTPCLIENT-FEATURES-API-GET">ftp_get</H2
NAME="NET-FTPCLIENT-FEATURES-API-GET">ftp_get</H2
><TABLE
><TABLE
BORDER="5"
BORDER="5"
BGCOLOR="#E0E0F0"
BGCOLOR="#E0E0F0"
WIDTH="70%"
WIDTH="70%"
><TR
><TR
><TD
><TD
><PRE
><PRE
CLASS="PROGRAMLISTING"
CLASS="PROGRAMLISTING"
>int ftp_get(char &#0042; hostname,
>int ftp_get(char &#0042; hostname,
            char &#0042; username,
            char &#0042; username,
            char &#0042; passwd,
            char &#0042; passwd,
            char &#0042; filename,
            char &#0042; filename,
            char &#0042; buf,
            char &#0042; buf,
            unsigned buf_size,
            unsigned buf_size,
            ftp_printf_t ftp_printf);</PRE
            ftp_printf_t ftp_printf);</PRE
></TD
></TD
></TR
></TR
></TABLE
></TABLE
><P
><P
>Use the FTP protocol to retrieve a file from a server. Only binary
>Use the FTP protocol to retrieve a file from a server. Only binary
mode is supported. The filename can include a directory name. Only
mode is supported. The filename can include a directory name. Only
use unix style &#8216;/&#8217; file separators,
use unix style &#8216;/&#8217; file separators,
not &#8216;\&#8217;.
not &#8216;\&#8217;.
The file is placed into <TT
The file is placed into <TT
CLASS="PARAMETER"
CLASS="PARAMETER"
><I
><I
>buf</I
>buf</I
></TT
></TT
>.
>.
<TT
<TT
CLASS="PARAMETER"
CLASS="PARAMETER"
><I
><I
>buf</I
>buf</I
></TT
></TT
> has maximum size <TT
> has maximum size <TT
CLASS="PARAMETER"
CLASS="PARAMETER"
><I
><I
>buf_size</I
>buf_size</I
></TT
></TT
>.
>.
If the file is bigger than this, the
If the file is bigger than this, the
transfer fails and <SPAN
transfer fails and <SPAN
CLASS="ERRORCODE"
CLASS="ERRORCODE"
>FTP_TOOBIG</SPAN
>FTP_TOOBIG</SPAN
> is returned.
> is returned.
Other error codes listed in the header can also be returned.
Other error codes listed in the header can also be returned.
If the transfer is successful the number of bytes received is returned.</P
If the transfer is successful the number of bytes received is returned.</P
></DIV
></DIV
><DIV
><DIV
CLASS="SECT2"
CLASS="SECT2"
><H2
><H2
CLASS="SECT2"
CLASS="SECT2"
><A
><A
NAME="NET-FTPCLIENT-FEATURES-API-PUT">ftp_put</H2
NAME="NET-FTPCLIENT-FEATURES-API-PUT">ftp_put</H2
><TABLE
><TABLE
BORDER="5"
BORDER="5"
BGCOLOR="#E0E0F0"
BGCOLOR="#E0E0F0"
WIDTH="70%"
WIDTH="70%"
><TR
><TR
><TD
><TD
><PRE
><PRE
CLASS="PROGRAMLISTING"
CLASS="PROGRAMLISTING"
>int ftp_put(char &#0042; hostname,
>int ftp_put(char &#0042; hostname,
            char &#0042; username,
            char &#0042; username,
            char &#0042; passwd,
            char &#0042; passwd,
            char &#0042; filename,
            char &#0042; filename,
            char &#0042; buf,
            char &#0042; buf,
            unsigned buf_size,
            unsigned buf_size,
            ftp_printf_t ftp_printf);</PRE
            ftp_printf_t ftp_printf);</PRE
></TD
></TD
></TR
></TR
></TABLE
></TABLE
><P
><P
>Use the FTP protocol to send a file to a server.
>Use the FTP protocol to send a file to a server.
Only binary
Only binary
mode is supported. The filename can include a directory name. Only
mode is supported. The filename can include a directory name. Only
use unix style &#8216;/&#8217; file separators,
use unix style &#8216;/&#8217; file separators,
not &#8216;\&#8217;.
not &#8216;\&#8217;.
The contents of <TT
The contents of <TT
CLASS="PARAMETER"
CLASS="PARAMETER"
><I
><I
>buf</I
>buf</I
></TT
></TT
> are placed into the file on the
> are placed into the file on the
server. If an error occurs one of the codes listed will be returned. If the
server. If an error occurs one of the codes listed will be returned. If the
transfer is successful zero is returned.</P
transfer is successful zero is returned.</P
></DIV
></DIV
><DIV
><DIV
CLASS="SECT2"
CLASS="SECT2"
><H2
><H2
CLASS="SECT2"
CLASS="SECT2"
><A
><A
NAME="NET-FTPCLIENT-FEATURES-API-PRINTF">ftpclient_printf</H2
NAME="NET-FTPCLIENT-FEATURES-API-PRINTF">ftpclient_printf</H2
><TABLE
><TABLE
BORDER="5"
BORDER="5"
BGCOLOR="#E0E0F0"
BGCOLOR="#E0E0F0"
WIDTH="70%"
WIDTH="70%"
><TR
><TR
><TD
><TD
><PRE
><PRE
CLASS="PROGRAMLISTING"
CLASS="PROGRAMLISTING"
>void ftpclient_printf(unsigned error, const char *fmt, ...);</PRE
>void ftpclient_printf(unsigned error, const char *fmt, ...);</PRE
></TD
></TD
></TR
></TR
></TABLE
></TABLE
><P
><P
><TT
><TT
CLASS="FUNCTION"
CLASS="FUNCTION"
>ftp_get()</TT
>ftp_get()</TT
> and <TT
> and <TT
CLASS="FUNCTION"
CLASS="FUNCTION"
>ftp_put</TT
>ftp_put</TT
>
>
take a pointer to a function to use for printing
take a pointer to a function to use for printing
out diagnostic and error messages. This is a sample implementation
out diagnostic and error messages. This is a sample implementation
which can be used if you don't want to implement the function
which can be used if you don't want to implement the function
yourself.
yourself.
<TT
<TT
CLASS="PARAMETER"
CLASS="PARAMETER"
><I
><I
>error</I
>error</I
></TT
></TT
> will be true when the message to print is an
> will be true when the message to print is an
error message. Otherwise the message is diagnostic, eg. the commands sent
error message. Otherwise the message is diagnostic, eg. the commands sent
and received from the server.</P
and received from the server.</P
></DIV
></DIV
></DIV
></DIV
></DIV
></DIV
><DIV
><DIV
CLASS="NAVFOOTER"
CLASS="NAVFOOTER"
><HR
><HR
ALIGN="LEFT"
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
SUMMARY="Footer navigation table"
WIDTH="100%"
WIDTH="100%"
BORDER="0"
BORDER="0"
CELLPADDING="0"
CELLPADDING="0"
CELLSPACING="0"
CELLSPACING="0"
><TR
><TR
><TD
><TD
WIDTH="33%"
WIDTH="33%"
ALIGN="left"
ALIGN="left"
VALIGN="top"
VALIGN="top"
><A
><A
HREF="net-ftpclient.html"
HREF="net-ftpclient.html"
ACCESSKEY="P"
ACCESSKEY="P"
>Prev</A
>Prev</A
></TD
></TD
><TD
><TD
WIDTH="34%"
WIDTH="34%"
ALIGN="center"
ALIGN="center"
VALIGN="top"
VALIGN="top"
><A
><A
HREF="ecos-ref.html"
HREF="ecos-ref.html"
ACCESSKEY="H"
ACCESSKEY="H"
>Home</A
>Home</A
></TD
></TD
><TD
><TD
WIDTH="33%"
WIDTH="33%"
ALIGN="right"
ALIGN="right"
VALIGN="top"
VALIGN="top"
><A
><A
HREF="services-crc.html"
HREF="services-crc.html"
ACCESSKEY="N"
ACCESSKEY="N"
>Next</A
>Next</A
></TD
></TD
></TR
></TR
><TR
><TR
><TD
><TD
WIDTH="33%"
WIDTH="33%"
ALIGN="left"
ALIGN="left"
VALIGN="top"
VALIGN="top"
>FTP Client for eCos TCP/IP Stack</TD
>FTP Client for eCos TCP/IP Stack</TD
><TD
><TD
WIDTH="34%"
WIDTH="34%"
ALIGN="center"
ALIGN="center"
VALIGN="top"
VALIGN="top"
><A
><A
HREF="net-ftpclient.html"
HREF="net-ftpclient.html"
ACCESSKEY="U"
ACCESSKEY="U"
>Up</A
>Up</A
></TD
></TD
><TD
><TD
WIDTH="33%"
WIDTH="33%"
ALIGN="right"
ALIGN="right"
VALIGN="top"
VALIGN="top"
>CRC Algorithms</TD
>CRC Algorithms</TD
></TR
></TR
></TABLE
></TABLE
></DIV
></DIV
></BODY
></BODY
></HTML
></HTML
 
 

powered by: WebSVN 2.1.0

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