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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [net/] [ftpclient/] [v2_0/] [doc/] [ftpclient.sgml] - Blame information for rev 773

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

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

powered by: WebSVN 2.1.0

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