亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ftpdlib.c

?? tornado開發 三星s3c44b0x開發板 bsp
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* ftpdLib.c - File Transfer Protocol (FTP) server *//* Copyright 1990 - 1998 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------03d,03dec98,lrn  added default home dir control (SPR#23554)                 removed dependency on usrLib (SPR#23536)03c,29sep98,lrn  creqated DosFs 2.0 branch for T2.0, verified fix for SPR#2082803b,14jul98,lrn  SPR#6647: adding notes on text file to description03a,25may98,lrn  anonymous access with root dir and upload dir	         connection timeout, default mode Binary                 enhance transfer rate: bufSize now same as winSize                 mget "*" support with wildcards, rework directory travel	         standardized directory listing to work with GUI clients	         simplified error handling in main loop, to make code smaller	         fixed: ASCII transfer of binary files breaks connection02n,17may98,lrn  merged previous additions with SENS source		 added support for delete, rename, mkdir and rmdir,		 added non-standard service port02m,05dec97,spm  upgraded server shutdown routine to terminate active                  sessions (SPR #9906); corrected response for PASV command                 to include valid IP address (SPR #1318); modified syntax                 of PASV command (SPR #5627); corrected handling of PORT                  command to support multiple interfaces (SPR #3500); added                  support for maximum number of connections (SPR #2032);                 applied changes for configurable password authentication                  from SENS branch (SPR #8602); removed incorrect note from                 man page concerning user/password verification, which was                  actually performed (SPR #7672); general cleanup (reorganized                 code, added FTP responses for error conditions, replaced                  "static" with LOCAL keyword in function declarations)02l,09jul97,dgp  doc: add note on UID and password per SPR 767202k,06feb97,jdi  made drawing internal.02j,30sep96,spm  partial fix for spr #7227. Added support for deleting files                 and using relative pathnames when listing directories.02i,05aug96,sgv  fix for spr #3583 and spr #5920. Provide login security		 for VxWorks login02h,21may96,sgv  Added global variable ftpdWindowSize which can be set by		 the user. the server would set the window size after the		 connection is established.02g,29mar95,kdl  changed ftpdDirListGet() to use ANSI time format in stat.02f,11feb95,jdi  doc format tweak.02e,20aug93,jag  Fixed memory leak by calling fclose (SPR #2194)                 Changed ftpdWorkTask Command Read Logic, Added error checking		 on write calls to the network and file operations.                 Added case-conversion changes (SPR #2035)02d,20aug93,jmm  Changed ioctl.h and socket.h to sys/ioctl.h and sys/socket.h02c,27feb93,kdl  Removed 01z case-conversion changes (SPR #2035).02b,05feb93,jag  Changed call to inet_ntoa to inet_ntoa_b. SPR# 181402a,20jan93,jdi  documentation cleanup for 5.1.01z,09sep92,jmm  fixed spr 1568, ftpd now recognizes lower case commands                 changed errnoGet() to errno to get rid of warning message01y,19aug92,smb  Changed systime.h to sys/times.h.01x,16jun92,kdl	 increased slot buffer to hold null terminator; use calloc()		 to allocate slot struct (SPR #1509).01w,26may92,rrr  the tree shuffle		  -changed includes to have absolute path from h/01v,08apr92,jmm  cleaned up some ansi warnings01u,18dec91,rrr  removed a recursive macro (killed the mips compiler)01t,10dec91,gae  ANSI cleanup. Changed ftpdSlotSem to an Id so that internal		    routine semTerminate() not used.01s,19nov91,rrr  shut up some ansi warnings.01r,14nov91,rrr  shut up some warnings01q,12nov91,wmd  fixed bug in ftpdDataStreamSend() and ftpdDataStreamReceive(),                 EOF is cast to type char to prevent endless looping.01p,04oct91,rrr  passed through the ansification filter                  -changed functions to ansi style		  -changed includes to have absolute path from h/		  -changed VOID to void		  -changed copyright notice01o,10jul91,gae  i960 fixes: non-varargs usage, added ntohs().  added HELP		 command, changed listing to support NFS/DOS not old style.01n,30apr91,jdi	 documentation tweaks.01m,05apr91,jdi	 documentation -- removed header parens and x-ref numbers;		 doc review by dnw.01l,12feb91,jaa	 documentation.01k,08oct90,hjb  included "inetLib.h".01j,05oct90,dnw  made ftpdWorkTask() be LOCAL.		 documentation tweaks.01i,02oct90,hjb  deleted "inet.h".  added more doc to ftpdInit().  added a call		   to htons() where needed.01h,18sep90,kdl  removed erroneous forward declaration of "ftpDataStreamRecv()".01g,10aug90,dnw  added forward declaration of ftpdDataStreamReceive().01f,10aug90,kdl  added forward declarations for functions returning void.01e,26jun90,jcf  changed ftpd semaphore to static mutex.01d,07may90,hjb  various bug fixes -- too numerous to mention.01c,17apr90,jcf  changed ftpd work task name to tFtpd...01b,11apr90,hjb  de-linted01a,01mar90,hjb  written*//*DESCRIPTIONThis library implements the server side of the File Transfer Protocol (FTP),which provides remote access to the file systems available on a target.The protocol is defined in RFC 959. This implementation supports all commandsrequired by that specification, as well as several additional commands.USER INTERFACEDuring system startup, the ftpdInit() routine creates a control connectionat the predefined FTP server port which is monitored by the primary FTPtask. Each FTP session established is handled by a secondary server taskcreated as necessary. The server accepts the following commands:.TStab(|);l1 l.    HELP | - List supported commands.    USER | - Verify user name.    PASS | - Verify password for the user.    QUIT | - Quit the session.    LIST | - List out contents of a directory.    NLST | - List directory contents using a concise format.    RETR | - Retrieve a file.    STOR | - Store a file.    CWD  | - Change working directory.    XCWD | - Change working directory.    CDUP | - Change to parent directory.    XCUP | - Change to parent directory.    TYPE | - Change the data representation type.    PORT | - Change the port number.    PWD  | - Get the name of current working directory.    XPWD | - Get the name of current working directory.    STRU | - Change file structure settings.    MODE | - Change file transfer mode.    ALLO | - Reserver sufficient storage.    ACCT | - Identify the user's account.    PASV | - Make the server listen on a port for data connection.    NOOP | - Do nothing.    DELE | - Delete a file    MKD  | - Make a directory    XMKD | - Make a directory    RMD  | - Remove a directory    XRMD | - Remove a directory    RNFR | - File to rename    RNTO | - a new name for a file that is being renamed    SIZE | - get file size in bytes    MDTM | - get file modification date and time    SYST | - report type of operating system.TEThe ftpdDelete() routine will disable the FTP server until restarted. It reclaims all system resources used by the server tasks and cleanly terminates all active sessions.This FTP server optionally offers client login via loginLib, or anyother custom user and password verification mechanism, which isintroduced to the FTP server by calling ftpdLoginInstall().  Also,"anonymous" guest access may be optionally enabled withftpdAnonymousAllow(), which imposes certain access restrictions on theguest client, namely access may be restriced to a certain subdirectoryon the disk, and the access is restirected to read-only, except aspecified directory which is allowed for read-write access.Please note that if ftpdLoginInstall() is not called, the FTP server willaccept any client, which may potentially cause a security problem, hence ifthere is no user login mechanism used, then at least "anonymous" access shouldbe enabled, so at least some access restrictions can be imposed on the client,which can not be authenticated.Therefore, if anonymous access has been enabled but no other authenticationmechanism was installed with ftpdLoginInstall(), no other user then"anonymous" will be allowed to access the FTP service.NOTE ON TEXT FILESAlthough the dominant file system on VxWorksis MS-DOS compatible, this does not imply that Text Files on VxWorks aretreated as in MS-DOS.Essentially, VxWorks does not treat Text Files in any special way, all filestext or binary are treated in a transparrent manner by the I/O and stdiolibraries, resulting in handling of Text Files similar to UNIX.Therefore, the FTP server will treat ASCII-mode file transfers in the same wayas on UNIX, whence the text lines are delimited with the Line Feed characteronly. Transferring a Text File from an MS-DOS or Windows system to VxWorkswill thus result in all CR-LF sequences converted to LF only.INTERNALThe ftpdInit() routine spawns the primary server task ('ftpdTask') to handlemultiple FTP sessions. That task creates a separate task ('ftpdWorkTask') foreach active control connection.The diagram below defines the structure chart of ftpdLib..CS  ftpdDelete		   			ftpdInit	|  \					  |	|   \					  |	|    \					ftpdTask	|     \					/    |  \____________	|      \			       /     |		     \	|	|   	          ftpdSessionAdd ftpdWorkTask ftpdSessionDelete	|	|	      ______________________/     |  \	|	|	     /    /	|	          |   \ ftpdSlotDelete | ftpdDirListGet /  ftpdDataStreamReceive |   ftpdDataStreamSend	|	|	        /	|	\	  |   /	     /	 \	|    __________/	|	 \	  |  /	    /	  \	|   /			|         ftpdDataConnGet  /	   \	|   |			|	   |   ___________/	    \	|   |			|	   |  /         ftpdSockFree			ftpdDataCmdSend.CEKnown Problems:Work task name are not guaranteed to be unique.All file sizes are done in 32-bit, hence 3 GB max file size limitation.Should log every anonymous access to logMsg or log file.INCLUDE FILES: ftpdLib.hSEE ALSO:ftpLib, netDrv, .I "RFC-959 File Transfer Protocol"*/#include "vxWorks.h"#include "ioLib.h"#include "taskLib.h"#include "lstLib.h"#include "stdio.h"#include "sys/socket.h"#include "netinet/in.h"#include "errno.h"#include "version.h"#include "string.h"#include "stdlib.h"#include "iosLib.h"#include "inetLib.h"#include "dirent.h"#include "sys/stat.h"#include "sys/times.h"#include "sockLib.h"#include "logLib.h"#include "unistd.h"#include "pathLib.h"#include "sysLib.h"#include "ftpdLib.h"#include "ctype.h"#include "time.h"#include "loginLib.h"#include "fioLib.h"#include "dosFsLib.h"	/* for attributes definition *//* Representation Type */#define FTPD_BINARY_TYPE	0x1#define FTPD_ASCII_TYPE		0x2#define FTPD_EBCDIC_TYPE	0x4#define FTPD_LOCAL_BYTE_TYPE	0x8/* Transfer mode */#define FTPD_STREAM_MODE	0x10#define FTPD_BLOCK_MODE		0x20#define FTPD_COMPRESSED_MODE	0x40/* File structure */#define FTPD_NO_RECORD_STRU	0x100#define FTPD_RECORD_STRU	0x200#define FTPD_PAGE_STRU		0x400/* Session Status */#define FTPD_USER_OK		0x1000#define	FTPD_ANONYMOUS		0x2000#define FTPD_PASSIVE		0x10000/* Macros to obtain correct parts of the status code */#define FTPD_REPRESENTATION(slot)	( (slot)->status	& 0xff)#ifdef	_unused_#define FTPD_TRANS_MODE(slot)		(((slot)->status >> 8)	& 0xff)#define FTPD_FILE_STRUCTURE(slot)	(((slot)->status >> 16)	& 0xff)#define FTPD_STATUS(slot)		(((slot)->status >> 24) & 0xff)#endif/* Well known port definitions -- someday we'll have getservbyname */#define FTP_DATA_PORT		20#define FTP_DAEMON_PORT		21/* Free socket indicative */#define FTPD_SOCK_FREE		-1/* Arbitrary limits for the size of the FTPD work task name */#define FTPD_WORK_TASK_NAME_LEN	40/* Arbitrary limits hinted by Unix FTPD in waing for a new data connection */#define FTPD_WAIT_MAX		90#define FTPD_WAIT_INTERVAL	5#define	FTPD_CONN_TIMEOUT	200/* Macro to get the byte out of an int */#define FTPD_UC(ch)		(((int) (ch)) & 0xff)/* Bit set in FTP reply code to indicate multi-line reply. * Used internally by ftpdCmdSend() where codes are less than * 1024 but are 32-bit integers.  [Admittedly a hack, see * ftpdCmdSend().] */#define	FTPD_MULTI_LINE		0x10000000#define FTPD_WINDOW_SIZE	10240#define	FTPD_ANONYMOUS_USER_1	"anonymous"#define	FTPD_ANONYMOUS_USER_2	"ftp"#define	FTPD_ANONYMOUS_USER_3	"guest"/* globals */int ftpdDebug			= FALSE;	/* TRUE: debugging messages */int ftpdTaskPriority		= 56;int ftpdTaskOptions 		= VX_SUPERVISOR_MODE | VX_UNBREAKABLE;int ftpdWorkTaskPriority	= 152;int ftpdWorkTaskOptions		= VX_SUPERVISOR_MODE | VX_UNBREAKABLE; int ftpdWorkTaskStackSize	= 12000;int ftpdWindowSize              = FTPD_WINDOW_SIZE;int ftpsMaxClients = 4; 	/* Default max. for simultaneous connections */int ftpsCurrentClients;/* locals */LOCAL BOOL ftpsActive = FALSE; 	/* Server started? */LOCAL BOOL ftpsShutdownFlag; 	/* Server halt requested? *//* * The FTP server keeps track of active client sessions in a linked list * of the following FTPD_SESSION_DATA data structures. That structure * contains all the variables which must be maintained separately * for each client so that the code shared by every secondary * task will function correctly. */typedef struct    {    NODE		node;		/* for link-listing */    int			status;		/* see various status bits above */    int			byteCount;	/* bytes transferred */    int			cmdSock;	/* command socket */    STATUS		cmdSockError;   /* Set to ERROR on write error */    int			dataSock;	/* data socket */    struct sockaddr_in	peerAddr;	/* address of control connection */    struct sockaddr_in 	dataAddr; 	/* address of data connection */    caddr_t		buf;		/* multi-purpose buffer per session */    int			bufSize;	/* size of the above buffer */    time_t		timeUsed;	/* last time session was active */    char 		curDirName 	/* active directory */				[MAX_FILENAME_LENGTH+1];    char                curUserName 	/* current user */				[MAX_LOGIN_NAME_LEN+1];    } FTPD_SESSION_DATA;LOCAL int ftpdTaskId 		= -1;LOCAL int ftpdServerSock 	= FTPD_SOCK_FREE;LOCAL LIST		ftpsSessionList;LOCAL SEM_ID		ftpsMutexSem;LOCAL SEM_ID 		ftpsSignalSem;LOCAL char		ftpdWorkTaskName [FTPD_WORK_TASK_NAME_LEN];LOCAL int		ftpdNumTasks;LOCAL FUNCPTR		pLoginVrfyFunc = NULL ;LOCAL char		defaultHomeDir	/* default root directory */				[MAX_FILENAME_LENGTH+1] = {0};LOCAL char		guestHomeDir	/* anonymous root directory */				[MAX_FILENAME_LENGTH+1] = {0};LOCAL char		writeDirName	/* anonymous upload directory */				[MAX_FILENAME_LENGTH+1] = {0};/* Various messages to be told to the clients */LOCAL const char *messages [] =    {    "Can't open passive connection",    "Parameter not accepted",    "Data connection error",    "Directory non existent or syntax error",    "Local resource failure: %s",    "VxWorks FTP server (VxWorks %s) ready.",    "Password required",    "User logged in",    "Bye...see you later",    "USER and PASS required",    "No files found or invalid directory or permission problem",    "Transfer complete",    "File \"%s\" not found or permission problem",    "Cannot create file \"%s\" or permission problem",    "Changed directory to \"%s\"",    "Type set to I, binary mode",    "Type set to A, ASCII mode",    "Port set okay",    "Current directory is \"%s\"",    "File structure set to NO RECORD",    "Stream mode okay",    "Allocate and Account not required",    "Entering Passive Mode (%d,%d,%d,%d,%d,%d)",    "NOOP -- did nothing as requested...hah!",    "Command not recognized",    "Error in input file",    "Unimplemented TYPE %d",    "You could at least say goodbye.",    "The following commands are recognized:",    "End of command list.",    "File deleted successfully.",    "Login failed.",    "File exists, ready for destination name.",    "File renamed successfuly.",    "\"%s\" directory created",    "Directory %s removed",    "%s: not a plain file",    "UNIX Type: L8 Version: VxWorks",

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
4hu四虎永久在线影院成人| 中文字幕第一页久久| 精品久久人人做人人爱| 久久久久9999亚洲精品| 一区免费观看视频| 亚洲成精国产精品女| 久久99久久99| www.欧美.com| 欧美另类久久久品| 国产视频一区二区在线| 亚洲综合一区二区| 久久成人久久鬼色| 一本高清dvd不卡在线观看| 7777精品久久久大香线蕉| 久久这里只有精品6| 亚洲一区二区三区中文字幕| 黑人精品欧美一区二区蜜桃| 99久久婷婷国产精品综合| 欧美日韩一区二区三区在线看| 久久综合狠狠综合久久综合88 | 蜜臀av性久久久久蜜臀aⅴ四虎 | 日韩精品在线一区| 国产精品久久午夜| 免费精品视频在线| 一本高清dvd不卡在线观看| 精品国产电影一区二区| 又紧又大又爽精品一区二区| 国产麻豆精品久久一二三| 欧美日韩一区二区在线观看视频| 久久久国际精品| 午夜精品国产更新| 99国产精品国产精品毛片| 日韩免费观看高清完整版在线观看| 国产精品国产馆在线真实露脸| 麻豆精品一区二区三区| 欧美在线免费观看亚洲| 国产欧美va欧美不卡在线| 美女久久久精品| 欧美亚洲动漫另类| 国产精品每日更新在线播放网址| 免费观看日韩电影| 欧美综合天天夜夜久久| 国产精品久99| 久草在线在线精品观看| 欧美顶级少妇做爰| 亚洲综合网站在线观看| 成人国产精品视频| 国产亚洲欧美日韩日本| 捆绑调教美女网站视频一区| 欧美亚洲动漫精品| 亚洲精品成人少妇| 成人免费视频一区二区| 亚洲精品一区二区三区蜜桃下载| 图片区日韩欧美亚洲| 欧美日韩在线不卡| 亚洲伊人色欲综合网| 99久久国产综合精品女不卡| 久久精品一区八戒影视| 狠狠色狠狠色综合| 欧美mv日韩mv| 美腿丝袜一区二区三区| 91精品国产综合久久精品性色| 亚洲一区中文在线| 色999日韩国产欧美一区二区| 亚洲天堂成人在线观看| gogo大胆日本视频一区| 中文字幕免费观看一区| 成人福利视频网站| 中文字幕一区二区三区在线播放| 国产白丝网站精品污在线入口| 久久久精品免费观看| 国产精品白丝jk黑袜喷水| 26uuu亚洲婷婷狠狠天堂| 久久99精品久久只有精品| 91麻豆精品91久久久久同性| 免费视频最近日韩| 欧美大片在线观看一区二区| 在线观看亚洲精品视频| 一区二区高清视频在线观看| 色噜噜狠狠色综合中国 | 色一情一乱一乱一91av| 国产精品久久久久久久久免费相片| 国产成人免费高清| 中文字幕高清不卡| 91在线精品一区二区三区| 亚洲欧美国产毛片在线| 在线亚洲+欧美+日本专区| 亚洲成人激情av| 555www色欧美视频| 另类小说图片综合网| 精品国产乱码久久久久久久久 | 久久综合色综合88| 高清shemale亚洲人妖| 亚洲日本va在线观看| 欧美在线观看你懂的| 日产欧产美韩系列久久99| 精品精品欲导航| 国产精品一线二线三线精华| 国产情人综合久久777777| av一本久道久久综合久久鬼色| 亚洲精品国产品国语在线app| 欧美视频中文字幕| 久久9热精品视频| 国产欧美日韩麻豆91| gogogo免费视频观看亚洲一| 亚洲综合色区另类av| 日韩一二三区视频| 粉嫩一区二区三区在线看| 亚洲欧美激情视频在线观看一区二区三区 | 91丨九色丨黑人外教| 亚洲国产日日夜夜| 精品国产乱码久久久久久久| 成人18精品视频| 丝袜美腿成人在线| 久久综合九色综合97_久久久| 99久久精品免费看| 青青草国产成人av片免费| 国产女主播视频一区二区| 欧美在线free| 国产综合一区二区| 亚洲一区二区中文在线| 精品国产一区二区精华| 色婷婷亚洲婷婷| 麻豆一区二区在线| 亚洲欧洲中文日韩久久av乱码| 在线播放中文一区| 成人免费毛片片v| 日av在线不卡| 综合久久久久久| 欧美成人国产一区二区| 91丝袜美女网| 国产一区 二区 三区一级| 亚洲一级不卡视频| 国产日韩精品一区二区三区在线| 欧美日韩国产首页| a美女胸又www黄视频久久| 捆绑变态av一区二区三区| 一片黄亚洲嫩模| 欧美国产日本韩| 欧美tickling挠脚心丨vk| 欧美亚洲国产bt| 成人午夜在线免费| 精品中文字幕一区二区小辣椒| 一本久久精品一区二区| 激情五月婷婷综合| 五月开心婷婷久久| 亚洲欧美日韩一区| 中文字幕乱码一区二区免费| 日韩情涩欧美日韩视频| 欧美视频一区在线| 91在线视频网址| 懂色av一区二区三区免费看| 七七婷婷婷婷精品国产| 亚洲综合色婷婷| 亚洲天堂精品视频| 亚洲国产成人午夜在线一区| 精品福利一二区| 欧美高清视频不卡网| 91麻豆精品秘密| 成人免费黄色在线| 粉嫩久久99精品久久久久久夜| 久久aⅴ国产欧美74aaa| 日韩精品电影在线| 图片区日韩欧美亚洲| 亚洲图片欧美视频| 亚洲一区影音先锋| 亚洲免费观看高清完整版在线观看熊| 亚洲国产电影在线观看| 精品国产一区二区三区久久影院| 91麻豆精品91久久久久同性| 欧美日韩免费在线视频| 色老汉一区二区三区| 色婷婷精品久久二区二区蜜臀av | 久久精品亚洲国产奇米99| 欧美一区二区三区视频免费播放 | 日韩电影免费在线看| 午夜影院久久久| 日韩有码一区二区三区| 图片区小说区区亚洲影院| 午夜私人影院久久久久| 亚洲综合免费观看高清完整版在线| 亚洲色图在线播放| 亚洲精品久久久蜜桃| 一区二区三区四区在线| 亚洲一区二区欧美| 婷婷开心激情综合| 日韩成人伦理电影在线观看| 亚洲国产精品久久人人爱| 亚洲不卡av一区二区三区| 亚洲国产精品人人做人人爽| 亚洲一级二级在线| 日韩激情在线观看| 日韩国产欧美在线播放| 蜜桃精品视频在线观看| 久久99久久99精品免视看婷婷| 国产麻豆成人传媒免费观看| 成人午夜免费电影| 91黄色激情网站| 9191成人精品久久| 精品日韩欧美在线|