kernel-interface: Consider interface ID when allocating reqids
[strongswan.git] / src / pool / pool_usage.c
1 /*
2 * Copyright (C) 2008 Martin Willi
3 * Copyright (C) 2009-2010 Andreas Steffen
4 * HSR 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|--leases|--purge [options]\n\
27 ipsec pool --showattr|--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 [--hexout]\n\
33 Show a list of all attributes stored in the database with the values\n\
34 converted to the correct format if the type is known by --showattr or\n\
35 in hex format otherwise.\n\
36 hexout: Output all values in hex format\n\
37 \n\
38 ipsec pool --showattr\n\
39 Show a keyword list of the major attribute types.\n\
40 \n\
41 ipsec pool --add <name> --start <start> --end <end> [--timeout <timeout>]\n\
42 ipsec pool --replace <name> --start <start> --end <end> [--timeout <timeout>]\n\
43 Add a new pool to or replace an existing pool in the database.\n\
44 name: Name of the pool, as used in ipsec.conf rightsourceip=%%name\n\
45 start: Start address of the pool\n\
46 end: End address of the pool\n\
47 timeout: Lease time in hours (use 'd', 'm', or 's' to alternatively\n\
48 configure the time in days, minutes or seconds, respectively),\n\
49 0 for static leases\n\
50 \n\
51 ipsec pool --add <name> --addresses <file> [--timeout <timeout>]\n\
52 ipsec pool --replace <name> --addresses <file> [--timeout <timeout>]\n\
53 Add a new pool to or replace an existing pool in the database.\n\
54 name: Name of the pool, as used in ipsec.conf rightsourceip=%%name\n\
55 file: File newline separated addresses for the pool are read from.\n\
56 Optionally each address can be pre-assigned to a roadwarrior\n\
57 identity, e.g. 10.231.14.2=alice@strongswan.org.\n\
58 If a - (hyphen) is given instead of a file name, the addresses\n\
59 are read from STDIN. Reading addresses stops at the end of file\n\
60 or an empty line. Pools created with this command can not be\n\
61 resized.\n\
62 timeout: Lease time in hours (use 'd', 'm', or 's' to alternatively\n\
63 configure the time in days, minutes or seconds, respectively),\n\
64 0 for static leases\n\
65 \n\
66 ipsec pool --addattr <type> [--pool <name> [--identity <id>]]\n\
67 --addr|--mask|--server|--subnet|--string|--hex <value>\n\
68 Add a new attribute to the database. Attributes can be bundled by using\n\
69 the --pool and --identity options. If a bundle matches a peer the contained\n\
70 attributes are sent to that peer instead of the global ones.\n\
71 type: a keyword from --showattr or a number from the range 1..32767\n\
72 name: the name of the pool this attribute is added to\n\
73 id: identity of the peer this attribute is bound to\n\
74 addr: IPv4 or IPv6 address\n\
75 mask: IPv4 or IPv6 netmask (synonym for --addr)\n\
76 server: IPv4 or IPv6 address of a server (synonym for --addr)\n\
77 subnet: IPv4 subnet[s] given by network/mask[,network/mask,...]\n\
78 string: value of a string-type attribute\n\
79 hex: hex value of any attribute\n\
80 \n\
81 ipsec pool --del <name>\n\
82 Delete a pool from the database.\n\
83 name: Name of the pool to delete\n\
84 \n\
85 ipsec pool --delattr <type> [--pool <name> [--identity <id>]]\n\
86 [--addr|--mask|--server|--subnet|--string|--hex <value>]\n\
87 Delete a specific or all attributes of a given type from the database.\n\
88 type: a keyword from --showattr or a number from the range 1..32767\n\
89 name: the name of the pool this attribute is added to\n\
90 id: identity of the peer this attribute is bound to\n\
91 addr: IPv4 or IPv6 address\n\
92 mask: IPv4 or IPv6 netmask (synonym for --addr)\n\
93 server: IPv4 or IPv6 address of a server (synonym for --addr)\n\
94 subnet: IPv4 subnet[s] given by network/mask[,network/mask,...]\n\
95 string: value of a string-type attribute\n\
96 hex: hex value of any attribute\n\
97 \n\
98 ipsec pool --resize <name> --end <end>\n\
99 Grow or shrink an existing pool.\n\
100 name: Name of the pool to resize\n\
101 end: New end address for the pool\n\
102 \n\
103 ipsec pool --leases [--filter <filter>] [--utc]\n\
104 Show lease information using filters:\n\
105 filter: Filter string containing comma separated key=value filters,\n\
106 e.g. id=alice@strongswan.org,addr=1.1.1.1\n\
107 pool: name of the pool\n\
108 id: assigned identity of the lease\n\
109 addr: lease IP address\n\
110 tstamp: UNIX timestamp when lease was valid, as integer\n\
111 status: status of the lease: online|valid|expired\n\
112 utc: Show times in UTC instead of local time\n\
113 \n\
114 ipsec pool --purge <name>\n\
115 Delete lease history of a pool:\n\
116 name: Name of the pool to purge\n\
117 \n\
118 ipsec pool --batch <file>\n\
119 Read commands from a file and execute them atomically.\n\
120 file: File to read the newline separated commands from. Commands\n\
121 appear as they are written on the command line, e.g.\n\
122 --replace mypool --start 10.0.0.1 --end 10.0.0.254\n\
123 --del dns\n\
124 --add dns --server 10.1.0.1\n\
125 --add dns --server 10.1.1.1\n\
126 If a - (hyphen) is given as a file name, the commands are read\n\
127 from STDIN. Readin commands stops at the end of file. Empty\n\
128 lines are ignored. The file may not contain a --batch command.\n\
129 \n");
130 }