add debug

This commit is contained in:
anlicheng 2026-03-04 16:01:03 +08:00
parent dd8330deed
commit 9351cabdee
2 changed files with 3 additions and 1 deletions

View File

@ -250,6 +250,8 @@ handle_event(internal, {frame, <<?PACKET_POLICY_REQUEST, Body/binary>>}, registe
#sdl_policy_request{src_identity_id = SrcIdentityId, dst_identity_id = DstIdentityId, version = Version} ?= PolicyRequest, #sdl_policy_request{src_identity_id = SrcIdentityId, dst_identity_id = DstIdentityId, version = Version} ?= PolicyRequest,
{ok, Rules} = get_rules(SrcIdentityId, DstIdentityId), {ok, Rules} = get_rules(SrcIdentityId, DstIdentityId),
logger:debug("[sdlan_channel] policy_request src_identity_id: ~p, dst_identity_id: ~p, rules: ~p", [SrcIdentityId, DstIdentityId, Rules]),
RuleBin = iolist_to_binary(lists:map(fun({Proto, Port}) -> <<Proto:8, Port:16>> end, Rules)), RuleBin = iolist_to_binary(lists:map(fun({Proto, Port}) -> <<Proto:8, Port:16>> end, Rules)),
PolicyResponsePkt = sdlan_pb:encode_msg(#sdl_policy_response { PolicyResponsePkt = sdlan_pb:encode_msg(#sdl_policy_response {
src_identity_id = SrcIdentityId, src_identity_id = SrcIdentityId,

View File

@ -106,7 +106,7 @@ message SDLPolicyResponse {
uint32 dst_identity_id = 3; uint32 dst_identity_id = 3;
// ; // ;
uint32 version = 4; uint32 version = 4;
// 4+1+2 // 1 + 2, : <<Proto:8, Port:16>> ; allowdeny规则的服务器端已经屏蔽
bytes rules = 5; bytes rules = 5;
} }