diff options
author | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2017-01-12 14:58:49 +0100 |
---|---|---|
committer | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2017-01-12 14:58:49 +0100 |
commit | 4e3c360377bc9b792c2fac83e9402d7531f79bbe (patch) | |
tree | e4409fb32ed7c391f48c3c2699997fc5b75137a1 /src/ipcpd/normal/ribmgr.c | |
parent | 7cad036f812a87aafd7c0e8ed4cbea76fb4cb097 (diff) | |
parent | 15e9b779385c71d366776b83540e19e0735c4e66 (diff) | |
download | ouroboros-4e3c360377bc9b792c2fac83e9402d7531f79bbe.tar.gz ouroboros-4e3c360377bc9b792c2fac83e9402d7531f79bbe.zip |
Merged in sandervrijders/ouroboros/be-gam (pull request #345)
Be gam
Diffstat (limited to 'src/ipcpd/normal/ribmgr.c')
-rw-r--r-- | src/ipcpd/normal/ribmgr.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/ipcpd/normal/ribmgr.c b/src/ipcpd/normal/ribmgr.c index 6356d48c..993fe62a 100644 --- a/src/ipcpd/normal/ribmgr.c +++ b/src/ipcpd/normal/ribmgr.c @@ -139,6 +139,8 @@ struct { struct addr_auth * addr_auth; enum pol_addr_auth addr_auth_type; + enum pol_gam dt_gam_type; + enum ribmgr_state state; pthread_cond_t state_cond; pthread_mutex_t state_lock; @@ -168,6 +170,7 @@ void ribmgr_ro_created(const char * name, rib.dtc.min_pdu_size = stat_msg->min_pdu_size; rib.dtc.max_pdu_size = stat_msg->max_pdu_size; rib.addr_auth_type = stat_msg->addr_auth_type; + rib.dt_gam_type = stat_msg->dt_gam_type; static_info_msg__free_unpacked(stat_msg, NULL); } @@ -1262,6 +1265,7 @@ int ribmgr_bootstrap(struct dif_config * conf) stat_info.min_pdu_size = rib.dtc.min_pdu_size = conf->min_pdu_size; stat_info.max_pdu_size = rib.dtc.max_pdu_size = conf->max_pdu_size; stat_info.addr_auth_type = rib.addr_auth_type = conf->addr_auth_type; + stat_info.dt_gam_type = rib.dt_gam_type = conf->dt_gam_type; len = static_info_msg__get_packed_size(&stat_info); if (len == 0) { @@ -1354,16 +1358,21 @@ int ribmgr_start_policies(void) return 0; } -struct dt_const * ribmgr_dt_const() +struct dt_const * ribmgr_dt_const(void) { return &(rib.dtc); } -uint64_t ribmgr_address() +uint64_t ribmgr_address(void) { return rib.address; } +enum pol_gam ribmgr_dt_gam(void) +{ + return rib.dt_gam_type; +} + static int send_neighbors_ro(char * name, ro_msg_t * msg, enum cdap_opcode code) { struct list_head * p = NULL; @@ -1577,8 +1586,8 @@ ssize_t ro_children(const char * name, char *** children) } child = node->child; - **children = malloc(len); - if (**children == NULL) { + *children = malloc(len); + if (*children == NULL) { pthread_mutex_unlock(&rib.ro_lock); return -1; } @@ -1590,7 +1599,7 @@ ssize_t ro_children(const char * name, char *** children) free((*children)[i]); i--; } - free(**children); + free(*children); pthread_mutex_unlock(&rib.ro_lock); return -1; } |