starter: Use new parser to read config file
This commit is contained in:
+4
-38
@@ -18,13 +18,6 @@
|
||||
|
||||
#include <kernel/kernel_ipsec.h>
|
||||
|
||||
#include "ipsec-parser.h"
|
||||
|
||||
/** to mark seen keywords */
|
||||
typedef u_int64_t seen_t;
|
||||
#define SEEN_NONE 0;
|
||||
#define SEEN_KW(kw, base) ((seen_t)1 << ((kw) - (base)))
|
||||
|
||||
typedef enum {
|
||||
STARTUP_NO,
|
||||
STARTUP_ADD,
|
||||
@@ -92,7 +85,6 @@ typedef enum {
|
||||
typedef struct starter_end starter_end_t;
|
||||
|
||||
struct starter_end {
|
||||
seen_t seen;
|
||||
char *auth;
|
||||
char *auth2;
|
||||
char *id;
|
||||
@@ -121,22 +113,10 @@ struct starter_end {
|
||||
char *dns;
|
||||
};
|
||||
|
||||
typedef struct also also_t;
|
||||
|
||||
struct also {
|
||||
char *name;
|
||||
bool included;
|
||||
also_t *next;
|
||||
};
|
||||
|
||||
typedef struct starter_conn starter_conn_t;
|
||||
|
||||
struct starter_conn {
|
||||
seen_t seen;
|
||||
char *name;
|
||||
also_t *also;
|
||||
kw_list_t *kw;
|
||||
u_int visit;
|
||||
startup_t startup;
|
||||
starter_state_t state;
|
||||
|
||||
@@ -193,11 +173,7 @@ struct starter_conn {
|
||||
typedef struct starter_ca starter_ca_t;
|
||||
|
||||
struct starter_ca {
|
||||
seen_t seen;
|
||||
char *name;
|
||||
also_t *also;
|
||||
kw_list_t *kw;
|
||||
u_int visit;
|
||||
startup_t startup;
|
||||
starter_state_t state;
|
||||
|
||||
@@ -217,7 +193,6 @@ typedef struct starter_config starter_config_t;
|
||||
|
||||
struct starter_config {
|
||||
struct {
|
||||
seen_t seen;
|
||||
bool charonstart;
|
||||
char *charondebug;
|
||||
bool uniqueids;
|
||||
@@ -229,23 +204,14 @@ struct starter_config {
|
||||
u_int err;
|
||||
u_int non_fatal_err;
|
||||
|
||||
/* do we parse also statements */
|
||||
bool parse_also;
|
||||
|
||||
/* ca %default */
|
||||
starter_ca_t ca_default;
|
||||
|
||||
/* connections list (without %default) */
|
||||
/* connections list */
|
||||
starter_ca_t *ca_first, *ca_last;
|
||||
|
||||
/* conn %default */
|
||||
starter_conn_t conn_default;
|
||||
|
||||
/* connections list (without %default) */
|
||||
/* connections list */
|
||||
starter_conn_t *conn_first, *conn_last;
|
||||
};
|
||||
|
||||
extern starter_config_t *confread_load(const char *file);
|
||||
extern void confread_free(starter_config_t *cfg);
|
||||
starter_config_t *confread_load(const char *file);
|
||||
void confread_free(starter_config_t *cfg);
|
||||
|
||||
#endif /* _IPSEC_CONFREAD_H_ */
|
||||
|
||||
Reference in New Issue
Block a user