diff options
author | Sander Vrijders <[email protected]> | 2017-03-02 15:29:11 +0100 |
---|---|---|
committer | Sander Vrijders <[email protected]> | 2017-03-02 16:01:35 +0100 |
commit | 9d2fbef7b8569aac930c95ca1afb92a5dec79dac (patch) | |
tree | 7c4931890ee54d9bac331ac6031f411ddac08527 /src/ipcpd/normal/pol | |
parent | a5796c7f02570a2878f9c6a5d28dca80beabed12 (diff) | |
download | ouroboros-9d2fbef7b8569aac930c95ca1afb92a5dec79dac.tar.gz ouroboros-9d2fbef7b8569aac930c95ca1afb92a5dec79dac.zip |
ipcpd: normal: Add connection manager
This adds the connection manager which allows the different AEs of the
normal IPCP to register with it. An AE can then use the connection
manager to allocate a flow to a neighbor, or to wait for a new
connection from a neighbor.
Diffstat (limited to 'src/ipcpd/normal/pol')
-rw-r--r-- | src/ipcpd/normal/pol/complete.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/ipcpd/normal/pol/complete.c b/src/ipcpd/normal/pol/complete.c index 68f43e81..daf8c9bf 100644 --- a/src/ipcpd/normal/pol/complete.c +++ b/src/ipcpd/normal/pol/complete.c @@ -38,7 +38,7 @@ struct neighbor { struct list_head next; - char * neighbor; + uint64_t neighbor; }; struct complete { @@ -135,7 +135,6 @@ void complete_destroy(void * o) list_for_each_safe(p, n, &complete->neighbors) { struct neighbor * e = list_entry(p, struct neighbor, next); list_del(&e->next); - free(e->neighbor); free(e); } @@ -168,7 +167,7 @@ int complete_accept_flow(void * o, list_for_each(pos, &complete->neighbors) { struct neighbor * e = list_entry(pos, struct neighbor, next); /* FIXME: figure out union type and check name or address */ - if (strcmp(e->neighbor, info->ae.name) == 0) { + if (e->neighbor == info->addr) { pthread_mutex_unlock(&complete->neighbors_lock); return -1; } @@ -186,13 +185,7 @@ int complete_accept_flow(void * o, list_head_init(&n->next); - /* FIXME: figure out union type and check name or address */ - n->neighbor = strdup(info->ae.name); - if (n->neighbor == NULL) { - pthread_mutex_unlock(&complete->neighbors_lock); - free(n); - return -1; - } + n->neighbor = info->addr; list_add(&n->next, &complete->neighbors); |