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

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

?? ftplib.c

?? vxworks的完整的源代碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
/* ftpLib.c - File Transfer Protocol (FTP) library *//* Copyright 1984 - 2002 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------02q,26jun02,elr  Correction for passive mode STOR and RETR command in                      ftpXfer() (SPR #79108)02p,06jun02,elr  Documentation (SPR #78008)02o,23may02,elr  Added ftplPasvModeDisable flag02n,22may02,elr  added PASV mode to ftpDataConnInit() (SPR #77169) to                     correct long delays during frequent reboots                 changed doc of ftpReplyGet() and                      ftpReplyGetEnhanced() (SPR #76317)                 changed ftpLibDebugLevelSet() to ftpLibDebugOptionsSet()02m,10may02,kbw  making man page edits02l,22mar02,elr  Cleanup compiler warnings02k,14mar02,elr  Define host response return codes (SPR #68838)                 Host response FTP_PRELIM is ok during ftpXfer (SPR #71954)                 Limit FTP_TRANSIENT response retries during ftpXfer()                      ftpPrelimConfig() (SPR #70907) (SPR #6259) (SPR #33119)                 Added ftpLibDebugLevelSet() and added debugging messages                  Added documentation about stack memory allocation                     and tuning (SPR #64220)                 Moved some error message to FTPLDEBUG  (SPR #71496)                    and removed ftpErrorSuppress in favor ftplDebug                 Added documentation concerning ftpHookup() and ftpDataConnInit()                    socket connections (SPR #62289) (SPR #30556)02j,15oct01,rae  merge from truestack ver 02n, base 02i (SPR #67644)02i,22sep99,cno  change FD_ISSET control & data connection tests (SPR27234)02h,15mar99,elg  change erroneous example code in ftpXfer() (SPR 9989).02g,12mar99,p_m  Fixed SPR# 9022 by publishing ftpLs().02f,05oct98,jmp  doc: cleanup.02e,23jan98,spm  fixed ftpXfer to expect correct return codes for commands                 which do not involve data transfer (SPR #20017)02d,05jun95,jag  Changed ftpXfer to handle error 425 at boot time.02c,30aug93,jag  Changed ftpCommand to issue a single write (SPR #2492)02b,11aug93,jmm  Changed ioctl.h and socket.h to sys/ioctl.h and sys/socket.h02a,23feb93,jdi  doc: changed ftpCommand() examples to fixed no. of args.01z,20jan93,jdi  documentation cleanup for 5.1.01y,20sep92,kdl  added ftpLs; moved ftpErrorSuppress to funcBind.c.01x,11sep92,jmm  added ftpErrorSuppress for lsOld() (SPR #1257)01w,19aug92,smb  Changed systime.h to sys/times.h.01v,18jul92,smb  Changed errno.h to errnoLib.h.01u,26may92,rrr  the tree shuffle		  -changed includes to have absolute path from h/01t,19nov91,rrr  shut up some ansi warnings.01s,04oct91,rrr  passed through the ansification filter                  -changed functions to ansi style		  -changed copyright notice01r,05apr91,jdi	 documentation -- removed header parens and x-ref numbers;		 doc review by dnw.01q,12feb91,jaa	 documentation.01p,02oct90,hjb  added a call to htons() where needed.01o,07may90,hjb  added some documentation to ftpXfer routine to issue a "QUIT"		 at the end of the file transfer session via FTP.01n,22feb90,jdi  documentation cleanup.01m,07jun89,gae  changed SOCKADDR back to "struct sockaddr".01l,23sep88,gae  documentation touchup.01k,30may88,dnw  changed to v4 names.01j,28may88,dnw  changed fioStdErr call to STD_ERR.01i,05apr88,gae  changed fprintf() call to fdprintf()01h,17nov87,ecs  lint: added include of inetLib.h.01g,11nov87,jlf  documentation01f,06nov87,dnw  fixed bug in use of setsockopt().01e,01nov87,llk  changed remInetAddr() to UNIX compatible inet_addr().01d,01apr87,ecs  hushed lint in ftpGetReply.		 changed "VARARGS 2" to "VARARGS2" in ftpCommand		 removed extraneous 4th arg from calls to bind, socket, accept,		    & connect.01c,19mar87,dnw  documentation		 prepended FTP_ to ftp reply codes.01b,14feb87,dnw  changed to use getsockname() instead of using privileged port.01a,07nov86,dnw  written*//*DESCRIPTIONThis library provides facilities for transferring files to and from a hostvia File Transfer Protocol (FTP).  This library implements only the"client" side of the FTP facilities.FTP IN VXWORKSFor most purposes, you should access the services of ftpLib by means of netDrv, a VxWorks I/O driver that supports transparent access to remote files by means of standard I/O system calls.  Before attempting to access ftpLib services directly, you should check whether netDrv already provides the same access for less trouble.HIGH-LEVEL INTERFACEThe routines ftpXfer() and ftpReplyGet() provide the highest level ofdirect interface to FTP.  The routine ftpXfer() connects to a specifiedremote FTP server, logs in under a specified user name, and initiates aspecified data transfer command.  The routine ftpReplyGet() receivescontrol reply messages sent by the remote FTP server in response to thecommands sent.LOW-LEVEL INTERFACEThe routines ftpHookup(), ftpLogin(), ftpDataConnInit(), ftpDataConnGet(),ftpCommand(), ftpCommandEnhanced()  provide the primitives necessary to create and use control and data connections to remote FTP servers.  The following example shows how to use these low-level routines.  It implements roughly the same function as ftpXfer()..CSchar *host, *user, *passwd, *acct, *dirname, *filename;int ctrlSock = ERROR; /@ This is the control socket file descriptor @/int dataSock = ERROR; /@ This is the data path socket file descriptor @/if (((ctrlSock = ftpHookup (host)) == ERROR)		                      ||    (ftpLogin (ctrlSock, user, passwd, acct) == ERROR)	                      ||    (ftpCommand (ctrlSock, "TYPE I", 0, 0, 0, 0, 0, 0) != FTP_COMPLETE)       ||    (ftpCommand (ctrlSock, "CWD %s", dirname, 0, 0, 0, 0, 0) != FTP_COMPLETE) ||    ((dataSock = ftpDataConnInit (ctrlSock)) == ERROR)	                      ||    (ftpCommand (ctrlSock, "RETR %s", filename, 0, 0, 0, 0, 0) != FTP_PRELIM) ||    ((dataSock = ftpDataConnGet (dataSock)) == ERROR))    {    /@ an error occurred; close any open sockets and return @/    if (ctrlSock != ERROR)	close (ctrlSock);    if (dataSock != ERROR)	close (dataSock);    return (ERROR);    }.CEFor even lower-level access,  please note that the sockets provided by ftpHookup() and ftpDataConnInit() are standard TCP/IP sockets.  Developers may implement read(), write() and select() calls using these sockets for maximum flexibility.To use this feature, include the following component:INCLUDE_FTPTUNING FOR MULTIPLE FILE ACCESS: Please note that accessing multiple files simultaneously may require increasing the memory available to the network stack.  You can examine memory requirements by using netStackSysPoolShow() and netStackDataPoolShow()before opening and after closing files.You may need to modify the following macro definitions according to your specific memory requirements: NUM_64 NUM_128 NUM_256 NUM_512 NUM_1024 NUM_2048 NUM_SYS_64 NUM_SYS_128 NUM_SYS_256 NUM_SYS_512 NUM_SYS_1024 NUM_SYS_2048Please also note that each concurrent file access requires three file descriptors (File, Control and Socket).  The following macro definition may need modification per your application:NUM_FILESDevelopers are encouraged to enable the error reporting facility during debugging using the function ftpLibDebugOptionsSet().  The output is displayed via the logging facility.INCLUDE FILES: ftpLib.hSEE ALSO: netDrv, logLib*/#include "vxWorks.h"#include "ctype.h"#include "sys/socket.h"#include "netinet/in.h"#include "ftpLib.h"#include "inetLib.h"#include "sys/times.h"#include "hostLib.h"#include "sockLib.h"#include "stdio.h"#include "string.h"#include "unistd.h"#include "errnoLib.h"#include "iosLib.h"#include "remLib.h"#include "selectLib.h"#include "taskLib.h"#include "vwModNum.h"#include "private/ftpLibP.h"#include "private/funcBindP.h"typedef struct sockaddr_in SOCKADDR_IN;#define UCA(n)     (((int)(((char *)&dataAddr.sin_addr)[n])) & 0xff)#define UCP(n)     (((int)(((char *)&dataAddr.sin_port)[n])) & 0xff)#define FTPLDEBUG(string, debugLevel, param1, param2, param3, param4, param5, param6)\   {\   if ((_func_logMsg != NULL) && (ftplDebug & debugLevel))\      (* _func_logMsg) (string, param1, param2, param3, param4, param5, param6);\   }#define FTP_PORT	21#define PASV_REPLY_STRING_LENGTH 256/* XXX ftplPasvModeDisable - XXX this will be removed in the next release XXX */BOOL ftplPasvModeDisable = FALSE;LOCAL STATUS ftpPasvReplyParse (char *, UINT32 *, UINT32 *, UINT32 *,  \                                UINT32 *, UINT32 *, UINT32 *);LOCAL BOOL ftpTransientFatal (UINT32 reply);LOCAL char pasvReplyString[PASV_REPLY_STRING_LENGTH];UINT32  ftplTransientMaxRetryCount = 1;   /* Retry just once for now */UINT32  ftplTransientRetryInterval = 0;   /* Default with no delay */FUNCPTR _func_ftpTransientFatal    = ftpTransientFatal;/********************************************************************************* ftpCommand - send an FTP command and get the reply ** This command has been superceded by ftpCommandEnhanced() ** This routine sends the specified command on the specified socket, which* should be a control connection to a remote FTP server.* The command is specified as a string in printf() format with up* to six arguments.** After the command is sent, ftpCommand() waits for the reply from the* remote server.  The FTP reply code is returned in the same way as in* ftpReplyGet().** EXAMPLE* .CS* ftpCommand (ctrlSock, "TYPE I", 0, 0, 0, 0, 0, 0);     /@ image-type xfer @/* ftpCommand (ctrlSock, "STOR %s", file, 0, 0, 0, 0, 0); /@ init file write @/* .CE** RETURNS:**  1 = FTP_PRELIM (positive preliminary)*  2 = FTP_COMPLETE (positive completion)*  3 = FTP_CONTINUE (positive intermediate)*  4 = FTP_TRANSIENT (transient negative completion)*  5 = FTP_ERROR (permanent negative completion)** ERROR if there is a read/write error or an unexpected EOF.** SEE ALSO: ftpReplyGet()** VARARGS2*/int ftpCommand    (    int ctrlSock,       /* fd of control connection socket */    char *fmt,          /* format string of command to send */    int arg1,           /* first of six args to format string */    int arg2,    int arg3,    int arg4,    int arg5,    int arg6    )    {        /* return most significant digit of the reply */        return (ftpCommandEnhanced (ctrlSock, fmt, arg1, arg2,                                     arg3, arg4, arg5, arg6, NULL, 0) / 100);    }/********************************************************************************* ftpCommandEnhanced - send an FTP command and get the complete RFC reply code** This command supercedes ftpCommand() ** This routine sends the specified command on the specified socket, which* should be a control connection to a remote FTP server.* The command is specified as a string in printf() format with up* to six arguments.** After the command is sent, ftpCommand() waits for the reply from the* remote server.  The FTP reply code is returned in the same way as in* ftpReplyGetEnhanced().** EXAMPLE* .CS* ftpCommandEnhanced (ctrlSock, "TYPE I", 0, 0, 0, 0, 0, 0, 0, 0);     /@ image-type xfer @/* ftpCommandEnhanced (ctrlSock, "STOR %s", file, 0, 0, 0, 0, 0, 0, 0); /@ init file write @/* ftpCommandEnhanced (ctrlSock, "PASV", file, 0, 0, 0, 0, 0, reply, rplyLen); /@ Get port @/* .CE** RETURNS:*  The complete FTP response code (see RFC #959)** ERROR if there is a read/write error or an unexpected EOF.** SEE ALSO: ftpReplyGetEnhanced(), ftpReplyGet()** VARARGS2*/int ftpCommandEnhanced    (    int ctrlSock,       /* fd of control connection socket */    char *fmt,          /* format string of command to send */    int arg1,           /* first of six args to format string */    int arg2,    int arg3,    int arg4,    int arg5,    int arg6,    char *replyString, /* storage for the last line of the server response or NULL */    int replyStringLength  /* Maximum character length of the replyString */    )    {    char buffer [128];    int len;    if (ftplDebug & FTPL_DEBUG_OUTGOING)        {        printErr ("---> ");        printErr (fmt, arg1, arg2, arg3, arg4, arg5, arg6);        printErr ("\n");        }    /* Format Command to send to FTP server */    /* The next line will generate a warning with gcc 2.96+, this is O.K. */    sprintf (buffer, fmt, arg1, arg2, arg3, arg4, arg5, arg6);    len = strlen(buffer);    /* Append CR LF to format copy to force a single write to TCP */    sprintf(&buffer[len],"%s","\r\n");    len = strlen(buffer);    if (write(ctrlSock, buffer, len) < len)        {        FTPLDEBUG ("ftpCommandEnhanced: error during write to control socket - errno:0x%08x",  \                   FTPL_DEBUG_ERRORS,errno,1,2,3,4,5);        return(ERROR);        }    return (ftpReplyGetEnhanced (ctrlSock,                                  !strcmp (fmt, "QUIT"),                                  replyString,                                  replyStringLength));    }/********************************************************************************* ftpXfer - initiate a transfer via FTP** This routine initiates a transfer via a remote FTP server* in the following order:* .IP (1) 4* Establishes a connection to the FTP server on the specified host.* .IP (2)* Logs in with the specified user name, password, and account,* as necessary for the particular host.* .IP (3)* Sets the transfer type to image by sending the command "TYPE I".* .IP (4)* Changes to the specified directory by sending* the command "CWD <dirname>".* .IP (5)* Sends the specified transfer command* with the specified filename as an argument, and establishes a data connection.* Typical transfer commands are "STOR %s", to write to a remote file,* or "RETR %s", to read a remote file.* .LP* The resulting control and data connection file descriptors are returned* via <pCtrlSock> and <pDataSock>, respectively.** After calling this routine, the data can be read or written to the remote* server by reading or writing on the file descriptor returned in* <pDataSock>.  When all incoming data has been read (as indicated by * an EOF when reading the data socket) and/or all outgoing data has been* written, the data socket fd should be closed.  The routine ftpReplyGet()* should then be called to receive the final reply on the control socket,* after which the control socket should be closed.** If the FTP command does not involve data transfer, <pDataSock> should be * NULL, in which case no data connection will be established. The only * FTP commands supported for this case are DELE, RMD, and MKD.** EXAMPLE* The following code fragment reads the file "/usr/fred/myfile" from the* host "server", logged in as user "fred", with password "magic"* and no account name.** .CS*     #include "vxWorks.h"*     #include "ftpLib.h"**     int	ctrlSock;*     int	dataSock;*     char	buf [512];*     int	nBytes;*     STATUS	status;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
免费高清在线一区| 懂色av一区二区夜夜嗨| 国产另类ts人妖一区二区| 色婷婷综合久久久中文字幕| 日韩久久免费av| 亚洲图片你懂的| 蜜桃精品视频在线观看| 91欧美激情一区二区三区成人| 日韩三级电影网址| 亚洲永久精品国产| 色婷婷亚洲婷婷| 国产精品久久午夜| 国产激情精品久久久第一区二区| 欧美一区二区在线看| 亚洲在线视频免费观看| 91在线看国产| 亚洲色图一区二区三区| jiyouzz国产精品久久| 国产亚洲精品7777| 激情综合网最新| 日韩一区二区精品葵司在线| 性欧美大战久久久久久久久| 欧美在线观看禁18| 亚洲女与黑人做爰| 波波电影院一区二区三区| 国产亚洲女人久久久久毛片| 国产激情视频一区二区三区欧美 | 精品国产青草久久久久福利| 亚洲美女免费视频| 色综合天天综合网天天看片| 亚洲欧美一区二区三区国产精品| 成人白浆超碰人人人人| 国产精品久久三区| 色综合网色综合| 一级精品视频在线观看宜春院| 99久久久久久| 亚洲成a人v欧美综合天堂下载| 欧美日韩免费观看一区二区三区| 亚洲国产另类av| 欧美精品日日鲁夜夜添| 麻豆精品视频在线| 久久久久久久久99精品| 成人国产精品视频| 一区二区欧美精品| 欧美一三区三区四区免费在线看 | 一区二区久久久久久| 在线亚洲高清视频| 日韩经典中文字幕一区| 精品久久久网站| 国产成人免费xxxxxxxx| 亚洲色图在线播放| 欧美精品三级在线观看| 国产一区二区91| 中文字幕在线一区免费| 欧美视频一区在线| 美国av一区二区| 国产精品全国免费观看高清 | 精品国产区一区| 波多野结衣欧美| 日韩中文欧美在线| 日本一区二区三区电影| 91久久线看在观草草青青| 日韩av网站在线观看| 国产亚洲成年网址在线观看| 色综合咪咪久久| 麻豆精品一区二区av白丝在线| 中文字幕中文字幕在线一区| 69堂精品视频| 不卡av电影在线播放| 日韩电影在线免费观看| 国产精品美女久久福利网站| 欧美日韩在线免费视频| 国产a视频精品免费观看| 亚洲国产精品精华液网站| 国产亚洲成aⅴ人片在线观看| 欧美少妇bbb| 94色蜜桃网一区二区三区| 捆绑变态av一区二区三区| 亚洲人成精品久久久久| 精品国产一区二区亚洲人成毛片| 色综合天天综合狠狠| 国产精品一区二区视频| 亚洲成年人影院| 亚洲日本va在线观看| 久久综合久久综合亚洲| 在线不卡欧美精品一区二区三区| 国产a级毛片一区| 久久国产生活片100| 亚洲综合另类小说| 综合激情成人伊人| 国产日韩精品一区二区三区在线| 欧美日韩精品福利| 色一区在线观看| av电影在线观看一区| 国产精品自拍一区| 久久精品免费看| 五月天网站亚洲| 亚洲精品日日夜夜| 亚洲人成亚洲人成在线观看图片 | 精品粉嫩超白一线天av| 88在线观看91蜜桃国自产| 欧美影视一区在线| 色综合天天综合网天天狠天天| 国产成人免费视频网站高清观看视频| 另类小说视频一区二区| 美女性感视频久久| 日本 国产 欧美色综合| 午夜精品福利视频网站| 亚洲va韩国va欧美va| 亚洲午夜久久久| 亚洲国产欧美在线| 亚洲第四色夜色| 五月天一区二区三区| 天堂蜜桃91精品| 日韩精品一二三区| 精品在线播放午夜| 国内精品免费在线观看| 国产一区二区在线看| 国产精品正在播放| 粉嫩av一区二区三区粉嫩 | 热久久国产精品| 日本强好片久久久久久aaa| 蜜臀av性久久久久蜜臀aⅴ四虎 | 午夜视黄欧洲亚洲| 亚洲成a人片在线不卡一二三区| 性久久久久久久久久久久| 亚州成人在线电影| 久久国产乱子精品免费女| 国产美女精品在线| 成人性生交大片免费| 日本道精品一区二区三区| 欧美视频完全免费看| 91超碰这里只有精品国产| 日韩手机在线导航| 亚洲图片欧美视频| 国内久久精品视频| 国产不卡在线一区| 91久久精品一区二区三区| 欧美精品久久天天躁| 欧美成人国产一区二区| 久久女同性恋中文字幕| 中文字幕一区视频| 调教+趴+乳夹+国产+精品| 国产一区二区在线影院| 91在线精品秘密一区二区| 欧美日韩久久久久久| 欧美精品一区二区三区四区| 中文字幕中文字幕一区二区| 亚洲一区二三区| 精品一区二区三区在线播放| 99久久精品免费精品国产| 在线不卡的av| 国产精品白丝在线| 秋霞国产午夜精品免费视频| 丁香激情综合五月| 欧美日韩国产高清一区二区| 欧美国产日韩a欧美在线观看| 亚洲图片一区二区| 国产成人夜色高潮福利影视| 欧美调教femdomvk| 中文字幕av一区 二区| 午夜精品久久久久久久久久| 国产成人免费在线| 欧美日本韩国一区二区三区视频| 欧美国产视频在线| 五月婷婷色综合| 色综合久久久网| 久久久激情视频| 青青国产91久久久久久| 色综合一个色综合| 亚洲国产高清在线| 欧美aⅴ一区二区三区视频| 91亚洲精华国产精华精华液| 精品久久久影院| 麻豆成人久久精品二区三区红| 91丨porny丨蝌蚪视频| 国产亚洲精品福利| 久久电影国产免费久久电影| 在线观看91视频| 国产精品免费av| 国产美女主播视频一区| 91精品在线免费观看| 五月综合激情日本mⅴ| 在线一区二区三区| 国产精品夫妻自拍| 国产成人丝袜美腿| 2023国产精品| 九一久久久久久| 欧美日韩aaa| 日韩高清一级片| 欧美男生操女生| 亚洲福利电影网| 欧美日韩国产成人在线免费| 夜夜嗨av一区二区三区中文字幕 | 一区二区三区欧美亚洲| 成人激情黄色小说| 中文字幕一区二区三区在线播放 | 亚洲综合激情网| 色噜噜偷拍精品综合在线| 亚洲人成亚洲人成在线观看图片|