豆包ko 发表于 2015-5-27 08:44:36

ftp测试脚本

#include "lrs.h"
extern char *strtok(char *string, const char *delimiters );
Action()
{
char *BufVal;
char *token;
char hostport;
char portinfo;
char PortNum;
    char cVal;
char cHighVal;

char cLowVal;
    int iVal,iLength,i,j;
    lrs_create_socket("socket0", "TCP", "LocalHost=0", "RemoteHost=192.168.0.100:21",LrsLastArg);
lrs_send("socket0","vpnbuf0",LrsLastArg);
    lrs_receive("socket0", "buf0", LrsLastArg);
    lrs_send("socket0", "buf1", LrsLastArg);
    lrs_receive("socket0", "buf2", LrsLastArg);
    lrs_send("socket0", "buf3", LrsLastArg);
    lrs_receive("socket0", "buf4", LrsLastArg);
//send PASV
    lrs_send("socket0", "pasvbuf0", LrsLastArg);
lrs_receive("socket0", "pasvbuf1", LrsLastArg);
//Get the Local Port of the Local Host on socket0*/
lrs_get_last_received_buffer("socket0",&BufVal,&iLength);
lr_output_message("The buffer is:%s", BufVal);
strcpy(PortNum,BufVal);
// lr_output_message("PortNum Conetnt %s", PortNum);

for(i=0,j=40;i
页: [1]
查看完整版本: ftp测试脚本