Skip to content
This repository was archived by the owner on Dec 11, 2024. It is now read-only.

Commit

Permalink
add SCTP server
Browse files Browse the repository at this point in the history
  • Loading branch information
furmur committed May 14, 2018
1 parent 4fcf475 commit 31a0116
Show file tree
Hide file tree
Showing 15 changed files with 837 additions and 48 deletions.
25 changes: 25 additions & 0 deletions cmake/FindSCTP.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#.rst:
# FindSCTP
# --------
#
# Find libsctp
#
# Find libsctp headers and libraries.
#
# ::
#
# SCTP_INCLUDE_DIRS - where to find sctp.h
# SCTP_LIBRARIES - List of libraries when using libsctp.
# SCTP_FOUND - True if libSCTP found.
# SCTP_VERSION - Version of found libsctp.

find_package(PkgConfig REQUIRED)
pkg_check_modules(SCTP libsctp)

# handle the QUIETLY and REQUIRED arguments and set TASN_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SCTP
REQUIRED_VARS SCTP_LIBRARIES
VERSION_VAR SCTP_VERSION)

20 changes: 20 additions & 0 deletions format/defs/SctpBusPDU.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
syntax = "proto2";

message SctpBusPDU {
required int32 src_node_id = 1;
required string src_session_id = 2;
required int32 dst_node_id = 3;
required string dst_session_id = 4;

enum EventType {
REQUEST = 0;
REPLY = 1;
}
optional EventType type = 5 [default = REQUEST];

/* sequence to match requests/replies within connection.
must be set for replies and for requests which are need replies */
optional uint64 sequence = 6;

required bytes payload = 0xf;
}
12 changes: 12 additions & 0 deletions format/defs/YetiEvent.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
syntax = "proto2";

import "CfgRequest.proto";
import "CfgResponse.proto";

message YetiEvent {
oneof data {
CfgRequest cfg_request = 10;
CfgResponse cfg_response = 11;
string json = 12;
}
}
2 changes: 2 additions & 0 deletions server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ cmake_policy(SET CMP0026 OLD)
find_package(Threads REQUIRED)
find_package(NanoMsg REQUIRED)
find_package(Confuse REQUIRED)
find_package(SCTP REQUIRED)

include_directories(${CMAKE_SOURCE_DIR}/format/src ${CMAKE_CURRENT_SOURCE_DIR}/src)
include_directories(${PB_INCLUDE_DIRS})
Expand All @@ -17,6 +18,7 @@ target_link_libraries(yeti_management
${CMAKE_THREAD_LIBS_INIT}
${NanoMsg_LIBRARIES}
${Confuse_LIBRARIES}
${SCTP_LIBRARIES}
${PB_LIBRARIES})

install(TARGETS yeti_management DESTINATION ${RUNTIME_DIR})
Expand Down
Loading

0 comments on commit 31a0116

Please sign in to comment.