/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1990-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* *
***********************************************************************/
/*
* File: ifs_ftp.c
*/
#include "ifs_agent.h"
#include <stdio.h>
struct {
int version;
} ftp_data;
struct fileinfo {
char *fname;
char *info;
int ftype;
};
/*
* name: ftp_addentry
* Add a time entry of filename into timestamp
*/
int
char *fname;
{
int len;
return -1;
}
}
}
}
return 0;
}
/*
* name: ftp_doentry
* add a full-path file to timestamp
*/
int
char *filepath;
{
char *ptr;
return -1;
*ptr = '\0';
*ptr++ = '/';
return -1;
return 0;
}
/*
* name: ftp_log2hash
* read log timestamp into an new allocated hash table
*/
/*
HASHTABLE *
ftp_log2hash( logfile )
char *logfile;
{
HASHTABLE *htab;
FILE *fent;
char buf[ STRLEN ], *ptr;
htab = hashalloc( NULL, HASH_set, HASH_ALLOCATE, 0 );
if( (fent = fopen( logfile, "r" )) != NULL ) {
while( fgets( buf, sizeof(buf), fent ) != NULL ) {
if( (ptr = strchr( buf, ' ' )) != NULL ) {
*ptr++ = '\0';
hashput( htab, buf, ptr );
}
}
fclose( fent );
}
return htab;
}
*/
/*
* name: ftp_parselist
* parse the directory entry and check the file type.
* PS: support UNIX and NT ftp directory styles.
*/
int
char *buf;
{
char *ptr;
return 0;
*ptr++ = '\0';
switch( buf[0] ) {
/* -rw-rw-r-- 1 CSIE ftp 1509 Sep 14 08:31 README */
/* drwxrwxr-x 25 CSIE ftp 1024 Jan 31 04:56 pub */
case '-': /* unix regular file */
ptr -= 15;
}
break;
return 0;
*ptr = '\0';
break;
/* 08-01-95 02:55PM 13280 ROCNTS1.DOC */
/* 08-01-95 02:55PM <DIR> DIR */
case '0': /* NT 3.0 file system */
case '1':
ptr -= 2;
}
break;
default: return 0;
}
return 1;
}
/*
* name: ftp_makedents
* make virtual name space from the directory list.
* PS: the mtime of invalid file is set to 4 years ago.
*/
int
char *tmpfile;
{
return -1;
} else { /* regular */
}
}
}
return 0;
}
/*
* ========================= ftp cs =========================
*/
/*
*name: FtpCommand
*/
int
{
return -1;
#ifdef DEBUG
debug_logit( "PASS *\r\n" );
else
debug_logit( buf );
#endif
return 0;
}
/*
*name: FtpReply
*/
int
char *buf;
int bsize;
{
}
debug_logit( "FtpReply: NetGets return NULL\n" );
return -1;
}
/* parsing multi-line response */
debug_logit( "Multi-line parse error\n" );
return -1;
}
}
}
/* trim "...\r\n" to "...\n" */
*ptr++ = '\n';
*ptr = '\0';
}
debug_logit( buf );
}
/*
*name: FtpTalk
*/
int
{
}
/*
*name: FtpDataConnect
*/
NetFile *
struct server_info *srv;
{
int port;
return NULL;
}
return NULL;
}
}
/*
*name: FtpXfer
*/
int
struct server_info *srv;
char *cmd;
char *rpath;
char *tmpfile;
{
return -1;
}
return -1;
}
} else {
}
}
}
/*
*name: FtpXferFile
*/
int
struct server_info *srv;
char *tmpfile;
{
rpath++;
return -1;
}
ftp_doentry( lpath );
return 0;
}
/*
*name: FtpXferDir
*/
int
struct server_info *srv;
char *tmpfile;
{
rpath++;
/* typo of SMART_CD patch (of jdli@csie.nctu.edu.tw) */
logit( "<ftp>: cwd error\n" );
return -1;
}
logit( "<ftp>: xfer directory\n" );
return -1;
}
ftp_makedents( "._dir" );
return 0;
}
/*
*name: FtpConnect
* create a connection to remote host,
* save socket handler in the 'mode' field of mount_item.
*/
int
struct server_info *srv;
{
int port;
return 0;
}
}
logit( "<ftp>: connect\n" );
logit( "<ftp>: connect failed!\n" );
return -1;
}
return -1;
}
logit( "<ftp>: login\n" );
} else {
}
return -1;
}
return -1;
}
return 0;
}
/*
*name: FtpDisconnect
* close the socket handler which stored in mount_item->mode
*/
int
struct server_info *srv;
{
logit( "<ftp>: disconnect\n" );
}
return 0;
}
/*
*name: FtpGetFile
*/
int
struct server_info *srv;
{
int ans;
return -1;
FtpDisconnect( srv );
return -1;
}
} else {
}
return ans;
}
/*
* name: FtpPutFile
* put a file from local file system to remote host
*/
int
struct server_info *srv;
{
char *rpath;
return -1;
logit( "<ftp>: store file\n" );
return -1;
}
return -1;
}
rpath++;
logit( "<ftp>: stor error\n" );
return -1;
}
}
return -1;
}
return 0;
}
/*
* name: FtpNop
* unimplement command
*/
int
FtpNop()
{
return 0;
}
/*
* name: FtpInit
* Initial the data and functions in agent_item
*/
int
struct agent_item *tbl;
{
return 0;
}