📄 commond_action.h
字号:
#ifndef _COMMOND_ACTION_H
#define _COMMOND_ACTION_H
#include <sys/types.h>
#include <shadow.h>
#include <string.h>
#include <unistd.h>
#include <stdio.h>
#include <pwd.h>
#include <unistd.h>
#include <signal.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <errno.h>
#include <sys/stat.h>
#include <dirent.h>
#include <time.h>
#include <fcntl.h>
#define PORT 1
#define PASV 2
#define SCUESS 3
#define FAIL 4
#define ASCII 5
#define BINARY 6
#define YES 7
#define NO 8
typedef struct commond_action
{
char *commond;
int (*action)(char *);
}COMMOND;
typedef struct clinent_infor
{
int socket_control;
int socket_data_listen;
int socket_data_transfers;
int socket_port;
int socket_trans_list;
int connect_mode;
int port_num;
char ip_addr[20];
int trans_mode;
long file_offset;
char file_old_name[500];
int append_on;
int is_anonymous;
}CLIENT;
typedef struct file_infor
{
char file_type;
char owner_is_read;
char owner_is_write;
char owner_is_execute;
char owner_group_is_read;
char owner_group_is_write;
char owner_group_is_execute;
char other_user_is_read;
char other_user_is_write;
char other_user_is_execute;
int hard_link_counts;
int user_identify_code;
int group_identify_code;
int file_bulk;
char create_data[100];
char file_name[100];
}FILE_IN;
extern COMMOND commond_list[];
extern CLIENT client_infor;
extern char commond_buffer[100];
extern char pwd[500];
extern char commond[50];
extern char valus[50];
int timeout_check(int clientfd);
int user_validate(char *username);
int passwd_validate(char *passwd);
int syst(char *valus);
int send_pwd(char *valus);
int send_type(char *valus);
int port_connection(char *valus);
int my_ls(char *valus);
int change_dir(char *valus);
int cdup(char *valus);
int noop(char *valus);
int quit(char *valus);
int help(char *valus);
int pasv_connection(char *valus);
int upload(char *valus);
int download(char *valus);
int reset_file_offset(char *valus);
int del_file(char *valus);
int ready_rename_file(char *valus);
int rename_file(char *valus);
int make_dir(char *valus);
int remove_dir(char *valus);
int send_file_size(char *valus);
int append_data(char *valus);
#endif/*_COMMOND_ACTION_H*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -