/***********************************************************************
* *
* 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_agent.c
*/
#include "ifs_agent.h"
#include <sig.h>
#define IFS_DEBUG
/*
*name: AgentTable
* A list structure records the informations about agents.
*/
/*
*name: AgentRegister
* Insert a new agent structure in the head of AgentTable
* rtn: NULL if error
*/
struct agent_item *
char *name;
{
}
return newitem;
}
/*
*name: AgentSearch
* Find a agent item from the AgentTable
* rtn: NULL if not found
*/
struct agent_item *
char *name;
{
if( *name == 'p' )
name++;
item = AgentTable;
return item;
}
}
return NULL;
}
/*
* Initial functions of agents
*/
extern int FtpInit();
extern int GopherInit();
extern int HttpInit();
extern int NewsInit();
extern int RshInit();
int IfsAbortFlag;
/*
*name: IfsAbortSignal
*/
void
int sig;
{
IfsAbortFlag = 1;
}
/*
*name: IfsInitial
* Initial the agents of IFS
*/
void
{
}
/*
*name: MountListTable
* A list structure records the mount lists of individual users.
*/
/*
*name: MountListSearch
* Search the mount list of a special user.
* Insert a new mount list if not found.
*/
struct mount_list *
int uid;
{
ml = MountListTable;
return ml;
}
MountListTable = ml;
}
return ml;
}
/*
*name: MountItemDump
* Dump the mount information
*/
#ifdef IFS_DEBUG_DUMP
struct mount_item *mi;
{
int n;
logit( "mount_item: ++++++++++++++++++++\n" );
logit( "\nmount_item: --------------------\n" );
}
#else
#endif
/*
*name: AgentMount
* Create a new mount point at localpath and insert to the mount list
* rtn: NULL if error
*/
struct mount_item *
struct mount_list *ml;
char *url;
char *localpath;
char *option;
{
/* url format: "proto:/user:pass@host:port/remote-path" */
/* split proto & user:pass@host:port, and remote-path */
return NULL;
}
*host++ = '\0';
/* check to protocol */
return NULL;
}
/* allocate a new structure */
/* split the remote-path */
*ptr = '\0';
} else {
}
/* split "user:pass" & "host:port" */
*ptr++ = '\0';
*pass++ = '\0';
}
}
/* parse the host & port number */
*ptr++ = '\0';
}
/* parse the timeout value */
sfsprintf( mi->timeout, sizeof(mi->timeout), "/%d", option ? (int)strtol(option, (char**)0, 0) : 86400 );
/* Insert the mount infomation to the mount list */
return mi;
}
/*
*name: AgentUnmount
* Unmount a mount point and remove from the mount list
* rtn: -1 if error
*/
int
struct mount_list *ml;
char *lpath;
{
/* remove the first mount information in mount list */
} else {
while( 1 ) {
/* lpath is not exists in mount list */
return -1;
}
break;
}
/* remove the mount information after 'last' */
}
/* run disconnect before destroy */
}
/* destroy the mount information */
return 0;
}
/*
*name: AgentAutoMount
* Create an auto mount point and insert to the mount list
* rtn: -1 if error
*/
int
struct mount_list *ml;
char *lpath;
{
/* matching "(...):/(...)" */
for (;;)
{
return -1;
{
if (ptr[2])
break;
return -1;
}
ptr++;
}
while( *ptr != '/' )
/* not match with "(...)/proto:/(....)" */
return -1;
}
/* split localpath and url */
/* restore the lpath */
return 0;
}
struct mount_item *
struct mount_list *ml;
{
char ch;
int len, n;
switch( ch ) {
case '*':
len -= 4;
len -= 2;
break;
case '?':
len -= 13;
break;
case '.':
len -= 2;
break;
}
while( 1 ) {
}
break;
}
return mi;
}
}
close( n );
return NULL;
}
int
struct mount_item *mi;
int size;
{
if( rpath ) {
}
return 0;
}
int
struct mount_list *ml;
char *lpath;
{
int n, num;
n = sizeof(csusrmsg);
num = 0;
num++;
}
} else if( *lpath != '/' ) {
num--;
}
} else {
}
} else {
} else {
}
}
return 0;
}
int
struct server_info *srv;
char *argv[];
char *proxy;
{
IfsAbortFlag = 0;
if( argc < 2 ) {
return -1;
}
return -1;
}
}
return -1;
}
return -1;
}
#ifdef DEBUG
if( 1 ) {
int flog;
MountItemDump( mitem );
}
#endif
return 0;
}
/*
*name: cserrmsg
*/
static char *
cserrmsg()
{
char *msg;
switch( cserrno ) {
default: msg = "undefined error number"; break;
}
return msg;
}
int
char *buf;
int bsize;
int rcode;
{
int len;
if( rcode < 0 ) {
} else {
}
return len;
}
/*
*name: IfsCacheValid
*/
int
char *fpath;
unsigned long expire;
{
unsigned long mtime;
return 0; /* no such file */
return 0; /* no file: fpath/._dir */
return 1;
}
}
/*
* Usage: mount url local-path option
* url format: protocol:/user:passwd@host:port/remote-path
*/
int
char *ret;
char *argv[];
{
int n;
n = sizeof( csusrmsg );
if( argc < 3 ) {
} else {
}
} else {
}
}
/*
* Usage: connect protocol server user-info
*/
int
char *ret;
int argc;
char *argv[];
{
}
/*
* Usage: disconnect protocol server
*/
int
char *ret;
int argc;
char *argv[];
{
}
/*
* Usage: listdents local-path
*/
int
char *ret;
int argc;
char *argv[];
{
}
/*
* Usage: getfile local-path
*/
int
char *ret;
int argc;
char *argv[];
{
}
/*
* Usage: open logical path [name=value] ...
* stat logical path [name=value] ...
*/
int
char* ret;
int retsize;
int uid;
int argc;
char* argv[];
{
register int n;
char* physical;
char* proxy;
unsigned long expire;
if (argc < 3) {
}
expire = 86400;
proxy = 0;
for (n = 3; n < argc; n++) {
}
else
argv[2] = 0;
n = -1; /* unmounted path */
} else {
n = 0; /* file validated */
else
n = -1; /* getfile failed */
}
}
/*
* Usage: putfile [source] local-path
*/
int
char *ret;
int argc;
char *argv[];
{
if( argc > 2 ) {
}
}
/*
* Usage: userdef protocol arguments
*/
int
char *ret;
int argc;
char *argv[];
{
}