]>
Commit | Line | Data |
---|---|---|
997358a6 MW |
1 | /* |
2 | * copyright reporter | |
3 | * (just avoids having the info in more than one place in the source) | |
4 | * Copyright (C) 2001 Henry Spencer. | |
7daf5226 | 5 | * |
997358a6 MW |
6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms of the GNU General Public License as published by the | |
8 | * Free Software Foundation; either version 2 of the License, or (at your | |
9 | * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>. | |
7daf5226 | 10 | * |
997358a6 MW |
11 | * This program is distributed in the hope that it will be useful, but |
12 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |
13 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
14 | * for more details. | |
997358a6 MW |
15 | */ |
16 | ||
17 | #include <sys/types.h> | |
18 | #include <stdio.h> | |
19 | #include <stdlib.h> | |
20 | #include <string.h> | |
21 | #include <unistd.h> | |
22 | #include <getopt.h> | |
fa9f1013 | 23 | |
fa9f1013 | 24 | #include <library.h> |
997358a6 | 25 | |
4a548609 | 26 | static const char *copyright[] = { |
dc4dd88c | 27 | "Copyright (C) 1999-2013", |
e398dfb4 | 28 | " Henry Spencer, D. Hugh Redelmeier, Michael Richardson, Ken Bantoft,", |
a7b8e380 AS |
29 | " Stephen J. Bevan, JuanJo Ciarlante, Thomas Egerer, Heiko Hund,", |
30 | " Mathieu Lafon, Stephane Laroche, Kai Martius, Stephan Scholz,", | |
31 | " Tuomo Soini, Herbert Xu.", | |
4a548609 TB |
32 | "", |
33 | " Martin Berner, Marco Bertossa, David Buechi, Ueli Galizzi,", | |
34 | " Christoph Gysin, Andreas Hess, Patric Lichtsteiner, Michael Meier,", | |
35 | " Andreas Schleiss, Ariane Seiler, Mario Strasser, Lukas Suter,", | |
36 | " Roger Wegmann, Simon Zwahlen,", | |
37 | " ZHW Zuercher Hochschule Winterthur (Switzerland).", | |
38 | "", | |
dc4dd88c AS |
39 | " Philip Boetschi, Tobias Brunner, Christoph Buehler, Reto Buerki,", |
40 | " Sansar Choinyambuu, Adrian Doerig, Andreas Eigenmann, Giuliano Grassi,", | |
41 | " Reto Guadagnini, Fabian Hartmann, Noah Heusser, Jan Hutter,", | |
42 | " Thomas Kallenberg, Patrick Loetscher, Daniel Roethlisberger,", | |
43 | " Adrian-Ken Rueegsegger, Ralf Sager, Joel Stillhart, Daniel Wydler,", | |
44 | " Andreas Steffen,", | |
4a548609 TB |
45 | " HSR Hochschule fuer Technik Rapperswil (Switzerland).", |
46 | "", | |
a7b8e380 AS |
47 | " Martin Willi (revosec AG), Clavister (Sweden).", |
48 | "", | |
4a548609 TB |
49 | "This program is free software; you can redistribute it and/or modify it", |
50 | "under the terms of the GNU General Public License as published by the", | |
51 | "Free Software Foundation; either version 2 of the License, or (at your", | |
52 | "option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.", | |
53 | "", | |
54 | "This program is distributed in the hope that it will be useful, but", | |
55 | "WITHOUT ANY WARRANTY; without even the implied warranty of", | |
56 | "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General", | |
57 | "Public License (file COPYING in the distribution) for more details.", | |
58 | NULL, | |
59 | }; | |
60 | ||
997358a6 MW |
61 | char usage[] = "Usage: ipsec _copyright"; |
62 | struct option opts[] = { | |
63 | {"help", 0, NULL, 'h',}, | |
64 | {"version", 0, NULL, 'v',}, | |
65 | {0, 0, NULL, 0, }, | |
66 | }; | |
67 | ||
68 | char me[] = "ipsec _copyright"; /* for messages */ | |
69 | ||
70 | int | |
71 | main(int argc, char *argv[]) | |
72 | { | |
73 | int opt; | |
74 | extern int optind; | |
75 | int errflg = 0; | |
4a548609 | 76 | const char **notice = copyright; |
997358a6 MW |
77 | const char **co; |
78 | ||
34d3bfcf | 79 | library_init(NULL, "_copyright"); |
fa9f1013 TB |
80 | atexit(library_deinit); |
81 | ||
997358a6 MW |
82 | while ((opt = getopt_long(argc, argv, "", opts, NULL)) != EOF) |
83 | switch (opt) { | |
84 | case 'h': /* help */ | |
85 | printf("%s\n", usage); | |
86 | exit(0); | |
87 | break; | |
88 | case 'v': /* version */ | |
ebde1a7d | 89 | printf("%s strongSwan "VERSION"\n", me); |
997358a6 MW |
90 | exit(0); |
91 | break; | |
92 | case '?': | |
93 | default: | |
94 | errflg = 1; | |
95 | break; | |
96 | } | |
97 | if (errflg || optind != argc) { | |
98 | fprintf(stderr, "%s\n", usage); | |
99 | exit(2); | |
100 | } | |
101 | ||
102 | for (co = notice; *co != NULL; co++) | |
103 | printf("%s\n", *co); | |
104 | exit(0); | |
105 | } |