RTEMS Logo

RTEMS 4.6.1 On-Line Library


Using Hooks

PREV UP NEXT Bookshelf RTEMS Network Supplement

5.1.3: Using Hooks

In the example above, one hook was installed. The hook causes FTPD to call the function Untar_FromMemory when the user sends data to the file untar. The prototype for the untar hook (and hooks, in general) is:

   int Untar_FromMemory(unsigned char *tar_buf, unsigned long size);

An example FTP transcript which exercises this hook is:

220 RTEMS FTP server (Version 1.0-JWJ) ready.
Name (dcomm0:janovetz): John Galt
230 User logged in.
Remote system type is RTEMS.
ftp> bin
200 Type set to I.
ftp> dir
200 PORT command successful.
150 ASCII data connection for LIST.
drwxrwx--x      0     0         268  dev
drwxrwx--x      0     0           0  TFTP
226 Transfer complete.
ftp> put html.tar untar
local: html.tar remote: untar
200 PORT command successful.
150 BINARY data connection.
210 File transferred successfully.
471040 bytes sent in 0.48 secs (9.6e+02 Kbytes/sec)
ftp> dir
200 PORT command successful.
150 ASCII data connection for LIST.
drwxrwx--x      0     0         268  dev
drwxrwx--x      0     0           0  TFTP
drwxrwx--x      0     0        3484  public_html
226 Transfer complete.
ftp> quit
221 Goodbye.


PREV UP NEXT Bookshelf RTEMS Network Supplement

Copyright © 1988-2004 OAR Corporation