diff options
author | David Sommerseth <dazo@users.sourceforge.net> | 2009-04-02 15:41:23 +0200 |
---|---|---|
committer | David Sommerseth <dazo@users.sourceforge.net> | 2009-04-02 15:41:23 +0200 |
commit | 5b6c3ba53f33dfe75ddfbb0cf62996f9b3d8de4c (patch) | |
tree | 22738d9835a63ab25d99cc72ee186ae477053953 /eurephiadm | |
parent | b8923339a3cdae13d313e916761f7b5e6455bc6c (diff) | |
download | eurephia-5b6c3ba53f33dfe75ddfbb0cf62996f9b3d8de4c.tar.gz eurephia-5b6c3ba53f33dfe75ddfbb0cf62996f9b3d8de4c.tar.xz eurephia-5b6c3ba53f33dfe75ddfbb0cf62996f9b3d8de4c.zip |
Renamed fwadmin command to fwprofiles, which is more correct
Diffstat (limited to 'eurephiadm')
-rw-r--r-- | eurephiadm/CMakeLists.txt | 2 | ||||
-rw-r--r-- | eurephiadm/commands.h | 8 | ||||
-rw-r--r-- | eurephiadm/commands/fwprofiles.c (renamed from eurephiadm/commands/fwadmin.c) | 53 |
3 files changed, 31 insertions, 32 deletions
diff --git a/eurephiadm/CMakeLists.txt b/eurephiadm/CMakeLists.txt index 984d258..c6c7458 100644 --- a/eurephiadm/CMakeLists.txt +++ b/eurephiadm/CMakeLists.txt @@ -16,7 +16,7 @@ SET(efw_ipt_SRC commands/usercerts.c commands/adminaccess.c commands/edit_config.c - commands/fwadmin.c + commands/fwprofiles.c ../common/eurephia_log.c ../common/eurephia_getsym.c ../common/eurephia_values.c diff --git a/eurephiadm/commands.h b/eurephiadm/commands.h index 90a7019..b6f3ea4 100644 --- a/eurephiadm/commands.h +++ b/eurephiadm/commands.h @@ -55,8 +55,8 @@ int cmd_Certificates(eurephiaCTX *, eurephiaSESSION *, eurephiaVALUES *cfg, int void help_UserCerts(); int cmd_UserCerts(eurephiaCTX *, eurephiaSESSION *, eurephiaVALUES *cfg, int argc, char **argv); -void help_fwAdmin(); -int cmd_fwAdmin(eurephiaCTX *, eurephiaSESSION *, eurephiaVALUES *cfg, int argc, char **argv); +void help_fwProfiles(); +int cmd_fwProfiles(eurephiaCTX *, eurephiaSESSION *, eurephiaVALUES *cfg, int argc, char **argv); void help_AdminAccess(); int cmd_AdminAccess(eurephiaCTX *, eurephiaSESSION *, eurephiaVALUES *cfg, int argc, char **argv); @@ -87,8 +87,8 @@ static const eurephiadm_functions cmdline_functions[] = { {"usercerts", 1, "useradmin", NULL, "User account/Certificate link management", help_UserCerts, cmd_UserCerts}, - {"fwadmin", 1, "fwadmin", NULL, - "Firewall access management", help_fwAdmin, cmd_fwAdmin}, + {"fwprofiles", 1, "fwprofiles", NULL, + "Firewall profile management", help_fwProfiles, cmd_fwProfiles}, {"adminaccess", 1, "useradmin", NULL, "User account access levels (admin)", help_AdminAccess, cmd_AdminAccess}, diff --git a/eurephiadm/commands/fwadmin.c b/eurephiadm/commands/fwprofiles.c index 6f6d6fc..81d96bd 100644 --- a/eurephiadm/commands/fwadmin.c +++ b/eurephiadm/commands/fwprofiles.c @@ -1,5 +1,5 @@ -/* fwadmin.c -- eurephiadm fwadmin command: - * Manages firewall profiles +/* fwprofiles.c -- eurephiadm fwprofiles command: + * Manages firewall profiles * * GPLv2 only - Copyright (C) 2009 * David Sommerseth <dazo@users.sourceforge.net> @@ -28,7 +28,7 @@ #include <libxml/tree.h> #endif -#define MODULE "eurephia::fwAdmin" +#define MODULE "eurephia::fwProfiles" #include <eurephia_nullsafe.h> #include <eurephia_context.h> #include <eurephia_log.h> @@ -43,13 +43,12 @@ #include "../field_print.h" #include "../xsltparser.h" -#define FWADMIN_XSLT "fwadmin.xsl" -void display_fwadmin_help(int page) +void display_fwprofiles_help(int page) { switch( page ) { case 'l': - printf("The fwadmin list mode will show all registered firewall profiles.\n" + printf("The fwprofiles list mode will show all registered firewall profiles.\n" "\n" " -v | --verbose Show more details\n" "\n" @@ -64,7 +63,7 @@ void display_fwadmin_help(int page) break; case 'A': - printf("The fwadmin add mode will register a new firewall profile.\n" + printf("The fwprofiles add mode will register a new firewall profile.\n" "\n" " -d | --description <text> Description of the firewall destination/rule\n" " -f | --fw-destination <name> The reference used by the firewall module\n" @@ -73,7 +72,7 @@ void display_fwadmin_help(int page) break; case 'D': - printf("The fwadmin delete mode will delete a firewall profile.\n" + printf("The fwprofiles delete mode will delete a firewall profile.\n" "\n" " -a | --accessprofile <id> Description of the firewall destination/rule\n" " -f | --fw-destination <name> The reference used by the firewall module\n" @@ -82,7 +81,7 @@ void display_fwadmin_help(int page) break; default: - printf("Available modes for the fwadmin command are:\n\n" + printf("Available modes for the fwprofiles command are:\n\n" " -A | --add Add a new firewall profile\n" " -D | --delete Delete a firewall profile\n" " -l | --list List available firewall profiles\n" @@ -92,21 +91,21 @@ void display_fwadmin_help(int page) } -void help_fwAdmin() +void help_fwProfiles() { - display_fwadmin_help(0); + display_fwprofiles_help(0); } -int help_fwAdmin2(eurephiaCTX *ctx, eurephiaSESSION *sess, eurephiaVALUES *cfg, int argc, char **argv) +int help_fwProfiles2(eurephiaCTX *ctx, eurephiaSESSION *sess, eurephiaVALUES *cfg, int argc, char **argv) { - e_options fwadminargs[] = { + e_options fwprofilesargs[] = { {"--list", "-l", 0}, {"--add", "-A", 0}, {"--delete", "-D", 0}, {NULL, NULL, 0} }; int i = 1; - display_fwadmin_help(eurephia_getopt(&i, argc, argv, fwadminargs)); + display_fwprofiles_help(eurephia_getopt(&i, argc, argv, fwprofilesargs)); return 0; } @@ -118,7 +117,7 @@ int list_profiles(eurephiaCTX *ctx, eurephiaSESSION *sess, eurephiaVALUES *cfg, char *xsltparams[] = {"view", "'list'", NULL}; int i = 0; - e_options fwadminargs[] = { + e_options fwprofilesargs[] = { {"--verbose", "-v", 0}, {"--help", "-h", 0}, {"--accessprofile", "-a", 1}, @@ -138,7 +137,7 @@ int list_profiles(eurephiaCTX *ctx, eurephiaSESSION *sess, eurephiaVALUES *cfg, xmlNewProp(fmap_n, (xmlChar *) "table", (xmlChar *) "firewall_profiles"); for( i = 1; i < argc; i++ ) { - switch( eurephia_getopt(&i, argc, argv, fwadminargs) ) { + switch( eurephia_getopt(&i, argc, argv, fwprofilesargs) ) { case 'v': xsltparams[1] = "'details'"; break; @@ -172,7 +171,7 @@ int list_profiles(eurephiaCTX *ctx, eurephiaSESSION *sess, eurephiaVALUES *cfg, break; case 'h': - display_fwadmin_help('l'); + display_fwprofiles_help('l'); return 0; default: @@ -187,7 +186,7 @@ int list_profiles(eurephiaCTX *ctx, eurephiaSESSION *sess, eurephiaVALUES *cfg, return 1; } - xslt_print_xmldoc(stdout, cfg, profiles_xml, FWADMIN_XSLT, (const char **) xsltparams); + xslt_print_xmldoc(stdout, cfg, profiles_xml, "fwadmin.xsl", (const char **) xsltparams); xmlFreeDoc(profiles_xml); return 0; @@ -215,16 +214,16 @@ int addelete_profile(eurephiaCTX *ctx, eurephiaSESSION *sess, eurephiaVALUES *cf }; - e_options *fwadminargs = NULL; + e_options *fwprofilesargs = NULL; eurephiaXML_CreateDoc(ctx, 1, "firewall_profiles", &srch_xml, &srch_n); if( (strcmp(argv[0], "--add") == 0) || (strcmp(argv[0], "-A") == 0) ) { xmlNewProp(srch_n, (xmlChar *) "mode", (xmlChar *) "add"); - fwadminargs = addargs; + fwprofilesargs = addargs; mode = 'A'; } else if( (strcmp(argv[0], "--delete") == 0) || (strcmp(argv[0], "-D") == 0) ) { xmlNewProp(srch_n, (xmlChar *) "mode", (xmlChar *) "delete"); - fwadminargs = deleteargs; + fwprofilesargs = deleteargs; mode = 'D'; } else { fprintf(stderr, "%s: Invalid mode\n", MODULE); @@ -236,7 +235,7 @@ int addelete_profile(eurephiaCTX *ctx, eurephiaSESSION *sess, eurephiaVALUES *cf xmlNewProp(fmap_n, (xmlChar *) "table", (xmlChar *) "firewall_profiles"); for( i = 1; i < argc; i++ ) { - switch( eurephia_getopt(&i, argc, argv, fwadminargs) ) { + switch( eurephia_getopt(&i, argc, argv, fwprofilesargs) ) { case 'a': xmlNewChild(fmap_n, NULL, (xmlChar *) "accessprofile", (xmlChar *) optargs[0]); break; @@ -250,7 +249,7 @@ int addelete_profile(eurephiaCTX *ctx, eurephiaSESSION *sess, eurephiaVALUES *cf break; case 'h': - display_fwadmin_help(mode); + display_fwprofiles_help(mode); return 0; default: @@ -285,11 +284,11 @@ int addelete_profile(eurephiaCTX *ctx, eurephiaSESSION *sess, eurephiaVALUES *cf } -int cmd_fwAdmin(eurephiaCTX *ctx, eurephiaSESSION *sess, eurephiaVALUES *cfg, int argc, char **argv) +int cmd_fwProfiles(eurephiaCTX *ctx, eurephiaSESSION *sess, eurephiaVALUES *cfg, int argc, char **argv) { char **mode_argv; int rc = 0, i = 0, mode_argc = 0; - e_options fwadminargs[] = { + e_options fwprofilesargs[] = { {"--list", "-l", 0}, {"--add", "-A", 0}, {"--delete", "-D", 0}, @@ -302,7 +301,7 @@ int cmd_fwAdmin(eurephiaCTX *ctx, eurephiaSESSION *sess, eurephiaVALUES *cfg, in mode_fnc = NULL; for( i = 1; i < argc; i++ ) { - switch( eurephia_getopt(&i, argc, argv, fwadminargs) ) { + switch( eurephia_getopt(&i, argc, argv, fwprofilesargs) ) { case 'l': mode_fnc = list_profiles; break; @@ -313,7 +312,7 @@ int cmd_fwAdmin(eurephiaCTX *ctx, eurephiaSESSION *sess, eurephiaVALUES *cfg, in break; case 'h': - mode_fnc = help_fwAdmin2; + mode_fnc = help_fwProfiles2; default: break; |