Subversion Repositories Tewi

Rev

Rev 12 | Rev 18 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

/* $Id: tw_config.h 17 2024-09-13 17:41:07Z nishi $ */

#ifndef __TW_CONFIG_H__
#define __TW_CONFIG_H__

#include <stdint.h>

#define MAX_PORTS 1024

#define MAX_VHOSTS 1024

struct tw_config_entry {
        char* name;
        int port;
        char* sslkey;
        char* sslcert;
};

struct tw_config {
        uint64_t ports[MAX_PORTS + 1]; /* If port & (1 << 32) is non-zero, it is SSL */
        char hostname[1025];
        struct tw_config_entry root;
        struct tw_config_entry vhosts[MAX_VHOSTS];
        int vhost_count;
        char* server_root;
};

void tw_config_init(void);
int tw_config_read(const char* path);
struct tw_config_entry* tw_vhost_match(const char* name, int port);

#endif