diff options
author | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2009-02-28 22:02:31 +0000 |
---|---|---|
committer | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2009-02-28 22:02:31 +0000 |
commit | 19364e11c66714324bd3d5d0dc9212db397085cb (patch) | |
tree | fe7f5e55f0474dad1d0c29ba7c0a6f4546c99c3a /src/stroke | |
parent | c7f1b0530b85bc7654e68992f25ed8ced5d0a80d (diff) | |
download | vyos-strongswan-19364e11c66714324bd3d5d0dc9212db397085cb.tar.gz vyos-strongswan-19364e11c66714324bd3d5d0dc9212db397085cb.zip |
[svn-upgrade] Integrating new upstream version, strongswan (4.2.12)
Diffstat (limited to 'src/stroke')
-rw-r--r-- | src/stroke/Makefile.in | 18 | ||||
-rw-r--r-- | src/stroke/stroke.c | 20 | ||||
-rw-r--r-- | src/stroke/stroke_keywords.c | 80 | ||||
-rw-r--r-- | src/stroke/stroke_keywords.h | 5 | ||||
-rw-r--r-- | src/stroke/stroke_keywords.txt | 7 | ||||
-rw-r--r-- | src/stroke/stroke_msg.h | 12 |
6 files changed, 87 insertions, 55 deletions
diff --git a/src/stroke/Makefile.in b/src/stroke/Makefile.in index 62d1bb83e..0d78d9425 100644 --- a/src/stroke/Makefile.in +++ b/src/stroke/Makefile.in @@ -76,22 +76,17 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ -ECHO = @ECHO@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GPERF = @GPERF@ GREP = @GREP@ INSTALL = @INSTALL@ @@ -101,6 +96,7 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ IPSEC_ROUTING_TABLE = @IPSEC_ROUTING_TABLE@ IPSEC_ROUTING_TABLE_PRIO = @IPSEC_ROUTING_TABLE_PRIO@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ @@ -109,12 +105,16 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LINUX_HEADERS = @LINUX_HEADERS@ +LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ +NM = @NM@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ @@ -137,8 +137,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -177,6 +176,7 @@ libstrongswan_plugins = @libstrongswan_plugins@ linuxdir = @linuxdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ nm_CFLAGS = @nm_CFLAGS@ diff --git a/src/stroke/stroke.c b/src/stroke/stroke.c index d100c2107..01cbcb5b0 100644 --- a/src/stroke/stroke.c +++ b/src/stroke/stroke.c @@ -13,7 +13,7 @@ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * - * RCSID $Id: stroke.c 4384 2008-10-08 07:00:13Z andreas $ + * RCSID $Id: stroke.c 4783 2008-12-10 13:00:02Z martin $ */ #include <stdlib.h> @@ -259,6 +259,18 @@ static int purge(stroke_keyword_t kw) return send_stroke_msg(&msg); } +static int leases(stroke_keyword_t kw, char *pool, char *address) +{ + + stroke_msg_t msg; + + msg.type = STR_LEASES; + msg.length = offsetof(stroke_msg_t, buffer); + msg.leases.pool = push_string(&msg, pool); + msg.leases.address = push_string(&msg, address); + return send_stroke_msg(&msg); +} + static int set_loglevel(char *type, u_int level) { stroke_msg_t msg; @@ -318,6 +330,8 @@ static void exit_usage(char *error) printf(" stroke rereadsecrets|rereadcrls|rereadall\n"); printf(" Purge ocsp cache entries:\n"); printf(" stroke purgeocsp\n"); + printf(" Show leases of a pool:\n"); + printf(" stroke leases [POOL [ADDRESS]]\n"); exit_error(error); } @@ -429,6 +443,10 @@ int main(int argc, char *argv[]) case STROKE_PURGE_OCSP: res = purge(token->kw); break; + case STROKE_LEASES: + res = leases(token->kw, argc > 2 ? argv[2] : NULL, + argc > 3 ? argv[3] : NULL); + break; default: exit_usage(NULL); } diff --git a/src/stroke/stroke_keywords.c b/src/stroke/stroke_keywords.c index 17bcda47c..a5d17edc2 100644 --- a/src/stroke/stroke_keywords.c +++ b/src/stroke/stroke_keywords.c @@ -44,7 +44,7 @@ error "gperf generated tables don't work with this execution character set. Plea * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * - * RCSID $Id: stroke_keywords.txt 4384 2008-10-08 07:00:13Z andreas $ + * RCSID $Id: stroke_keywords.txt 4783 2008-12-10 13:00:02Z martin $ */ #include <string.h> @@ -56,12 +56,12 @@ struct stroke_token { stroke_keyword_t kw; }; -#define TOTAL_KEYWORDS 31 +#define TOTAL_KEYWORDS 32 #define MIN_WORD_LENGTH 2 #define MAX_WORD_LENGTH 15 #define MIN_HASH_VALUE 3 -#define MAX_HASH_VALUE 48 -/* maximum key range = 46, duplicates = 0 */ +#define MAX_HASH_VALUE 65 +/* maximum key range = 63, duplicates = 0 */ #ifdef __GNUC__ __inline @@ -77,32 +77,32 @@ hash (str, len) { static const unsigned char asso_values[] = { - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 0, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 0, 0, 5, - 28, 0, 49, 10, 49, 20, 49, 49, 0, 49, - 49, 20, 0, 49, 10, 10, 0, 10, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49 + 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 0, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 0, 0, 5, + 45, 0, 66, 10, 66, 15, 66, 66, 0, 66, + 66, 20, 0, 66, 10, 10, 0, 10, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66 }; register int hval = len; @@ -129,7 +129,8 @@ static const struct stroke_token wordlist[] = { {""}, {""}, {""}, {"add", STROKE_ADD}, - {""}, {""}, {""}, + {""}, {""}, + {"leases", STROKE_LEASES}, {"listall", STROKE_LIST_ALL}, {"loglevel", STROKE_LOGLEVEL}, {""}, @@ -145,8 +146,8 @@ static const struct stroke_token wordlist[] = {"rereadall", STROKE_REREAD_ALL}, {""}, {"listcacerts", STROKE_LIST_CACERTS}, - {"rereadacerts", STROKE_REREAD_ACERTS,}, - {"rereadaacerts", STROKE_REREAD_AACERTS,}, + {"rereadacerts", STROKE_REREAD_ACERTS}, + {"rereadaacerts", STROKE_REREAD_AACERTS}, {"listcerts", STROKE_LIST_CERTS}, {"rereadcrls", STROKE_REREAD_CRLS}, {"status", STROKE_STATUS}, @@ -154,13 +155,10 @@ static const struct stroke_token wordlist[] = {"rereadcacerts", STROKE_REREAD_CACERTS}, {"statusall", STROKE_STATUSALL}, {""}, - {"del", STROKE_DEL}, - {"down", STROKE_DOWN}, - {"rereadsecrets", STROKE_REREAD_SECRETS}, - {"delete", STROKE_DELETE}, - {""}, {"listcainfos", STROKE_LIST_CAINFOS}, {""}, + {"rereadsecrets", STROKE_REREAD_SECRETS}, + {""}, {""}, {""}, {""}, {"listocsp", STROKE_LIST_OCSP}, {""}, {"listgroups", STROKE_LIST_GROUPS}, @@ -169,6 +167,12 @@ static const struct stroke_token wordlist[] = {""}, {"rereadocspcerts", STROKE_REREAD_OCSPCERTS}, {""}, {""}, + {"del", STROKE_DEL}, + {"down", STROKE_DOWN}, + {""}, + {"delete", STROKE_DELETE}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {"down-srcip", STROKE_DOWN_SRCIP} }; diff --git a/src/stroke/stroke_keywords.h b/src/stroke/stroke_keywords.h index 0ad221153..e089b5660 100644 --- a/src/stroke/stroke_keywords.h +++ b/src/stroke/stroke_keywords.h @@ -12,7 +12,7 @@ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * - * RCSID $Id: stroke_keywords.h 4384 2008-10-08 07:00:13Z andreas $ + * RCSID $Id: stroke_keywords.h 4783 2008-12-10 13:00:02Z martin $ */ #ifndef _STROKE_KEYWORDS_H_ @@ -49,7 +49,8 @@ typedef enum { STROKE_REREAD_ACERTS, STROKE_REREAD_CRLS, STROKE_REREAD_ALL, - STROKE_PURGE_OCSP + STROKE_PURGE_OCSP, + STROKE_LEASES } stroke_keyword_t; #define STROKE_LIST_FIRST STROKE_LIST_PUBKEYS diff --git a/src/stroke/stroke_keywords.txt b/src/stroke/stroke_keywords.txt index ba35e8bcc..3ec259a24 100644 --- a/src/stroke/stroke_keywords.txt +++ b/src/stroke/stroke_keywords.txt @@ -13,7 +13,7 @@ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * - * RCSID $Id: stroke_keywords.txt 4384 2008-10-08 07:00:13Z andreas $ + * RCSID $Id: stroke_keywords.txt 4783 2008-12-10 13:00:02Z martin $ */ #include <string.h> @@ -52,8 +52,9 @@ listall, STROKE_LIST_ALL rereadsecrets, STROKE_REREAD_SECRETS rereadcacerts, STROKE_REREAD_CACERTS rereadocspcerts, STROKE_REREAD_OCSPCERTS -rereadaacerts, STROKE_REREAD_AACERTS, -rereadacerts, STROKE_REREAD_ACERTS, +rereadaacerts, STROKE_REREAD_AACERTS +rereadacerts, STROKE_REREAD_ACERTS rereadcrls, STROKE_REREAD_CRLS rereadall, STROKE_REREAD_ALL purgeocsp, STROKE_PURGE_OCSP +leases, STROKE_LEASES diff --git a/src/stroke/stroke_msg.h b/src/stroke/stroke_msg.h index 38f44f923..81ad2e397 100644 --- a/src/stroke/stroke_msg.h +++ b/src/stroke/stroke_msg.h @@ -19,7 +19,7 @@ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * - * RCSID $Id: stroke_msg.h 4614 2008-11-11 07:28:52Z andreas $ + * RCSID $Id: stroke_msg.h 4783 2008-12-10 13:00:02Z martin $ */ #ifndef STROKE_MSG_H_ @@ -181,7 +181,9 @@ struct stroke_msg_t { /* reread various objects */ STR_REREAD, /* purge various objects */ - STR_PURGE + STR_PURGE, + /* show pool leases */ + STR_LEASES, /* more to come */ } type; @@ -278,6 +280,12 @@ struct stroke_msg_t { struct { purge_flag_t flags; } purge; + + /* data for STR_LEASES */ + struct { + char *pool; + char *address; + } leases; }; char buffer[STROKE_BUF_LEN]; }; |