summaryrefslogtreecommitdiff
path: root/src/stroke
diff options
context:
space:
mode:
Diffstat (limited to 'src/stroke')
-rw-r--r--src/stroke/Makefile.am14
-rw-r--r--src/stroke/Makefile.in16
-rw-r--r--src/stroke/stroke_keywords.h3
-rw-r--r--src/stroke/stroke_keywords.h.in79
4 files changed, 103 insertions, 9 deletions
diff --git a/src/stroke/Makefile.am b/src/stroke/Makefile.am
index ed170bd08..5c04b5ae7 100644
--- a/src/stroke/Makefile.am
+++ b/src/stroke/Makefile.am
@@ -4,13 +4,19 @@ stroke_SOURCES = \
stroke.c stroke_msg.h stroke_keywords.c stroke_keywords.h
stroke_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la $(SOCKLIB)
-EXTRA_DIST = stroke_keywords.txt Android.mk
-BUILT_SOURCES = stroke_keywords.c
-MAINTAINERCLEANFILES = stroke_keywords.c
+EXTRA_DIST = stroke_keywords.h.in stroke_keywords.txt Android.mk
+BUILT_SOURCES = stroke_keywords.h stroke_keywords.c
+MAINTAINERCLEANFILES = stroke_keywords.h stroke_keywords.c
AM_CPPFLAGS = \
-I$(top_srcdir)/src/libstrongswan \
-DIPSEC_PIDDIR=\"${piddir}\"
-stroke_keywords.c: $(srcdir)/stroke_keywords.txt $(srcdir)/stroke_keywords.h
+stroke_keywords.h: $(srcdir)/stroke_keywords.h.in
+ $(AM_V_GEN) \
+ sed \
+ -e "s:\@GPERF_LEN_TYPE\@:$(GPERF_LEN_TYPE):" \
+ $< > $@
+
+stroke_keywords.c: $(srcdir)/stroke_keywords.txt stroke_keywords.h
$(AM_V_GEN) \
$(GPERF) -m 10 -D -C -G -t < $(srcdir)/stroke_keywords.txt > $@
diff --git a/src/stroke/Makefile.in b/src/stroke/Makefile.in
index 9d17733ba..be31bc581 100644
--- a/src/stroke/Makefile.in
+++ b/src/stroke/Makefile.in
@@ -215,9 +215,11 @@ ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
+FUZZING_LDFLAGS = @FUZZING_LDFLAGS@
GEM = @GEM@
GENHTML = @GENHTML@
GPERF = @GPERF@
+GPERF_LEN_TYPE = @GPERF_LEN_TYPE@
GPRBUILD = @GPRBUILD@
GREP = @GREP@
INSTALL = @INSTALL@
@@ -422,9 +424,9 @@ stroke_SOURCES = \
stroke.c stroke_msg.h stroke_keywords.c stroke_keywords.h
stroke_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la $(SOCKLIB)
-EXTRA_DIST = stroke_keywords.txt Android.mk
-BUILT_SOURCES = stroke_keywords.c
-MAINTAINERCLEANFILES = stroke_keywords.c
+EXTRA_DIST = stroke_keywords.h.in stroke_keywords.txt Android.mk
+BUILT_SOURCES = stroke_keywords.h stroke_keywords.c
+MAINTAINERCLEANFILES = stroke_keywords.h stroke_keywords.c
AM_CPPFLAGS = \
-I$(top_srcdir)/src/libstrongswan \
-DIPSEC_PIDDIR=\"${piddir}\"
@@ -769,7 +771,13 @@ uninstall-am: uninstall-ipsecPROGRAMS
.PRECIOUS: Makefile
-stroke_keywords.c: $(srcdir)/stroke_keywords.txt $(srcdir)/stroke_keywords.h
+stroke_keywords.h: $(srcdir)/stroke_keywords.h.in
+ $(AM_V_GEN) \
+ sed \
+ -e "s:\@GPERF_LEN_TYPE\@:$(GPERF_LEN_TYPE):" \
+ $< > $@
+
+stroke_keywords.c: $(srcdir)/stroke_keywords.txt stroke_keywords.h
$(AM_V_GEN) \
$(GPERF) -m 10 -D -C -G -t < $(srcdir)/stroke_keywords.txt > $@
diff --git a/src/stroke/stroke_keywords.h b/src/stroke/stroke_keywords.h
index 4a1016277..00b992769 100644
--- a/src/stroke/stroke_keywords.h
+++ b/src/stroke/stroke_keywords.h
@@ -73,6 +73,7 @@ typedef enum {
typedef struct stroke_token stroke_token_t;
-extern const stroke_token_t* in_word_set(register const char *str, register unsigned int len);
+extern const stroke_token_t* in_word_set(register const char *str,
+ register unsigned len);
#endif /* _STROKE_KEYWORDS_H_ */
diff --git a/src/stroke/stroke_keywords.h.in b/src/stroke/stroke_keywords.h.in
new file mode 100644
index 000000000..2b5780adc
--- /dev/null
+++ b/src/stroke/stroke_keywords.h.in
@@ -0,0 +1,79 @@
+/* stroke keywords
+ * Copyright (C) 2006 Andreas Steffen
+ * Hochschule fuer Technik Rapperswil, Switzerland
+ *
+ * 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.
+ */
+
+#ifndef _STROKE_KEYWORDS_H_
+#define _STROKE_KEYWORDS_H_
+
+typedef enum {
+ STROKE_ADD,
+ STROKE_DEL,
+ STROKE_DELETE,
+ STROKE_ROUTE,
+ STROKE_UNROUTE,
+ STROKE_UP,
+ STROKE_UP_NOBLK,
+ STROKE_DOWN,
+ STROKE_DOWN_NOBLK,
+ STROKE_DOWN_SRCIP,
+ STROKE_REKEY,
+ STROKE_LOGLEVEL,
+ STROKE_STATUS,
+ STROKE_STATUSALL,
+ STROKE_STATUSALL_NOBLK,
+ STROKE_LIST_PUBKEYS,
+ STROKE_LIST_CERTS,
+ STROKE_LIST_CACERTS,
+ STROKE_LIST_OCSPCERTS,
+ STROKE_LIST_AACERTS,
+ STROKE_LIST_ACERTS,
+ STROKE_LIST_GROUPS,
+ STROKE_LIST_CAINFOS,
+ STROKE_LIST_CRLS,
+ STROKE_LIST_OCSP,
+ STROKE_LIST_ALGS,
+ STROKE_LIST_PLUGINS,
+ STROKE_LIST_ALL,
+ STROKE_REREAD_SECRETS,
+ STROKE_REREAD_CACERTS,
+ STROKE_REREAD_OCSPCERTS,
+ STROKE_REREAD_AACERTS,
+ STROKE_REREAD_ACERTS,
+ STROKE_REREAD_CRLS,
+ STROKE_REREAD_ALL,
+ STROKE_PURGE_OCSP,
+ STROKE_PURGE_CRLS,
+ STROKE_PURGE_CERTS,
+ STROKE_PURGE_IKE,
+ STROKE_EXPORT_X509,
+ STROKE_EXPORT_CONN_CERT,
+ STROKE_EXPORT_CONN_CHAIN,
+ STROKE_LEASES,
+ STROKE_MEMUSAGE,
+ STROKE_USER_CREDS,
+ STROKE_COUNTERS,
+ STROKE_COUNTERS_RESET,
+} stroke_keyword_t;
+
+#define STROKE_LIST_FIRST STROKE_LIST_PUBKEYS
+#define STROKE_REREAD_FIRST STROKE_REREAD_SECRETS
+#define STROKE_PURGE_FIRST STROKE_PURGE_OCSP
+#define STROKE_EXPORT_FIRST STROKE_EXPORT_X509
+
+typedef struct stroke_token stroke_token_t;
+
+extern const stroke_token_t* in_word_set(register const char *str,
+ register @GPERF_LEN_TYPE@ len);
+
+#endif /* _STROKE_KEYWORDS_H_ */