Only include C files that start with the plugin name when building for Android.
[strongswan.git] / src / libhydra / plugins / attr_sql / pool_usage.c
1 /*
2 * Copyright (C) 2008 Martin Willi
3 * Copyright (C) 2009-2010 Andreas Steffen
4 * Hochschule fuer Technik Rapperswil
5 *
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>.
10 *
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.
15 */
16
17 #include <stdio.h>
18
19 /**
20 * print pool usage info
21 */
22 void usage(void)
23 {
24 printf("\
25 Usage:\n\
26 ipsec pool --status|--add|--replace|--del|--resize|--purge [options]\n\
27 ipsec pool --statusattr|--addattr|--delattr [options]\n\
28 \n\
29 ipsec pool --status\n\
30 Show a list of installed pools with statistics plus nameserver info.\n\
31 \n\
32 ipsec pool --statusattr\n\
33 Show a list of all attributes stored in the database.\n\
34 \n\
35 ipsec pool --add <name> --start <start> --end <end> [--timeout <timeout>]\n\
36 ipsec pool --replace <name> --start <start> --end <end> [--timeout <timeout>]\n\
37 Add a new pool to or replace an existing pool in the database.\n\
38 name: Name of the pool, as used in ipsec.conf rightsourceip=%%name\n\
39 start: Start address of the pool\n\
40 end: End address of the pool\n\
41 timeout: Lease time in hours, 0 for static leases\n\
42 \n\
43 ipsec pool --add <name> --addresses <file> [--timeout <timeout>]\n\
44 ipsec pool --replace <name> --addresses <file> [--timeout <timeout>]\n\
45 Add a new pool to or replace an existing pool in the database.\n\
46 name: Name of the pool, as used in ipsec.conf rightsourceip=%%name\n\
47 file: File newline separated addresses for the pool are read from.\n\
48 Optionally each address can be pre-assigned to a roadwarrior\n\
49 identity, e.g. 10.231.14.2=alice@strongswan.org.\n\
50 If a - (hyphen) is given instead of a file name, the addresses\n\
51 are read from STDIN. Reading addresses stops at the end of file\n\
52 or an empty line. Pools created with this command can not be\n\
53 resized.\n\
54 timeout: Lease time in hours, 0 for static leases\n\
55 \n\
56 ipsec pool --add dns|nbns|wins --server <server>\n\
57 Add a new DNS or NBNS server to the database.\n\
58 server: IPv4 or IPv6 address of a name server\n\
59 \n\
60 ipsec pool --addattr <type> --server|--subnet|--string|--hex <value>\n\
61 Add a new attribute to the database.\n\
62 server: IPv4 or IPv6 address of a server\n\
63 subnet: IPv4 subnet given by network/mask\n\
64 string: value of a string-type attribute\n\
65 hex: hex value of any attribute\n\
66 \n\
67 ipsec pool --del <name>\n\
68 Delete a pool from the database.\n\
69 name: Name of the pool to delete\n\
70 \n\
71 ipsec pool --del dns|nbns|wins [--server <server>]\n\
72 Delete a specific or all DNS or NBNS servers from the database.\n\
73 server: IP address of the name server to delete\n\
74 \n\
75 ipsec pool --delattr <type> [--server|--subnet|--string|--hex <value>]\n\
76 Delete a specific or all attributes of a given type from the database.\n\
77 server: IPv4 or IPv6 address of a server\n\
78 subnet: IPv4 subnet given by network/mask\n\
79 string: value of a string-type attribute\n\
80 hex: hex value of any attribute\n\
81 \n\
82 ipsec pool --resize <name> --end <end>\n\
83 Grow or shrink an existing pool.\n\
84 name: Name of the pool to resize\n\
85 end: New end address for the pool\n\
86 \n\
87 ipsec pool --leases [--filter <filter>] [--utc]\n\
88 Show lease information using filters:\n\
89 filter: Filter string containing comma separated key=value filters,\n\
90 e.g. id=alice@strongswan.org,addr=1.1.1.1\n\
91 pool: name of the pool\n\
92 id: assigned identity of the lease\n\
93 addr: lease IP address\n\
94 tstamp: UNIX timestamp when lease was valid, as integer\n\
95 status: status of the lease: online|valid|expired\n\
96 utc: Show times in UTC instead of local time\n\
97 \n\
98 ipsec pool --purge <name>\n\
99 Delete lease history of a pool:\n\
100 name: Name of the pool to purge\n\
101 \n\
102 ipsec pool --batch <file>\n\
103 Read commands from a file and execute them atomically.\n\
104 file: File to read the newline separated commands from. Commands\n\
105 appear as they are written on the command line, e.g.\n\
106 --replace mypool --start 10.0.0.1 --end 10.0.0.254\n\
107 --del dns\n\
108 --add dns --server 10.1.0.1\n\
109 --add dns --server 10.1.1.1\n\
110 If a - (hyphen) is given as a file name, the commands are read\n\
111 from STDIN. Readin commands stops at the end of file. Empty\n\
112 lines are ignored. The file may not contain a --batch command.\n\
113 \n");
114 }
115