aboutsummaryrefslogtreecommitdiffstats
path: root/src/_copyright/_copyright.c
blob: b20b1725603fee68e7e2a1a786bd8e184b02bc32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*
 * copyright reporter
 * (just avoids having the info in more than one place in the source)
 * Copyright (C) 2001  Henry Spencer.
 *
 * 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; either version 2 of the License, or (at your
 * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
 *
 * 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.
 */

#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <getopt.h>

#include <library.h>

static const char *copyright[] = {
	"Copyright (C) 1999-2012",
	"    Henry Spencer, D. Hugh Redelmeier, Michael Richardson, Ken Bantoft,",
	"    Stephen J. Bevan, JuanJo Ciarlante, Thomas Egerer, Heiko Hund,",
	"    Mathieu Lafon, Stephane Laroche, Kai Martius, Stephan Scholz,",
	"    Tuomo Soini, Herbert Xu.",
	"",
	"    Martin Berner, Marco Bertossa, David Buechi, Ueli Galizzi,",
	"    Christoph Gysin, Andreas Hess, Patric Lichtsteiner, Michael Meier,",
	"    Andreas Schleiss, Ariane Seiler, Mario Strasser, Lukas Suter,",
	"    Roger Wegmann, Simon Zwahlen,",
	"    ZHW Zuercher Hochschule Winterthur (Switzerland).",
	"",
	"    Philip Boetschi, Tobias Brunner, Sansar Choinyambuu, Adrian Doerig,",
	"    Andreas Eigenmann, Giuliano Grassi, Reto Guadagnini, Fabian Hartmann,",
	"    Noah Heusser, Jan Hutter, Thomas Kallenberg, Daniel Roethlisberger,",
	"    Ralf Sager, Joel Stillhart, Daniel Wydler, Andreas Steffen,",
	"    HSR Hochschule fuer Technik Rapperswil (Switzerland).",
	"",
	"    Martin Willi (revosec AG), Clavister (Sweden).",
	"",
	"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; either version 2 of the License, or (at your",
	"option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.",
	"",
	"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 (file COPYING in the distribution) for more details.",
	NULL,
};

char usage[] = "Usage: ipsec _copyright";
struct option opts[] = {
  {"help",	0,	NULL,	'h',},
  {"version",	0,	NULL,	'v',},
  {0,		0,	NULL,	0, },
};

char me[] = "ipsec _copyright";	/* for messages */

int
main(int argc, char *argv[])
{
	int opt;
	extern int optind;
	int errflg = 0;
	const char **notice = copyright;
	const char **co;

	library_init(NULL);
	atexit(library_deinit);

	while ((opt = getopt_long(argc, argv, "", opts, NULL)) != EOF)
		switch (opt) {
		case 'h':	/* help */
			printf("%s\n", usage);
			exit(0);
			break;
		case 'v':	/* version */
			printf("%s strongSwan "VERSION"\n", me);
			exit(0);
			break;
		case '?':
		default:
			errflg = 1;
			break;
		}
	if (errflg || optind != argc) {
		fprintf(stderr, "%s\n", usage);
		exit(2);
	}

	for (co = notice; *co != NULL; co++)
		printf("%s\n", *co);
	exit(0);
}