diff options
author | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2016-06-28 17:02:42 +0200 |
---|---|---|
committer | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2016-06-28 17:02:42 +0200 |
commit | a19521aa74edfa4a2eb62466b04c9264c3b6576c (patch) | |
tree | 36b94730d8690c2d131f39b3cc3ff715674f9fcc /src/ipcpd/shim-eth-llc/main.c | |
parent | acd29da104d0d8ddace2b2693314542bb5a56fcc (diff) | |
parent | 99d19307fae8f1370f52a62aee88fded624ad464 (diff) | |
download | ouroboros-a19521aa74edfa4a2eb62466b04c9264c3b6576c.tar.gz ouroboros-a19521aa74edfa4a2eb62466b04c9264c3b6576c.zip |
Merged in sandervrijders/ouroboros/be (pull request #144)
lib, irmd, ipcpd: Change of IRM API
Diffstat (limited to 'src/ipcpd/shim-eth-llc/main.c')
-rw-r--r-- | src/ipcpd/shim-eth-llc/main.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/ipcpd/shim-eth-llc/main.c b/src/ipcpd/shim-eth-llc/main.c index 9bd6920b..48b6391f 100644 --- a/src/ipcpd/shim-eth-llc/main.c +++ b/src/ipcpd/shim-eth-llc/main.c @@ -31,7 +31,7 @@ #include <ouroboros/list.h> #include <ouroboros/utils.h> #include <ouroboros/ipcp.h> -#include <ouroboros/dif_config.h> +#include <ouroboros/irm_config.h> #include <ouroboros/sockets.h> #include <ouroboros/bitmap.h> #include <ouroboros/flow.h> @@ -70,7 +70,7 @@ typedef ShimEthLlcMsg shim_eth_llc_msg_t; #define MAX_SAPS 64 /* global for trapping signal */ -int irmd_pid; +int irmd_api; struct ipcp * _ipcp; @@ -675,7 +675,6 @@ static void * eth_llc_ipcp_sdu_reader(void * o) dst_mac, MAC_SIZE) && memcmp(br_addr, dst_mac, MAC_SIZE)) { - LOG_DBG("Not a unicast or broadcast frame."); #if defined(PACKET_RX_RING) && defined(PACKET_TX_RING) offset = (offset + 1) & (SHM_BLOCKS_IN_MAP - 1); header->tp_status = TP_STATUS_KERNEL; @@ -715,7 +714,6 @@ static void * eth_llc_ipcp_sdu_reader(void * o) if (j < 0) { pthread_rwlock_unlock(&shim_data(_ipcp)->flows_lock); pthread_rwlock_unlock(&_ipcp->state_lock); - LOG_DBG("Received data for unknown flow."); #if defined(PACKET_RX_RING) && defined(PACKET_TX_RING) offset = (offset + 1) & (SHM_BLOCKS_IN_MAP - 1); @@ -818,7 +816,7 @@ void ipcp_sig_handler(int sig, siginfo_t * info, void * c) case SIGINT: case SIGTERM: case SIGHUP: - if (info->si_pid == irmd_pid) { + if (info->si_pid == irmd_api) { bool clean_threads = false; LOG_DBG("Terminating by order of %d. Bye.", info->si_pid); @@ -990,7 +988,7 @@ static int eth_llc_ipcp_bootstrap(struct dif_config * conf) pthread_rwlock_unlock(&_ipcp->state_lock); - LOG_DBG("Bootstrapped shim IPCP over Ethernet with LLC with pid %d.", + LOG_DBG("Bootstrapped shim IPCP over Ethernet with LLC with api %d.", getpid()); return 0; @@ -1030,7 +1028,7 @@ static int eth_llc_ipcp_name_unreg(char * name) return 0; } -static int eth_llc_ipcp_flow_alloc(pid_t n_pid, +static int eth_llc_ipcp_flow_alloc(pid_t n_api, int port_id, char * dst_name, char * src_ae_name, @@ -1049,7 +1047,7 @@ static int eth_llc_ipcp_flow_alloc(pid_t n_pid, if (qos != QOS_CUBE_BE) LOG_DBGF("QoS requested. Ethernet LLC can't do that. For now."); - rb = shm_ap_rbuff_open(n_pid); + rb = shm_ap_rbuff_open(n_api); if (rb == NULL) return -1; /* -ENORBUFF */ @@ -1108,7 +1106,7 @@ static int eth_llc_ipcp_flow_alloc(pid_t n_pid, return index; } -static int eth_llc_ipcp_flow_alloc_resp(pid_t n_pid, +static int eth_llc_ipcp_flow_alloc_resp(pid_t n_api, int port_id, int response) { @@ -1134,7 +1132,7 @@ static int eth_llc_ipcp_flow_alloc_resp(pid_t n_pid, return -1; } - rb = shm_ap_rbuff_open(n_pid); + rb = shm_ap_rbuff_open(n_api); if (rb == NULL) { LOG_ERR("Could not open N + 1 ringbuffer."); ipcp_flow(index)->state = FLOW_NULL; @@ -1236,8 +1234,6 @@ static struct ipcp_ops eth_llc_ops = { int main(int argc, char * argv[]) { - /* argument 1: pid of irmd ? */ - /* argument 2: ap name */ struct sigaction sig_act; sigset_t sigset; int i = 0; @@ -1254,7 +1250,7 @@ int main(int argc, char * argv[]) } /* store the process id of the irmd */ - irmd_pid = atoi(argv[1]); + irmd_api = atoi(argv[1]); /* init sig_act */ memset(&sig_act, 0, sizeof(sig_act)); |