starter: Removed all unsupported keywords.

This commit is contained in:
Tobias Brunner
2012-06-11 17:33:32 +02:00
parent e55876a657
commit 3e2ff81e5d
7 changed files with 25 additions and 202 deletions
-70
View File
@@ -86,13 +86,6 @@ static const char *LST_startup[] = {
NULL NULL
}; };
static const char *LST_packetdefault[] = {
"drop",
"reject",
"pass",
NULL
};
static const char *LST_keyexchange[] = { static const char *LST_keyexchange[] = {
"ike", "ike",
"ikev1", "ikev1",
@@ -100,42 +93,6 @@ static const char *LST_keyexchange[] = {
NULL NULL
}; };
static const char *LST_plutodebug[] = {
"none",
"all",
"raw",
"crypt",
"parsing",
"emitting",
"control",
"lifecycle",
"klips",
"kernel",
"dns",
"natt",
"oppo",
"controlmore",
"private",
NULL
};
static const char *LST_klipsdebug[] = {
"tunnel",
"tunnel-xmit",
"pfkey",
"xform",
"eroute",
"spi",
"radij",
"esp",
"ah",
"ipcomp",
"verbose",
"all",
"none",
NULL
};
static const char *LST_authby[] = { static const char *LST_authby[] = {
"psk", "psk",
"secret", "secret",
@@ -159,37 +116,10 @@ typedef struct {
static const token_info_t token_info[] = static const token_info_t token_info[] =
{ {
/* config setup keywords */ /* config setup keywords */
{ ARG_LST, offsetof(starter_config_t, setup.interfaces), NULL },
{ ARG_STR, offsetof(starter_config_t, setup.dumpdir), NULL },
{ ARG_ENUM, offsetof(starter_config_t, setup.charonstart), LST_bool },
{ ARG_ENUM, offsetof(starter_config_t, setup.plutostart), LST_bool },
/* pluto/charon keywords */
{ ARG_LST, offsetof(starter_config_t, setup.plutodebug), LST_plutodebug },
{ ARG_STR, offsetof(starter_config_t, setup.charondebug), NULL }, { ARG_STR, offsetof(starter_config_t, setup.charondebug), NULL },
{ ARG_STR, offsetof(starter_config_t, setup.prepluto), NULL },
{ ARG_STR, offsetof(starter_config_t, setup.postpluto), NULL },
{ ARG_STR, offsetof(starter_config_t, setup.plutostderrlog), NULL },
{ ARG_ENUM, offsetof(starter_config_t, setup.uniqueids), LST_unique }, { ARG_ENUM, offsetof(starter_config_t, setup.uniqueids), LST_unique },
{ ARG_UINT, offsetof(starter_config_t, setup.overridemtu), NULL },
{ ARG_TIME, offsetof(starter_config_t, setup.crlcheckinterval), NULL },
{ ARG_ENUM, offsetof(starter_config_t, setup.cachecrls), LST_bool }, { ARG_ENUM, offsetof(starter_config_t, setup.cachecrls), LST_bool },
{ ARG_ENUM, offsetof(starter_config_t, setup.strictcrlpolicy), LST_strict }, { ARG_ENUM, offsetof(starter_config_t, setup.strictcrlpolicy), LST_strict },
{ ARG_ENUM, offsetof(starter_config_t, setup.nocrsend), LST_bool },
{ ARG_ENUM, offsetof(starter_config_t, setup.nat_traversal), LST_bool },
{ ARG_TIME, offsetof(starter_config_t, setup.keep_alive), NULL },
{ ARG_ENUM, offsetof(starter_config_t, setup.force_keepalive), LST_bool },
{ ARG_STR, offsetof(starter_config_t, setup.virtual_private), NULL },
{ ARG_STR, offsetof(starter_config_t, setup.pkcs11module), NULL },
{ ARG_STR, offsetof(starter_config_t, setup.pkcs11initargs), NULL },
{ ARG_ENUM, offsetof(starter_config_t, setup.pkcs11keepstate), LST_bool },
{ ARG_ENUM, offsetof(starter_config_t, setup.pkcs11proxy), LST_bool },
/* KLIPS keywords */
{ ARG_LST, offsetof(starter_config_t, setup.klipsdebug), LST_klipsdebug },
{ ARG_ENUM, offsetof(starter_config_t, setup.fragicmp), LST_bool },
{ ARG_STR, offsetof(starter_config_t, setup.packetdefault), LST_packetdefault },
{ ARG_ENUM, offsetof(starter_config_t, setup.hidetos), LST_bool },
/* conn section keywords */ /* conn section keywords */
{ ARG_STR, offsetof(starter_conn_t, name), NULL }, { ARG_STR, offsetof(starter_conn_t, name), NULL },
+3 -23
View File
@@ -23,8 +23,7 @@
#define SUBCMP(obj) if (!samesubnet(&c1->obj,&c2->obj)) return FALSE #define SUBCMP(obj) if (!samesubnet(&c1->obj,&c2->obj)) return FALSE
#define STRCMP(obj) if (strcmp(c1->obj,c2->obj)) return FALSE #define STRCMP(obj) if (strcmp(c1->obj,c2->obj)) return FALSE
static bool static bool starter_cmp_end(starter_end_t *c1, starter_end_t *c2)
starter_cmp_end(starter_end_t *c1, starter_end_t *c2)
{ {
if ((c1 == NULL) || (c2 == NULL)) if ((c1 == NULL) || (c2 == NULL))
return FALSE; return FALSE;
@@ -38,8 +37,7 @@ starter_cmp_end(starter_end_t *c1, starter_end_t *c2)
return cmp_args(KW_END_FIRST, KW_END_LAST, (char *)c1, (char *)c2); return cmp_args(KW_END_FIRST, KW_END_LAST, (char *)c1, (char *)c2);
} }
bool bool starter_cmp_conn(starter_conn_t *c1, starter_conn_t *c2)
starter_cmp_conn(starter_conn_t *c1, starter_conn_t *c2)
{ {
if ((c1 == NULL) || (c2 == NULL)) if ((c1 == NULL) || (c2 == NULL))
return FALSE; return FALSE;
@@ -58,8 +56,7 @@ starter_cmp_conn(starter_conn_t *c1, starter_conn_t *c2)
return cmp_args(KW_CONN_NAME, KW_CONN_LAST, (char *)c1, (char *)c2); return cmp_args(KW_CONN_NAME, KW_CONN_LAST, (char *)c1, (char *)c2);
} }
bool bool starter_cmp_ca(starter_ca_t *c1, starter_ca_t *c2)
starter_cmp_ca(starter_ca_t *c1, starter_ca_t *c2)
{ {
if (c1 == NULL || c2 == NULL) if (c1 == NULL || c2 == NULL)
return FALSE; return FALSE;
@@ -67,20 +64,3 @@ starter_cmp_ca(starter_ca_t *c1, starter_ca_t *c2)
return cmp_args(KW_CA_NAME, KW_CA_LAST, (char *)c1, (char *)c2); return cmp_args(KW_CA_NAME, KW_CA_LAST, (char *)c1, (char *)c2);
} }
bool
starter_cmp_klips(starter_config_t *c1, starter_config_t *c2)
{
if ((c1 == NULL) || (c2 == NULL))
return FALSE;
return cmp_args(KW_KLIPS_FIRST, KW_KLIPS_LAST, (char *)c1, (char *)c2);
}
bool
starter_cmp_pluto(starter_config_t *c1, starter_config_t *c2)
{
if ((c1 == NULL) || (c2 == NULL))
return FALSE;
return cmp_args(KW_PLUTO_FIRST, KW_PLUTO_LAST, (char *)c1, (char *)c2);
}
+2 -4
View File
@@ -15,10 +15,8 @@
#ifndef _STARTER_CMP_H_ #ifndef _STARTER_CMP_H_
#define _STARTER_CMP_H_ #define _STARTER_CMP_H_
extern bool starter_cmp_conn(starter_conn_t *c1, starter_conn_t *c2); bool starter_cmp_conn(starter_conn_t *c1, starter_conn_t *c2);
extern bool starter_cmp_ca(starter_ca_t *c1, starter_ca_t *c2); bool starter_cmp_ca(starter_ca_t *c1, starter_ca_t *c2);
extern bool starter_cmp_klips(starter_config_t *c1, starter_config_t *c2);
extern bool starter_cmp_pluto(starter_config_t *c1, starter_config_t *c2);
#endif #endif
-3
View File
@@ -69,10 +69,7 @@ static void default_values(starter_config_t *cfg)
sizeof(cfg->ca_default.seen) * BITS_PER_BYTE); sizeof(cfg->ca_default.seen) * BITS_PER_BYTE);
cfg->setup.seen = SEEN_NONE; cfg->setup.seen = SEEN_NONE;
cfg->setup.fragicmp = TRUE;
cfg->setup.hidetos = TRUE;
cfg->setup.uniqueids = TRUE; cfg->setup.uniqueids = TRUE;
cfg->setup.interfaces = new_list("%defaultroute");
#ifdef START_CHARON #ifdef START_CHARON
cfg->setup.charonstart = TRUE; cfg->setup.charonstart = TRUE;
+1 -27
View File
@@ -209,37 +209,11 @@ typedef struct starter_config starter_config_t;
struct starter_config { struct starter_config {
struct { struct {
seen_t seen; seen_t seen;
char **interfaces; bool charonstart;
char *dumpdir;
bool charonstart;
bool plutostart;
/* pluto/charon keywords */
char **plutodebug;
char *charondebug; char *charondebug;
char *prepluto;
char *postpluto;
char *plutostderrlog;
bool uniqueids; bool uniqueids;
u_int overridemtu;
time_t crlcheckinterval;
bool cachecrls; bool cachecrls;
strict_t strictcrlpolicy; strict_t strictcrlpolicy;
bool nocrsend;
bool nat_traversal;
time_t keep_alive;
u_int force_keepalive;
char *virtual_private;
char *pkcs11module;
char *pkcs11initargs;
bool pkcs11keepstate;
bool pkcs11proxy;
/* KLIPS keywords */
char **klipsdebug;
bool fragicmp;
char *packetdefault;
bool hidetos;
} setup; } setup;
/* number of encountered parsing errors */ /* number of encountered parsing errors */
+7 -40
View File
@@ -1,4 +1,4 @@
/* strongSwan keywords /*
* Copyright (C) 2005 Andreas Steffen * Copyright (C) 2005 Andreas Steffen
* Hochschule fuer Technik Rapperswil, Switzerland * Hochschule fuer Technik Rapperswil, Switzerland
* *
@@ -18,46 +18,13 @@
typedef enum { typedef enum {
/* config setup keywords */ /* config setup keywords */
KW_INTERFACES,
KW_DUMPDIR,
KW_CHARONSTART,
KW_PLUTOSTART,
/* pluto/charon keywords */
KW_PLUTODEBUG,
KW_CHARONDEBUG, KW_CHARONDEBUG,
KW_PREPLUTO,
KW_POSTPLUTO,
KW_PLUTOSTDERRLOG,
KW_UNIQUEIDS, KW_UNIQUEIDS,
KW_OVERRIDEMTU,
KW_CRLCHECKINTERVAL,
KW_CACHECRLS, KW_CACHECRLS,
KW_STRICTCRLPOLICY, KW_STRICTCRLPOLICY,
KW_NOCRSEND,
KW_NAT_TRAVERSAL,
KW_KEEP_ALIVE,
KW_FORCE_KEEPALIVE,
KW_VIRTUAL_PRIVATE,
KW_PKCS11MODULE,
KW_PKCS11INITARGS,
KW_PKCS11KEEPSTATE,
KW_PKCS11PROXY,
#define KW_PLUTO_FIRST KW_PLUTODEBUG #define KW_SETUP_FIRST KW_CHARONDEBUG
#define KW_PLUTO_LAST KW_PKCS11PROXY #define KW_SETUP_LAST KW_STRICTCRLPOLICY
/* KLIPS keywords */
KW_KLIPSDEBUG,
KW_FRAGICMP,
KW_PACKETDEFAULT,
KW_HIDETOS,
#define KW_KLIPS_FIRST KW_KLIPSDEBUG
#define KW_KLIPS_LAST KW_HIDETOS
#define KW_SETUP_FIRST KW_INTERFACES
#define KW_SETUP_LAST KW_HIDETOS
/* conn section keywords */ /* conn section keywords */
KW_CONN_NAME, KW_CONN_NAME,
@@ -106,7 +73,7 @@ typedef enum {
#define KW_CONN_FIRST KW_CONN_SETUP #define KW_CONN_FIRST KW_CONN_SETUP
#define KW_CONN_LAST KW_TFC #define KW_CONN_LAST KW_TFC
/* ca section keywords */ /* ca section keywords */
KW_CA_NAME, KW_CA_NAME,
KW_CA_SETUP, KW_CA_SETUP,
KW_CACERT, KW_CACERT,
@@ -121,7 +88,7 @@ typedef enum {
#define KW_CA_FIRST KW_CA_SETUP #define KW_CA_FIRST KW_CA_SETUP
#define KW_CA_LAST KW_CERTURIBASE #define KW_CA_LAST KW_CERTURIBASE
/* end keywords */ /* end keywords */
KW_HOST, KW_HOST,
KW_IKEPORT, KW_IKEPORT,
KW_SUBNET, KW_SUBNET,
@@ -148,7 +115,7 @@ typedef enum {
#define KW_END_FIRST KW_HOST #define KW_END_FIRST KW_HOST
#define KW_END_LAST KW_GROUPS #define KW_END_LAST KW_GROUPS
/* left end keywords */ /* left end keywords */
KW_LEFT, KW_LEFT,
KW_LEFTIKEPORT, KW_LEFTIKEPORT,
KW_LEFTSUBNET, KW_LEFTSUBNET,
@@ -175,7 +142,7 @@ typedef enum {
#define KW_LEFT_FIRST KW_LEFT #define KW_LEFT_FIRST KW_LEFT
#define KW_LEFT_LAST KW_LEFTGROUPS #define KW_LEFT_LAST KW_LEFTGROUPS
/* right end keywords */ /* right end keywords */
KW_RIGHT, KW_RIGHT,
KW_RIGHTIKEPORT, KW_RIGHTIKEPORT,
KW_RIGHTSUBNET, KW_RIGHTSUBNET,
+12 -35
View File
@@ -1,5 +1,5 @@
%{ %{
/* strongSwan keywords /*
* Copyright (C) 2005 Andreas Steffen * Copyright (C) 2005 Andreas Steffen
* Hochschule fuer Technik Rapperswil, Switzerland * Hochschule fuer Technik Rapperswil, Switzerland
* *
@@ -24,37 +24,10 @@ struct kw_entry {
kw_token_t token; kw_token_t token;
}; };
%% %%
interfaces, KW_INTERFACES
dumpdir, KW_DUMPDIR
charonstart, KW_CHARONSTART
plutostart, KW_PLUTOSTART
klipsdebug, KW_KLIPSDEBUG
plutodebug, KW_PLUTODEBUG
charondebug, KW_CHARONDEBUG charondebug, KW_CHARONDEBUG
prepluto, KW_PREPLUTO
postpluto, KW_POSTPLUTO
plutostderrlog, KW_PLUTOSTDERRLOG
fragicmp, KW_FRAGICMP
packetdefault, KW_PACKETDEFAULT
hidetos, KW_HIDETOS
uniqueids, KW_UNIQUEIDS uniqueids, KW_UNIQUEIDS
overridemtu, KW_OVERRIDEMTU
crlcheckinterval, KW_CRLCHECKINTERVAL
cachecrls, KW_CACHECRLS cachecrls, KW_CACHECRLS
strictcrlpolicy, KW_STRICTCRLPOLICY strictcrlpolicy, KW_STRICTCRLPOLICY
nocrsend, KW_NOCRSEND
nat_traversal, KW_NAT_TRAVERSAL
keep_alive, KW_KEEP_ALIVE
force_keepalive, KW_FORCE_KEEPALIVE
virtual_private, KW_VIRTUAL_PRIVATE
eap_identity, KW_EAP_IDENTITY
aaa_identity, KW_AAA_IDENTITY
mobike, KW_MOBIKE
forceencaps, KW_FORCEENCAPS
pkcs11module, KW_PKCS11MODULE
pkcs11initargs, KW_PKCS11INITARGS
pkcs11keepstate, KW_PKCS11KEEPSTATE
pkcs11proxy, KW_PKCS11PROXY
keyexchange, KW_KEYEXCHANGE keyexchange, KW_KEYEXCHANGE
type, KW_TYPE type, KW_TYPE
compress, KW_COMPRESS compress, KW_COMPRESS
@@ -62,21 +35,25 @@ installpolicy, KW_INSTALLPOLICY
aggressive, KW_AGGRESSIVE aggressive, KW_AGGRESSIVE
auth, KW_AUTH auth, KW_AUTH
authby, KW_AUTHBY authby, KW_AUTHBY
eap_identity, KW_EAP_IDENTITY
aaa_identity, KW_AAA_IDENTITY
mobike, KW_MOBIKE
forceencaps, KW_FORCEENCAPS
ikelifetime, KW_IKELIFETIME
lifetime, KW_KEYLIFE
keylife, KW_KEYLIFE keylife, KW_KEYLIFE
rekeymargin, KW_REKEYMARGIN rekeymargin, KW_REKEYMARGIN
lifetime, KW_KEYLIFE
margintime, KW_REKEYMARGIN margintime, KW_REKEYMARGIN
lifebytes, KW_LIFEBYTES lifebytes, KW_LIFEBYTES
marginbytes, KW_MARGINBYTES marginbytes, KW_MARGINBYTES
lifepackets, KW_LIFEPACKETS lifepackets, KW_LIFEPACKETS
marginpackets, KW_MARGINPACKETS marginpackets, KW_MARGINPACKETS
ikelifetime, KW_IKELIFETIME
keyingtries, KW_KEYINGTRIES keyingtries, KW_KEYINGTRIES
rekeyfuzz, KW_REKEYFUZZ rekeyfuzz, KW_REKEYFUZZ
rekey, KW_REKEY rekey, KW_REKEY
reauth, KW_REAUTH reauth, KW_REAUTH
esp, KW_ESP
ike, KW_IKE ike, KW_IKE
esp, KW_ESP
dpddelay, KW_DPDDELAY dpddelay, KW_DPDDELAY
dpdtimeout, KW_DPDTIMEOUT dpdtimeout, KW_DPDTIMEOUT
dpdaction, KW_DPDACTION dpdaction, KW_DPDACTION
@@ -113,10 +90,10 @@ leftfirewall, KW_LEFTFIREWALL
lefthostaccess, KW_LEFTHOSTACCESS lefthostaccess, KW_LEFTHOSTACCESS
leftallowany, KW_LEFTALLOWANY leftallowany, KW_LEFTALLOWANY
leftupdown, KW_LEFTUPDOWN leftupdown, KW_LEFTUPDOWN
leftid, KW_LEFTID
leftid2, KW_LEFTID2
leftauth, KW_LEFTAUTH leftauth, KW_LEFTAUTH
leftauth2, KW_LEFTAUTH2 leftauth2, KW_LEFTAUTH2
leftid, KW_LEFTID
leftid2, KW_LEFTID2
leftrsasigkey, KW_LEFTRSASIGKEY leftrsasigkey, KW_LEFTRSASIGKEY
leftcert, KW_LEFTCERT leftcert, KW_LEFTCERT
leftcert2, KW_LEFTCERT2 leftcert2, KW_LEFTCERT2
@@ -135,10 +112,10 @@ rightfirewall, KW_RIGHTFIREWALL
righthostaccess, KW_RIGHTHOSTACCESS righthostaccess, KW_RIGHTHOSTACCESS
rightallowany, KW_RIGHTALLOWANY rightallowany, KW_RIGHTALLOWANY
rightupdown, KW_RIGHTUPDOWN rightupdown, KW_RIGHTUPDOWN
rightid, KW_RIGHTID
rightid2, KW_RIGHTID2
rightauth, KW_RIGHTAUTH rightauth, KW_RIGHTAUTH
rightauth2, KW_RIGHTAUTH2 rightauth2, KW_RIGHTAUTH2
rightid, KW_RIGHTID
rightid2, KW_RIGHTID2
rightrsasigkey, KW_RIGHTRSASIGKEY rightrsasigkey, KW_RIGHTRSASIGKEY
rightcert, KW_RIGHTCERT rightcert, KW_RIGHTCERT
rightcert2, KW_RIGHTCERT2 rightcert2, KW_RIGHTCERT2