use %016llx when printing dpids
[actl.git] / conf.h
blob69d53ebe10f50a275f70ebbb596ec853d54ae827
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 struct config {
39 char *c_nodeid; /* controller ID */
40 int c_co_port; /* control port */
41 int c_sw_port; /* switch port */
42 char *c_ofp_verstr; /* openflow version string */
43 ofp_fptr c_ofp; /* openflow version protocol */
44 int c_nreplicas; /* number of replicas */
45 char *c_app_name; /* application name */
46 int c_app_argc; /* app init() argc */
47 char **c_app_argv; /* app init() argv */
48 void *c_app_so; /* app dlopen() handle */
49 struct app c_app; /* app handlers */
50 int c_atime; /* adaptation time */
51 int c_ltime; /* learning time */
52 char *c_logfile; /* log file name */
53 FILE *c_logfp; /* log file pointer */
54 int c_topo_n; /* size of topo arrary */
55 struct host_info **c_topo; /* topology info */
58 /* parse.y */
59 int parse_config(struct config *, const char *);
60 #endif