summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-01-27 03:05:36 -0500
committerimarom <imarom@cisco.com>2016-01-27 03:07:00 -0500
commit1e69b27f272fef2e3124693b865521a4927418f5 (patch)
treec73058766d1aa90f4d94b81bf9589fbe956b32b8
parentea3f39cd42ea667d1928564a25bffca19275cfeb (diff)
ZMQ stubbed on simulation
-rwxr-xr-xlinux/ws_main.py23
-rw-r--r--src/stub/trex_stateless_stub.cpp23
-rw-r--r--src/stub/zmq_stub.c81
3 files changed, 90 insertions, 37 deletions
diff --git a/linux/ws_main.py b/linux/ws_main.py
index ec3ef6d7..22c52eea 100755
--- a/linux/ws_main.py
+++ b/linux/ws_main.py
@@ -224,8 +224,13 @@ yaml_src = SrcGroup(dir='external_libs/yaml-cpp/src/',
'tag.cpp']);
+# stubs
+stubs = SrcGroup(dir='/src/stub/',
+ src_list=['zmq_stub.c'])
+
rpc_server_mock = SrcGroups([
main_src,
+ stubs,
cmn_src,
rpc_server_src,
rpc_server_mock_src,
@@ -235,25 +240,17 @@ rpc_server_mock = SrcGroups([
net_src,
])
-# REMOVE ME - need to decide if stateless is part of bp sim or not
-bp_hack_for_compile = SrcGroup(dir='/src/stub/',
- src_list=['trex_stateless_stub.cpp'
- ])
-
bp =SrcGroups([
bp_sim_main,
bp_sim_gtest,
main_src,
cmn_src ,
-
+ stubs,
net_src ,
yaml_src,
json_src,
stateless_src,
rpc_server_src
- #rpc_server_mock_src,
-
- #bp_hack_for_compile,
]);
@@ -407,15 +404,15 @@ class build_option:
build_types = [
- build_option(name = "bp-sim", src = bp, use = ['zmq'],debug_mode= DEBUG_, platform = PLATFORM_64, is_pie = False,
+ build_option(name = "bp-sim", src = bp, use = [''],debug_mode= DEBUG_, platform = PLATFORM_64, is_pie = False,
flags = ['-Wall', '-Werror', '-Wno-sign-compare', '-Wno-strict-aliasing'],
rpath = ['.']),
- build_option(name = "bp-sim", src = bp, use = ['zmq'],debug_mode= RELEASE_,platform = PLATFORM_64, is_pie = False,
+ build_option(name = "bp-sim", src = bp, use = [''],debug_mode= RELEASE_,platform = PLATFORM_64, is_pie = False,
flags = ['-Wall', '-Werror', '-Wno-sign-compare', '-Wno-strict-aliasing'],
rpath = ['.']),
- build_option(name = "mock-rpc-server", use = ['zmq'], src = rpc_server_mock, debug_mode= DEBUG_,platform = PLATFORM_64, is_pie = False,
+ build_option(name = "mock-rpc-server", use = [''], src = rpc_server_mock, debug_mode= DEBUG_,platform = PLATFORM_64, is_pie = False,
flags = ['-DTREX_RPC_MOCK_SERVER', '-Wall', '-Werror', '-Wno-sign-compare'],
rpath = ['.']),
]
@@ -423,8 +420,6 @@ build_types = [
def build_prog (bld, build_obj):
- zmq_lib_path='external_libs/zmq/'
- bld.read_shlib( name='zmq' , paths=[top + zmq_lib_path] )
bld.program(features='cxx cxxprogram',
includes =includes_path,
diff --git a/src/stub/trex_stateless_stub.cpp b/src/stub/trex_stateless_stub.cpp
deleted file mode 100644
index 199356d8..00000000
--- a/src/stub/trex_stateless_stub.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-
-#include <trex_stateless_dp_core.h>
-
-class CFlowGenListPerThread;
-class TrexStatelessCpToDpMsgBase;
-
-void
-TrexStatelessDpCore::create(unsigned char, CFlowGenListPerThread*) {
- m_thread_id = 0;
- m_core = NULL;
-
- m_state = STATE_IDLE;
-
- CMessagingManager * cp_dp = CMsgIns::Ins()->getCpDp();
-
- m_ring_from_cp = cp_dp->getRingCpToDp(0);
- m_ring_to_cp = cp_dp->getRingDpToCp(0);
-}
-
-void TrexStatelessDpCore::start(){}
-
-void TrexStatelessDpCore::handle_cp_msg(TrexStatelessCpToDpMsgBase*) {}
-
diff --git a/src/stub/zmq_stub.c b/src/stub/zmq_stub.c
new file mode 100644
index 00000000..b94f93e4
--- /dev/null
+++ b/src/stub/zmq_stub.c
@@ -0,0 +1,81 @@
+#include <zmq.h>
+#include <assert.h>
+
+void *zmq_ctx_new (void) {
+ return NULL;
+}
+
+void *zmq_socket (void *, int type) {
+ return NULL;
+}
+
+int zmq_close (void *s) {
+ return (-1);
+}
+
+int zmq_setsockopt (void *s, int option, const void *optval,size_t optvallen) {
+ return (-1);
+}
+
+int zmq_getsockopt (void *s, int option, void *optval,
+ size_t *optvallen) {
+ return (-1);
+}
+
+int zmq_bind (void *s, const char *addr) {
+ return (-1);
+}
+
+void *zmq_init (int io_threads) {
+ return NULL;
+}
+
+int zmq_term (void *context) {
+ return (-1);
+}
+
+int zmq_ctx_destroy (void *context) {
+ return (-1);
+}
+
+
+int zmq_connect (void *s, const char *addr) {
+ return (-1);
+}
+
+int zmq_send (void *s, const void *buf, size_t len, int flags) {
+ return (-1);
+}
+
+int zmq_recv (void *s, void *buf, size_t len, int flags) {
+ return (-1);
+}
+
+int zmq_errno (void) {
+ return (-1);
+}
+
+const char *zmq_strerror (int errnum) {
+ return "";
+}
+
+int zmq_msg_init (zmq_msg_t *msg) {
+ return (-1);
+}
+
+int zmq_msg_recv (zmq_msg_t *msg, void *s, int flags) {
+ return (-1);
+}
+
+int zmq_msg_close (zmq_msg_t *msg) {
+ return (-1);
+}
+
+void *zmq_msg_data (zmq_msg_t *msg) {
+ return NULL;
+}
+
+size_t zmq_msg_size (zmq_msg_t *msg) {
+ return (0);
+}
+