-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathload_config.h
41 lines (35 loc) · 1.07 KB
/
load_config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef LOAD_CONFIG_H
#define LOAD_CONFIG_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "c_api.h"
#define MAX 256
typedef enum {
ENTITY_INFO_NAME = 1,
ENTITY_INFO_PURPOSE,
ENTITY_INFO_NUMKEY,
ENCRYPTION_MODE,
HMAC_MODE,
AUTH_INFO_PUBKEY_PATH,
ENTITY_INFO_PRIVKEY_PATH,
AUTH_INFO_IP_ADDRESS,
AUTH_INFO_PORT,
ENTITY_SERVER_INFO_IP_ADDRESS,
ENTITY_SERVER_INFO_PORT_NUMBER,
FILE_SYSTEM_MANAGER_INFO_IP_ADDRESS,
FILE_SYSTEM_MANAGER_INFO_PORT_NUMBER,
NETWORK_PROTOCOL
} config_type_t;
// Get a value by comparing a string of conditional statement with a variable.
// @param ptr input variable to compare with string
// @return value
config_type_t get_key_value(char *ptr);
// Load config file from path and save the information in config struct.
// @param path config file path
// @return config struct to use when connecting to Auth
config_t *load_config(const char *path);
// Free memory used in config_t.
// @param config struct config_t to be freed.
void free_config_t(config_t *config);
#endif // LOAD_CONFIG_H