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

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

?? ftpdlib.c

?? vxworks的完整的源代碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* ftpdLib.c - File Transfer Protocol (FTP) server *//* Copyright 1990 - 2002 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------02u,22may02,elr  Corrected closing of sockets so they do not linger (SPR #77377)02t,05nov01,vvv  fixed compilation warnings02s,15oct01,rae  merge from truestack ver 02w, base 02q02r,13oct00,cn   fixed memory leak (SPR# 25954).02q,16mar99,spm  recovered orphaned code from tor2_0_x branch (SPR #25770)02p,01dec98,spm  changed reply code for successful DELE command (SPR #20554)02o,27mar98,spm  corrected byte-ordering problem in PASV command (SPR #20828)02n,27mar98,spm  merged from recovered version 02m of tor1_0_x branch02m,10dec97,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.    TYPE | - Change the data representation type.    PORT | - Change the port number.    PWD | - 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.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.To use this feature, include the following component:INCLUDE_FTP_SERVERINTERNALThe 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.CEINCLUDE 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 "memPartLib.h"#ifndef _WRS_VXWORKS_5_X#include "private/pdLibP.h"#endif /* _WRS_VXWORKS_5_X *//* 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_PASSIVE		0x2000/* Macros to obtain correct parts of the status code */#define FTPD_REPRESENTATION(slot)	( (slot)->status	& 0xff)#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)/* 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/* 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/* globals */int ftpdDebug			= FALSE;	/* TRUE: debugging messages */int ftpdTaskPriority		= 56;int ftpdTaskOptions 		= VX_SUPERVISOR_MODE | VX_UNBREAKABLE;int ftpdWorkTaskPriority	= 252;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;FUNCPTR loginVerifyRtn;/* 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 */    char		buf [BUFSIZE]; /* multi-purpose buffer per session */    char 		curDirName [MAX_FILENAME_LENGTH]; /* active directory */    char               user [MAX_LOGIN_NAME_LEN+1]; /* current user */    } 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;/* Various messages to be told to the clients */LOCAL char *messages [] =    {    "Can't open passive connection",    "Parameter not accepted",    "Data connection error",    "Directory non existent or syntax error",    "Local resource failure: %s",    "VxWorks (%s) FTP server 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.",    };/* Indexes to the messages [] array */#define MSG_PASSIVE_ERROR	0#define MSG_PARAM_BAD		1#define MSG_DATA_CONN_ERROR	2#define MSG_DIR_NOT_PRESENT	3#define MSG_LOCAL_RESOURCE_FAIL	4#define MSG_SERVER_READY	5#define MSG_PASSWORD_REQUIRED	6#define MSG_USER_LOGGED_IN	7#define MSG_SEE_YOU_LATER	8#define MSG_USER_PASS_REQ	9#define MSG_DIR_ERROR		10#define MSG_TRANS_COMPLETE	11#define MSG_FILE_ERROR		12#define MSG_CREATE_ERROR	13#define MSG_CHANGED_DIR		14#define MSG_TYPE_BINARY		15#define MSG_TYPE_ASCII		16#define MSG_PORT_SET		17#define MSG_CUR_DIR		18#define MSG_FILE_STRU		19#define MSG_STREAM_MODE		20#define MSG_ALLOC_ACCOUNT	21#define MSG_PASSIVE_MODE	22#define MSG_NOOP_OKAY		23#define MSG_BAD_COMMAND		24#define MSG_INPUT_FILE_ERROR	25#define MSG_TYPE_ERROR		26#define MSG_NO_GOOD_BYE		27#define	MSG_COMMAND_LIST_BEGIN	28#define	MSG_COMMAND_LIST_END	29#define MSG_DELE_OKAY           30#define        MSG_USER_LOGIN_FAILED   31LOCAL char *ftpdCommandList ="HELP	USER	PASS	QUIT	LIST	NLST\n\RETR	STOR	CWD	TYPE	PORT	PWD\n\STRU	MODE	ALLO	ACCT	PASV	NOOP\n\DELE\n";/* forward declarations */LOCAL FTPD_SESSION_DATA *ftpdSessionAdd (void);LOCAL void ftpdSessionDelete (FTPD_SESSION_DATA *);LOCAL STATUS ftpdWorkTask (FTPD_SESSION_DATA *);LOCAL STATUS ftpdCmdSend (FTPD_SESSION_DATA *, int, int, char *,                          int, int, int, int, int, int);LOCAL STATUS ftpdDataConnGet (FTPD_SESSION_DATA *);LOCAL void ftpdDataStreamSend (FTPD_SESSION_DATA *, FILE *);LOCAL void ftpdDataStreamReceive (FTPD_SESSION_DATA *, FILE *outStream);LOCAL void ftpdSockFree (int *);LOCAL STATUS ftpdDirListGet (int, char *, BOOL);LOCAL void ftpdDebugMsg (char *, int, int, int, int);LOCAL void unImplementedType (FTPD_SESSION_DATA *pSlot);LOCAL void dataError (FTPD_SESSION_DATA *pSlot);LOCAL void fileError (FTPD_SESSION_DATA *pSlot);LOCAL void transferOkay (FTPD_SESSION_DATA *pSlot);/********************************************************************************* ftpdTask - FTP server daemon task** This routine monitors the FTP control port for incoming requests from clients* and processes each request by spawning a secondary server task after * establishing the control connection. If the maximum number of connections is* reached, it returns the appropriate error to the requesting client. The * routine is the entry point for the primary FTP server task and should only* be called internally.** RETURNS: N/A** ERRNO: N/A** INTERNAL:* The server task is deleted by the server shutdown routine. Adding a newly* created client session to the list of active clients is performed atomically* with respect to the shutdown routine. However, accepting control connections* is not a critical section, since closing the initial socket used in the* listen() call also closes any later connections which are still open.** NOMANUAL*/LOCAL void ftpdTask (void)    {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲夂夂婷婷色拍ww47| 色综合中文字幕国产| 国产精品一线二线三线精华| 色综合久久天天| 国产情人综合久久777777| 亚洲亚洲精品在线观看| proumb性欧美在线观看| 精品国产91亚洲一区二区三区婷婷| 亚洲免费在线电影| 成人精品免费网站| 国产午夜亚洲精品午夜鲁丝片| 日韩—二三区免费观看av| 在线精品视频免费播放| 综合激情成人伊人| 成人av集中营| 中文字幕精品一区二区三区精品| 久久国产精品99久久人人澡| 欧美年轻男男videosbes| 一区二区三区欧美久久| 99久久久国产精品免费蜜臀| 国产欧美一区在线| 国产91在线看| 中文成人综合网| 国产成人午夜视频| 精品国产乱码久久久久久1区2区| 美腿丝袜亚洲色图| 精品国内二区三区| 国产一区二区h| 久久这里只有精品6| 国产一区二区三区综合| 欧美精品一区二区三区四区| 久久99精品久久久久久 | 精品亚洲国内自在自线福利| 精品视频在线免费看| 亚洲一区二区三区在线| 欧美系列亚洲系列| 日韩精品高清不卡| 日韩欧美资源站| 国产精品亚洲视频| 国产精品嫩草影院av蜜臀| www.日韩精品| 麻豆久久一区二区| 久久这里只有精品视频网| 成人综合在线网站| 国产精品成人免费| 欧美日韩中文国产| 激情综合色播五月| 亚洲国产成人私人影院tom| 9久草视频在线视频精品| 亚洲精选视频免费看| 欧美日韩国产高清一区二区三区| 美女视频一区在线观看| 欧美韩国日本一区| 在线观看av不卡| 久久99国产精品久久99果冻传媒| 国产日产亚洲精品系列| 色狠狠综合天天综合综合| 五月激情丁香一区二区三区| 精品免费国产二区三区| heyzo一本久久综合| 午夜久久久影院| 久久综合网色—综合色88| 成人v精品蜜桃久久一区| 一区二区三区四区精品在线视频 | www.性欧美| 丝袜亚洲另类丝袜在线| 国产亚洲欧洲997久久综合| 欧美中文字幕一区| 国产一区啦啦啦在线观看| 一区二区三区国产精品| 欧美成人一区二区| 色av成人天堂桃色av| 国产一区二区在线看| 亚洲影视在线播放| 国产视频一区二区三区在线观看| 91国偷自产一区二区开放时间 | 国v精品久久久网| 亚洲国产成人91porn| 国产人成亚洲第一网站在线播放 | 久久综合九色综合久久久精品综合| 日韩午夜激情电影| 91啪九色porn原创视频在线观看| 蜜桃视频免费观看一区| 亚洲愉拍自拍另类高清精品| 久久精品一区四区| 欧美一区二区三区视频在线 | 亚洲成人一区在线| 国产精品女主播av| 久久久精品国产免大香伊| 8v天堂国产在线一区二区| 在线影院国内精品| 成人动漫一区二区在线| 久久99国产精品久久99| 日韩va欧美va亚洲va久久| 亚洲老妇xxxxxx| 综合激情网...| 国产精品久久二区二区| 精品国产乱码久久久久久老虎| 5月丁香婷婷综合| 91在线视频播放地址| 精品一区二区三区蜜桃| 日韩一区欧美一区| 国产精品久久久久影院色老大| 国产精品亚洲第一 | 一本色道久久加勒比精品| 欧美mv和日韩mv国产网站| 91国偷自产一区二区三区成为亚洲经典 | 精品一区二区三区香蕉蜜桃| 日日摸夜夜添夜夜添精品视频| 伊人色综合久久天天人手人婷| 国产精品污网站| 中文字幕中文字幕一区二区| 国产精品美女一区二区三区| 亚洲一卡二卡三卡四卡五卡| 中文在线一区二区| 国产精品久久久一本精品| 国产精品美女久久久久高潮| 中文字幕不卡在线播放| 亚洲国产成人午夜在线一区 | 欧美不卡激情三级在线观看| 欧美一区二区三区啪啪| 日韩免费高清视频| 久久在线免费观看| 国产精品短视频| 亚洲线精品一区二区三区| 亚洲欧美日韩中文播放| 亚洲免费高清视频在线| 亚洲最新视频在线观看| 午夜av区久久| 精品一区二区国语对白| 国产精品一区二区久久精品爱涩| 粉嫩aⅴ一区二区三区四区五区| 国产福利91精品一区二区三区| 成人黄色国产精品网站大全在线免费观看| jizz一区二区| 欧美日韩午夜在线视频| 精品伦理精品一区| 国产精品免费网站在线观看| 亚洲综合色视频| 日本成人在线视频网站| 国产精品亚洲成人| 欧洲另类一二三四区| 91精品国产高清一区二区三区蜜臀| 欧美精品一区二区在线观看| 国产精品无遮挡| 久久国产精品第一页| 精品日产卡一卡二卡麻豆| 91福利精品第一导航| 99久久99久久精品免费观看| 精品视频资源站| 国产亚洲精品7777| 亚洲电影在线播放| 国产精品1区2区| 在线观看91精品国产入口| www成人在线观看| 亚洲成av人片| 粉嫩在线一区二区三区视频| 欧美伦理视频网站| 中文字幕亚洲一区二区va在线| 日韩成人免费看| jiyouzz国产精品久久| 精品理论电影在线观看| 亚洲国产一区二区三区青草影视| 欧美日韩情趣电影| 国产视频视频一区| 免费视频一区二区| 色av成人天堂桃色av| 国产欧美日韩在线看| 日本成人在线一区| 欧美日韩免费高清一区色橹橹 | 色婷婷久久久综合中文字幕| 26uuu另类欧美| 日韩国产在线观看一区| 99re成人精品视频| 国产日韩亚洲欧美综合| 美腿丝袜亚洲一区| 51精品久久久久久久蜜臀| 亚洲啪啪综合av一区二区三区| 国产一区在线不卡| 精品日本一线二线三线不卡| 亚洲午夜av在线| 成人免费毛片a| 国产日韩欧美a| 国模一区二区三区白浆| 91精品国产综合久久精品麻豆| 亚洲精品高清在线观看| 99精品偷自拍| 国产精品伦一区| 成人午夜精品在线| 亚洲国产精华液网站w| 国产一二精品视频| 久久久久久久久久久久久久久99| 久久国产免费看| 欧美精品一区二区在线观看| 捆绑紧缚一区二区三区视频| 日韩亚洲欧美中文三级| 六月丁香婷婷久久| 日韩一级片网站| 久久精品国内一区二区三区| 欧美一区二区啪啪|