Mercurial > dropbear
comparison dbmulti.c @ 30:223b0f5f8dce
Switching to the magical new Makefile, and new dbmulti style
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Tue, 27 Jul 2004 14:44:43 +0000 |
parents | fe6bca95afa7 |
children | f789045062e6 |
comparison
equal
deleted
inserted
replaced
29:0fcf63e1cb01 | 30:223b0f5f8dce |
---|---|
2 | 2 |
3 /* definitions are cleanest if we just put them here */ | 3 /* definitions are cleanest if we just put them here */ |
4 int dropbear_main(int argc, char ** argv); | 4 int dropbear_main(int argc, char ** argv); |
5 int dropbearkey_main(int argc, char ** argv); | 5 int dropbearkey_main(int argc, char ** argv); |
6 int dropbearconvert_main(int argc, char ** argv); | 6 int dropbearconvert_main(int argc, char ** argv); |
7 int scp_main(int argc, char ** argv); | |
7 | 8 |
8 int main(int argc, char ** argv) { | 9 int main(int argc, char ** argv) { |
9 | 10 |
10 char * progname; | 11 char * progname; |
11 | 12 |
12 if (argc > 0) { | 13 if (argc > 0) { |
13 /* figure which form we're being called as */ | 14 /* figure which form we're being called as */ |
14 progname = basename(argv[0]); | 15 progname = basename(argv[0]); |
15 | 16 |
16 #ifdef DBMULTI_DROPBEAR | 17 #ifdef DBMULTI_dropbear |
17 if (strcmp(progname, "dropbear") == 0) { | 18 if (strcmp(progname, "dropbear") == 0) { |
18 return dropbear_main(argc, argv); | 19 return dropbear_main(argc, argv); |
19 } | 20 } |
20 #endif | 21 #endif |
21 #ifdef DBMULTI_KEY | 22 #ifdef DBMULTI_dropbearkey |
22 if (strcmp(progname, "dropbearkey") == 0) { | 23 if (strcmp(progname, "dropbearkey") == 0) { |
23 return dropbearkey_main(argc, argv); | 24 return dropbearkey_main(argc, argv); |
24 } | 25 } |
25 #endif | 26 #endif |
26 #ifdef DBMULTI_CONVERT | 27 #ifdef DBMULTI_dropbearconvert |
27 if (strcmp(progname, "dropbearconvert") == 0) { | 28 if (strcmp(progname, "dropbearconvert") == 0) { |
28 return dropbearconvert_main(argc, argv); | 29 return dropbearconvert_main(argc, argv); |
30 } | |
31 #endif | |
32 #ifdef DBMULTI_scp | |
33 if (strcmp(progname, "scp") == 0) { | |
34 return scp_main(argc, argv); | |
29 } | 35 } |
30 #endif | 36 #endif |
31 } | 37 } |
32 | 38 |
33 fprintf(stderr, "Dropbear multi-purpose version %s\n" | 39 fprintf(stderr, "Dropbear multi-purpose version %s\n" |
34 "Make a symlink pointing at this binary with one of the following names:\n" | 40 "Make a symlink pointing at this binary with one of the following names:\n" |
35 #ifdef DBMULTI_DROPBEAR | 41 #ifdef DBMULTI_dropbear |
36 "'dropbear' - the Dropbear server\n" | 42 "'dropbear' - the Dropbear server\n" |
37 #endif | 43 #endif |
38 #ifdef DBMULTI_KEY | 44 #ifdef DBMULTI_dropbearkey |
39 "'dropbearkey' - the key generator\n" | 45 "'dropbearkey' - the key generator\n" |
40 #endif | 46 #endif |
41 #ifdef DBMULTI_CONVERT | 47 #ifdef DBMULTI_dropbearconvert |
42 "'dropbearconvert' - the key converter\n" | 48 "'dropbearconvert' - the key converter\n" |
49 #endif | |
50 #ifdef DBMULTI_scp | |
51 "'scp' - secure copy\n" | |
43 #endif | 52 #endif |
44 , | 53 , |
45 DROPBEAR_VERSION); | 54 DROPBEAR_VERSION); |
46 exit(1); | 55 exit(1); |
47 | 56 |