convert kmeans_incr threshold
[actl.git] / conf.h
blobb5753611a772403cfff8ab7ff1850563f31606ba
1 /*
2 * Copyright (c) 2016 Mohamed Aslan <maslan@sce.carleton.ca>
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 #ifndef CONF_H
18 #define CONF_H
20 #include <libof.h>
21 #include <of10.h>
23 #include "actl.h"
26 #define CONFFILENAME ".actl"
28 typedef struct of_protocol *(*ofp_fptr)(void);
30 #define N_OFP_VERS 1
31 static const struct {
32 char *ver;
33 ofp_fptr func;
34 } ofp_vers[N_OFP_VERS] = {
35 {"1.0", (ofp_fptr)of10_protocol}
36 };
38 #define LEARN_KMEANS_SEQ 0
39 #define LEARN_KMEANS_INCR 1
40 struct config {
41 char *c_nodeid; /* controller ID */
42 int c_co_port; /* control port */
43 int c_sw_port; /* switch port */
44 char *c_ofp_verstr; /* openflow version string */
45 ofp_fptr c_ofp; /* openflow version protocol */
46 int c_nreplicas; /* number of replicas */
47 int c_npeers; /* number of peers */
48 struct peer {
49 char *node_id;
50 struct in_addr ip_addr;
51 uint16_t port;
52 } *c_peers; /* controller peers */
53 char *c_app_name; /* application name */
54 int c_app_argc; /* app init() argc */
55 char **c_app_argv; /* app init() argv */
56 void *c_app_so; /* app dlopen() handle */
57 struct app c_app; /* app handlers */
58 int c_atime; /* adaptation time */
59 int c_ltime; /* learning time */
60 int c_lalgo; /* learning algorithm */
61 int c_lparam; /* any algorithm-specific parameter */
62 char *c_logfile; /* log file name */
63 FILE *c_logfp; /* log file pointer */
64 int c_topo_n; /* size of topo arrary */
65 struct host_info **c_topo; /* topology info */
68 /* parse.y */
69 int parse_config(struct config *, const char *);
70 #endif