hsa: move vcl test apps to hsa
Type: refactor
Change-Id: I352975585c1091bfc5b85d7f8fe985f9059820a7
Signed-off-by: Florin Coras <fcoras@cisco.com>
diff --git a/src/plugins/hs_apps/CMakeLists.txt b/src/plugins/hs_apps/CMakeLists.txt
index e7885c3..bf1f49c 100644
--- a/src/plugins/hs_apps/CMakeLists.txt
+++ b/src/plugins/hs_apps/CMakeLists.txt
@@ -11,6 +11,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+##############################################################################
+# vpp builtin hs apps
+##############################################################################
add_vpp_plugin(hs_apps
SOURCES
echo_client.c
@@ -20,24 +23,46 @@
proxy.c
)
-option(VPP_BUILD_SESSION_ECHO_APPS "Build session echo apps." ON)
-if(VPP_BUILD_SESSION_ECHO_APPS)
+##############################################################################
+# vpp external hs apps that use the "raw" session layer api
+##############################################################################
+option(VPP_BUILD_HS_SAPI_APPS "Build hs apps that use the session api." ON)
+if(VPP_BUILD_HS_SAPI_APPS)
add_vpp_executable(tcp_echo
- SOURCES tcp_echo.c
+ SOURCES sapi/tcp_echo.c
LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
DEPENDS api_headers
NO_INSTALL
)
add_vpp_executable(quic_echo
- SOURCES quic_echo.c
+ SOURCES sapi/quic_echo.c
LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
DEPENDS api_headers
NO_INSTALL
)
add_vpp_executable(udp_echo
- SOURCES udp_echo.c
+ SOURCES sapi/udp_echo.c
LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
DEPENDS api_headers
NO_INSTALL
)
-endif(VPP_BUILD_SESSION_ECHO_APPS)
+endif(VPP_BUILD_HS_SAPI_APPS)
+
+##############################################################################
+# vcl tests
+##############################################################################
+option(VPP_BUILD_VCL_TESTS "Build vcl tests." ON)
+if(VPP_BUILD_VCL_TESTS)
+ foreach(test
+ vcl_test_server
+ vcl_test_client
+ sock_test_server
+ sock_test_client
+ )
+ add_vpp_executable(${test}
+ SOURCES "vcl/${test}.c"
+ LINK_LIBRARIES vppcom pthread
+ NO_INSTALL
+ )
+ endforeach()
+endif(VPP_BUILD_VCL_TESTS)
diff --git a/src/plugins/hs_apps/quic_echo.c b/src/plugins/hs_apps/sapi/quic_echo.c
similarity index 100%
rename from src/plugins/hs_apps/quic_echo.c
rename to src/plugins/hs_apps/sapi/quic_echo.c
diff --git a/src/plugins/hs_apps/tcp_echo.c b/src/plugins/hs_apps/sapi/tcp_echo.c
similarity index 100%
rename from src/plugins/hs_apps/tcp_echo.c
rename to src/plugins/hs_apps/sapi/tcp_echo.c
diff --git a/src/plugins/hs_apps/udp_echo.c b/src/plugins/hs_apps/sapi/udp_echo.c
similarity index 100%
rename from src/plugins/hs_apps/udp_echo.c
rename to src/plugins/hs_apps/sapi/udp_echo.c
diff --git a/src/vcl/sock_test.h b/src/plugins/hs_apps/vcl/sock_test.h
similarity index 98%
rename from src/vcl/sock_test.h
rename to src/plugins/hs_apps/vcl/sock_test.h
index 082c72e..9f7f437 100644
--- a/src/vcl/sock_test.h
+++ b/src/plugins/hs_apps/vcl/sock_test.h
@@ -20,7 +20,7 @@
#include <errno.h>
#include <stdlib.h>
#include <string.h>
-#include <vcl/vcl_test.h>
+#include <hs_apps/vcl/vcl_test.h>
#define SOCK_TEST_AF_UNIX_FILENAME "/tmp/ldp_server_af_unix_socket"
#define SOCK_TEST_MIXED_EPOLL_DATA "Hello, world! (over an AF_UNIX socket)"
diff --git a/src/vcl/sock_test_client.c b/src/plugins/hs_apps/vcl/sock_test_client.c
similarity index 99%
rename from src/vcl/sock_test_client.c
rename to src/plugins/hs_apps/vcl/sock_test_client.c
index a28feee..ea89987 100644
--- a/src/vcl/sock_test_client.c
+++ b/src/plugins/hs_apps/vcl/sock_test_client.c
@@ -22,7 +22,7 @@
#include <stdio.h>
#include <time.h>
#include <arpa/inet.h>
-#include <vcl/sock_test.h>
+#include <hs_apps/vcl/sock_test.h>
#include <fcntl.h>
#ifndef VCL_TEST
#include <sys/un.h>
diff --git a/src/vcl/sock_test_server.c b/src/plugins/hs_apps/vcl/sock_test_server.c
similarity index 99%
rename from src/vcl/sock_test_server.c
rename to src/plugins/hs_apps/vcl/sock_test_server.c
index 2e678c3..59dae17 100644
--- a/src/vcl/sock_test_server.c
+++ b/src/plugins/hs_apps/vcl/sock_test_server.c
@@ -21,7 +21,7 @@
#include <string.h>
#include <time.h>
#include <ctype.h>
-#include <vcl/sock_test.h>
+#include <hs_apps/vcl/sock_test.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ioctl.h>
diff --git a/src/vcl/vcl_test.h b/src/plugins/hs_apps/vcl/vcl_test.h
similarity index 100%
rename from src/vcl/vcl_test.h
rename to src/plugins/hs_apps/vcl/vcl_test.h
diff --git a/src/vcl/vcl_test_client.c b/src/plugins/hs_apps/vcl/vcl_test_client.c
similarity index 99%
rename from src/vcl/vcl_test_client.c
rename to src/plugins/hs_apps/vcl/vcl_test_client.c
index 42476ff..1ead146 100644
--- a/src/vcl/vcl_test_client.c
+++ b/src/plugins/hs_apps/vcl/vcl_test_client.c
@@ -22,7 +22,7 @@
#include <stdio.h>
#include <time.h>
#include <arpa/inet.h>
-#include <vcl/vcl_test.h>
+#include <hs_apps/vcl/vcl_test.h>
#include <pthread.h>
typedef struct
diff --git a/src/vcl/vcl_test_server.c b/src/plugins/hs_apps/vcl/vcl_test_server.c
similarity index 99%
rename from src/vcl/vcl_test_server.c
rename to src/plugins/hs_apps/vcl/vcl_test_server.c
index 173bada..62292ad 100644
--- a/src/vcl/vcl_test_server.c
+++ b/src/plugins/hs_apps/vcl/vcl_test_server.c
@@ -23,7 +23,7 @@
#include <ctype.h>
#include <sys/stat.h>
#include <fcntl.h>
-#include <vcl/vcl_test.h>
+#include <hs_apps/vcl/vcl_test.h>
#include <sys/epoll.h>
#include <vppinfra/mem.h>
#include <pthread.h>
diff --git a/src/vcl/CMakeLists.txt b/src/vcl/CMakeLists.txt
index 2578a37..ab0a6ad 100644
--- a/src/vcl/CMakeLists.txt
+++ b/src/vcl/CMakeLists.txt
@@ -40,27 +40,8 @@
add_vpp_headers(vcl
ldp.h
- sock_test.h
ldp_glibc_socket.h
- vcl_test.h
vppcom.h
vcl_locked.h
ldp_socket_wrapper.h
-)
-
-##############################################################################
-# vcl tests
-##############################################################################
-option(VPP_BUILD_VCL_TESTS "Build vcl tests." ON)
-if(VPP_BUILD_VCL_TESTS)
- foreach(test
- vcl_test_server
- vcl_test_client
- sock_test_server
- sock_test_client
- )
- add_vpp_executable(${test} SOURCES ${test}.c LINK_LIBRARIES vppcom pthread
- NO_INSTALL)
- endforeach()
-endif(VPP_BUILD_VCL_TESTS)
-
+)
\ No newline at end of file