starter: Print additional help texts for selected deprecated keywords.
authorTobias Brunner <tobias@strongswan.org>
Tue, 12 Jun 2012 11:59:05 +0000 (13:59 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 12 Jun 2012 14:15:03 +0000 (16:15 +0200)
src/starter/args.c
src/starter/confread.c
src/starter/keywords.h
src/starter/keywords.txt

index 36f1205..5aaf764 100644 (file)
@@ -120,6 +120,7 @@ static const token_info_t token_info[] =
        { ARG_ENUM, offsetof(starter_config_t, setup.uniqueids), LST_unique            },
        { ARG_ENUM, offsetof(starter_config_t, setup.cachecrls), LST_bool              },
        { ARG_ENUM, offsetof(starter_config_t, setup.strictcrlpolicy), LST_strict      },
+       { ARG_MISC, 0, NULL  /* KW_PKCS11_DEPRECATED */                                },
        { ARG_MISC, 0, NULL  /* KW_SETUP_DEPRECATED */                                 },
 
        /* conn section keywords */
@@ -165,6 +166,7 @@ static const token_info_t token_info[] =
        { ARG_MISC, 0, NULL  /* KW_MARK_IN */                                          },
        { ARG_MISC, 0, NULL  /* KW_MARK_OUT */                                         },
        { ARG_MISC, 0, NULL  /* KW_TFC */                                              },
+       { ARG_MISC, 0, NULL  /* KW_PFS_DEPRECATED */                                   },
        { ARG_MISC, 0, NULL  /* KW_CONN_DEPRECATED */                                  },
 
        /* ca section keywords */
index 81db70a..cee9e9d 100644 (file)
@@ -59,11 +59,13 @@ static bool is_deprecated(kw_token_t token, kw_list_t *kw, char *name)
        switch (token)
        {
                case KW_SETUP_DEPRECATED:
+               case KW_PKCS11_DEPRECATED:
                        DBG1(DBG_APP, "# deprecated keyword '%s' in config setup",
                                 kw->entry->name);
                        break;
                case KW_CONN_DEPRECATED:
                case KW_END_DEPRECATED:
+               case KW_PFS_DEPRECATED:
                        DBG1(DBG_APP, "# deprecated keyword '%s' in conn '%s'",
                                 kw->entry->name, name);
                        break;
@@ -74,6 +76,19 @@ static bool is_deprecated(kw_token_t token, kw_list_t *kw, char *name)
                default:
                        return FALSE;
        }
+       /* additional messages for some */
+       switch (token)
+       {
+               case KW_PKCS11_DEPRECATED:
+                       DBG1(DBG_APP, "  use the 'pkcs11' plugin instead", kw->entry->name);
+                       break;
+               case KW_PFS_DEPRECATED:
+                       DBG1(DBG_APP, "  PFS is enabled by specifying a DH group in the "
+                                "'esp' cipher suite", kw->entry->name);
+                       break;
+               default:
+                       break;
+       }
        return TRUE;
 }
 
index c1347dc..c053db1 100644 (file)
@@ -22,6 +22,7 @@ typedef enum {
        KW_UNIQUEIDS,
        KW_CACHECRLS,
        KW_STRICTCRLPOLICY,
+       KW_PKCS11_DEPRECATED,
        KW_SETUP_DEPRECATED,
 
 #define KW_SETUP_FIRST  KW_CHARONDEBUG
@@ -70,6 +71,7 @@ typedef enum {
        KW_MARK_IN,
        KW_MARK_OUT,
        KW_TFC,
+       KW_PFS_DEPRECATED,
        KW_CONN_DEPRECATED,
 
 #define KW_CONN_FIRST   KW_CONN_SETUP
index eab8bd5..238b3fd 100644 (file)
@@ -147,12 +147,12 @@ nat_traversal,     KW_SETUP_DEPRECATED
 keep_alive,        KW_SETUP_DEPRECATED
 force_keepalive,   KW_SETUP_DEPRECATED
 virtual_private,   KW_SETUP_DEPRECATED
-pkcs11module,      KW_SETUP_DEPRECATED
-pkcs11initargs,    KW_SETUP_DEPRECATED
-pkcs11keepstate,   KW_SETUP_DEPRECATED
-pkcs11proxy,       KW_SETUP_DEPRECATED
-pfs,               KW_CONN_DEPRECATED
-pfsgroup,          KW_CONN_DEPRECATED
+pkcs11module,      KW_PKCS11_DEPRECATED
+pkcs11initargs,    KW_PKCS11_DEPRECATED
+pkcs11keepstate,   KW_PKCS11_DEPRECATED
+pkcs11proxy,       KW_PKCS11_DEPRECATED
+pfs,               KW_PFS_DEPRECATED
+pfsgroup,          KW_PFS_DEPRECATED
 eap,               KW_CONN_DEPRECATED
 leftnexthop,       KW_LEFT_DEPRECATED
 leftsubnetwithin,  KW_LEFT_DEPRECATED