summaryrefslogtreecommitdiffstats
path: root/database
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2008-09-26 09:15:48 +0200
committerDavid Sommerseth <dazo@users.sourceforge.net>2008-09-26 09:15:48 +0200
commita66ebdced469fe235ac3519a7bcec733046b5e76 (patch)
treed3cccef4640a56793f0e9219dc5b15a4489d8185 /database
parent7681cc6bcbc0bca9eda98672db3cc8f178dd5082 (diff)
Improved description in database driver template regarding argument parsing
Diffstat (limited to 'database')
-rw-r--r--database/eurephiadb-driver_template.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/database/eurephiadb-driver_template.c b/database/eurephiadb-driver_template.c
index b608481..005afc7 100644
--- a/database/eurephiadb-driver_template.c
+++ b/database/eurephiadb-driver_template.c
@@ -105,13 +105,26 @@ int eDBconnect(eurephiaCTX *ctx, const int argc, const char **argv)
eDBconn *dbc = NULL;
int rc;
- DEBUG(ctx, 10, "Function call: eDBconnect(ctx, %i, '%s')", argc, argv[1]);
-
- if( (argc != 1) || (argv[0] == NULL) || (strlen(argv[0]) < 1) ) {
- eurephia_log(ctx, LOG_PANIC, 0,
- "Wrong parameters to eurephia-auth (eDBconnect). Cannot open database.");
- return 0;
- }
+ /* WORK TO DO -- Parse arguments
+ *
+ * use what ever suitable approach to parse arguments sent to the database module.
+ *
+ * The arguments being recieved is everything after the '--' (double dash)
+ * in the 'plugin' configuration line for OpenVPN.
+ *
+ * plugin eurephia-auth.so "-i my_db_module.so -L 3 -- myparam1 myparam2 myparam3"
+ *
+ * In this example the following parameters will be available here:
+ *
+ * argc = 3
+ * argv[0] = myparam1
+ * argv[1] = myparam2
+ * argv[2] = myparam3
+ *
+ * You are free to use whatever parameter syntax you would like to use.
+ */
+
+ DEBUG(ctx, 10, "Function call: eDBconnect(ctx, %i, '...')", argc, dbame);
// Connect to the database
dbc = (eDBconn *) malloc(sizeof(eDBconn)+2);