commands.h

Go to the documentation of this file.
00001 /* commands.h  --  All eurephiadm commands are declared here
00002  *                 The function is found in the ./commands dir
00003  *                 where each command have their own file
00004  *
00005  *  GPLv2 only - Copyright (C) 2008 - 2010
00006  *               David Sommerseth <dazo@users.sourceforge.net>
00007  *
00008  *  This program is free software; you can redistribute it and/or
00009  *  modify it under the terms of the GNU General Public License
00010  *  as published by the Free Software Foundation; version 2
00011  *  of the License.
00012  *
00013  *  This program is distributed in the hope that it will be useful,
00014  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  *  GNU General Public License for more details.
00017  *
00018  *  You should have received a copy of the GNU General Public License
00019  *  along with this program; if not, write to the Free Software
00020  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00021  *
00022  */
00023 
00035 #ifndef         EUREPHIADM_COMMANDS_H_
00036 # define        EUREPHIADM_COMMANDS_H_
00037 
00041 typedef struct {
00042         char *command;          
00043         int need_session;       
00044         char *accesslvl;        
00045         char *arghint;          
00046         char *helpinfo;         
00047         void (*helpfunc)(void); 
00057         int (*function)(eurephiaCTX *, eurephiaSESSION *, eurephiaVALUES *, int argc, char **argv);
00058 } eurephiadm_functions;
00059 
00061 void help_Help();
00062 int cmd_Help(eurephiaCTX *, eurephiaSESSION *, eurephiaVALUES *cfg, int argc, char **argv);
00063 int cmd_Logout(eurephiaCTX *, eurephiaSESSION *, eurephiaVALUES *cfg, int argc, char **argv);
00064 int cmd_ShowCfg(eurephiaCTX *, eurephiaSESSION *, eurephiaVALUES *cfg, int argc, char **argv);
00065 
00066 
00067 /*  Commands and help functions listed here are found in ./commands/{command}.c files - one file per command*/
00068 void help_Users();
00069 int cmd_Users(eurephiaCTX *, eurephiaSESSION *, eurephiaVALUES *cfg, int argc, char **argv);
00070 
00071 void help_Lastlog();
00072 int cmd_Lastlog(eurephiaCTX *, eurephiaSESSION *, eurephiaVALUES *cfg, int argc, char **argv);
00073 
00074 void help_Attempts();
00075 int cmd_Attempts(eurephiaCTX *, eurephiaSESSION *, eurephiaVALUES *cfg, int argc, char **argv);
00076 
00077 void help_Blacklist();
00078 int cmd_Blacklist(eurephiaCTX *, eurephiaSESSION *, eurephiaVALUES *cfg, int argc, char **argv);
00079 
00080 void help_Certificates();
00081 int cmd_Certificates(eurephiaCTX *, eurephiaSESSION *, eurephiaVALUES *cfg, int argc, char **argv);
00082 
00083 void help_UserCerts();
00084 int cmd_UserCerts(eurephiaCTX *, eurephiaSESSION *, eurephiaVALUES *cfg, int argc, char **argv);
00085 
00086 void help_fwProfiles();
00087 int cmd_fwProfiles(eurephiaCTX *, eurephiaSESSION *, eurephiaVALUES *cfg, int argc, char **argv);
00088 
00089 void help_AdminAccess();
00090 int cmd_AdminAccess(eurephiaCTX *, eurephiaSESSION *, eurephiaVALUES *cfg, int argc, char **argv);
00091 
00092 void help_EditConfig();
00093 int cmd_EditConfig(eurephiaCTX *, eurephiaSESSION *, eurephiaVALUES *cfg, int argc, char **argv);
00094 
00100 static const eurephiadm_functions cmdline_functions[] = {
00101 
00102         {"help",            0, NULL,        "[<command>]",
00103          "This help screen",                       help_Help, cmd_Help},
00104 
00105         {"logout",          1, NULL,        NULL,  // Logout is specially handled - change with care
00106          "Logout from an open session",            NULL, cmd_Logout},
00107 
00108         {"users",       1, "useradmin", "-l",
00109          "User management",                        help_Users, cmd_Users},
00110 
00111         {"lastlog",     1, "useradmin", NULL,
00112          "Query the eurephia lastlog",               help_Lastlog, cmd_Lastlog},
00113 
00114         {"attempts",    1, "attempts",  NULL,
00115          "Show/edit registered login attempts",      help_Attempts, cmd_Attempts},
00116 
00117         {"blacklist",   1, "blacklist",  NULL,
00118          "Show/edit blacklisted items",              help_Blacklist, cmd_Blacklist},
00119 
00120         {"certs",       1, "certadmin", NULL,
00121          "Certificate management",                 help_Certificates, cmd_Certificates},
00122 
00123         {"usercerts",   1, "useradmin", NULL,
00124          "User account/Certificate link management", help_UserCerts, cmd_UserCerts},
00125 
00126         {"fwprofiles",  1, "fwprofiles", NULL,
00127          "Firewall profile management",               help_fwProfiles,   cmd_fwProfiles},
00128 
00129         {"adminaccess",  1, "useradmin", NULL,
00130          "User account access levels (admin)",      help_AdminAccess, cmd_AdminAccess},
00131 
00132         {"show-config",     1, "config",    NULL,
00133          "List all config settings",               NULL, cmd_ShowCfg},
00134 
00135         {"show-configfile", 0, NULL,        NULL,
00136          "List only config file settings",         NULL, cmd_ShowCfg},
00137 
00138         {"config",          1, "config",    "[-s|-d] <key> [<val>] | [-l]",
00139          "Add, delete or show one config setting", help_EditConfig, cmd_EditConfig},
00140 
00141         // End of records marker
00142         {NULL,              0, NULL,        NULL,
00143          NULL,                                     NULL, NULL}
00144 };
00145 
00146 #endif      /* !COMMANDS_H_ */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines