summaryrefslogtreecommitdiff
path: root/dbmulti.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2004-06-01 02:46:09 +0000
committerMatt Johnston <matt@ucc.asn.au>2004-06-01 02:46:09 +0000
commitd53c6e53ee09a98198f57c5dfa18416040d3ce99 (patch)
tree3b5a173c356f867b94df3873b57ff36d33129ea7 /dbmulti.c
downloaddropbear-d53c6e53ee09a98198f57c5dfa18416040d3ce99.tar.gz
Makefile.in contains updated files required
Diffstat (limited to 'dbmulti.c')
-rw-r--r--dbmulti.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/dbmulti.c b/dbmulti.c
new file mode 100644
index 0000000..d82eff0
--- /dev/null
+++ b/dbmulti.c
@@ -0,0 +1,48 @@
+#include "includes.h"
+
+/* definitions are cleanest if we just put them here */
+int dropbear_main(int argc, char ** argv);
+int dropbearkey_main(int argc, char ** argv);
+int dropbearconvert_main(int argc, char ** argv);
+
+int main(int argc, char ** argv) {
+
+ char * progname;
+
+ if (argc > 0) {
+ /* figure which form we're being called as */
+ progname = basename(argv[0]);
+
+#ifdef DBMULTI_DROPBEAR
+ if (strcmp(progname, "dropbear") == 0) {
+ return dropbear_main(argc, argv);
+ }
+#endif
+#ifdef DBMULTI_KEY
+ if (strcmp(progname, "dropbearkey") == 0) {
+ return dropbearkey_main(argc, argv);
+ }
+#endif
+#ifdef DBMULTI_CONVERT
+ if (strcmp(progname, "dropbearconvert") == 0) {
+ return dropbearconvert_main(argc, argv);
+ }
+#endif
+ }
+
+ fprintf(stderr, "Dropbear multi-purpose version %s\n"
+ "Make a symlink pointing at this binary with one of the following names:\n"
+#ifdef DBMULTI_DROPBEAR
+ "'dropbear' - the Dropbear server\n"
+#endif
+#ifdef DBMULTI_KEY
+ "'dropbearkey' - the key generator\n"
+#endif
+#ifdef DBMULTI_CONVERT
+ "'dropbearconvert' - the key converter\n"
+#endif
+ ,
+ DROPBEAR_VERSION);
+ exit(1);
+
+}