资源简介
互联网应用课程的大作业,rar压缩包无密码,解压后的资源包括:源代码+pdf的报告,其中源代码为一个程序,pdf报告中包含程序教程、截图、及设计流程图。

代码片段和文件信息
/* header files */
// ƒ‹ µœ÷get put £¨“˛≤ÿ√‹¬Î∫√¡À‘›«“’‚—˘œ‘ æ∫Ï…´£¨mayan≤ª–– 6.3 20:00
#include
#include
#include
#include
#include /* getservbyname() gethostbyname() */
#include /* for definition of errno */
#include /* for inet_aton()*/ // ...................
#include /* for inet_aton()*/ // ...................
#include /* for inet_aton()*/ // ...................
#include
#include /* for write open read */
#include /* for read write open */
#include
#include /*for mask password*/
#define BACKLOG 10 /* ◊Ó¥ÛÕ¨ ±¡¨Ω”«Î«Û ˝ */
/* define macros*/
#define MAXBUF 1024
#define STDIN_FILENO 0
#define STDOUT_FILENO 1
#define ECHOFLAGS (ECHO | ECHOE | ECHOK | ECHONL) // /*for mask password*/
/* define FTP reply code */
#define USERNAME 220
#define PASSWORD 331
#define LOGIN 230
#define PATHNAME 257
#define CLOSEDATA 226
#define ACTIONOK 250
/* DefinE global variables */
char *host; /* hostname or dotted-decimal string */
char *port;
char *rbuf *rbuf1; /* pointer that is malloc‘ed */
char *wbuf *wbuf1; /* pointer that is malloc‘ed */
struct sockaddr_in servaddr;
struct hostent *hptr;
struct in_addr temporary_IP;
int totalfilesize;
int upfilesize;
struct timeval startstartup;
struct timeval endendup;
long timeusedtimeusedup;
int retransmit=0;
char *thesize;
char *limitspeed;
int fileno(FILE *stream);
int fstat(int filedesstruct stat *buf);
struct stat thefilestruct;
struct stat upfilestruct;
int cliopen(char *host char *port); /* function list */
void strtosrv(char *str char *host char *port);
void cmd_tcp(int sockfd);
void ftp_list(int sockfd);
int ftp_get(int sck char *pDownloadFileName_s);
int ftp_put (int sck char *pUploadFileName_s);
int flag_150=0; // to distinguish “ls“ and “ get [filename]“ instuction
int
main(int argc char *argv[])
{
int fd;
//code here: Allocate the read and write buffers before open().
char write_buffer[MAXBUF]; // send to server
char read_buffer[MAXBUF]; // get from server
if (0 != argc-2)
{
printf(“%s\n““missing “);
exit(0);
} // end of if
host = argv[1];
port = “21“;
rbuf=(char *)malloc(MAXBUF);
rbuf1=(char *)malloc(MAXBUF);
wbuf=(char *)malloc(MAXBUF);
wbuf1=(char *)malloc(MAXBUF);
fd = cliopen(host port);
printf(“sockfd(the first) is %d \n“fd);
cmd_tcp(fd);
exit(0);
} // end of main function
/* Establish a TCP connection from client to server */
int cliopen(char *host char *port)
{
int a; // host is IP or domain name
int sockfd;// returned socket number
int send_length;
int receive_length;
char str[32];
unsigned short echoServPort;
char *servIP;
// host is IP or domain name
a=inet_aton(host&temporary_IP);
printf(“flag is : %d (1 means IP0
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1216362 2013-06-17 19:23 ftpclt_2010215102_10212784&10212772_梁扬&王可惟.pdf
文件 30658 2013-06-12 12:56 ftpclt_2010215102_10212784&10212772_梁扬&王可惟.c
----------- --------- ---------- ----- ----
1247020 2
相关资源
- FTP课程设计(服务端+客户端)
- uboot到linux logo显示不间断 补丁
- Uninstall_Cortana_WINCLIENT.CN.rar
- UNIX/LINUX编程实践教程的源码
- Linux任务管理器
- linux应用层的华容道游戏源代码
- python实现的ftp自动上传、下载脚本
- 用Socket编程实现FTP
- ubuntu9.10 可加载内核模块和字符设备驱
- MP3文件ID3v2ID3v2APEv2标签读取
- 操作系统实验——虚存管理实验
- linux下的发包工具sendip
- 尚观培训linux许巍关于c 的笔记和讲义
- 尚观培训linux董亮老师关于数据结构的
- linux 线程池源码 c 版
- tftp文件传输工具
- linux C 电梯程序练习
- linux下用多进程同步方法解决生产者
- SOCKET 网络编程 计算机网络 作业 客户
- Linux 操作系统实验(全)
- Linux From Scratch 中文手册
- linux 网络实验 ftp程序
- 用Socket写的简易FTP服务器和客户端
- Linux命令大全离线版&在线版
- 基于C 的简易FTP客户端(带源码)
- 操作系统共享内存实验
- dos 下运行Linux 命令--gnu_utils
- linux 0.12内核源代码
- linux简易shell C实现
- linux实验报告及心得体会
评论
共有 条评论