diff options
-rw-r--r-- | hicn-plugin/CMakeLists.txt | 31 | ||||
-rw-r--r-- | libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc | 7 |
2 files changed, 33 insertions, 5 deletions
diff --git a/hicn-plugin/CMakeLists.txt b/hicn-plugin/CMakeLists.txt index aaa4136ff..1cd6f0411 100644 --- a/hicn-plugin/CMakeLists.txt +++ b/hicn-plugin/CMakeLists.txt @@ -179,6 +179,10 @@ set(HICN_API_TEST_HEADER_FILES set(HICN_API_GENERATED_FILES ${CMAKE_CURRENT_BINARY_DIR}/vpp_plugins/hicn/hicn.api.h) +set(HICN_VAPI_GENERATED_FILES + ${CMAKE_CURRENT_BINARY_DIR}/vpp_plugins/hicn/hicn.api.vapi.h + ${CMAKE_CURRENT_BINARY_DIR}/vpp_plugins/hicn/hicn.api.vapi.hpp) + if (NOT VPP_HOME) set(VPP_HOME /usr) endif() @@ -197,9 +201,25 @@ elseif (CMAKE_BUILD_TYPE STREQUAL "Debug") endif() execute_process(COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/hicn) -add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/vpp_plugins/hicn/hicn.api.h +# These files are missing from vpp binary distribution +execute_process( + COMMAND curl https://git.fd.io/vpp/plain/src/vpp-api/vapi/vapi_json_parser.py?h=stable/1901 -o ${CMAKE_BINARY_DIR}/vapi_json_parser.py + COMMAND curl https://git.fd.io/vpp/plain/src/vpp-api/vapi/vapi_c_gen.py?h=stable/1901 -o ${CMAKE_BINARY_DIR}/vapi_c_gen.py + COMMAND curl https://git.fd.io/vpp/plain/src/vpp-api/vapi/vapi_cpp_gen.py?h=stable/1901 -o ${CMAKE_BINARY_DIR}/vapi_cpp_gen.py + ) + +add_custom_command( + COMMAND chmod +x ${CMAKE_BINARY_DIR}/vapi_json_parser.py ${CMAKE_BINARY_DIR}/vapi_c_gen.py ${CMAKE_BINARY_DIR}/vapi_cpp_gen.py + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/vpp_plugins/hicn/hicn.api.h COMMAND ${VPP_HOME}/bin/vppapigen --input ${CMAKE_CURRENT_SOURCE_DIR}/src/hicn.api --output ${CMAKE_CURRENT_BINARY_DIR}/vpp_plugins/hicn/hicn.api.h - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/hicn.api) + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/hicn.api + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/vpp_plugins/hicn/hicn.api.json + COMMAND ${VPP_HOME}/bin/vppapigen JSON --input ${CMAKE_CURRENT_SOURCE_DIR}/src/hicn.api --output ${CMAKE_CURRENT_BINARY_DIR}/vpp_plugins/hicn/hicn.api.json + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/vpp_plugins/hicn/hicn.api.vapi.h + COMMAND ${CMAKE_BINARY_DIR}/vapi_c_gen.py ${CMAKE_CURRENT_BINARY_DIR}/vpp_plugins/hicn/hicn.api.json + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/vpp_plugins/hicn/hicn.api.vapi.hpp + COMMAND ${CMAKE_BINARY_DIR}/vapi_cpp_gen.py ${CMAKE_CURRENT_BINARY_DIR}/vpp_plugins/hicn/hicn.api.json + ) include_directories(SYSTEM) include_directories(${CMAKE_CURRENT_BINARY_DIR}) @@ -208,7 +228,8 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHICN_VPP_PLUGIN=1") add_library(hicn_plugin SHARED ${LIBHICN_FILES} ${HICN_PLUGIN_SOURCE_FILES} - ${HICN_API_GENERATED_FILES}) + ${HICN_API_GENERATED_FILES} + ${HICN_VAPI_GENERATED_FILES}) file(COPY ${HICN_API_TEST_HEADER_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/vpp_plugins/hicn) include_directories(${CMAKE_CURRENT_BINARY_DIR}/vpp_plugins) @@ -250,4 +271,8 @@ install(TARGETS hicn_api_test_plugin install(FILES ${HICN_API_TEST_HEADER_FILES} ${HICN_API_GENERATED_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/vpp_plugins/hicn + COMPONENT ${HICN_PLUGIN}) + +install(FILES ${HICN_VAPI_GENERATED_FILES} + DESTINATION ${CMAKE_INSTALL_PREFIX}/include/vapi COMPONENT ${HICN_PLUGIN})
\ No newline at end of file diff --git a/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc b/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc index 740e03c3c..ede1ff247 100644 --- a/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc +++ b/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc @@ -145,9 +145,12 @@ void RTCProducerSocket::onInterest(Interest::Ptr &&interest) { uint32_t lifetime = interest->getLifetime(); uint32_t max_gap; - // XXX + if (on_interest_input_ != VOID_HANDLER) { + on_interest_input_(*this, *interest); + } + // packetsProductionRate_ is modified by another thread in updateStats - // this should be safe since I just read here. but, you never know. + // this should be safe since I just read here. max_gap = (uint32_t)floor( (double)((double)((double)lifetime * INTEREST_LIFETIME_REDUCTION_FACTOR / 1000.0) * |