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

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

?? ftplib.c

?? vxwork源代碼
?? 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男人天堂一区| 久久久精品天堂| 欧美精品一区二区在线播放| 91国产成人在线| 欧美在线观看禁18| 色综合亚洲欧洲| 亚洲国产精华液网站w| 国产原创一区二区三区| 国产欧美日韩精品a在线观看| 青青青爽久久午夜综合久久午夜| 99久久er热在这里只有精品15| 精品欧美乱码久久久久久1区2区| 中文字幕在线不卡| 亚洲欧美激情插| 亚洲婷婷在线视频| 一区二区三区在线视频播放| 亚洲va天堂va国产va久| 国产一区视频在线看| 美女诱惑一区二区| a级精品国产片在线观看| 综合久久久久综合| 欧美日韩一区二区电影| av在线不卡免费看| 婷婷国产在线综合| 欧美综合一区二区| 日本精品一区二区三区四区的功能| 亚洲成a人片在线观看中文| 欧美精品一区二| 亚洲丝袜精品丝袜在线| 老司机精品视频线观看86| 色婷婷精品久久二区二区蜜臀av | 不卡一区中文字幕| 91蜜桃在线免费视频| 黄色日韩网站视频| 国产麻豆精品一区二区| 91在线视频免费观看| 亚洲精品一卡二卡| 一区二区三区免费在线观看| 另类成人小视频在线| 欧美成人综合网站| 爽好多水快深点欧美视频| 国产清纯美女被跳蛋高潮一区二区久久w | 亚洲主播在线观看| 精品区一区二区| 成人av在线一区二区三区| 一区二区高清在线| 在线视频你懂得一区| 日本中文一区二区三区| 欧美精品一区二区久久久| 亚洲黄色在线视频| 欧美mv日韩mv国产网站app| 国产精品毛片无遮挡高清| 日韩精品自拍偷拍| 国产精品久久久久久久蜜臀| 亚洲天堂精品视频| 26uuu亚洲综合色欧美| 91国产免费看| 欧美日韩中文字幕一区| 美女一区二区在线观看| 久久国产精品99久久久久久老狼 | 在线不卡免费欧美| 五月激情六月综合| 欧美一区二区三区播放老司机| 自拍偷在线精品自拍偷无码专区 | 亚洲色图.com| 欧美国产日韩a欧美在线观看| 精品亚洲国内自在自线福利| 国产高清在线观看免费不卡| 日韩中文字幕亚洲一区二区va在线| 日韩经典中文字幕一区| 国产精品午夜在线| k8久久久一区二区三区| 成人av在线电影| 最近中文字幕一区二区三区| 99久久精品免费看国产| 成人精品视频一区二区三区| 亚洲欧洲精品一区二区三区不卡| 午夜精品视频在线观看| 日韩一区二区三区在线观看| 亚洲高清三级视频| 日韩精品在线一区二区| 99精品久久只有精品| 精品国产亚洲一区二区三区在线观看| 日韩影院精彩在线| 国产蜜臀97一区二区三区| 欧美日韩aaa| 国内精品久久久久影院薰衣草 | 日本va欧美va精品| 91国偷自产一区二区使用方法| 久久精品国产成人一区二区三区 | 日日夜夜免费精品视频| 亚洲婷婷在线视频| 高清久久久久久| 日韩美女一区二区三区| 亚洲综合在线观看视频| 国产成人自拍网| 91成人免费在线| 一级中文字幕一区二区| www.99精品| 国产精品白丝在线| 亚洲五月六月丁香激情| 欧美亚洲综合另类| 亚洲国产精品影院| 91老师国产黑色丝袜在线| 国产毛片精品一区| 中文字幕国产一区| 开心九九激情九九欧美日韩精美视频电影 | 五月开心婷婷久久| 国产**成人网毛片九色 | 亚洲国产日韩一级| 欧美性高清videossexo| 午夜伦欧美伦电影理论片| 日韩美女久久久| 亚洲区小说区图片区qvod| 国产一区二区主播在线| 国产91精品免费| 91亚洲精品一区二区乱码| 欧美一区三区四区| 色激情天天射综合网| 色8久久精品久久久久久蜜| 欧美另类videos死尸| 欧美一区二区三区在线观看| 美女一区二区久久| 欧美乱熟臀69xxxxxx| 国产农村妇女毛片精品久久麻豆| 美女视频第一区二区三区免费观看网站| 国产成人精品亚洲777人妖| 国产视频一区二区在线| 成人福利视频在线| 欧美经典一区二区| 懂色av中文字幕一区二区三区| 国产欧美一区在线| 日韩一区二区在线免费观看| 国产成人av资源| 洋洋av久久久久久久一区| 欧美一区二区久久| 欧美三级乱人伦电影| 国产寡妇亲子伦一区二区| 亚洲欧美电影一区二区| 91精品国产高清一区二区三区蜜臀| 丁香婷婷综合五月| 国产乱子伦视频一区二区三区 | 99久久国产综合精品麻豆| 欧美日韩国产高清一区| 国产婷婷精品av在线| 色悠悠久久综合| 蜜臀a∨国产成人精品| 亚洲欧美日韩国产一区二区三区| 国产一区二区精品久久99| 奇米影视一区二区三区| 日韩美女久久久| 国产亚洲欧美日韩在线一区| 成人av影院在线| 日韩三级精品电影久久久| 精品国产乱码久久久久久免费| 欧美在线啊v一区| 国产激情一区二区三区桃花岛亚洲| 国产拍欧美日韩视频二区| 日本一区二区三区国色天香| 国产精品免费视频观看| 一区二区三区在线免费观看| 视频一区二区欧美| 国产在线播放一区二区三区| 不卡电影免费在线播放一区| 91在线观看污| 欧美日韩二区三区| 日韩美女一区二区三区| 亚洲国产高清在线观看视频| 亚洲精品欧美综合四区| 亚洲激情在线激情| 美腿丝袜亚洲三区| 9i在线看片成人免费| 欧美日韩免费观看一区三区| 欧美一级黄色录像| 久久色成人在线| 亚洲乱码精品一二三四区日韩在线| 亚洲一区二区不卡免费| 九九视频精品免费| 午夜精彩视频在线观看不卡| 国产精品自拍网站| 欧美丝袜丝交足nylons图片| 久久亚区不卡日本| 午夜精品福利视频网站| 国产999精品久久久久久| 欧美精品粉嫩高潮一区二区| 国产精品美日韩| 日韩avvvv在线播放| 一区二区三区不卡视频| 欧美色图天堂网|