summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-08-22 17:58:21 +0200
committerMatt Johnson <matt9j@cs.washington.edu>2020-09-08 01:34:03 -0700
commit515aa3343442e784602e23890672e40eb320aa00 (patch)
tree74581e7201b5f94d2363a0e8aec716da977907f7 /src
parent0c40c626caa95fd27be5f6af9b0b9f63edb23bb2 (diff)
ipa_proto: Hook ipa_proto_ccm into the handling of CCM messages
Diffstat (limited to 'src')
-rw-r--r--src/ipa_proto.erl8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ipa_proto.erl b/src/ipa_proto.erl
index 9a3f3d0..20e5a1b 100644
--- a/src/ipa_proto.erl
+++ b/src/ipa_proto.erl
@@ -261,15 +261,15 @@ loop(S, StreamMap) ->
end.
% Respond with PONG to PING
-process_ccm_msg(Socket, StreamID, ?IPAC_MSGT_PING, _) ->
+process_ccm_msg(Socket, StreamID, ping, _) ->
io:format("Socket ~p Stream ~p: PING -> PONG~n", [Socket, StreamID]),
send(Socket, StreamID, <<?IPAC_MSGT_PONG>>);
% Simply respond to ID_ACK with ID_ACK
-process_ccm_msg(Socket, StreamID, ?IPAC_MSGT_ID_ACK, _) ->
+process_ccm_msg(Socket, StreamID, id_ack, _) ->
io:format("Socket ~p Stream ~p: ID_ACK -> ID_ACK~n", [Socket, StreamID]),
send(Socket, StreamID, <<?IPAC_MSGT_ID_ACK>>);
% Simply respond to ID_RESP with ID_ACK
-process_ccm_msg(Socket, StreamID, ?IPAC_MSGT_ID_RESP, _) ->
+process_ccm_msg(Socket, StreamID, id_resp, _) ->
io:format("Socket ~p Stream ~p: ID_RESP -> ID_ACK~n", [Socket, StreamID]),
send(Socket, StreamID, <<?IPAC_MSGT_ID_ACK>>);
% Default message handler for unknown messages
@@ -279,7 +279,7 @@ process_ccm_msg(Socket, StreamID, MsgType, Opts) ->
% process an incoming CCM message (Stream ID 254)
process_rx_ccm_msg(Socket, StreamID, PayloadBin) ->
- [MsgType|Opts] = binary:bin_to_list(PayloadBin),
+ {MsgType, Opts} = ipa_proto_ccm:decode(PayloadBin),
process_ccm_msg(Socket, StreamID, MsgType, Opts).
send_ccm_id_get(Socket) ->