osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-s1gw/+/37041?usp=email )
Change subject: Move S1AP constants into a header file ...................................................................... Move S1AP constants into a header file Change-Id: I8f06d11f984fe47b7ee0a3ed43532861cbae1dd0 --- A include/s1ap.hrl M src/sctp_client.erl M src/sctp_server.erl 3 files changed, 20 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-s1gw refs/changes/41/37041/1 diff --git a/include/s1ap.hrl b/include/s1ap.hrl new file mode 100644 index 0000000..479af3a --- /dev/null +++ b/include/s1ap.hrl @@ -0,0 +1,5 @@ +-define(S1AP_PORT, 36412). +-define(S1AP_SCTP_PPID, 18). +-define(S1AP_SCTP_STREAM, 0). + +%% vim:set ts=4 sw=4 et: diff --git a/src/sctp_client.erl b/src/sctp_client.erl index 67c7069..908afcd 100644 --- a/src/sctp_client.erl +++ b/src/sctp_client.erl @@ -9,9 +9,7 @@ -include_lib("kernel/include/inet.hrl"). -include_lib("kernel/include/inet_sctp.hrl"). --define(S1AP_PORT, 36412). --define(S1AP_PPID, 18). --define(SCTP_STREAM, 0). +-include("s1ap.hrl"). %% ------------------------------------------------------------------ %% public API @@ -31,8 +29,8 @@ send_data({Sock, Aid}, Data) -> - gen_sctp:send(Sock, #sctp_sndrcvinfo{stream = ?SCTP_STREAM, - ppid = ?S1AP_PPID, + gen_sctp:send(Sock, #sctp_sndrcvinfo{stream = ?S1AP_SCTP_STREAM, + ppid = ?S1AP_SCTP_PPID, assoc_id = Aid}, Data). diff --git a/src/sctp_server.erl b/src/sctp_server.erl index f032492..48583c5 100644 --- a/src/sctp_server.erl +++ b/src/sctp_server.erl @@ -13,9 +13,7 @@ -include_lib("kernel/include/inet.hrl"). -include_lib("kernel/include/inet_sctp.hrl"). --define(S1AP_PORT, 36412). --define(S1AP_PPID, 18). --define(SCTP_STREAM, 0). +-include("s1ap.hrl"). -record(server_state, {sock, clients}). -record(client_state, {addr_port, pid}). @@ -65,8 +63,8 @@ handle_cast({send_data, Aid, Data}, State) -> gen_sctp:send(State#server_state.sock, - #sctp_sndrcvinfo{stream = ?SCTP_STREAM, - ppid = ?S1AP_PPID, + #sctp_sndrcvinfo{stream = ?S1AP_SCTP_STREAM, + ppid = ?S1AP_SCTP_PPID, assoc_id = Aid}, Data), {noreply, State}; -- To view, visit https://gerrit.osmocom.org/c/osmo-s1gw/+/37041?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: I8f06d11f984fe47b7ee0a3ed43532861cbae1dd0 Gerrit-Change-Number: 37041 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osm...@sysmocom.de> Gerrit-CC: fixeria <vyanits...@sysmocom.de> Gerrit-MessageType: newchange