diff options
author | Sander Vrijders <[email protected]> | 2016-07-05 15:43:13 +0200 |
---|---|---|
committer | Sander Vrijders <[email protected]> | 2016-07-05 15:43:13 +0200 |
commit | a315150a16c02f3cb694e639d5aba555fce4b4c3 (patch) | |
tree | 59525d68eec0cf5d2dae83891c7bc4eaabff9cf3 /src/ipcpd | |
parent | aca5db11a73e66377b8566e69c1baabb1df803ab (diff) | |
download | ouroboros-a315150a16c02f3cb694e639d5aba555fce4b4c3.tar.gz ouroboros-a315150a16c02f3cb694e639d5aba555fce4b4c3.zip |
lib: Provide first implementation of revised CDAP
This commit introduces a first version of the revised CDAP
specification. CACEP (for authentication purposes) has been separated
from CDAP. Application developers may use CDAP if they find it
useful. Within Ouroboros CDAP will be used to perform operations on
the RIB of an IPCP.
Diffstat (limited to 'src/ipcpd')
-rw-r--r-- | src/ipcpd/ipcp-data.h | 2 | ||||
-rw-r--r-- | src/ipcpd/ipcp.c | 8 | ||||
-rw-r--r-- | src/ipcpd/ipcp.h | 2 | ||||
-rw-r--r-- | src/ipcpd/local/main.c | 2 | ||||
-rw-r--r-- | src/ipcpd/shim-udp/main.c | 6 |
5 files changed, 11 insertions, 9 deletions
diff --git a/src/ipcpd/ipcp-data.h b/src/ipcpd/ipcp-data.h index ce20730b..1e183dca 100644 --- a/src/ipcpd/ipcp-data.h +++ b/src/ipcpd/ipcp-data.h @@ -24,7 +24,7 @@ #ifndef IPCPD_IPCP_DATA_H #define IPCPD_IPCP_DATA_H -#include <ouroboros/common.h> +#include <ouroboros/shared.h> #include <ouroboros/list.h> #include <sys/types.h> #include <pthread.h> diff --git a/src/ipcpd/ipcp.c b/src/ipcpd/ipcp.c index 4acbffa2..579203c2 100644 --- a/src/ipcpd/ipcp.c +++ b/src/ipcpd/ipcp.c @@ -236,14 +236,14 @@ void * ipcp_main_loop(void * o) ipcp_msg__free_unpacked(msg, NULL); - buffer.size = ipcp_msg__get_packed_size(&ret_msg); - if (buffer.size == 0) { + buffer.len = ipcp_msg__get_packed_size(&ret_msg); + if (buffer.len == 0) { LOG_ERR("Failed to send reply message"); close(lsockfd); continue; } - buffer.data = malloc(buffer.size); + buffer.data = malloc(buffer.len); if (buffer.data == NULL) { close(lsockfd); continue; @@ -251,7 +251,7 @@ void * ipcp_main_loop(void * o) ipcp_msg__pack(&ret_msg, buffer.data); - if (write(lsockfd, buffer.data, buffer.size) == -1) { + if (write(lsockfd, buffer.data, buffer.len) == -1) { free(buffer.data); close(lsockfd); continue; diff --git a/src/ipcpd/ipcp.h b/src/ipcpd/ipcp.h index 1e9e9763..27c3cf8e 100644 --- a/src/ipcpd/ipcp.h +++ b/src/ipcpd/ipcp.h @@ -24,6 +24,8 @@ #define IPCPD_IPCP_H #include <ouroboros/config.h> +#include <ouroboros/shared.h> + #include <pthread.h> #include "ipcp-ops.h" diff --git a/src/ipcpd/local/main.c b/src/ipcpd/local/main.c index 837cbf8c..4802a161 100644 --- a/src/ipcpd/local/main.c +++ b/src/ipcpd/local/main.c @@ -31,7 +31,7 @@ #include <ouroboros/irm_config.h> #include <ouroboros/sockets.h> #include <ouroboros/bitmap.h> -#include <ouroboros/common.h> +#include <ouroboros/shared.h> #include <ouroboros/dev.h> #define OUROBOROS_PREFIX "ipcpd/local" diff --git a/src/ipcpd/shim-udp/main.c b/src/ipcpd/shim-udp/main.c index 68d393af..c22947fa 100644 --- a/src/ipcpd/shim-udp/main.c +++ b/src/ipcpd/shim-udp/main.c @@ -340,8 +340,8 @@ static int send_shim_udp_msg(shim_udp_msg_t * msg, r_saddr.sin_addr.s_addr = dst_ip_addr; r_saddr.sin_port = LISTEN_PORT; - buf.size = shim_udp_msg__get_packed_size(msg); - if (buf.size == 0) { + buf.len = shim_udp_msg__get_packed_size(msg); + if (buf.len == 0) { return -1; } @@ -354,7 +354,7 @@ static int send_shim_udp_msg(shim_udp_msg_t * msg, if (sendto(shim_data(_ipcp)->s_fd, buf.data, - buf.size, + buf.len, 0, (struct sockaddr *) &r_saddr, sizeof(r_saddr)) == -1) { |