fix acl
This commit is contained in:
parent
7c726ffcb3
commit
a7f43b7260
@ -61,6 +61,9 @@
|
||||
-define(PACKET_POLICY_REQUEST, 16#b0).
|
||||
-define(PACKET_POLICY_REPLY, 16#b1).
|
||||
|
||||
-define(PACKET_EXPOSED_SERVICE_REQUEST, 16#b2).
|
||||
-define(PACKET_EXPOSED_SERVICE_RESPONSE, 16#b3).
|
||||
|
||||
%% 欢迎消息
|
||||
-define(PACKET_WELCOME, 16#4F).
|
||||
|
||||
|
||||
@ -137,6 +137,22 @@
|
||||
}).
|
||||
-endif.
|
||||
|
||||
-ifndef('SDLEXPOSEDSERVICEREQUEST_PB_H').
|
||||
-define('SDLEXPOSEDSERVICEREQUEST_PB_H', true).
|
||||
-record('SDLExposedServiceRequest',
|
||||
{version = 0 :: non_neg_integer() | undefined % = 1, optional, 32 bits
|
||||
}).
|
||||
-endif.
|
||||
|
||||
-ifndef('SDLEXPOSEDSERVICERESPONSE_PB_H').
|
||||
-define('SDLEXPOSEDSERVICERESPONSE_PB_H', true).
|
||||
-record('SDLExposedServiceResponse',
|
||||
{version = 0 :: non_neg_integer() | undefined, % = 1, optional, 32 bits
|
||||
tcp_ports = [] :: [non_neg_integer()] | undefined, % = 2, repeated, 32 bits
|
||||
udp_ports = [] :: [non_neg_integer()] | undefined % = 3, repeated, 32 bits
|
||||
}).
|
||||
-endif.
|
||||
|
||||
-ifndef('SDLEVENT.NATCHANGED_PB_H').
|
||||
-define('SDLEVENT.NATCHANGED_PB_H', true).
|
||||
-record('SDLEvent.NatChanged',
|
||||
@ -156,6 +172,13 @@
|
||||
}).
|
||||
-endif.
|
||||
|
||||
-ifndef('SDLEVENT.EXPOSEDSERVICECHANGED_PB_H').
|
||||
-define('SDLEVENT.EXPOSEDSERVICECHANGED_PB_H', true).
|
||||
-record('SDLEvent.ExposedServiceChanged',
|
||||
{
|
||||
}).
|
||||
-endif.
|
||||
|
||||
-ifndef('SDLEVENT.NETWORKSHUTDOWN_PB_H').
|
||||
-define('SDLEVENT.NETWORKSHUTDOWN_PB_H', true).
|
||||
-record('SDLEvent.NetworkShutdown',
|
||||
@ -166,7 +189,7 @@
|
||||
-ifndef('SDLEVENT_PB_H').
|
||||
-define('SDLEVENT_PB_H', true).
|
||||
-record('SDLEvent',
|
||||
{event :: {nat_changed, sdlan_pb:'SDLEvent.NatChanged'()} | {send_register, sdlan_pb:'SDLEvent.SendRegister'()} | {shutdown, sdlan_pb:'SDLEvent.NetworkShutdown'()} | undefined % oneof
|
||||
{event :: {nat_changed, sdlan_pb:'SDLEvent.NatChanged'()} | {send_register, sdlan_pb:'SDLEvent.SendRegister'()} | {shutdown, sdlan_pb:'SDLEvent.NetworkShutdown'()} | {exposed_service_changed, sdlan_pb:'SDLEvent.ExposedServiceChanged'()} | undefined % oneof
|
||||
}).
|
||||
-endif.
|
||||
|
||||
|
||||
@ -117,6 +117,16 @@ message SDLPolicyResponse {
|
||||
bytes rules = 4;
|
||||
}
|
||||
|
||||
message SDLExposedServiceRequest {
|
||||
uint32 version = 1;
|
||||
}
|
||||
|
||||
message SDLExposedServiceResponse {
|
||||
uint32 version = 1;
|
||||
repeated uint32 tcp_ports = 2;
|
||||
repeated uint32 udp_ports = 3;
|
||||
}
|
||||
|
||||
// 事件定义
|
||||
|
||||
message SDLEvent {
|
||||
@ -135,6 +145,10 @@ message SDLEvent {
|
||||
optional SDLV6Info v6_info = 5;
|
||||
}
|
||||
|
||||
message ExposedServiceChanged {
|
||||
|
||||
}
|
||||
|
||||
// 网络关闭
|
||||
message NetworkShutdown {
|
||||
string message = 1;
|
||||
@ -144,6 +158,7 @@ message SDLEvent {
|
||||
NatChanged nat_changed = 1;
|
||||
SendRegister send_register = 2;
|
||||
NetworkShutdown shutdown = 3;
|
||||
ExposedServiceChanged exposed_service_changed = 4;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -14,6 +14,7 @@
|
||||
%% API
|
||||
-export([get_all_networks/0, get_network/1]).
|
||||
-export([flow_report/5, network_forward_report/2, auth_access_token/1, set_node_status/1]).
|
||||
-export([node_acl/1]).
|
||||
|
||||
-spec get_all_networks() -> {ok, [NetworkId :: integer()]} | {error, Reason :: any()}.
|
||||
get_all_networks() ->
|
||||
@ -65,6 +66,20 @@ auth_access_token(Params) when is_map(Params) ->
|
||||
Error
|
||||
end.
|
||||
|
||||
-spec node_acl(Params :: map()) -> {ok, Resp :: map()} | {error, Reason :: any()}.
|
||||
node_acl(Params) when is_map(Params) ->
|
||||
case safe_request(fun() -> do_post("acl", Params) end) of
|
||||
{ok, Resp} ->
|
||||
case decode_json(Resp) of
|
||||
{ok, Result} ->
|
||||
{ok, Result};
|
||||
{error, Reason} ->
|
||||
{error, Reason}
|
||||
end;
|
||||
{error, _Reason} = Error ->
|
||||
Error
|
||||
end.
|
||||
|
||||
-spec set_node_status(Params :: map()) -> {ok, Resp :: map()} | {error, Reason :: any()}.
|
||||
set_node_status(Params) when is_map(Params) ->
|
||||
case safe_request(fun() -> do_post("set_node_status", Params) end) of
|
||||
|
||||
380
src/sdlan_pb.erl
380
src/sdlan_pb.erl
@ -82,10 +82,16 @@
|
||||
|
||||
-type 'SDLPolicyResponse'() :: #'SDLPolicyResponse'{}.
|
||||
|
||||
-type 'SDLExposedServiceRequest'() :: #'SDLExposedServiceRequest'{}.
|
||||
|
||||
-type 'SDLExposedServiceResponse'() :: #'SDLExposedServiceResponse'{}.
|
||||
|
||||
-type 'SDLEvent.NatChanged'() :: #'SDLEvent.NatChanged'{}.
|
||||
|
||||
-type 'SDLEvent.SendRegister'() :: #'SDLEvent.SendRegister'{}.
|
||||
|
||||
-type 'SDLEvent.ExposedServiceChanged'() :: #'SDLEvent.ExposedServiceChanged'{}.
|
||||
|
||||
-type 'SDLEvent.NetworkShutdown'() :: #'SDLEvent.NetworkShutdown'{}.
|
||||
|
||||
-type 'SDLEvent'() :: #'SDLEvent'{}.
|
||||
@ -110,9 +116,9 @@
|
||||
|
||||
-type 'SDLRegisterAck'() :: #'SDLRegisterAck'{}.
|
||||
|
||||
-export_type(['SDLV4Info'/0, 'SDLV6Info'/0, 'SDLV6AssistProbe'/0, 'SDLV6AssistProbeReply'/0, 'SDLWelcome'/0, 'SDLRegisterSuper'/0, 'SDLRegisterSuperAck'/0, 'SDLRegisterSuperNak'/0, 'SDLQueryInfo'/0, 'SDLPeerInfo'/0, 'SDLArpRequest'/0, 'SDLArpResponse'/0, 'SDLPolicyRequest'/0, 'SDLPolicyResponse'/0, 'SDLEvent.NatChanged'/0, 'SDLEvent.SendRegister'/0, 'SDLEvent.NetworkShutdown'/0, 'SDLEvent'/0, 'SDLCommand.ExitNodeControl'/0, 'SDLCommand'/0, 'SDLCommandAck'/0, 'SDLStunRequest'/0, 'SDLStunReply'/0, 'SDLData'/0, 'SDLStunProbe'/0, 'SDLStunProbeReply'/0, 'SDLRegister'/0, 'SDLRegisterAck'/0]).
|
||||
-type '$msg_name'() :: 'SDLV4Info' | 'SDLV6Info' | 'SDLV6AssistProbe' | 'SDLV6AssistProbeReply' | 'SDLWelcome' | 'SDLRegisterSuper' | 'SDLRegisterSuperAck' | 'SDLRegisterSuperNak' | 'SDLQueryInfo' | 'SDLPeerInfo' | 'SDLArpRequest' | 'SDLArpResponse' | 'SDLPolicyRequest' | 'SDLPolicyResponse' | 'SDLEvent.NatChanged' | 'SDLEvent.SendRegister' | 'SDLEvent.NetworkShutdown' | 'SDLEvent' | 'SDLCommand.ExitNodeControl' | 'SDLCommand' | 'SDLCommandAck' | 'SDLStunRequest' | 'SDLStunReply' | 'SDLData' | 'SDLStunProbe' | 'SDLStunProbeReply' | 'SDLRegister' | 'SDLRegisterAck'.
|
||||
-type '$msg'() :: 'SDLV4Info'() | 'SDLV6Info'() | 'SDLV6AssistProbe'() | 'SDLV6AssistProbeReply'() | 'SDLWelcome'() | 'SDLRegisterSuper'() | 'SDLRegisterSuperAck'() | 'SDLRegisterSuperNak'() | 'SDLQueryInfo'() | 'SDLPeerInfo'() | 'SDLArpRequest'() | 'SDLArpResponse'() | 'SDLPolicyRequest'() | 'SDLPolicyResponse'() | 'SDLEvent.NatChanged'() | 'SDLEvent.SendRegister'() | 'SDLEvent.NetworkShutdown'() | 'SDLEvent'() | 'SDLCommand.ExitNodeControl'() | 'SDLCommand'() | 'SDLCommandAck'() | 'SDLStunRequest'() | 'SDLStunReply'() | 'SDLData'() | 'SDLStunProbe'() | 'SDLStunProbeReply'() | 'SDLRegister'() | 'SDLRegisterAck'().
|
||||
-export_type(['SDLV4Info'/0, 'SDLV6Info'/0, 'SDLV6AssistProbe'/0, 'SDLV6AssistProbeReply'/0, 'SDLWelcome'/0, 'SDLRegisterSuper'/0, 'SDLRegisterSuperAck'/0, 'SDLRegisterSuperNak'/0, 'SDLQueryInfo'/0, 'SDLPeerInfo'/0, 'SDLArpRequest'/0, 'SDLArpResponse'/0, 'SDLPolicyRequest'/0, 'SDLPolicyResponse'/0, 'SDLExposedServiceRequest'/0, 'SDLExposedServiceResponse'/0, 'SDLEvent.NatChanged'/0, 'SDLEvent.SendRegister'/0, 'SDLEvent.ExposedServiceChanged'/0, 'SDLEvent.NetworkShutdown'/0, 'SDLEvent'/0, 'SDLCommand.ExitNodeControl'/0, 'SDLCommand'/0, 'SDLCommandAck'/0, 'SDLStunRequest'/0, 'SDLStunReply'/0, 'SDLData'/0, 'SDLStunProbe'/0, 'SDLStunProbeReply'/0, 'SDLRegister'/0, 'SDLRegisterAck'/0]).
|
||||
-type '$msg_name'() :: 'SDLV4Info' | 'SDLV6Info' | 'SDLV6AssistProbe' | 'SDLV6AssistProbeReply' | 'SDLWelcome' | 'SDLRegisterSuper' | 'SDLRegisterSuperAck' | 'SDLRegisterSuperNak' | 'SDLQueryInfo' | 'SDLPeerInfo' | 'SDLArpRequest' | 'SDLArpResponse' | 'SDLPolicyRequest' | 'SDLPolicyResponse' | 'SDLExposedServiceRequest' | 'SDLExposedServiceResponse' | 'SDLEvent.NatChanged' | 'SDLEvent.SendRegister' | 'SDLEvent.ExposedServiceChanged' | 'SDLEvent.NetworkShutdown' | 'SDLEvent' | 'SDLCommand.ExitNodeControl' | 'SDLCommand' | 'SDLCommandAck' | 'SDLStunRequest' | 'SDLStunReply' | 'SDLData' | 'SDLStunProbe' | 'SDLStunProbeReply' | 'SDLRegister' | 'SDLRegisterAck'.
|
||||
-type '$msg'() :: 'SDLV4Info'() | 'SDLV6Info'() | 'SDLV6AssistProbe'() | 'SDLV6AssistProbeReply'() | 'SDLWelcome'() | 'SDLRegisterSuper'() | 'SDLRegisterSuperAck'() | 'SDLRegisterSuperNak'() | 'SDLQueryInfo'() | 'SDLPeerInfo'() | 'SDLArpRequest'() | 'SDLArpResponse'() | 'SDLPolicyRequest'() | 'SDLPolicyResponse'() | 'SDLExposedServiceRequest'() | 'SDLExposedServiceResponse'() | 'SDLEvent.NatChanged'() | 'SDLEvent.SendRegister'() | 'SDLEvent.ExposedServiceChanged'() | 'SDLEvent.NetworkShutdown'() | 'SDLEvent'() | 'SDLCommand.ExitNodeControl'() | 'SDLCommand'() | 'SDLCommandAck'() | 'SDLStunRequest'() | 'SDLStunReply'() | 'SDLData'() | 'SDLStunProbe'() | 'SDLStunProbeReply'() | 'SDLRegister'() | 'SDLRegisterAck'().
|
||||
-export_type(['$msg_name'/0, '$msg'/0]).
|
||||
|
||||
-if(?OTP_RELEASE >= 24).
|
||||
@ -153,8 +159,11 @@ encode_msg(Msg, MsgName, Opts) ->
|
||||
'SDLArpResponse' -> encode_msg_SDLArpResponse(id(Msg, TrUserData), TrUserData);
|
||||
'SDLPolicyRequest' -> encode_msg_SDLPolicyRequest(id(Msg, TrUserData), TrUserData);
|
||||
'SDLPolicyResponse' -> encode_msg_SDLPolicyResponse(id(Msg, TrUserData), TrUserData);
|
||||
'SDLExposedServiceRequest' -> encode_msg_SDLExposedServiceRequest(id(Msg, TrUserData), TrUserData);
|
||||
'SDLExposedServiceResponse' -> encode_msg_SDLExposedServiceResponse(id(Msg, TrUserData), TrUserData);
|
||||
'SDLEvent.NatChanged' -> 'encode_msg_SDLEvent.NatChanged'(id(Msg, TrUserData), TrUserData);
|
||||
'SDLEvent.SendRegister' -> 'encode_msg_SDLEvent.SendRegister'(id(Msg, TrUserData), TrUserData);
|
||||
'SDLEvent.ExposedServiceChanged' -> 'encode_msg_SDLEvent.ExposedServiceChanged'(id(Msg, TrUserData), TrUserData);
|
||||
'SDLEvent.NetworkShutdown' -> 'encode_msg_SDLEvent.NetworkShutdown'(id(Msg, TrUserData), TrUserData);
|
||||
'SDLEvent' -> encode_msg_SDLEvent(id(Msg, TrUserData), TrUserData);
|
||||
'SDLCommand.ExitNodeControl' -> 'encode_msg_SDLCommand.ExitNodeControl'(id(Msg, TrUserData), TrUserData);
|
||||
@ -650,6 +659,46 @@ encode_msg_SDLPolicyResponse(#'SDLPolicyResponse'{src_identity_id = F1, dst_iden
|
||||
end
|
||||
end.
|
||||
|
||||
encode_msg_SDLExposedServiceRequest(Msg, TrUserData) -> encode_msg_SDLExposedServiceRequest(Msg, <<>>, TrUserData).
|
||||
|
||||
|
||||
encode_msg_SDLExposedServiceRequest(#'SDLExposedServiceRequest'{version = F1}, Bin, TrUserData) ->
|
||||
if F1 == undefined -> Bin;
|
||||
true ->
|
||||
begin
|
||||
TrF1 = id(F1, TrUserData),
|
||||
if TrF1 =:= 0 -> Bin;
|
||||
true -> e_varint(TrF1, <<Bin/binary, 8>>, TrUserData)
|
||||
end
|
||||
end
|
||||
end.
|
||||
|
||||
encode_msg_SDLExposedServiceResponse(Msg, TrUserData) -> encode_msg_SDLExposedServiceResponse(Msg, <<>>, TrUserData).
|
||||
|
||||
|
||||
encode_msg_SDLExposedServiceResponse(#'SDLExposedServiceResponse'{version = F1, tcp_ports = F2, udp_ports = F3}, Bin, TrUserData) ->
|
||||
B1 = if F1 == undefined -> Bin;
|
||||
true ->
|
||||
begin
|
||||
TrF1 = id(F1, TrUserData),
|
||||
if TrF1 =:= 0 -> Bin;
|
||||
true -> e_varint(TrF1, <<Bin/binary, 8>>, TrUserData)
|
||||
end
|
||||
end
|
||||
end,
|
||||
B2 = begin
|
||||
TrF2 = id(F2, TrUserData),
|
||||
if TrF2 == [] -> B1;
|
||||
true -> e_field_SDLExposedServiceResponse_tcp_ports(TrF2, B1, TrUserData)
|
||||
end
|
||||
end,
|
||||
begin
|
||||
TrF3 = id(F3, TrUserData),
|
||||
if TrF3 == [] -> B2;
|
||||
true -> e_field_SDLExposedServiceResponse_udp_ports(TrF3, B2, TrUserData)
|
||||
end
|
||||
end.
|
||||
|
||||
'encode_msg_SDLEvent.NatChanged'(Msg, TrUserData) -> 'encode_msg_SDLEvent.NatChanged'(Msg, <<>>, TrUserData).
|
||||
|
||||
|
||||
@ -719,6 +768,8 @@ encode_msg_SDLPolicyResponse(#'SDLPolicyResponse'{src_identity_id = F1, dst_iden
|
||||
true -> begin TrF5 = id(F5, TrUserData), 'e_mfield_SDLEvent.SendRegister_v6_info'(TrF5, <<B4/binary, 42>>, TrUserData) end
|
||||
end.
|
||||
|
||||
'encode_msg_SDLEvent.ExposedServiceChanged'(_Msg, _TrUserData) -> <<>>.
|
||||
|
||||
'encode_msg_SDLEvent.NetworkShutdown'(Msg, TrUserData) -> 'encode_msg_SDLEvent.NetworkShutdown'(Msg, <<>>, TrUserData).
|
||||
|
||||
|
||||
@ -743,7 +794,8 @@ encode_msg_SDLEvent(#'SDLEvent'{event = F1}, Bin, TrUserData) ->
|
||||
case id(F1, TrUserData) of
|
||||
{nat_changed, TF1} -> begin TrTF1 = id(TF1, TrUserData), e_mfield_SDLEvent_nat_changed(TrTF1, <<Bin/binary, 10>>, TrUserData) end;
|
||||
{send_register, TF1} -> begin TrTF1 = id(TF1, TrUserData), e_mfield_SDLEvent_send_register(TrTF1, <<Bin/binary, 18>>, TrUserData) end;
|
||||
{shutdown, TF1} -> begin TrTF1 = id(TF1, TrUserData), e_mfield_SDLEvent_shutdown(TrTF1, <<Bin/binary, 26>>, TrUserData) end
|
||||
{shutdown, TF1} -> begin TrTF1 = id(TF1, TrUserData), e_mfield_SDLEvent_shutdown(TrTF1, <<Bin/binary, 26>>, TrUserData) end;
|
||||
{exposed_service_changed, TF1} -> begin TrTF1 = id(TF1, TrUserData), e_mfield_SDLEvent_exposed_service_changed(TrTF1, <<Bin/binary, 34>>, TrUserData) end
|
||||
end
|
||||
end.
|
||||
|
||||
@ -1140,6 +1192,30 @@ e_mfield_SDLPeerInfo_v6_info(Msg, Bin, TrUserData) ->
|
||||
Bin2 = e_varint(byte_size(SubBin), Bin),
|
||||
<<Bin2/binary, SubBin/binary>>.
|
||||
|
||||
e_field_SDLExposedServiceResponse_tcp_ports(Elems, Bin, TrUserData) when Elems =/= [] ->
|
||||
SubBin = e_pfield_SDLExposedServiceResponse_tcp_ports(Elems, <<>>, TrUserData),
|
||||
Bin2 = <<Bin/binary, 18>>,
|
||||
Bin3 = e_varint(byte_size(SubBin), Bin2),
|
||||
<<Bin3/binary, SubBin/binary>>;
|
||||
e_field_SDLExposedServiceResponse_tcp_ports([], Bin, _TrUserData) -> Bin.
|
||||
|
||||
e_pfield_SDLExposedServiceResponse_tcp_ports([Value | Rest], Bin, TrUserData) ->
|
||||
Bin2 = e_varint(id(Value, TrUserData), Bin, TrUserData),
|
||||
e_pfield_SDLExposedServiceResponse_tcp_ports(Rest, Bin2, TrUserData);
|
||||
e_pfield_SDLExposedServiceResponse_tcp_ports([], Bin, _TrUserData) -> Bin.
|
||||
|
||||
e_field_SDLExposedServiceResponse_udp_ports(Elems, Bin, TrUserData) when Elems =/= [] ->
|
||||
SubBin = e_pfield_SDLExposedServiceResponse_udp_ports(Elems, <<>>, TrUserData),
|
||||
Bin2 = <<Bin/binary, 26>>,
|
||||
Bin3 = e_varint(byte_size(SubBin), Bin2),
|
||||
<<Bin3/binary, SubBin/binary>>;
|
||||
e_field_SDLExposedServiceResponse_udp_ports([], Bin, _TrUserData) -> Bin.
|
||||
|
||||
e_pfield_SDLExposedServiceResponse_udp_ports([Value | Rest], Bin, TrUserData) ->
|
||||
Bin2 = e_varint(id(Value, TrUserData), Bin, TrUserData),
|
||||
e_pfield_SDLExposedServiceResponse_udp_ports(Rest, Bin2, TrUserData);
|
||||
e_pfield_SDLExposedServiceResponse_udp_ports([], Bin, _TrUserData) -> Bin.
|
||||
|
||||
'e_mfield_SDLEvent.SendRegister_v6_info'(Msg, Bin, TrUserData) ->
|
||||
SubBin = encode_msg_SDLV6Info(Msg, <<>>, TrUserData),
|
||||
Bin2 = e_varint(byte_size(SubBin), Bin),
|
||||
@ -1160,6 +1236,8 @@ e_mfield_SDLEvent_shutdown(Msg, Bin, TrUserData) ->
|
||||
Bin2 = e_varint(byte_size(SubBin), Bin),
|
||||
<<Bin2/binary, SubBin/binary>>.
|
||||
|
||||
e_mfield_SDLEvent_exposed_service_changed(_Msg, Bin, _TrUserData) -> <<Bin/binary, 0>>.
|
||||
|
||||
e_mfield_SDLCommand_exit_node(Msg, Bin, TrUserData) ->
|
||||
SubBin = 'encode_msg_SDLCommand.ExitNodeControl'(Msg, <<>>, TrUserData),
|
||||
Bin2 = e_varint(byte_size(SubBin), Bin),
|
||||
@ -1322,8 +1400,11 @@ decode_msg_2_doit('SDLArpRequest', Bin, TrUserData) -> id(decode_msg_SDLArpReque
|
||||
decode_msg_2_doit('SDLArpResponse', Bin, TrUserData) -> id(decode_msg_SDLArpResponse(Bin, TrUserData), TrUserData);
|
||||
decode_msg_2_doit('SDLPolicyRequest', Bin, TrUserData) -> id(decode_msg_SDLPolicyRequest(Bin, TrUserData), TrUserData);
|
||||
decode_msg_2_doit('SDLPolicyResponse', Bin, TrUserData) -> id(decode_msg_SDLPolicyResponse(Bin, TrUserData), TrUserData);
|
||||
decode_msg_2_doit('SDLExposedServiceRequest', Bin, TrUserData) -> id(decode_msg_SDLExposedServiceRequest(Bin, TrUserData), TrUserData);
|
||||
decode_msg_2_doit('SDLExposedServiceResponse', Bin, TrUserData) -> id(decode_msg_SDLExposedServiceResponse(Bin, TrUserData), TrUserData);
|
||||
decode_msg_2_doit('SDLEvent.NatChanged', Bin, TrUserData) -> id('decode_msg_SDLEvent.NatChanged'(Bin, TrUserData), TrUserData);
|
||||
decode_msg_2_doit('SDLEvent.SendRegister', Bin, TrUserData) -> id('decode_msg_SDLEvent.SendRegister'(Bin, TrUserData), TrUserData);
|
||||
decode_msg_2_doit('SDLEvent.ExposedServiceChanged', Bin, TrUserData) -> id('decode_msg_SDLEvent.ExposedServiceChanged'(Bin, TrUserData), TrUserData);
|
||||
decode_msg_2_doit('SDLEvent.NetworkShutdown', Bin, TrUserData) -> id('decode_msg_SDLEvent.NetworkShutdown'(Bin, TrUserData), TrUserData);
|
||||
decode_msg_2_doit('SDLEvent', Bin, TrUserData) -> id(decode_msg_SDLEvent(Bin, TrUserData), TrUserData);
|
||||
decode_msg_2_doit('SDLCommand.ExitNodeControl', Bin, TrUserData) -> id('decode_msg_SDLCommand.ExitNodeControl'(Bin, TrUserData), TrUserData);
|
||||
@ -2222,6 +2303,138 @@ skip_32_SDLPolicyResponse(<<_:32, Rest/binary>>, Z1, Z2, F, F@_1, F@_2, F@_3, F@
|
||||
|
||||
skip_64_SDLPolicyResponse(<<_:64, Rest/binary>>, Z1, Z2, F, F@_1, F@_2, F@_3, F@_4, TrUserData) -> dfp_read_field_def_SDLPolicyResponse(Rest, Z1, Z2, F, F@_1, F@_2, F@_3, F@_4, TrUserData).
|
||||
|
||||
decode_msg_SDLExposedServiceRequest(Bin, TrUserData) -> dfp_read_field_def_SDLExposedServiceRequest(Bin, 0, 0, 0, id(0, TrUserData), TrUserData).
|
||||
|
||||
dfp_read_field_def_SDLExposedServiceRequest(<<8, Rest/binary>>, Z1, Z2, F, F@_1, TrUserData) -> d_field_SDLExposedServiceRequest_version(Rest, Z1, Z2, F, F@_1, TrUserData);
|
||||
dfp_read_field_def_SDLExposedServiceRequest(<<>>, 0, 0, _, F@_1, _) -> #'SDLExposedServiceRequest'{version = F@_1};
|
||||
dfp_read_field_def_SDLExposedServiceRequest(Other, Z1, Z2, F, F@_1, TrUserData) -> dg_read_field_def_SDLExposedServiceRequest(Other, Z1, Z2, F, F@_1, TrUserData).
|
||||
|
||||
dg_read_field_def_SDLExposedServiceRequest(<<1:1, X:7, Rest/binary>>, N, Acc, F, F@_1, TrUserData) when N < 32 - 7 -> dg_read_field_def_SDLExposedServiceRequest(Rest, N + 7, X bsl N + Acc, F, F@_1, TrUserData);
|
||||
dg_read_field_def_SDLExposedServiceRequest(<<0:1, X:7, Rest/binary>>, N, Acc, _, F@_1, TrUserData) ->
|
||||
Key = X bsl N + Acc,
|
||||
case Key of
|
||||
8 -> d_field_SDLExposedServiceRequest_version(Rest, 0, 0, 0, F@_1, TrUserData);
|
||||
_ ->
|
||||
case Key band 7 of
|
||||
0 -> skip_varint_SDLExposedServiceRequest(Rest, 0, 0, Key bsr 3, F@_1, TrUserData);
|
||||
1 -> skip_64_SDLExposedServiceRequest(Rest, 0, 0, Key bsr 3, F@_1, TrUserData);
|
||||
2 -> skip_length_delimited_SDLExposedServiceRequest(Rest, 0, 0, Key bsr 3, F@_1, TrUserData);
|
||||
3 -> skip_group_SDLExposedServiceRequest(Rest, 0, 0, Key bsr 3, F@_1, TrUserData);
|
||||
5 -> skip_32_SDLExposedServiceRequest(Rest, 0, 0, Key bsr 3, F@_1, TrUserData)
|
||||
end
|
||||
end;
|
||||
dg_read_field_def_SDLExposedServiceRequest(<<>>, 0, 0, _, F@_1, _) -> #'SDLExposedServiceRequest'{version = F@_1}.
|
||||
|
||||
d_field_SDLExposedServiceRequest_version(<<1:1, X:7, Rest/binary>>, N, Acc, F, F@_1, TrUserData) when N < 57 -> d_field_SDLExposedServiceRequest_version(Rest, N + 7, X bsl N + Acc, F, F@_1, TrUserData);
|
||||
d_field_SDLExposedServiceRequest_version(<<0:1, X:7, Rest/binary>>, N, Acc, F, _, TrUserData) ->
|
||||
{NewFValue, RestF} = {id((X bsl N + Acc) band 4294967295, TrUserData), Rest},
|
||||
dfp_read_field_def_SDLExposedServiceRequest(RestF, 0, 0, F, NewFValue, TrUserData).
|
||||
|
||||
skip_varint_SDLExposedServiceRequest(<<1:1, _:7, Rest/binary>>, Z1, Z2, F, F@_1, TrUserData) -> skip_varint_SDLExposedServiceRequest(Rest, Z1, Z2, F, F@_1, TrUserData);
|
||||
skip_varint_SDLExposedServiceRequest(<<0:1, _:7, Rest/binary>>, Z1, Z2, F, F@_1, TrUserData) -> dfp_read_field_def_SDLExposedServiceRequest(Rest, Z1, Z2, F, F@_1, TrUserData).
|
||||
|
||||
skip_length_delimited_SDLExposedServiceRequest(<<1:1, X:7, Rest/binary>>, N, Acc, F, F@_1, TrUserData) when N < 57 -> skip_length_delimited_SDLExposedServiceRequest(Rest, N + 7, X bsl N + Acc, F, F@_1, TrUserData);
|
||||
skip_length_delimited_SDLExposedServiceRequest(<<0:1, X:7, Rest/binary>>, N, Acc, F, F@_1, TrUserData) ->
|
||||
Length = X bsl N + Acc,
|
||||
<<_:Length/binary, Rest2/binary>> = Rest,
|
||||
dfp_read_field_def_SDLExposedServiceRequest(Rest2, 0, 0, F, F@_1, TrUserData).
|
||||
|
||||
skip_group_SDLExposedServiceRequest(Bin, _, Z2, FNum, F@_1, TrUserData) ->
|
||||
{_, Rest} = read_group(Bin, FNum),
|
||||
dfp_read_field_def_SDLExposedServiceRequest(Rest, 0, Z2, FNum, F@_1, TrUserData).
|
||||
|
||||
skip_32_SDLExposedServiceRequest(<<_:32, Rest/binary>>, Z1, Z2, F, F@_1, TrUserData) -> dfp_read_field_def_SDLExposedServiceRequest(Rest, Z1, Z2, F, F@_1, TrUserData).
|
||||
|
||||
skip_64_SDLExposedServiceRequest(<<_:64, Rest/binary>>, Z1, Z2, F, F@_1, TrUserData) -> dfp_read_field_def_SDLExposedServiceRequest(Rest, Z1, Z2, F, F@_1, TrUserData).
|
||||
|
||||
decode_msg_SDLExposedServiceResponse(Bin, TrUserData) -> dfp_read_field_def_SDLExposedServiceResponse(Bin, 0, 0, 0, id(0, TrUserData), id([], TrUserData), id([], TrUserData), TrUserData).
|
||||
|
||||
dfp_read_field_def_SDLExposedServiceResponse(<<8, Rest/binary>>, Z1, Z2, F, F@_1, F@_2, F@_3, TrUserData) -> d_field_SDLExposedServiceResponse_version(Rest, Z1, Z2, F, F@_1, F@_2, F@_3, TrUserData);
|
||||
dfp_read_field_def_SDLExposedServiceResponse(<<18, Rest/binary>>, Z1, Z2, F, F@_1, F@_2, F@_3, TrUserData) -> d_pfield_SDLExposedServiceResponse_tcp_ports(Rest, Z1, Z2, F, F@_1, F@_2, F@_3, TrUserData);
|
||||
dfp_read_field_def_SDLExposedServiceResponse(<<16, Rest/binary>>, Z1, Z2, F, F@_1, F@_2, F@_3, TrUserData) -> d_field_SDLExposedServiceResponse_tcp_ports(Rest, Z1, Z2, F, F@_1, F@_2, F@_3, TrUserData);
|
||||
dfp_read_field_def_SDLExposedServiceResponse(<<26, Rest/binary>>, Z1, Z2, F, F@_1, F@_2, F@_3, TrUserData) -> d_pfield_SDLExposedServiceResponse_udp_ports(Rest, Z1, Z2, F, F@_1, F@_2, F@_3, TrUserData);
|
||||
dfp_read_field_def_SDLExposedServiceResponse(<<24, Rest/binary>>, Z1, Z2, F, F@_1, F@_2, F@_3, TrUserData) -> d_field_SDLExposedServiceResponse_udp_ports(Rest, Z1, Z2, F, F@_1, F@_2, F@_3, TrUserData);
|
||||
dfp_read_field_def_SDLExposedServiceResponse(<<>>, 0, 0, _, F@_1, R1, R2, TrUserData) -> #'SDLExposedServiceResponse'{version = F@_1, tcp_ports = lists_reverse(R1, TrUserData), udp_ports = lists_reverse(R2, TrUserData)};
|
||||
dfp_read_field_def_SDLExposedServiceResponse(Other, Z1, Z2, F, F@_1, F@_2, F@_3, TrUserData) -> dg_read_field_def_SDLExposedServiceResponse(Other, Z1, Z2, F, F@_1, F@_2, F@_3, TrUserData).
|
||||
|
||||
dg_read_field_def_SDLExposedServiceResponse(<<1:1, X:7, Rest/binary>>, N, Acc, F, F@_1, F@_2, F@_3, TrUserData) when N < 32 - 7 -> dg_read_field_def_SDLExposedServiceResponse(Rest, N + 7, X bsl N + Acc, F, F@_1, F@_2, F@_3, TrUserData);
|
||||
dg_read_field_def_SDLExposedServiceResponse(<<0:1, X:7, Rest/binary>>, N, Acc, _, F@_1, F@_2, F@_3, TrUserData) ->
|
||||
Key = X bsl N + Acc,
|
||||
case Key of
|
||||
8 -> d_field_SDLExposedServiceResponse_version(Rest, 0, 0, 0, F@_1, F@_2, F@_3, TrUserData);
|
||||
18 -> d_pfield_SDLExposedServiceResponse_tcp_ports(Rest, 0, 0, 0, F@_1, F@_2, F@_3, TrUserData);
|
||||
16 -> d_field_SDLExposedServiceResponse_tcp_ports(Rest, 0, 0, 0, F@_1, F@_2, F@_3, TrUserData);
|
||||
26 -> d_pfield_SDLExposedServiceResponse_udp_ports(Rest, 0, 0, 0, F@_1, F@_2, F@_3, TrUserData);
|
||||
24 -> d_field_SDLExposedServiceResponse_udp_ports(Rest, 0, 0, 0, F@_1, F@_2, F@_3, TrUserData);
|
||||
_ ->
|
||||
case Key band 7 of
|
||||
0 -> skip_varint_SDLExposedServiceResponse(Rest, 0, 0, Key bsr 3, F@_1, F@_2, F@_3, TrUserData);
|
||||
1 -> skip_64_SDLExposedServiceResponse(Rest, 0, 0, Key bsr 3, F@_1, F@_2, F@_3, TrUserData);
|
||||
2 -> skip_length_delimited_SDLExposedServiceResponse(Rest, 0, 0, Key bsr 3, F@_1, F@_2, F@_3, TrUserData);
|
||||
3 -> skip_group_SDLExposedServiceResponse(Rest, 0, 0, Key bsr 3, F@_1, F@_2, F@_3, TrUserData);
|
||||
5 -> skip_32_SDLExposedServiceResponse(Rest, 0, 0, Key bsr 3, F@_1, F@_2, F@_3, TrUserData)
|
||||
end
|
||||
end;
|
||||
dg_read_field_def_SDLExposedServiceResponse(<<>>, 0, 0, _, F@_1, R1, R2, TrUserData) -> #'SDLExposedServiceResponse'{version = F@_1, tcp_ports = lists_reverse(R1, TrUserData), udp_ports = lists_reverse(R2, TrUserData)}.
|
||||
|
||||
d_field_SDLExposedServiceResponse_version(<<1:1, X:7, Rest/binary>>, N, Acc, F, F@_1, F@_2, F@_3, TrUserData) when N < 57 -> d_field_SDLExposedServiceResponse_version(Rest, N + 7, X bsl N + Acc, F, F@_1, F@_2, F@_3, TrUserData);
|
||||
d_field_SDLExposedServiceResponse_version(<<0:1, X:7, Rest/binary>>, N, Acc, F, _, F@_2, F@_3, TrUserData) ->
|
||||
{NewFValue, RestF} = {id((X bsl N + Acc) band 4294967295, TrUserData), Rest},
|
||||
dfp_read_field_def_SDLExposedServiceResponse(RestF, 0, 0, F, NewFValue, F@_2, F@_3, TrUserData).
|
||||
|
||||
d_field_SDLExposedServiceResponse_tcp_ports(<<1:1, X:7, Rest/binary>>, N, Acc, F, F@_1, F@_2, F@_3, TrUserData) when N < 57 -> d_field_SDLExposedServiceResponse_tcp_ports(Rest, N + 7, X bsl N + Acc, F, F@_1, F@_2, F@_3, TrUserData);
|
||||
d_field_SDLExposedServiceResponse_tcp_ports(<<0:1, X:7, Rest/binary>>, N, Acc, F, F@_1, Prev, F@_3, TrUserData) ->
|
||||
{NewFValue, RestF} = {id((X bsl N + Acc) band 4294967295, TrUserData), Rest},
|
||||
dfp_read_field_def_SDLExposedServiceResponse(RestF, 0, 0, F, F@_1, cons(NewFValue, Prev, TrUserData), F@_3, TrUserData).
|
||||
|
||||
d_pfield_SDLExposedServiceResponse_tcp_ports(<<1:1, X:7, Rest/binary>>, N, Acc, F, F@_1, F@_2, F@_3, TrUserData) when N < 57 -> d_pfield_SDLExposedServiceResponse_tcp_ports(Rest, N + 7, X bsl N + Acc, F, F@_1, F@_2, F@_3, TrUserData);
|
||||
d_pfield_SDLExposedServiceResponse_tcp_ports(<<0:1, X:7, Rest/binary>>, N, Acc, F, F@_1, E, F@_3, TrUserData) ->
|
||||
Len = X bsl N + Acc,
|
||||
<<PackedBytes:Len/binary, Rest2/binary>> = Rest,
|
||||
NewSeq = d_packed_field_SDLExposedServiceResponse_tcp_ports(PackedBytes, 0, 0, F, E, TrUserData),
|
||||
dfp_read_field_def_SDLExposedServiceResponse(Rest2, 0, 0, F, F@_1, NewSeq, F@_3, TrUserData).
|
||||
|
||||
d_packed_field_SDLExposedServiceResponse_tcp_ports(<<1:1, X:7, Rest/binary>>, N, Acc, F, AccSeq, TrUserData) when N < 57 -> d_packed_field_SDLExposedServiceResponse_tcp_ports(Rest, N + 7, X bsl N + Acc, F, AccSeq, TrUserData);
|
||||
d_packed_field_SDLExposedServiceResponse_tcp_ports(<<0:1, X:7, Rest/binary>>, N, Acc, F, AccSeq, TrUserData) ->
|
||||
{NewFValue, RestF} = {id((X bsl N + Acc) band 4294967295, TrUserData), Rest},
|
||||
d_packed_field_SDLExposedServiceResponse_tcp_ports(RestF, 0, 0, F, [NewFValue | AccSeq], TrUserData);
|
||||
d_packed_field_SDLExposedServiceResponse_tcp_ports(<<>>, 0, 0, _, AccSeq, _) -> AccSeq.
|
||||
|
||||
d_field_SDLExposedServiceResponse_udp_ports(<<1:1, X:7, Rest/binary>>, N, Acc, F, F@_1, F@_2, F@_3, TrUserData) when N < 57 -> d_field_SDLExposedServiceResponse_udp_ports(Rest, N + 7, X bsl N + Acc, F, F@_1, F@_2, F@_3, TrUserData);
|
||||
d_field_SDLExposedServiceResponse_udp_ports(<<0:1, X:7, Rest/binary>>, N, Acc, F, F@_1, F@_2, Prev, TrUserData) ->
|
||||
{NewFValue, RestF} = {id((X bsl N + Acc) band 4294967295, TrUserData), Rest},
|
||||
dfp_read_field_def_SDLExposedServiceResponse(RestF, 0, 0, F, F@_1, F@_2, cons(NewFValue, Prev, TrUserData), TrUserData).
|
||||
|
||||
d_pfield_SDLExposedServiceResponse_udp_ports(<<1:1, X:7, Rest/binary>>, N, Acc, F, F@_1, F@_2, F@_3, TrUserData) when N < 57 -> d_pfield_SDLExposedServiceResponse_udp_ports(Rest, N + 7, X bsl N + Acc, F, F@_1, F@_2, F@_3, TrUserData);
|
||||
d_pfield_SDLExposedServiceResponse_udp_ports(<<0:1, X:7, Rest/binary>>, N, Acc, F, F@_1, F@_2, E, TrUserData) ->
|
||||
Len = X bsl N + Acc,
|
||||
<<PackedBytes:Len/binary, Rest2/binary>> = Rest,
|
||||
NewSeq = d_packed_field_SDLExposedServiceResponse_udp_ports(PackedBytes, 0, 0, F, E, TrUserData),
|
||||
dfp_read_field_def_SDLExposedServiceResponse(Rest2, 0, 0, F, F@_1, F@_2, NewSeq, TrUserData).
|
||||
|
||||
d_packed_field_SDLExposedServiceResponse_udp_ports(<<1:1, X:7, Rest/binary>>, N, Acc, F, AccSeq, TrUserData) when N < 57 -> d_packed_field_SDLExposedServiceResponse_udp_ports(Rest, N + 7, X bsl N + Acc, F, AccSeq, TrUserData);
|
||||
d_packed_field_SDLExposedServiceResponse_udp_ports(<<0:1, X:7, Rest/binary>>, N, Acc, F, AccSeq, TrUserData) ->
|
||||
{NewFValue, RestF} = {id((X bsl N + Acc) band 4294967295, TrUserData), Rest},
|
||||
d_packed_field_SDLExposedServiceResponse_udp_ports(RestF, 0, 0, F, [NewFValue | AccSeq], TrUserData);
|
||||
d_packed_field_SDLExposedServiceResponse_udp_ports(<<>>, 0, 0, _, AccSeq, _) -> AccSeq.
|
||||
|
||||
skip_varint_SDLExposedServiceResponse(<<1:1, _:7, Rest/binary>>, Z1, Z2, F, F@_1, F@_2, F@_3, TrUserData) -> skip_varint_SDLExposedServiceResponse(Rest, Z1, Z2, F, F@_1, F@_2, F@_3, TrUserData);
|
||||
skip_varint_SDLExposedServiceResponse(<<0:1, _:7, Rest/binary>>, Z1, Z2, F, F@_1, F@_2, F@_3, TrUserData) -> dfp_read_field_def_SDLExposedServiceResponse(Rest, Z1, Z2, F, F@_1, F@_2, F@_3, TrUserData).
|
||||
|
||||
skip_length_delimited_SDLExposedServiceResponse(<<1:1, X:7, Rest/binary>>, N, Acc, F, F@_1, F@_2, F@_3, TrUserData) when N < 57 -> skip_length_delimited_SDLExposedServiceResponse(Rest, N + 7, X bsl N + Acc, F, F@_1, F@_2, F@_3, TrUserData);
|
||||
skip_length_delimited_SDLExposedServiceResponse(<<0:1, X:7, Rest/binary>>, N, Acc, F, F@_1, F@_2, F@_3, TrUserData) ->
|
||||
Length = X bsl N + Acc,
|
||||
<<_:Length/binary, Rest2/binary>> = Rest,
|
||||
dfp_read_field_def_SDLExposedServiceResponse(Rest2, 0, 0, F, F@_1, F@_2, F@_3, TrUserData).
|
||||
|
||||
skip_group_SDLExposedServiceResponse(Bin, _, Z2, FNum, F@_1, F@_2, F@_3, TrUserData) ->
|
||||
{_, Rest} = read_group(Bin, FNum),
|
||||
dfp_read_field_def_SDLExposedServiceResponse(Rest, 0, Z2, FNum, F@_1, F@_2, F@_3, TrUserData).
|
||||
|
||||
skip_32_SDLExposedServiceResponse(<<_:32, Rest/binary>>, Z1, Z2, F, F@_1, F@_2, F@_3, TrUserData) -> dfp_read_field_def_SDLExposedServiceResponse(Rest, Z1, Z2, F, F@_1, F@_2, F@_3, TrUserData).
|
||||
|
||||
skip_64_SDLExposedServiceResponse(<<_:64, Rest/binary>>, Z1, Z2, F, F@_1, F@_2, F@_3, TrUserData) -> dfp_read_field_def_SDLExposedServiceResponse(Rest, Z1, Z2, F, F@_1, F@_2, F@_3, TrUserData).
|
||||
|
||||
'decode_msg_SDLEvent.NatChanged'(Bin, TrUserData) -> 'dfp_read_field_def_SDLEvent.NatChanged'(Bin, 0, 0, 0, id(<<>>, TrUserData), id(0, TrUserData), TrUserData).
|
||||
|
||||
'dfp_read_field_def_SDLEvent.NatChanged'(<<10, Rest/binary>>, Z1, Z2, F, F@_1, F@_2, TrUserData) -> 'd_field_SDLEvent.NatChanged_mac'(Rest, Z1, Z2, F, F@_1, F@_2, TrUserData);
|
||||
@ -2358,6 +2571,40 @@ skip_64_SDLPolicyResponse(<<_:64, Rest/binary>>, Z1, Z2, F, F@_1, F@_2, F@_3, F@
|
||||
|
||||
'skip_64_SDLEvent.SendRegister'(<<_:64, Rest/binary>>, Z1, Z2, F, F@_1, F@_2, F@_3, F@_4, F@_5, TrUserData) -> 'dfp_read_field_def_SDLEvent.SendRegister'(Rest, Z1, Z2, F, F@_1, F@_2, F@_3, F@_4, F@_5, TrUserData).
|
||||
|
||||
'decode_msg_SDLEvent.ExposedServiceChanged'(Bin, TrUserData) -> 'dfp_read_field_def_SDLEvent.ExposedServiceChanged'(Bin, 0, 0, 0, TrUserData).
|
||||
|
||||
'dfp_read_field_def_SDLEvent.ExposedServiceChanged'(<<>>, 0, 0, _, _) -> #'SDLEvent.ExposedServiceChanged'{};
|
||||
'dfp_read_field_def_SDLEvent.ExposedServiceChanged'(Other, Z1, Z2, F, TrUserData) -> 'dg_read_field_def_SDLEvent.ExposedServiceChanged'(Other, Z1, Z2, F, TrUserData).
|
||||
|
||||
'dg_read_field_def_SDLEvent.ExposedServiceChanged'(<<1:1, X:7, Rest/binary>>, N, Acc, F, TrUserData) when N < 32 - 7 -> 'dg_read_field_def_SDLEvent.ExposedServiceChanged'(Rest, N + 7, X bsl N + Acc, F, TrUserData);
|
||||
'dg_read_field_def_SDLEvent.ExposedServiceChanged'(<<0:1, X:7, Rest/binary>>, N, Acc, _, TrUserData) ->
|
||||
Key = X bsl N + Acc,
|
||||
case Key band 7 of
|
||||
0 -> 'skip_varint_SDLEvent.ExposedServiceChanged'(Rest, 0, 0, Key bsr 3, TrUserData);
|
||||
1 -> 'skip_64_SDLEvent.ExposedServiceChanged'(Rest, 0, 0, Key bsr 3, TrUserData);
|
||||
2 -> 'skip_length_delimited_SDLEvent.ExposedServiceChanged'(Rest, 0, 0, Key bsr 3, TrUserData);
|
||||
3 -> 'skip_group_SDLEvent.ExposedServiceChanged'(Rest, 0, 0, Key bsr 3, TrUserData);
|
||||
5 -> 'skip_32_SDLEvent.ExposedServiceChanged'(Rest, 0, 0, Key bsr 3, TrUserData)
|
||||
end;
|
||||
'dg_read_field_def_SDLEvent.ExposedServiceChanged'(<<>>, 0, 0, _, _) -> #'SDLEvent.ExposedServiceChanged'{}.
|
||||
|
||||
'skip_varint_SDLEvent.ExposedServiceChanged'(<<1:1, _:7, Rest/binary>>, Z1, Z2, F, TrUserData) -> 'skip_varint_SDLEvent.ExposedServiceChanged'(Rest, Z1, Z2, F, TrUserData);
|
||||
'skip_varint_SDLEvent.ExposedServiceChanged'(<<0:1, _:7, Rest/binary>>, Z1, Z2, F, TrUserData) -> 'dfp_read_field_def_SDLEvent.ExposedServiceChanged'(Rest, Z1, Z2, F, TrUserData).
|
||||
|
||||
'skip_length_delimited_SDLEvent.ExposedServiceChanged'(<<1:1, X:7, Rest/binary>>, N, Acc, F, TrUserData) when N < 57 -> 'skip_length_delimited_SDLEvent.ExposedServiceChanged'(Rest, N + 7, X bsl N + Acc, F, TrUserData);
|
||||
'skip_length_delimited_SDLEvent.ExposedServiceChanged'(<<0:1, X:7, Rest/binary>>, N, Acc, F, TrUserData) ->
|
||||
Length = X bsl N + Acc,
|
||||
<<_:Length/binary, Rest2/binary>> = Rest,
|
||||
'dfp_read_field_def_SDLEvent.ExposedServiceChanged'(Rest2, 0, 0, F, TrUserData).
|
||||
|
||||
'skip_group_SDLEvent.ExposedServiceChanged'(Bin, _, Z2, FNum, TrUserData) ->
|
||||
{_, Rest} = read_group(Bin, FNum),
|
||||
'dfp_read_field_def_SDLEvent.ExposedServiceChanged'(Rest, 0, Z2, FNum, TrUserData).
|
||||
|
||||
'skip_32_SDLEvent.ExposedServiceChanged'(<<_:32, Rest/binary>>, Z1, Z2, F, TrUserData) -> 'dfp_read_field_def_SDLEvent.ExposedServiceChanged'(Rest, Z1, Z2, F, TrUserData).
|
||||
|
||||
'skip_64_SDLEvent.ExposedServiceChanged'(<<_:64, Rest/binary>>, Z1, Z2, F, TrUserData) -> 'dfp_read_field_def_SDLEvent.ExposedServiceChanged'(Rest, Z1, Z2, F, TrUserData).
|
||||
|
||||
'decode_msg_SDLEvent.NetworkShutdown'(Bin, TrUserData) -> 'dfp_read_field_def_SDLEvent.NetworkShutdown'(Bin, 0, 0, 0, id(<<>>, TrUserData), TrUserData).
|
||||
|
||||
'dfp_read_field_def_SDLEvent.NetworkShutdown'(<<10, Rest/binary>>, Z1, Z2, F, F@_1, TrUserData) -> 'd_field_SDLEvent.NetworkShutdown_message'(Rest, Z1, Z2, F, F@_1, TrUserData);
|
||||
@ -2407,6 +2654,7 @@ decode_msg_SDLEvent(Bin, TrUserData) -> dfp_read_field_def_SDLEvent(Bin, 0, 0, 0
|
||||
dfp_read_field_def_SDLEvent(<<10, Rest/binary>>, Z1, Z2, F, F@_1, TrUserData) -> d_field_SDLEvent_nat_changed(Rest, Z1, Z2, F, F@_1, TrUserData);
|
||||
dfp_read_field_def_SDLEvent(<<18, Rest/binary>>, Z1, Z2, F, F@_1, TrUserData) -> d_field_SDLEvent_send_register(Rest, Z1, Z2, F, F@_1, TrUserData);
|
||||
dfp_read_field_def_SDLEvent(<<26, Rest/binary>>, Z1, Z2, F, F@_1, TrUserData) -> d_field_SDLEvent_shutdown(Rest, Z1, Z2, F, F@_1, TrUserData);
|
||||
dfp_read_field_def_SDLEvent(<<34, Rest/binary>>, Z1, Z2, F, F@_1, TrUserData) -> d_field_SDLEvent_exposed_service_changed(Rest, Z1, Z2, F, F@_1, TrUserData);
|
||||
dfp_read_field_def_SDLEvent(<<>>, 0, 0, _, F@_1, _) -> #'SDLEvent'{event = F@_1};
|
||||
dfp_read_field_def_SDLEvent(Other, Z1, Z2, F, F@_1, TrUserData) -> dg_read_field_def_SDLEvent(Other, Z1, Z2, F, F@_1, TrUserData).
|
||||
|
||||
@ -2417,6 +2665,7 @@ dg_read_field_def_SDLEvent(<<0:1, X:7, Rest/binary>>, N, Acc, _, F@_1, TrUserDat
|
||||
10 -> d_field_SDLEvent_nat_changed(Rest, 0, 0, 0, F@_1, TrUserData);
|
||||
18 -> d_field_SDLEvent_send_register(Rest, 0, 0, 0, F@_1, TrUserData);
|
||||
26 -> d_field_SDLEvent_shutdown(Rest, 0, 0, 0, F@_1, TrUserData);
|
||||
34 -> d_field_SDLEvent_exposed_service_changed(Rest, 0, 0, 0, F@_1, TrUserData);
|
||||
_ ->
|
||||
case Key band 7 of
|
||||
0 -> skip_varint_SDLEvent(Rest, 0, 0, Key bsr 3, F@_1, TrUserData);
|
||||
@ -2470,6 +2719,20 @@ d_field_SDLEvent_shutdown(<<0:1, X:7, Rest/binary>>, N, Acc, F, Prev, TrUserData
|
||||
end,
|
||||
TrUserData).
|
||||
|
||||
d_field_SDLEvent_exposed_service_changed(<<1:1, X:7, Rest/binary>>, N, Acc, F, F@_1, TrUserData) when N < 57 -> d_field_SDLEvent_exposed_service_changed(Rest, N + 7, X bsl N + Acc, F, F@_1, TrUserData);
|
||||
d_field_SDLEvent_exposed_service_changed(<<0:1, X:7, Rest/binary>>, N, Acc, F, Prev, TrUserData) ->
|
||||
{NewFValue, RestF} = begin Len = X bsl N + Acc, <<Bs:Len/binary, Rest2/binary>> = Rest, {id('decode_msg_SDLEvent.ExposedServiceChanged'(Bs, TrUserData), TrUserData), Rest2} end,
|
||||
dfp_read_field_def_SDLEvent(RestF,
|
||||
0,
|
||||
0,
|
||||
F,
|
||||
case Prev of
|
||||
undefined -> id({exposed_service_changed, NewFValue}, TrUserData);
|
||||
{exposed_service_changed, MVPrev} -> id({exposed_service_changed, 'merge_msg_SDLEvent.ExposedServiceChanged'(MVPrev, NewFValue, TrUserData)}, TrUserData);
|
||||
_ -> id({exposed_service_changed, NewFValue}, TrUserData)
|
||||
end,
|
||||
TrUserData).
|
||||
|
||||
skip_varint_SDLEvent(<<1:1, _:7, Rest/binary>>, Z1, Z2, F, F@_1, TrUserData) -> skip_varint_SDLEvent(Rest, Z1, Z2, F, F@_1, TrUserData);
|
||||
skip_varint_SDLEvent(<<0:1, _:7, Rest/binary>>, Z1, Z2, F, F@_1, TrUserData) -> dfp_read_field_def_SDLEvent(Rest, Z1, Z2, F, F@_1, TrUserData).
|
||||
|
||||
@ -3225,8 +3488,11 @@ merge_msgs(Prev, New, MsgName, Opts) ->
|
||||
'SDLArpResponse' -> merge_msg_SDLArpResponse(Prev, New, TrUserData);
|
||||
'SDLPolicyRequest' -> merge_msg_SDLPolicyRequest(Prev, New, TrUserData);
|
||||
'SDLPolicyResponse' -> merge_msg_SDLPolicyResponse(Prev, New, TrUserData);
|
||||
'SDLExposedServiceRequest' -> merge_msg_SDLExposedServiceRequest(Prev, New, TrUserData);
|
||||
'SDLExposedServiceResponse' -> merge_msg_SDLExposedServiceResponse(Prev, New, TrUserData);
|
||||
'SDLEvent.NatChanged' -> 'merge_msg_SDLEvent.NatChanged'(Prev, New, TrUserData);
|
||||
'SDLEvent.SendRegister' -> 'merge_msg_SDLEvent.SendRegister'(Prev, New, TrUserData);
|
||||
'SDLEvent.ExposedServiceChanged' -> 'merge_msg_SDLEvent.ExposedServiceChanged'(Prev, New, TrUserData);
|
||||
'SDLEvent.NetworkShutdown' -> 'merge_msg_SDLEvent.NetworkShutdown'(Prev, New, TrUserData);
|
||||
'SDLEvent' -> merge_msg_SDLEvent(Prev, New, TrUserData);
|
||||
'SDLCommand.ExitNodeControl' -> 'merge_msg_SDLCommand.ExitNodeControl'(Prev, New, TrUserData);
|
||||
@ -3473,6 +3739,31 @@ merge_msg_SDLPolicyResponse(#'SDLPolicyResponse'{src_identity_id = PFsrc_identit
|
||||
true -> NFrules
|
||||
end}.
|
||||
|
||||
-compile({nowarn_unused_function,merge_msg_SDLExposedServiceRequest/3}).
|
||||
merge_msg_SDLExposedServiceRequest(#'SDLExposedServiceRequest'{version = PFversion}, #'SDLExposedServiceRequest'{version = NFversion}, _) ->
|
||||
#'SDLExposedServiceRequest'{version =
|
||||
if NFversion =:= undefined -> PFversion;
|
||||
true -> NFversion
|
||||
end}.
|
||||
|
||||
-compile({nowarn_unused_function,merge_msg_SDLExposedServiceResponse/3}).
|
||||
merge_msg_SDLExposedServiceResponse(#'SDLExposedServiceResponse'{version = PFversion, tcp_ports = PFtcp_ports, udp_ports = PFudp_ports}, #'SDLExposedServiceResponse'{version = NFversion, tcp_ports = NFtcp_ports, udp_ports = NFudp_ports},
|
||||
TrUserData) ->
|
||||
#'SDLExposedServiceResponse'{version =
|
||||
if NFversion =:= undefined -> PFversion;
|
||||
true -> NFversion
|
||||
end,
|
||||
tcp_ports =
|
||||
if PFtcp_ports /= undefined, NFtcp_ports /= undefined -> 'erlang_++'(PFtcp_ports, NFtcp_ports, TrUserData);
|
||||
PFtcp_ports == undefined -> NFtcp_ports;
|
||||
NFtcp_ports == undefined -> PFtcp_ports
|
||||
end,
|
||||
udp_ports =
|
||||
if PFudp_ports /= undefined, NFudp_ports /= undefined -> 'erlang_++'(PFudp_ports, NFudp_ports, TrUserData);
|
||||
PFudp_ports == undefined -> NFudp_ports;
|
||||
NFudp_ports == undefined -> PFudp_ports
|
||||
end}.
|
||||
|
||||
-compile({nowarn_unused_function,'merge_msg_SDLEvent.NatChanged'/3}).
|
||||
'merge_msg_SDLEvent.NatChanged'(#'SDLEvent.NatChanged'{mac = PFmac, ip = PFip}, #'SDLEvent.NatChanged'{mac = NFmac, ip = NFip}, _) ->
|
||||
#'SDLEvent.NatChanged'{mac =
|
||||
@ -3509,6 +3800,9 @@ merge_msg_SDLPolicyResponse(#'SDLPolicyResponse'{src_identity_id = PFsrc_identit
|
||||
NFv6_info == undefined -> PFv6_info
|
||||
end}.
|
||||
|
||||
-compile({nowarn_unused_function,'merge_msg_SDLEvent.ExposedServiceChanged'/3}).
|
||||
'merge_msg_SDLEvent.ExposedServiceChanged'(_Prev, New, _TrUserData) -> New.
|
||||
|
||||
-compile({nowarn_unused_function,'merge_msg_SDLEvent.NetworkShutdown'/3}).
|
||||
'merge_msg_SDLEvent.NetworkShutdown'(#'SDLEvent.NetworkShutdown'{message = PFmessage}, #'SDLEvent.NetworkShutdown'{message = NFmessage}, _) ->
|
||||
#'SDLEvent.NetworkShutdown'{message =
|
||||
@ -3523,6 +3817,7 @@ merge_msg_SDLEvent(#'SDLEvent'{event = PFevent}, #'SDLEvent'{event = NFevent}, T
|
||||
{{nat_changed, OPFevent}, {nat_changed, ONFevent}} -> {nat_changed, 'merge_msg_SDLEvent.NatChanged'(OPFevent, ONFevent, TrUserData)};
|
||||
{{send_register, OPFevent}, {send_register, ONFevent}} -> {send_register, 'merge_msg_SDLEvent.SendRegister'(OPFevent, ONFevent, TrUserData)};
|
||||
{{shutdown, OPFevent}, {shutdown, ONFevent}} -> {shutdown, 'merge_msg_SDLEvent.NetworkShutdown'(OPFevent, ONFevent, TrUserData)};
|
||||
{{exposed_service_changed, OPFevent}, {exposed_service_changed, ONFevent}} -> {exposed_service_changed, 'merge_msg_SDLEvent.ExposedServiceChanged'(OPFevent, ONFevent, TrUserData)};
|
||||
{_, undefined} -> PFevent;
|
||||
_ -> NFevent
|
||||
end}.
|
||||
@ -3731,8 +4026,11 @@ verify_msg(Msg, MsgName, Opts) ->
|
||||
'SDLArpResponse' -> v_msg_SDLArpResponse(Msg, [MsgName], TrUserData);
|
||||
'SDLPolicyRequest' -> v_msg_SDLPolicyRequest(Msg, [MsgName], TrUserData);
|
||||
'SDLPolicyResponse' -> v_msg_SDLPolicyResponse(Msg, [MsgName], TrUserData);
|
||||
'SDLExposedServiceRequest' -> v_msg_SDLExposedServiceRequest(Msg, [MsgName], TrUserData);
|
||||
'SDLExposedServiceResponse' -> v_msg_SDLExposedServiceResponse(Msg, [MsgName], TrUserData);
|
||||
'SDLEvent.NatChanged' -> 'v_msg_SDLEvent.NatChanged'(Msg, [MsgName], TrUserData);
|
||||
'SDLEvent.SendRegister' -> 'v_msg_SDLEvent.SendRegister'(Msg, [MsgName], TrUserData);
|
||||
'SDLEvent.ExposedServiceChanged' -> 'v_msg_SDLEvent.ExposedServiceChanged'(Msg, [MsgName], TrUserData);
|
||||
'SDLEvent.NetworkShutdown' -> 'v_msg_SDLEvent.NetworkShutdown'(Msg, [MsgName], TrUserData);
|
||||
'SDLEvent' -> v_msg_SDLEvent(Msg, [MsgName], TrUserData);
|
||||
'SDLCommand.ExitNodeControl' -> 'v_msg_SDLCommand.ExitNodeControl'(Msg, [MsgName], TrUserData);
|
||||
@ -3976,6 +4274,34 @@ v_msg_SDLPolicyResponse(#'SDLPolicyResponse'{src_identity_id = F1, dst_identity_
|
||||
ok;
|
||||
v_msg_SDLPolicyResponse(X, Path, _TrUserData) -> mk_type_error({expected_msg, 'SDLPolicyResponse'}, X, Path).
|
||||
|
||||
-compile({nowarn_unused_function,v_msg_SDLExposedServiceRequest/3}).
|
||||
-dialyzer({nowarn_function,v_msg_SDLExposedServiceRequest/3}).
|
||||
v_msg_SDLExposedServiceRequest(#'SDLExposedServiceRequest'{version = F1}, Path, TrUserData) ->
|
||||
if F1 == undefined -> ok;
|
||||
true -> v_type_uint32(F1, [version | Path], TrUserData)
|
||||
end,
|
||||
ok;
|
||||
v_msg_SDLExposedServiceRequest(X, Path, _TrUserData) -> mk_type_error({expected_msg, 'SDLExposedServiceRequest'}, X, Path).
|
||||
|
||||
-compile({nowarn_unused_function,v_msg_SDLExposedServiceResponse/3}).
|
||||
-dialyzer({nowarn_function,v_msg_SDLExposedServiceResponse/3}).
|
||||
v_msg_SDLExposedServiceResponse(#'SDLExposedServiceResponse'{version = F1, tcp_ports = F2, udp_ports = F3}, Path, TrUserData) ->
|
||||
if F1 == undefined -> ok;
|
||||
true -> v_type_uint32(F1, [version | Path], TrUserData)
|
||||
end,
|
||||
if is_list(F2) ->
|
||||
_ = [v_type_uint32(Elem, [tcp_ports | Path], TrUserData) || Elem <- F2],
|
||||
ok;
|
||||
true -> mk_type_error({invalid_list_of, uint32}, F2, [tcp_ports | Path])
|
||||
end,
|
||||
if is_list(F3) ->
|
||||
_ = [v_type_uint32(Elem, [udp_ports | Path], TrUserData) || Elem <- F3],
|
||||
ok;
|
||||
true -> mk_type_error({invalid_list_of, uint32}, F3, [udp_ports | Path])
|
||||
end,
|
||||
ok;
|
||||
v_msg_SDLExposedServiceResponse(X, Path, _TrUserData) -> mk_type_error({expected_msg, 'SDLExposedServiceResponse'}, X, Path).
|
||||
|
||||
-compile({nowarn_unused_function,'v_submsg_SDLEvent.NatChanged'/3}).
|
||||
-dialyzer({nowarn_function,'v_submsg_SDLEvent.NatChanged'/3}).
|
||||
'v_submsg_SDLEvent.NatChanged'(Msg, Path, TrUserData) -> 'v_msg_SDLEvent.NatChanged'(Msg, Path, TrUserData).
|
||||
@ -4017,6 +4343,15 @@ v_msg_SDLPolicyResponse(X, Path, _TrUserData) -> mk_type_error({expected_msg, 'S
|
||||
ok;
|
||||
'v_msg_SDLEvent.SendRegister'(X, Path, _TrUserData) -> mk_type_error({expected_msg, 'SDLEvent.SendRegister'}, X, Path).
|
||||
|
||||
-compile({nowarn_unused_function,'v_submsg_SDLEvent.ExposedServiceChanged'/3}).
|
||||
-dialyzer({nowarn_function,'v_submsg_SDLEvent.ExposedServiceChanged'/3}).
|
||||
'v_submsg_SDLEvent.ExposedServiceChanged'(Msg, Path, TrUserData) -> 'v_msg_SDLEvent.ExposedServiceChanged'(Msg, Path, TrUserData).
|
||||
|
||||
-compile({nowarn_unused_function,'v_msg_SDLEvent.ExposedServiceChanged'/3}).
|
||||
-dialyzer({nowarn_function,'v_msg_SDLEvent.ExposedServiceChanged'/3}).
|
||||
'v_msg_SDLEvent.ExposedServiceChanged'(#'SDLEvent.ExposedServiceChanged'{}, _Path, _) -> ok;
|
||||
'v_msg_SDLEvent.ExposedServiceChanged'(X, Path, _TrUserData) -> mk_type_error({expected_msg, 'SDLEvent.ExposedServiceChanged'}, X, Path).
|
||||
|
||||
-compile({nowarn_unused_function,'v_submsg_SDLEvent.NetworkShutdown'/3}).
|
||||
-dialyzer({nowarn_function,'v_submsg_SDLEvent.NetworkShutdown'/3}).
|
||||
'v_submsg_SDLEvent.NetworkShutdown'(Msg, Path, TrUserData) -> 'v_msg_SDLEvent.NetworkShutdown'(Msg, Path, TrUserData).
|
||||
@ -4038,6 +4373,7 @@ v_msg_SDLEvent(#'SDLEvent'{event = F1}, Path, TrUserData) ->
|
||||
{nat_changed, OF1} -> 'v_submsg_SDLEvent.NatChanged'(OF1, [nat_changed, event | Path], TrUserData);
|
||||
{send_register, OF1} -> 'v_submsg_SDLEvent.SendRegister'(OF1, [send_register, event | Path], TrUserData);
|
||||
{shutdown, OF1} -> 'v_submsg_SDLEvent.NetworkShutdown'(OF1, [shutdown, event | Path], TrUserData);
|
||||
{exposed_service_changed, OF1} -> 'v_submsg_SDLEvent.ExposedServiceChanged'(OF1, [exposed_service_changed, event | Path], TrUserData);
|
||||
_ -> mk_type_error(invalid_oneof, F1, [event | Path])
|
||||
end,
|
||||
ok;
|
||||
@ -4342,6 +4678,11 @@ get_msg_defs() ->
|
||||
#field{name = dst_identity_id, fnum = 2, rnum = 3, type = uint32, occurrence = defaulty, opts = []},
|
||||
#field{name = version, fnum = 3, rnum = 4, type = uint32, occurrence = defaulty, opts = []},
|
||||
#field{name = rules, fnum = 4, rnum = 5, type = bytes, occurrence = defaulty, opts = []}]},
|
||||
{{msg, 'SDLExposedServiceRequest'}, [#field{name = version, fnum = 1, rnum = 2, type = uint32, occurrence = defaulty, opts = []}]},
|
||||
{{msg, 'SDLExposedServiceResponse'},
|
||||
[#field{name = version, fnum = 1, rnum = 2, type = uint32, occurrence = defaulty, opts = []},
|
||||
#field{name = tcp_ports, fnum = 2, rnum = 3, type = uint32, occurrence = repeated, opts = [packed]},
|
||||
#field{name = udp_ports, fnum = 3, rnum = 4, type = uint32, occurrence = repeated, opts = [packed]}]},
|
||||
{{msg, 'SDLEvent.NatChanged'}, [#field{name = mac, fnum = 1, rnum = 2, type = bytes, occurrence = defaulty, opts = []}, #field{name = ip, fnum = 2, rnum = 3, type = uint32, occurrence = defaulty, opts = []}]},
|
||||
{{msg, 'SDLEvent.SendRegister'},
|
||||
[#field{name = dst_mac, fnum = 1, rnum = 2, type = bytes, occurrence = defaulty, opts = []},
|
||||
@ -4349,13 +4690,15 @@ get_msg_defs() ->
|
||||
#field{name = nat_port, fnum = 3, rnum = 4, type = uint32, occurrence = defaulty, opts = []},
|
||||
#field{name = nat_type, fnum = 4, rnum = 5, type = uint32, occurrence = defaulty, opts = []},
|
||||
#field{name = v6_info, fnum = 5, rnum = 6, type = {msg, 'SDLV6Info'}, occurrence = optional, opts = []}]},
|
||||
{{msg, 'SDLEvent.ExposedServiceChanged'}, []},
|
||||
{{msg, 'SDLEvent.NetworkShutdown'}, [#field{name = message, fnum = 1, rnum = 2, type = string, occurrence = defaulty, opts = []}]},
|
||||
{{msg, 'SDLEvent'},
|
||||
[#gpb_oneof{name = event, rnum = 2,
|
||||
fields =
|
||||
[#field{name = nat_changed, fnum = 1, rnum = 2, type = {msg, 'SDLEvent.NatChanged'}, occurrence = optional, opts = []},
|
||||
#field{name = send_register, fnum = 2, rnum = 2, type = {msg, 'SDLEvent.SendRegister'}, occurrence = optional, opts = []},
|
||||
#field{name = shutdown, fnum = 3, rnum = 2, type = {msg, 'SDLEvent.NetworkShutdown'}, occurrence = optional, opts = []}],
|
||||
#field{name = shutdown, fnum = 3, rnum = 2, type = {msg, 'SDLEvent.NetworkShutdown'}, occurrence = optional, opts = []},
|
||||
#field{name = exposed_service_changed, fnum = 4, rnum = 2, type = {msg, 'SDLEvent.ExposedServiceChanged'}, occurrence = optional, opts = []}],
|
||||
opts = []}]},
|
||||
{{msg, 'SDLCommand.ExitNodeControl'}, [#field{name = action, fnum = 1, rnum = 2, type = int32, occurrence = defaulty, opts = []}, #field{name = remark, fnum = 2, rnum = 3, type = string, occurrence = defaulty, opts = []}]},
|
||||
{{msg, 'SDLCommand'},
|
||||
@ -4418,8 +4761,11 @@ get_msg_names() ->
|
||||
'SDLArpResponse',
|
||||
'SDLPolicyRequest',
|
||||
'SDLPolicyResponse',
|
||||
'SDLExposedServiceRequest',
|
||||
'SDLExposedServiceResponse',
|
||||
'SDLEvent.NatChanged',
|
||||
'SDLEvent.SendRegister',
|
||||
'SDLEvent.ExposedServiceChanged',
|
||||
'SDLEvent.NetworkShutdown',
|
||||
'SDLEvent',
|
||||
'SDLCommand.ExitNodeControl',
|
||||
@ -4452,8 +4798,11 @@ get_msg_or_group_names() ->
|
||||
'SDLArpResponse',
|
||||
'SDLPolicyRequest',
|
||||
'SDLPolicyResponse',
|
||||
'SDLExposedServiceRequest',
|
||||
'SDLExposedServiceResponse',
|
||||
'SDLEvent.NatChanged',
|
||||
'SDLEvent.SendRegister',
|
||||
'SDLEvent.ExposedServiceChanged',
|
||||
'SDLEvent.NetworkShutdown',
|
||||
'SDLEvent',
|
||||
'SDLCommand.ExitNodeControl',
|
||||
@ -4533,6 +4882,11 @@ find_msg_def('SDLPolicyResponse') ->
|
||||
#field{name = dst_identity_id, fnum = 2, rnum = 3, type = uint32, occurrence = defaulty, opts = []},
|
||||
#field{name = version, fnum = 3, rnum = 4, type = uint32, occurrence = defaulty, opts = []},
|
||||
#field{name = rules, fnum = 4, rnum = 5, type = bytes, occurrence = defaulty, opts = []}];
|
||||
find_msg_def('SDLExposedServiceRequest') -> [#field{name = version, fnum = 1, rnum = 2, type = uint32, occurrence = defaulty, opts = []}];
|
||||
find_msg_def('SDLExposedServiceResponse') ->
|
||||
[#field{name = version, fnum = 1, rnum = 2, type = uint32, occurrence = defaulty, opts = []},
|
||||
#field{name = tcp_ports, fnum = 2, rnum = 3, type = uint32, occurrence = repeated, opts = [packed]},
|
||||
#field{name = udp_ports, fnum = 3, rnum = 4, type = uint32, occurrence = repeated, opts = [packed]}];
|
||||
find_msg_def('SDLEvent.NatChanged') -> [#field{name = mac, fnum = 1, rnum = 2, type = bytes, occurrence = defaulty, opts = []}, #field{name = ip, fnum = 2, rnum = 3, type = uint32, occurrence = defaulty, opts = []}];
|
||||
find_msg_def('SDLEvent.SendRegister') ->
|
||||
[#field{name = dst_mac, fnum = 1, rnum = 2, type = bytes, occurrence = defaulty, opts = []},
|
||||
@ -4540,13 +4894,15 @@ find_msg_def('SDLEvent.SendRegister') ->
|
||||
#field{name = nat_port, fnum = 3, rnum = 4, type = uint32, occurrence = defaulty, opts = []},
|
||||
#field{name = nat_type, fnum = 4, rnum = 5, type = uint32, occurrence = defaulty, opts = []},
|
||||
#field{name = v6_info, fnum = 5, rnum = 6, type = {msg, 'SDLV6Info'}, occurrence = optional, opts = []}];
|
||||
find_msg_def('SDLEvent.ExposedServiceChanged') -> [];
|
||||
find_msg_def('SDLEvent.NetworkShutdown') -> [#field{name = message, fnum = 1, rnum = 2, type = string, occurrence = defaulty, opts = []}];
|
||||
find_msg_def('SDLEvent') ->
|
||||
[#gpb_oneof{name = event, rnum = 2,
|
||||
fields =
|
||||
[#field{name = nat_changed, fnum = 1, rnum = 2, type = {msg, 'SDLEvent.NatChanged'}, occurrence = optional, opts = []},
|
||||
#field{name = send_register, fnum = 2, rnum = 2, type = {msg, 'SDLEvent.SendRegister'}, occurrence = optional, opts = []},
|
||||
#field{name = shutdown, fnum = 3, rnum = 2, type = {msg, 'SDLEvent.NetworkShutdown'}, occurrence = optional, opts = []}],
|
||||
#field{name = shutdown, fnum = 3, rnum = 2, type = {msg, 'SDLEvent.NetworkShutdown'}, occurrence = optional, opts = []},
|
||||
#field{name = exposed_service_changed, fnum = 4, rnum = 2, type = {msg, 'SDLEvent.ExposedServiceChanged'}, occurrence = optional, opts = []}],
|
||||
opts = []}];
|
||||
find_msg_def('SDLCommand.ExitNodeControl') -> [#field{name = action, fnum = 1, rnum = 2, type = int32, occurrence = defaulty, opts = []}, #field{name = remark, fnum = 2, rnum = 3, type = string, occurrence = defaulty, opts = []}];
|
||||
find_msg_def('SDLCommand') ->
|
||||
@ -4664,8 +5020,11 @@ fqbin_to_msg_name(<<"SDLArpRequest">>) -> 'SDLArpRequest';
|
||||
fqbin_to_msg_name(<<"SDLArpResponse">>) -> 'SDLArpResponse';
|
||||
fqbin_to_msg_name(<<"SDLPolicyRequest">>) -> 'SDLPolicyRequest';
|
||||
fqbin_to_msg_name(<<"SDLPolicyResponse">>) -> 'SDLPolicyResponse';
|
||||
fqbin_to_msg_name(<<"SDLExposedServiceRequest">>) -> 'SDLExposedServiceRequest';
|
||||
fqbin_to_msg_name(<<"SDLExposedServiceResponse">>) -> 'SDLExposedServiceResponse';
|
||||
fqbin_to_msg_name(<<"SDLEvent.NatChanged">>) -> 'SDLEvent.NatChanged';
|
||||
fqbin_to_msg_name(<<"SDLEvent.SendRegister">>) -> 'SDLEvent.SendRegister';
|
||||
fqbin_to_msg_name(<<"SDLEvent.ExposedServiceChanged">>) -> 'SDLEvent.ExposedServiceChanged';
|
||||
fqbin_to_msg_name(<<"SDLEvent.NetworkShutdown">>) -> 'SDLEvent.NetworkShutdown';
|
||||
fqbin_to_msg_name(<<"SDLEvent">>) -> 'SDLEvent';
|
||||
fqbin_to_msg_name(<<"SDLCommand.ExitNodeControl">>) -> 'SDLCommand.ExitNodeControl';
|
||||
@ -4695,8 +5054,11 @@ msg_name_to_fqbin('SDLArpRequest') -> <<"SDLArpRequest">>;
|
||||
msg_name_to_fqbin('SDLArpResponse') -> <<"SDLArpResponse">>;
|
||||
msg_name_to_fqbin('SDLPolicyRequest') -> <<"SDLPolicyRequest">>;
|
||||
msg_name_to_fqbin('SDLPolicyResponse') -> <<"SDLPolicyResponse">>;
|
||||
msg_name_to_fqbin('SDLExposedServiceRequest') -> <<"SDLExposedServiceRequest">>;
|
||||
msg_name_to_fqbin('SDLExposedServiceResponse') -> <<"SDLExposedServiceResponse">>;
|
||||
msg_name_to_fqbin('SDLEvent.NatChanged') -> <<"SDLEvent.NatChanged">>;
|
||||
msg_name_to_fqbin('SDLEvent.SendRegister') -> <<"SDLEvent.SendRegister">>;
|
||||
msg_name_to_fqbin('SDLEvent.ExposedServiceChanged') -> <<"SDLEvent.ExposedServiceChanged">>;
|
||||
msg_name_to_fqbin('SDLEvent.NetworkShutdown') -> <<"SDLEvent.NetworkShutdown">>;
|
||||
msg_name_to_fqbin('SDLEvent') -> <<"SDLEvent">>;
|
||||
msg_name_to_fqbin('SDLCommand.ExitNodeControl') -> <<"SDLCommand.ExitNodeControl">>;
|
||||
@ -4755,9 +5117,12 @@ get_msg_containment("sdlan") ->
|
||||
'SDLCommandAck',
|
||||
'SDLData',
|
||||
'SDLEvent',
|
||||
'SDLEvent.ExposedServiceChanged',
|
||||
'SDLEvent.NatChanged',
|
||||
'SDLEvent.NetworkShutdown',
|
||||
'SDLEvent.SendRegister',
|
||||
'SDLExposedServiceRequest',
|
||||
'SDLExposedServiceResponse',
|
||||
'SDLPeerInfo',
|
||||
'SDLPolicyRequest',
|
||||
'SDLPolicyResponse',
|
||||
@ -4801,7 +5166,9 @@ get_proto_by_msg_name_as_fqbin(<<"SDLRegister">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"SDLEvent.SendRegister">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"SDLStunRequest">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"SDLPolicyRequest">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"SDLExposedServiceRequest">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"SDLEvent.NatChanged">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"SDLEvent.ExposedServiceChanged">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"SDLEvent">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"SDLCommand">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"SDLArpRequest">>) -> "sdlan";
|
||||
@ -4809,6 +5176,7 @@ get_proto_by_msg_name_as_fqbin(<<"SDLWelcome">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"SDLV6AssistProbe">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"SDLStunProbe">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"SDLPolicyResponse">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"SDLExposedServiceResponse">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"SDLArpResponse">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"SDLV6AssistProbeReply">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"SDLStunReply">>) -> "sdlan";
|
||||
|
||||
@ -36,6 +36,8 @@
|
||||
|
||||
client_id :: undefined | binary(),
|
||||
network_id = 0 :: integer(),
|
||||
access_token :: undefined | binary(),
|
||||
|
||||
%% 网络相关信息id
|
||||
network_pid :: undefined | pid(),
|
||||
%% mac地址
|
||||
@ -150,6 +152,7 @@ handle_frame(<<?PACKET_REGISTER_SUPER, Body/binary>>, Session = #session{status
|
||||
network_id = NetworkId,
|
||||
network_pid = NetworkPid,
|
||||
client_id = ClientId,
|
||||
access_token = AccessToken,
|
||||
mac = Mac,
|
||||
ip = Ip,
|
||||
offline_cb = OfflineCb
|
||||
@ -246,6 +249,34 @@ handle_frame(<<?PACKET_POLICY_REQUEST, Body/binary>>, Session = #session{status
|
||||
end,
|
||||
ok_result(Session, Packets);
|
||||
|
||||
handle_frame(<<?PACKET_EXPOSED_SERVICE_REQUEST, Body/binary>>,
|
||||
Session = #session{status = registered, network_pid = NetworkPid, transport = Transport, client_id = ClientId, access_token = AccessToken, network_id = NetworkId}) when is_pid(NetworkPid) ->
|
||||
|
||||
Packets = maybe
|
||||
#'SDLExposedServiceRequest'{version = Version} ?= sdlan_pb:decode_msg(Body, 'SDLExposedServiceRequest'),
|
||||
Params = #{
|
||||
<<"client_id">> => ClientId,
|
||||
<<"network_id">> => NetworkId,
|
||||
<<"access_token">> => AccessToken
|
||||
},
|
||||
case sdlan_api:node_acl(Params) of
|
||||
{ok, #{<<"result">> := #{<<"tcp_ports">> := TcpPorts0, <<"udp_ports">> := UdpPorts0}}} ->
|
||||
ExposedServiceResponsePkt = sdlan_pb:encode_msg(#'SDLExposedServiceResponse'{
|
||||
version = Version,
|
||||
tcp_ports = parse_ports(TcpPorts0),
|
||||
udp_ports = parse_ports(UdpPorts0)
|
||||
}),
|
||||
[<<?PACKET_EXPOSED_SERVICE_RESPONSE, ExposedServiceResponsePkt/binary>>];
|
||||
{error, Reason} ->
|
||||
logger:debug("[sdlan_session] SDLExposedServiceRequest: ~p, transport: ~p, get error: ~p", [Transport, Reason]),
|
||||
[]
|
||||
end
|
||||
else
|
||||
_ ->
|
||||
[]
|
||||
end,
|
||||
ok_result(Session, Packets);
|
||||
|
||||
%% 处理命令的响应逻辑
|
||||
handle_frame(<<?PACKET_COMMAND_ACK, Body/binary>>, Session = #session{status = registered, pending_commands = PendingCommands, transport = Transport}) ->
|
||||
logger:debug("[sdlan_session] transport: ~p command_ack", [Transport]),
|
||||
@ -377,3 +408,6 @@ heartbeat_ms(HeartbeatSec) when is_integer(HeartbeatSec), HeartbeatSec > 0 ->
|
||||
HeartbeatSec * 1000;
|
||||
heartbeat_ms(_) ->
|
||||
?PING_TICKER.
|
||||
|
||||
parse_ports(Ports0) when is_list(Ports0) ->
|
||||
lists:filter(fun(P0) -> is_integer(P0) andalso (P0 > 0 andalso P0 < 65535) end, Ports0).
|
||||
@ -2,11 +2,10 @@
|
||||
|
||||
rm -rf tmp
|
||||
mkdir tmp
|
||||
|
||||
cp proto/sdlan.proto tmp/sdlan_pb.proto
|
||||
|
||||
cd tmp
|
||||
|
||||
protoc sdlan_pb.proto --swift_out=.
|
||||
cp sdlan_pb.pb.swift SDLMessage.pb.swift
|
||||
cp SDLMessage.pb.swift /usr/local/code/macos/punchnet/Tun/Punchnet/Protobuf/
|
||||
cp SDLMessage.pb.swift /usr/local/code/macos/punchnet/Tun/Protobuf/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user