]> rtime.felk.cvut.cz Git - frescor/fwp.git/blob - fwp/lib/fwp.c
WIP: intergrate fwp-frsh
[frescor/fwp.git] / fwp / lib / fwp.c
1 #include "fwp_conf.h"
2 #include "fwp_contract.h"
3 #include "fwp_mngt.h"
4
5 static struct frsh_resource_t fwp_resource = {
6         .contract_ops = &fwp_contract_ops; 
7 };
8
9 int fwp_init()
10 {
11         int rv;
12
13         if ((rv = fwp_endpoint_table_init(fwp_configuration.max_endpoints)) ||
14             (rv = fwp_vres_table_init(fwp_configuration.max_vres)))
15                 return rv;
16         
17         if (fwp_configuration.mngt) { 
18                 frsh_resource_register(FRSH_WIFI, &fwp_resource);
19                 rv = fwp_mngt_init(); 
20                 return rv;
21         }
22
23         return 0;
24 }
25
26 int fwp_done()
27 {
28         /* TODO: Cancel all contracts */
29         return 0;
30 }