#ifndef PARSE_H
#define PARSE_H
#include <sys/queue.h>
#define AUTH_MAXLEN 120
#define DOMAIN_MAXLEN 255
enum keytype {
KT_RSA = 0,
KT_ECDSA
};
enum identifiertype {
ID_DNS = 0,
ID_IP
};
struct authority_c {
TAILQ_ENTRY(authority_c) entry;
char *name;
char *api;
int insecure;
char *account;
enum keytype keytype;
char *contact;
};
struct domain_c {
TAILQ_ENTRY(domain_c) entry;
TAILQ_HEAD(, altname_c) altname_list;
int altname_count;
enum keytype keytype;
enum identifiertype idtype;
char *handle;
char *domain;
char *key;
char *cert;
char *chain;
char *fullchain;
char *auth;
char *challengedir;
char *profile;
};
struct altname_c {
TAILQ_ENTRY(altname_c) entry;
char *domain;
enum identifiertype idtype;
};
struct keyfile {
LIST_ENTRY(keyfile) entry;
char *name;
};
#define ACME_OPT_VERBOSE 0x00000001
#define ACME_OPT_CHECK 0x00000004
struct acme_conf {
int opts;
TAILQ_HEAD(, authority_c) authority_list;
TAILQ_HEAD(, domain_c) domain_list;
LIST_HEAD(, keyfile) used_key_list;
};
struct acme_conf *parse_config(const char *, int);
int cmdline_symset(char *);
struct authority_c *authority_find(struct acme_conf *, char *);
struct authority_c *authority_find0(struct acme_conf *);
struct domain_c *domain_find_handle(struct acme_conf *, char *);
int domain_valid(const char *);
const char *ip_valid(const char *);
#endif