From 5b6c3ba53f33dfe75ddfbb0cf62996f9b3d8de4c Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Thu, 2 Apr 2009 15:41:23 +0200 Subject: Renamed fwadmin command to fwprofiles, which is more correct --- eurephiadm/CMakeLists.txt | 2 +- eurephiadm/commands.h | 8 +- eurephiadm/commands/fwadmin.c | 346 --------------------------------------- eurephiadm/commands/fwprofiles.c | 345 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 350 insertions(+), 351 deletions(-) delete mode 100644 eurephiadm/commands/fwadmin.c create mode 100644 eurephiadm/commands/fwprofiles.c 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/fwadmin.c deleted file mode 100644 index 6f6d6fc..0000000 --- a/eurephiadm/commands/fwadmin.c +++ /dev/null @@ -1,346 +0,0 @@ -/* fwadmin.c -- eurephiadm fwadmin command: - * Manages firewall profiles - * - * GPLv2 only - Copyright (C) 2009 - * David Sommerseth - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; version 2 - * of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include -#include -#include - -#ifdef HAVE_LIBXML2 -#include -#endif - -#define MODULE "eurephia::fwAdmin" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "../argparser.h" -#include "../field_print.h" -#include "../xsltparser.h" - -#define FWADMIN_XSLT "fwadmin.xsl" - -void display_fwadmin_help(int page) -{ - switch( page ) { - case 'l': - printf("The fwadmin list mode will show all registered firewall profiles.\n" - "\n" - " -v | --verbose Show more details\n" - "\n" - "Filters:\n" - " -a | --accessprofile Numeric ID.\n" - " -f | --fw-destination Reference used by the firewall\n" - " -i | --uid Numeric user ID\n" - " -n | --username User name\n" - " -c | --certid Numeric reference to a certificate\n" - " -e | --email e-mail address in certificates\n" - " -d | --digest Certificate SHA1 digest\n\n"); - break; - - case 'A': - printf("The fwadmin add mode will register a new firewall profile.\n" - "\n" - " -d | --description Description of the firewall destination/rule\n" - " -f | --fw-destination The reference used by the firewall module\n" - "\n" - ); - break; - - case 'D': - printf("The fwadmin delete mode will delete a firewall profile.\n" - "\n" - " -a | --accessprofile Description of the firewall destination/rule\n" - " -f | --fw-destination The reference used by the firewall module\n" - "\n" - ); - break; - - default: - printf("Available modes for the fwadmin 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" - " -h | --help Show help\n\n"); - break; - } -} - - -void help_fwAdmin() -{ - display_fwadmin_help(0); -} - -int help_fwAdmin2(eurephiaCTX *ctx, eurephiaSESSION *sess, eurephiaVALUES *cfg, int argc, char **argv) -{ - e_options fwadminargs[] = { - {"--list", "-l", 0}, - {"--add", "-A", 0}, - {"--delete", "-D", 0}, - {NULL, NULL, 0} - }; - int i = 1; - display_fwadmin_help(eurephia_getopt(&i, argc, argv, fwadminargs)); - return 0; -} - - -int list_profiles(eurephiaCTX *ctx, eurephiaSESSION *sess, eurephiaVALUES *cfg, int argc, char **argv) -{ - xmlDoc *profiles_xml = NULL, *srch_xml = NULL; - xmlNode *fmap_n = NULL, *srch_n = NULL; - char *xsltparams[] = {"view", "'list'", NULL}; - int i = 0; - - e_options fwadminargs[] = { - {"--verbose", "-v", 0}, - {"--help", "-h", 0}, - {"--accessprofile", "-a", 1}, - {"--fw-destination", "-f", 1}, - {"--uid", "-i", 1}, - {"--username", "-u", 1}, - {"--certid", "-c", 1}, - {"--email", "-e", 1}, - {"--digest", "-d", 1}, - {NULL, NULL, 0} - }; - - eurephiaXML_CreateDoc(ctx, 1, "firewall_profiles", &srch_xml, &srch_n); - xmlNewProp(srch_n, (xmlChar *) "mode", (xmlChar *) "search"); - - fmap_n = xmlNewChild(srch_n, NULL, (xmlChar *) "fieldMapping", NULL); - xmlNewProp(fmap_n, (xmlChar *) "table", (xmlChar *) "firewall_profiles"); - - for( i = 1; i < argc; i++ ) { - switch( eurephia_getopt(&i, argc, argv, fwadminargs) ) { - case 'v': - xsltparams[1] = "'details'"; - break; - - case 'a': - xmlNewChild(fmap_n, NULL, (xmlChar *) "accessprofile", (xmlChar *) optargs[0]); - break; - - case 'f': - xmlNewChild(fmap_n, NULL, (xmlChar *) "fwprofile", (xmlChar *) optargs[0]); - break; - - case 'i': - xmlNewChild(fmap_n, NULL, (xmlChar *) "uid", (xmlChar *) optargs[0]); - break; - - case 'u': - xmlNewChild(fmap_n, NULL, (xmlChar *) "username", (xmlChar *) optargs[0]); - break; - - case 'c': - xmlNewChild(fmap_n, NULL, (xmlChar *) "certid", (xmlChar *) optargs[0]); - break; - - case 'e': - xmlNewChild(fmap_n, NULL, (xmlChar *) "email", (xmlChar *) optargs[0]); - break; - - case 'd': - xmlNewChild(fmap_n, NULL, (xmlChar *) "digest", (xmlChar *) optargs[0]); - break; - - case 'h': - display_fwadmin_help('l'); - return 0; - - default: - return 1; - } - } - - profiles_xml = eDBadminFirewallProfiles(ctx, srch_xml); - xmlFreeDoc(srch_xml); - if( profiles_xml == NULL ) { - fprintf(stderr, "%s: Error retrieving firewall profiles\n", MODULE); - return 1; - } - - xslt_print_xmldoc(stdout, cfg, profiles_xml, FWADMIN_XSLT, (const char **) xsltparams); - - xmlFreeDoc(profiles_xml); - return 0; -} - - -int addelete_profile(eurephiaCTX *ctx, eurephiaSESSION *sess, eurephiaVALUES *cfg, int argc, char **argv) -{ - xmlDoc *result_xml = NULL, *srch_xml = NULL; - xmlNode *fmap_n = NULL, *res_n = NULL, *srch_n = NULL; - int i = 0, rc = 1, mode = 0; - - e_options addargs[] = { - {"--help", "-h", 0}, - {"--description", "-d", 1}, - {"--fw-destination", "-f", 1}, - {NULL, NULL, 0} - }; - - e_options deleteargs[] = { - {"--help", "-h", 0}, - {"--accessprofile", "-a", 1}, - {"--fw-destination", "-f", 1}, - {NULL, NULL, 0} - }; - - - e_options *fwadminargs = 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; - mode = 'A'; - } else if( (strcmp(argv[0], "--delete") == 0) || (strcmp(argv[0], "-D") == 0) ) { - xmlNewProp(srch_n, (xmlChar *) "mode", (xmlChar *) "delete"); - fwadminargs = deleteargs; - mode = 'D'; - } else { - fprintf(stderr, "%s: Invalid mode\n", MODULE); - xmlFreeDoc(srch_xml); - return 1; - } - - fmap_n = xmlNewChild(srch_n, NULL, (xmlChar *) "fieldMapping", NULL); - xmlNewProp(fmap_n, (xmlChar *) "table", (xmlChar *) "firewall_profiles"); - - for( i = 1; i < argc; i++ ) { - switch( eurephia_getopt(&i, argc, argv, fwadminargs) ) { - case 'a': - xmlNewChild(fmap_n, NULL, (xmlChar *) "accessprofile", (xmlChar *) optargs[0]); - break; - - case 'd': - xmlNewChild(fmap_n, NULL, (xmlChar *) "description", (xmlChar *) optargs[0]); - break; - - case 'f': - xmlNewChild(fmap_n, NULL, (xmlChar *) "fwprofile", (xmlChar *) optargs[0]); - break; - - case 'h': - display_fwadmin_help(mode); - return 0; - - default: - return 1; - } - } - - result_xml = eDBadminFirewallProfiles(ctx, srch_xml); - xmlFreeDoc(srch_xml); - if( result_xml == NULL ) { - fprintf(stderr, "%s: Error registering firewall profiles\n", MODULE); - return 1; - } - - res_n = eurephiaXML_getRoot(ctx, result_xml, NULL, 1); - if( res_n == NULL ) { - fprintf(stderr, "%s: Error registering firewall profiles. No results returned\n", MODULE); - return 1; - - } - - if( xmlStrcmp(res_n->name, (xmlChar *) "Error") == 0 ) { - fprintf(stderr, "%s: %s\n", MODULE, xmlExtractContent(res_n)); - rc = 1; - } else { - fprintf(stdout, "%s: %s\n", MODULE, xmlExtractContent(res_n)); - rc = 0; - } - xmlFreeDoc(result_xml); - - return rc; -} - - -int cmd_fwAdmin(eurephiaCTX *ctx, eurephiaSESSION *sess, eurephiaVALUES *cfg, int argc, char **argv) -{ - char **mode_argv; - int rc = 0, i = 0, mode_argc = 0; - e_options fwadminargs[] = { - {"--list", "-l", 0}, - {"--add", "-A", 0}, - {"--delete", "-D", 0}, - {"--help", "-h", 0}, - {NULL, NULL, 0} - }; - int (*mode_fnc) (eurephiaCTX *ctx, eurephiaSESSION *sess, eurephiaVALUES *cfg, int argc, char **argv); - - assert((ctx != NULL) && (ctx->dbc != NULL)); - - mode_fnc = NULL; - for( i = 1; i < argc; i++ ) { - switch( eurephia_getopt(&i, argc, argv, fwadminargs) ) { - case 'l': - mode_fnc = list_profiles; - break; - - case 'A': - case 'D': - mode_fnc = addelete_profile; - break; - - case 'h': - mode_fnc = help_fwAdmin2; - - default: - break; - } - if( mode_fnc != NULL ) { - break; - } - } - - // If we do not have any known mode defined, exit with error - if( mode_fnc == NULL ) { - fprintf(stderr, "%s: Unknown argument. No mode given\n", MODULE); - return 1; - } - - // Allocate memory for our arguments being sent to the mode function - mode_argv = (char **) calloc(sizeof(char *), (argc - i)+2); - assert(mode_argv != NULL); - - // Copy over only the arguments needed for the mode - mode_argc = eurephia_arraycp(i, argc, argv, mode_argv, (argc - i)); - - // Call the mode function - rc = mode_fnc(ctx, sess, cfg, mode_argc, mode_argv); - free_nullsafe(mode_argv); - - return rc; - -} - diff --git a/eurephiadm/commands/fwprofiles.c b/eurephiadm/commands/fwprofiles.c new file mode 100644 index 0000000..81d96bd --- /dev/null +++ b/eurephiadm/commands/fwprofiles.c @@ -0,0 +1,345 @@ +/* fwprofiles.c -- eurephiadm fwprofiles command: + * Manages firewall profiles + * + * GPLv2 only - Copyright (C) 2009 + * David Sommerseth + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; version 2 + * of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include +#include +#include + +#ifdef HAVE_LIBXML2 +#include +#endif + +#define MODULE "eurephia::fwProfiles" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../argparser.h" +#include "../field_print.h" +#include "../xsltparser.h" + + +void display_fwprofiles_help(int page) +{ + switch( page ) { + case 'l': + printf("The fwprofiles list mode will show all registered firewall profiles.\n" + "\n" + " -v | --verbose Show more details\n" + "\n" + "Filters:\n" + " -a | --accessprofile Numeric ID.\n" + " -f | --fw-destination Reference used by the firewall\n" + " -i | --uid Numeric user ID\n" + " -n | --username User name\n" + " -c | --certid Numeric reference to a certificate\n" + " -e | --email e-mail address in certificates\n" + " -d | --digest Certificate SHA1 digest\n\n"); + break; + + case 'A': + printf("The fwprofiles add mode will register a new firewall profile.\n" + "\n" + " -d | --description Description of the firewall destination/rule\n" + " -f | --fw-destination The reference used by the firewall module\n" + "\n" + ); + break; + + case 'D': + printf("The fwprofiles delete mode will delete a firewall profile.\n" + "\n" + " -a | --accessprofile Description of the firewall destination/rule\n" + " -f | --fw-destination The reference used by the firewall module\n" + "\n" + ); + break; + + default: + 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" + " -h | --help Show help\n\n"); + break; + } +} + + +void help_fwProfiles() +{ + display_fwprofiles_help(0); +} + +int help_fwProfiles2(eurephiaCTX *ctx, eurephiaSESSION *sess, eurephiaVALUES *cfg, int argc, char **argv) +{ + e_options fwprofilesargs[] = { + {"--list", "-l", 0}, + {"--add", "-A", 0}, + {"--delete", "-D", 0}, + {NULL, NULL, 0} + }; + int i = 1; + display_fwprofiles_help(eurephia_getopt(&i, argc, argv, fwprofilesargs)); + return 0; +} + + +int list_profiles(eurephiaCTX *ctx, eurephiaSESSION *sess, eurephiaVALUES *cfg, int argc, char **argv) +{ + xmlDoc *profiles_xml = NULL, *srch_xml = NULL; + xmlNode *fmap_n = NULL, *srch_n = NULL; + char *xsltparams[] = {"view", "'list'", NULL}; + int i = 0; + + e_options fwprofilesargs[] = { + {"--verbose", "-v", 0}, + {"--help", "-h", 0}, + {"--accessprofile", "-a", 1}, + {"--fw-destination", "-f", 1}, + {"--uid", "-i", 1}, + {"--username", "-u", 1}, + {"--certid", "-c", 1}, + {"--email", "-e", 1}, + {"--digest", "-d", 1}, + {NULL, NULL, 0} + }; + + eurephiaXML_CreateDoc(ctx, 1, "firewall_profiles", &srch_xml, &srch_n); + xmlNewProp(srch_n, (xmlChar *) "mode", (xmlChar *) "search"); + + fmap_n = xmlNewChild(srch_n, NULL, (xmlChar *) "fieldMapping", NULL); + xmlNewProp(fmap_n, (xmlChar *) "table", (xmlChar *) "firewall_profiles"); + + for( i = 1; i < argc; i++ ) { + switch( eurephia_getopt(&i, argc, argv, fwprofilesargs) ) { + case 'v': + xsltparams[1] = "'details'"; + break; + + case 'a': + xmlNewChild(fmap_n, NULL, (xmlChar *) "accessprofile", (xmlChar *) optargs[0]); + break; + + case 'f': + xmlNewChild(fmap_n, NULL, (xmlChar *) "fwprofile", (xmlChar *) optargs[0]); + break; + + case 'i': + xmlNewChild(fmap_n, NULL, (xmlChar *) "uid", (xmlChar *) optargs[0]); + break; + + case 'u': + xmlNewChild(fmap_n, NULL, (xmlChar *) "username", (xmlChar *) optargs[0]); + break; + + case 'c': + xmlNewChild(fmap_n, NULL, (xmlChar *) "certid", (xmlChar *) optargs[0]); + break; + + case 'e': + xmlNewChild(fmap_n, NULL, (xmlChar *) "email", (xmlChar *) optargs[0]); + break; + + case 'd': + xmlNewChild(fmap_n, NULL, (xmlChar *) "digest", (xmlChar *) optargs[0]); + break; + + case 'h': + display_fwprofiles_help('l'); + return 0; + + default: + return 1; + } + } + + profiles_xml = eDBadminFirewallProfiles(ctx, srch_xml); + xmlFreeDoc(srch_xml); + if( profiles_xml == NULL ) { + fprintf(stderr, "%s: Error retrieving firewall profiles\n", MODULE); + return 1; + } + + xslt_print_xmldoc(stdout, cfg, profiles_xml, "fwadmin.xsl", (const char **) xsltparams); + + xmlFreeDoc(profiles_xml); + return 0; +} + + +int addelete_profile(eurephiaCTX *ctx, eurephiaSESSION *sess, eurephiaVALUES *cfg, int argc, char **argv) +{ + xmlDoc *result_xml = NULL, *srch_xml = NULL; + xmlNode *fmap_n = NULL, *res_n = NULL, *srch_n = NULL; + int i = 0, rc = 1, mode = 0; + + e_options addargs[] = { + {"--help", "-h", 0}, + {"--description", "-d", 1}, + {"--fw-destination", "-f", 1}, + {NULL, NULL, 0} + }; + + e_options deleteargs[] = { + {"--help", "-h", 0}, + {"--accessprofile", "-a", 1}, + {"--fw-destination", "-f", 1}, + {NULL, NULL, 0} + }; + + + 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"); + fwprofilesargs = addargs; + mode = 'A'; + } else if( (strcmp(argv[0], "--delete") == 0) || (strcmp(argv[0], "-D") == 0) ) { + xmlNewProp(srch_n, (xmlChar *) "mode", (xmlChar *) "delete"); + fwprofilesargs = deleteargs; + mode = 'D'; + } else { + fprintf(stderr, "%s: Invalid mode\n", MODULE); + xmlFreeDoc(srch_xml); + return 1; + } + + fmap_n = xmlNewChild(srch_n, NULL, (xmlChar *) "fieldMapping", NULL); + xmlNewProp(fmap_n, (xmlChar *) "table", (xmlChar *) "firewall_profiles"); + + for( i = 1; i < argc; i++ ) { + switch( eurephia_getopt(&i, argc, argv, fwprofilesargs) ) { + case 'a': + xmlNewChild(fmap_n, NULL, (xmlChar *) "accessprofile", (xmlChar *) optargs[0]); + break; + + case 'd': + xmlNewChild(fmap_n, NULL, (xmlChar *) "description", (xmlChar *) optargs[0]); + break; + + case 'f': + xmlNewChild(fmap_n, NULL, (xmlChar *) "fwprofile", (xmlChar *) optargs[0]); + break; + + case 'h': + display_fwprofiles_help(mode); + return 0; + + default: + return 1; + } + } + + result_xml = eDBadminFirewallProfiles(ctx, srch_xml); + xmlFreeDoc(srch_xml); + if( result_xml == NULL ) { + fprintf(stderr, "%s: Error registering firewall profiles\n", MODULE); + return 1; + } + + res_n = eurephiaXML_getRoot(ctx, result_xml, NULL, 1); + if( res_n == NULL ) { + fprintf(stderr, "%s: Error registering firewall profiles. No results returned\n", MODULE); + return 1; + + } + + if( xmlStrcmp(res_n->name, (xmlChar *) "Error") == 0 ) { + fprintf(stderr, "%s: %s\n", MODULE, xmlExtractContent(res_n)); + rc = 1; + } else { + fprintf(stdout, "%s: %s\n", MODULE, xmlExtractContent(res_n)); + rc = 0; + } + xmlFreeDoc(result_xml); + + return rc; +} + + +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 fwprofilesargs[] = { + {"--list", "-l", 0}, + {"--add", "-A", 0}, + {"--delete", "-D", 0}, + {"--help", "-h", 0}, + {NULL, NULL, 0} + }; + int (*mode_fnc) (eurephiaCTX *ctx, eurephiaSESSION *sess, eurephiaVALUES *cfg, int argc, char **argv); + + assert((ctx != NULL) && (ctx->dbc != NULL)); + + mode_fnc = NULL; + for( i = 1; i < argc; i++ ) { + switch( eurephia_getopt(&i, argc, argv, fwprofilesargs) ) { + case 'l': + mode_fnc = list_profiles; + break; + + case 'A': + case 'D': + mode_fnc = addelete_profile; + break; + + case 'h': + mode_fnc = help_fwProfiles2; + + default: + break; + } + if( mode_fnc != NULL ) { + break; + } + } + + // If we do not have any known mode defined, exit with error + if( mode_fnc == NULL ) { + fprintf(stderr, "%s: Unknown argument. No mode given\n", MODULE); + return 1; + } + + // Allocate memory for our arguments being sent to the mode function + mode_argv = (char **) calloc(sizeof(char *), (argc - i)+2); + assert(mode_argv != NULL); + + // Copy over only the arguments needed for the mode + mode_argc = eurephia_arraycp(i, argc, argv, mode_argv, (argc - i)); + + // Call the mode function + rc = mode_fnc(ctx, sess, cfg, mode_argc, mode_argv); + free_nullsafe(mode_argv); + + return rc; + +} + -- cgit