fix policy
This commit is contained in:
parent
f9b30f0afd
commit
5a9b680d2e
@ -201,6 +201,20 @@ handle_event(info, {frame, <<?PACKET_QUERY_INFO, Body/binary>>}, registered, #st
|
|||||||
keep_state_and_data
|
keep_state_and_data
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
%% TODO 处理权限查询
|
||||||
|
handle_event(info, {frame, <<?PACKET_POLICY_REQUEST, Body/binary>>}, registered, #state{stream = Stream, network_pid = NetworkPid}) when is_pid(NetworkPid) ->
|
||||||
|
maybe
|
||||||
|
PolicyRequest = catch sdlan_pb:decode_msg(Body, sdl_policy_request),
|
||||||
|
#sdl_policy_request{src_identity_id = SrcIdentityId, dst_identity_id = DstIdentityId, version = Version} ?= PolicyRequest,
|
||||||
|
PolicyResponsePkt = sdlan_pb:encode_msg(#sdl_policy_response {
|
||||||
|
src_identity_id = SrcIdentityId,
|
||||||
|
dst_identity_id = DstIdentityId,
|
||||||
|
version = Version,
|
||||||
|
rules = <<1, 80:16, 2, 9090:16>>
|
||||||
|
}),
|
||||||
|
quic_send(Stream, <<?PACKET_POLICY_REPLY, PolicyResponsePkt/binary>>)
|
||||||
|
end;
|
||||||
|
|
||||||
handle_event(info, {frame, <<?PACKET_PING>>}, registered, State = #state{stream = Stream, ping_counter = PingCounter}) ->
|
handle_event(info, {frame, <<?PACKET_PING>>}, registered, State = #state{stream = Stream, ping_counter = PingCounter}) ->
|
||||||
quic_send(Stream, <<?PACKET_PONG>>),
|
quic_send(Stream, <<?PACKET_PONG>>),
|
||||||
{keep_state, State#state{ping_counter = PingCounter + 1}};
|
{keep_state, State#state{ping_counter = PingCounter + 1}};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user