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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [net/] [ftpclient/] [current/] [doc/] [ftpclient.sgml] - Blame information for rev 786

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
2
 
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 
28
29
 
30
31
FTP Client for eCos TCP/IP Stack
32
33
34
The ftpclient package provides an FTP (File Transfer Protocol) client
35
for use with the TCP/IP stack in eCos. It supports both IPv4 and IPv6
36
and will use the DNS client, when its is part of the eCos configuration.
37
38
39
40
FTP Client Features
41
42
FTP Client API
43
44
This package implements an FTP client.  The API is in include file
45
install/include/ftpclient.h and it can be used thus:
46
47
#include <network.h>
48
#include <ftpclient.h>
49
50
It looks like this:
51
52
53
ftp_get
54
55
int ftp_get(char * hostname,
56
            char * username,
57
            char * passwd,
58
            char * filename,
59
            char * buf,
60
            unsigned buf_size,
61
            ftp_printf_t ftp_printf);
62
63
64
Use the FTP protocol to retrieve a file from a server. Only binary
65
mode is supported. The filename can include a directory name. Only
66
use unix style ‘/’ file separators,
67
not ‘\’.
68
The file is placed into buf.
69
buf has maximum size buf_size.
70
If the file is bigger than this, the
71
transfer fails and FTP_TOOBIG is returned.
72
Other error codes listed in the header can also be returned.
73
If the transfer is successful the number of bytes received is returned.
74
75
76
77
ftp_put
78
79
int ftp_put(char * hostname,
80
            char * username,
81
            char * passwd,
82
            char * filename,
83
            char * buf,
84
            unsigned buf_size,
85
            ftp_printf_t ftp_printf);
86
87
88
Use the FTP protocol to send a file to a server.
89
Only binary
90
mode is supported. The filename can include a directory name. Only
91
use unix style ‘/’ file separators,
92
not ‘\’.
93
The contents of buf are placed into the file on the
94
server. If an error occurs one of the codes listed will be returned. If the
95
transfer is successful zero is returned.
96
97
98
99
ftpclient_printf
100
101
void ftpclient_printf(unsigned error, const char *fmt, ...);
102
103
104
ftp_get() and ftp_put
105
take a pointer to a function to use for printing
106
out diagnostic and error messages. This is a sample implementation
107
which can be used if you don't want to implement the function
108
yourself.
109
error will be true when the message to print is an
110
error message. Otherwise the message is diagnostic, eg. the commands sent
111
and received from the server.
112
113
114
115
116

powered by: WebSVN 2.1.0

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