diff options
author | Dimitri Staessens <dimitri.staessens@ugent.be> | 2017-12-18 20:50:04 +0100 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@ugent.be> | 2017-12-19 10:27:02 +0100 |
commit | e5cc7fbcf165ef9c205b6c136f239f645a8d7830 (patch) | |
tree | 334120a6cc6dcbe240076b3957233da337bf7ad2 /src/ipcpd | |
parent | d654c997f142b22e2529dc0fb9fab4f799f7ef56 (diff) | |
download | ouroboros-e5cc7fbcf165ef9c205b6c136f239f645a8d7830.tar.gz ouroboros-e5cc7fbcf165ef9c205b6c136f239f645a8d7830.zip |
ipcpd: Use the term "layer" and deprecate "shim"
This changes the terminology to use layer instead of DIF and deprecate
the word "shim" for the IPCPs that attach to Ethernet LLC and UDP .The
terminology has not yet been changed in the variable names etc.
This reflects the design choices in Ouroboros to make IPCPs pure
resource allocators instead of also providing an "IPC service". The
Ouroboros IPCPs that attach to Ethernet and UDP implement the
allocator and are thus not really shims.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
Diffstat (limited to 'src/ipcpd')
-rw-r--r-- | src/ipcpd/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/ipcpd/config.h.in | 4 | ||||
-rw-r--r-- | src/ipcpd/eth-llc/CMakeLists.txt (renamed from src/ipcpd/shim-eth-llc/CMakeLists.txt) | 38 | ||||
-rw-r--r-- | src/ipcpd/eth-llc/main.c (renamed from src/ipcpd/shim-eth-llc/main.c) | 10 | ||||
-rw-r--r-- | src/ipcpd/ipcp.c | 8 | ||||
-rw-r--r-- | src/ipcpd/local/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/ipcpd/normal/main.c | 4 | ||||
-rw-r--r-- | src/ipcpd/normal/pol/flat.c | 1 | ||||
-rw-r--r-- | src/ipcpd/udp/CMakeLists.txt (renamed from src/ipcpd/shim-udp/CMakeLists.txt) | 12 | ||||
-rw-r--r-- | src/ipcpd/udp/main.c (renamed from src/ipcpd/shim-udp/main.c) | 10 |
10 files changed, 47 insertions, 48 deletions
diff --git a/src/ipcpd/CMakeLists.txt b/src/ipcpd/CMakeLists.txt index f43dba65..67d9fccf 100644 --- a/src/ipcpd/CMakeLists.txt +++ b/src/ipcpd/CMakeLists.txt @@ -34,8 +34,8 @@ set(IPCP_SOURCES add_subdirectory(local) add_subdirectory(normal) add_subdirectory(raptor) -add_subdirectory(shim-udp) -add_subdirectory(shim-eth-llc) +add_subdirectory(udp) +add_subdirectory(eth-llc) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/config.h" @ONLY) diff --git a/src/ipcpd/config.h.in b/src/ipcpd/config.h.in index 322c6856..0c0e2922 100644 --- a/src/ipcpd/config.h.in +++ b/src/ipcpd/config.h.in @@ -45,12 +45,12 @@ #define IPCP_SCHED_THR_MUL @IPCP_SCHED_THR_MUL@ #define PFT_SIZE @PFT_SIZE@ -/* shim-udp */ +/* udp */ #cmakedefine HAVE_DDNS #define NSUPDATE_EXEC "@NSUPDATE_EXECUTABLE@" #define NSLOOKUP_EXEC "@NSLOOKUP_EXECUTABLE@" -/* shim-eth-llc */ +/* eth-llc */ #cmakedefine HAVE_NETMAP #cmakedefine HAVE_BPF #cmakedefine HAVE_RAW_SOCKETS diff --git a/src/ipcpd/shim-eth-llc/CMakeLists.txt b/src/ipcpd/eth-llc/CMakeLists.txt index e1eea2b5..11a631b3 100644 --- a/src/ipcpd/shim-eth-llc/CMakeLists.txt +++ b/src/ipcpd/eth-llc/CMakeLists.txt @@ -21,13 +21,13 @@ mark_as_advanced(NETMAP_C_INCLUDE_DIR) if (CMAKE_SYSTEM_NAME STREQUAL "Linux") set(DISABLE_RAW_SOCKETS FALSE CACHE BOOL - "Disable raw socket support for LLC shim") + "Disable raw socket support for LLC IPCP") if (NOT DISABLE_RAW_SOCKETS) - message(STATUS "Raw socket support for shim-eth-llc enabled") + message(STATUS "Raw socket support for eth-llc enabled") set(HAVE_RAW_SOCKETS TRUE PARENT_SCOPE) set(HAVE_LLC TRUE) else () - message(STATUS "Raw socket support for shim-eth-llc disabled by user") + message(STATUS "Raw socket support for eth-llc disabled by user") unset(HAVE_RAW_SOCKETS) unset(HAVE_LLC) endif () @@ -43,15 +43,15 @@ if (NOT CMAKE_SYSTEM_NAME STREQUAL "Linux") if (BPF_C_INCLUDE_DIR) set(DISABLE_BPF FALSE CACHE BOOL - "Disable Berkeley Packet Filter support for LLC shim") + "Disable Berkeley Packet Filter support for LLC IPCP") if (NOT DISABLE_BPF) message(STATUS "Berkeley Packet Filter support " - "for shim-eth-llc enabled") + "for eth-llc enabled") set(HAVE_BPF TRUE PARENT_SCOPE) set(HAVE_LLC TRUE) else () message(STATUS "Berkeley Packet Filter support " - "for shim-eth-llc disabled by user") + "for eth-llc disabled by user") unset(HAVE_BPF) unset(HAVE_LLC) endif () @@ -60,47 +60,47 @@ endif () if (NETMAP_C_INCLUDE_DIR) set(DISABLE_NETMAP FALSE CACHE BOOL - "Disable netmap support for LLC shim") + "Disable netmap support for LLC IPCP") if (NOT DISABLE_NETMAP) - message(STATUS "Netmap support for shim-eth-llc enabled") + message(STATUS "Netmap support for eth-llc enabled") set(HAVE_NETMAP TRUE PARENT_SCOPE) test_and_set_c_compiler_flag_global(-std=c99) set(HAVE_LLC TRUE) else () - message(STATUS "Netmap support for shim-eth-llc disabled by user") + message(STATUS "Netmap support for eth-llc disabled by user") unset(HAVE_NETMAP) unset(HAVE_LLC) - unset(IPCP_SHIM_ETH_LLC_TARGET CACHE) + unset(IPCP_ETH_LLC_TARGET CACHE) endif () endif () if (HAVE_LLC) - message(STATUS "Supported raw Ethernet API found, building shim-eth-llc") + message(STATUS "Supported raw Ethernet API found, building eth-llc") - set(SHIM_ETH_LLC_SOURCES + set(ETH_LLC_SOURCES # Add source files here ${CMAKE_CURRENT_SOURCE_DIR}/main.c ) - set(IPCP_SHIM_ETH_LLC_TARGET ipcpd-shim-eth-llc CACHE INTERNAL "") + set(IPCP_ETH_LLC_TARGET ipcpd-eth-llc CACHE INTERNAL "") - add_executable(ipcpd-shim-eth-llc ${SHIM_ETH_LLC_SOURCES} ${IPCP_SOURCES}) + add_executable(ipcpd-eth-llc ${ETH_LLC_SOURCES} ${IPCP_SOURCES}) if (HAVE_BPF AND NOT APPLE) - target_include_directories(ipcpd-shim-eth-llc PUBLIC ${BPF_C_INCLUDE_DIR}) + target_include_directories(ipcpd-eth-llc PUBLIC ${BPF_C_INCLUDE_DIR}) endif () if (HAVE_NETMAP AND NOT APPLE) - target_include_directories(ipcpd-shim-eth-llc PUBLIC + target_include_directories(ipcpd-eth-llc PUBLIC ${NETMAP_C_INCLUDE_DIR}) endif () - target_link_libraries(ipcpd-shim-eth-llc LINK_PUBLIC ouroboros-dev) + target_link_libraries(ipcpd-eth-llc LINK_PUBLIC ouroboros-dev) include(AddCompileFlags) if (CMAKE_BUILD_TYPE MATCHES "Debug*") - add_compile_flags(ipcpd-shim-eth-llc -DCONFIG_OUROBOROS_DEBUG) + add_compile_flags(ipcpd-eth-llc -DCONFIG_OUROBOROS_DEBUG) endif () - install(TARGETS ipcpd-shim-eth-llc RUNTIME DESTINATION sbin) + install(TARGETS ipcpd-eth-llc RUNTIME DESTINATION sbin) endif () diff --git a/src/ipcpd/shim-eth-llc/main.c b/src/ipcpd/eth-llc/main.c index 3fec7c3d..105058d3 100644 --- a/src/ipcpd/shim-eth-llc/main.c +++ b/src/ipcpd/eth-llc/main.c @@ -1,7 +1,7 @@ /* * Ouroboros - Copyright (C) 2016 - 2017 * - * Shim IPC process over Ethernet with LLC + * IPC process over Ethernet with LLC * * Dimitri Staessens <dimitri.staessens@ugent.be> * Sander Vrijders <sander.vrijders@ugent.be> @@ -31,7 +31,7 @@ #include "config.h" -#define OUROBOROS_PREFIX "ipcpd/shim-eth-llc" +#define OUROBOROS_PREFIX "ipcpd/eth-llc" #include <ouroboros/hash.h> #include <ouroboros/errno.h> @@ -91,7 +91,7 @@ #include <net/bpf.h> #endif -#define THIS_TYPE IPCP_SHIM_ETH_LLC +#define THIS_TYPE IPCP_ETH_LLC #define MGMT_SAP 0x01 #define MAC_SIZE 6 @@ -1109,7 +1109,7 @@ static int eth_llc_ipcp_bootstrap(const struct ipcp_config * conf) goto fail_sdu_writer; } - log_dbg("Bootstrapped shim IPCP over Ethernet with LLC with pid %d.", + log_dbg("Bootstrapped IPCP over Ethernet with LLC with pid %d.", getpid()); return 0; @@ -1370,7 +1370,7 @@ int main(int argc, goto fail_init; if (eth_llc_data_init() < 0) { - log_err("Failed to init shim-eth-llc data."); + log_err("Failed to init eth-llc data."); goto fail_data_init; } diff --git a/src/ipcpd/ipcp.c b/src/ipcpd/ipcp.c index 84c42b98..c6e819bb 100644 --- a/src/ipcpd/ipcp.c +++ b/src/ipcpd/ipcp.c @@ -245,10 +245,10 @@ static void * mainloop(void * o) conf.pff_type = conf_msg->pff_type; } - if (conf_msg->ipcp_type == IPCP_SHIM_ETH_LLC) + if (conf_msg->ipcp_type == IPCP_ETH_LLC) conf.if_name = conf_msg->if_name; - if (conf_msg->ipcp_type == IPCP_SHIM_UDP) { + if (conf_msg->ipcp_type == IPCP_UDP) { conf.ip_addr = conf_msg->ip_addr; conf.dns_addr = conf_msg->dns_addr; @@ -256,8 +256,8 @@ static void * mainloop(void * o) dif_info.dir_hash_algo = HASH_MD5; } - /* Only shim-udp needs a fixed hash algorithm */ - if (conf_msg->ipcp_type != IPCP_SHIM_UDP) { + /* Only udp needs a fixed hash algorithm */ + if (conf_msg->ipcp_type != IPCP_UDP) { switch(conf_msg->dif_info->dir_hash_algo) { case DIR_HASH_SHA3_224: conf.dif_info.dir_hash_algo = diff --git a/src/ipcpd/local/CMakeLists.txt b/src/ipcpd/local/CMakeLists.txt index 422fa709..ab416c61 100644 --- a/src/ipcpd/local/CMakeLists.txt +++ b/src/ipcpd/local/CMakeLists.txt @@ -14,11 +14,11 @@ include_directories(${CMAKE_BINARY_DIR}/include) set(IPCP_LOCAL_TARGET ipcpd-local CACHE INTERNAL "") -set(SHIM_LOCAL_SOURCES +set(LOCAL_SOURCES # Add source files here ${CMAKE_CURRENT_SOURCE_DIR}/main.c) -add_executable(ipcpd-local ${SHIM_LOCAL_SOURCES} ${IPCP_SOURCES}) +add_executable(ipcpd-local ${LOCAL_SOURCES} ${IPCP_SOURCES}) target_link_libraries(ipcpd-local LINK_PUBLIC ouroboros-common ouroboros-dev) include(AddCompileFlags) diff --git a/src/ipcpd/normal/main.c b/src/ipcpd/normal/main.c index 772b5792..401c1578 100644 --- a/src/ipcpd/normal/main.c +++ b/src/ipcpd/normal/main.c @@ -55,7 +55,7 @@ static int initialize_components(const struct ipcp_config * conf) { ipcpi.dif_name = strdup(conf->dif_info.dif_name); if (ipcpi.dif_name == NULL) { - log_err("Failed to set DIF name."); + log_err("Failed to set layer name."); goto fail_dif_name; } @@ -263,7 +263,7 @@ static int normal_ipcp_bootstrap(const struct ipcp_config * conf) goto fail_bootstrap; } - log_dbg("Bootstrapped in DIF %s.", conf->dif_info.dif_name); + log_dbg("Bootstrapped in layer %s.", conf->dif_info.dif_name); return 0; diff --git a/src/ipcpd/normal/pol/flat.c b/src/ipcpd/normal/pol/flat.c index c52ebe38..49525994 100644 --- a/src/ipcpd/normal/pol/flat.c +++ b/src/ipcpd/normal/pol/flat.c @@ -39,7 +39,6 @@ #include <assert.h> #define NAME_LEN 8 -#define REC_DIF_SIZE 10000 struct { uint8_t addr_size; diff --git a/src/ipcpd/shim-udp/CMakeLists.txt b/src/ipcpd/udp/CMakeLists.txt index aaf7e83b..20c1b58e 100644 --- a/src/ipcpd/shim-udp/CMakeLists.txt +++ b/src/ipcpd/udp/CMakeLists.txt @@ -12,14 +12,14 @@ include_directories(${CURRENT_BINARY_PARENT_DIR}) include_directories(${CMAKE_SOURCE_DIR}/include) include_directories(${CMAKE_BINARY_DIR}/include) -set(IPCP_SHIM_UDP_TARGET ipcpd-shim-udp CACHE INTERNAL "") +set(IPCP_UDP_TARGET ipcpd-udp CACHE INTERNAL "") -set(SHIM_UDP_SOURCES +set(UDP_SOURCES # Add source files here ${CMAKE_CURRENT_SOURCE_DIR}/main.c) -add_executable(ipcpd-shim-udp ${SHIM_UDP_SOURCES} ${IPCP_SOURCES}) -target_link_libraries(ipcpd-shim-udp LINK_PUBLIC ouroboros-dev) +add_executable(ipcpd-udp ${UDP_SOURCES} ${IPCP_SOURCES}) +target_link_libraries(ipcpd-udp LINK_PUBLIC ouroboros-dev) # Find the nsupdate executable find_program(NSUPDATE_EXECUTABLE @@ -54,7 +54,7 @@ endif () include(AddCompileFlags) if (CMAKE_BUILD_TYPE MATCHES "Debug*") - add_compile_flags(ipcpd-shim-udp -DCONFIG_OUROBOROS_DEBUG) + add_compile_flags(ipcpd-udp -DCONFIG_OUROBOROS_DEBUG) endif () -install(TARGETS ipcpd-shim-udp RUNTIME DESTINATION sbin) +install(TARGETS ipcpd-udp RUNTIME DESTINATION sbin) diff --git a/src/ipcpd/shim-udp/main.c b/src/ipcpd/udp/main.c index 79d5ea83..c54e6624 100644 --- a/src/ipcpd/shim-udp/main.c +++ b/src/ipcpd/udp/main.c @@ -1,7 +1,7 @@ /* * Ouroboros - Copyright (C) 2016 - 2017 * - * Shim IPC process over UDP + * IPC process over UDP * * Dimitri Staessens <dimitri.staessens@ugent.be> * Sander Vrijders <sander.vrijders@ugent.be> @@ -24,7 +24,7 @@ #include "config.h" -#define OUROBOROS_PREFIX "ipcpd/shim-udp" +#define OUROBOROS_PREFIX "ipcpd/udp" #include <ouroboros/hash.h> #include <ouroboros/list.h> @@ -53,7 +53,7 @@ #define FLOW_REQ 1 #define FLOW_REPLY 2 -#define THIS_TYPE IPCP_SHIM_UDP +#define THIS_TYPE IPCP_UDP #define LISTEN_PORT htons(0x0D1F) #define SHIM_UDP_BUF_SIZE 256 #define SHIM_UDP_MSG_SIZE 256 @@ -638,7 +638,7 @@ static int ipcp_udp_bootstrap(const struct ipcp_config * conf) goto fail_sduloop; } - log_dbg("Bootstrapped shim IPCP over UDP with pid %d.", getpid()); + log_dbg("Bootstrapped IPCP over UDP with pid %d.", getpid()); log_dbg("Bound to IP address %s.", ipstr); log_dbg("DNS server address is %s.", dnsstr); @@ -1124,7 +1124,7 @@ int main(int argc, } if (udp_data_init() < 0) { - log_err("Failed to init shim-udp data."); + log_err("Failed to init udp data."); ipcp_create_r(getpid(), -1); ipcp_fini(); exit(EXIT_FAILURE); |