# BRCM_VERSION=3
[bcm963xx.git] / userapps / opensource / ftpd / commands.h
1 #ifndef __BFTPD_COMMANDS_H
2 #define __BFTPD_COMMANDS_H
3
4 #include <config.h>
5 #include <stdio.h>
6 #ifdef HAVE_SYS_TYPES_H
7   #include <sys/types.h>
8 #endif
9 #ifdef HAVE_NETINET_IN_H
10   #include <netinet/in.h>
11 #endif
12
13 #include "commands_admin.h"
14
15 enum {
16     STATE_CONNECTED, STATE_USER, STATE_AUTHENTICATED, STATE_RENAME, STATE_ADMIN
17 };
18
19 enum {
20     TYPE_ASCII, TYPE_BINARY
21 };
22
23 #define USERLEN 30
24 #define USERLEN_S "30"
25 #define MAXCMD 255
26
27 extern int state;
28 extern char user[USERLEN + 1];
29 extern struct sockaddr_in sa;
30 extern char pasv;
31 extern int sock;
32 extern int transferring;
33 extern int pasvsock;
34 extern char *philename;
35 extern int offset;
36 extern int ratio_send, ratio_recv;
37 extern int bytes_stored, bytes_recvd;
38 extern int xfer_bufsize;
39
40 void control_printf(char success, char *format, ...);
41
42 void init_userinfo();
43 void new_umask();
44 int parsecmd(char *);
45 int dataconn();
46 void command_user(char *);
47 void command_pass(char *);
48 void command_pwd(char *);
49 void command_type(char *);
50 void command_port(char *);
51 void command_stor(char *);
52 void command_retr(char *);
53 void command_list(char *);
54 void command_syst(char *);
55 void command_cwd(char *);
56 void command_cdup(char *);
57 void command_dele(char *);
58 void command_mkd(char *);
59 void command_rmd(char *);
60 void command_noop(char *);
61 void command_rnfr(char *);
62 void command_rnto(char *);
63 void command_rest(char *);
64 void command_abor(char *);
65 void command_quit(char *);
66 void command_help(char *);
67 void command_stat(char *);
68 void command_feat(char *);
69 void command_fwupdate(char *);   //brcm 
70
71 struct command {
72   char *name;
73   char *syntax;
74   void (*function)(char *);
75   char state_needed;
76   char showinfeat;
77 };
78
79 #endif