From 15e9b779385c71d366776b83540e19e0735c4e66 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Wed, 11 Jan 2017 18:59:11 +0100 Subject: ipcpd: normal: Create policies for GAM This allows the selection of a policy for the graph adjacency manager. Currently we only support constructing a complete graph. --- src/ipcpd/normal/ribmgr.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/ipcpd/normal/ribmgr.c') diff --git a/src/ipcpd/normal/ribmgr.c b/src/ipcpd/normal/ribmgr.c index c780bf50..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; -- cgit v1.2.3