diff --git a/apps/sdlan/include/sdlan_tables.hrl b/apps/sdlan/include/sdlan_tables.hrl deleted file mode 100644 index 7bafce0..0000000 --- a/apps/sdlan/include/sdlan_tables.hrl +++ /dev/null @@ -1,19 +0,0 @@ -%%%------------------------------------------------------------------- -%%% @author anlicheng -%%% @copyright (C) 2025, -%%% @doc -%%% -%%% @end -%%% Created : 20. 1月 2025 21:35 -%%%------------------------------------------------------------------- --author("anlicheng"). - -%% ip的使用信息 --record(client, { - client_id :: binary(), - mac :: binary(), - ip :: integer(), - host_name :: binary(), - %% 当前状态 - status = normal :: normal | disabled -}). \ No newline at end of file diff --git a/apps/sdlan/src/quic/sdlan_quic_server.erl b/apps/sdlan/src/quic/sdlan_quic_server.erl index bece451..b94ed14 100644 --- a/apps/sdlan/src/quic/sdlan_quic_server.erl +++ b/apps/sdlan/src/quic/sdlan_quic_server.erl @@ -22,6 +22,8 @@ init() -> Path = code:priv_dir(sdlan), LOptions = #{ + addr_family => inet, + % 必选:QUIC/TLS证书配置 certfile => Path ++ "/cert.pem", keyfile => Path ++ "/key.pem", alpn => Alpn, diff --git a/apps/sdlan/src/sdlan.app.src b/apps/sdlan/src/sdlan.app.src index 0f99a57..26bccb6 100644 --- a/apps/sdlan/src/sdlan.app.src +++ b/apps/sdlan/src/sdlan.app.src @@ -17,7 +17,6 @@ dns_erlang, pkt, quicer, - mnesia, erts, public_key, ssl, diff --git a/apps/sdlan/src/sdlan_app.erl b/apps/sdlan/src/sdlan_app.erl index cac1b82..88e4fe2 100644 --- a/apps/sdlan/src/sdlan_app.erl +++ b/apps/sdlan/src/sdlan_app.erl @@ -11,8 +11,6 @@ start(_StartType, _StartArgs) -> io:setopts([{encoding, unicode}]), - %% 启动mnesia数据库 - mnesia:start(), %% 加速内存的回收 erlang:system_flag(fullsweep_after, 16), diff --git a/apps/sdlan/src/sdlan_stun.erl b/apps/sdlan/src/sdlan_stun.erl index a8bdc4b..738cd50 100644 --- a/apps/sdlan/src/sdlan_stun.erl +++ b/apps/sdlan/src/sdlan_stun.erl @@ -85,10 +85,8 @@ handle_call(_Request, _From, State = #state{}) -> {noreply, NewState :: #state{}} | {noreply, NewState :: #state{}, timeout() | hibernate} | {stop, Reason :: term(), NewState :: #state{}}). - %% 当前node下的转发,基于进程间的通讯 -handle_cast({stun_relay, Ip, Port, Reply}, State = #state{socket = Sock}) -> - ok = gen_udp:send(Sock, Ip, Port, Reply), +handle_cast(_Request, State) -> {noreply, State}. %% @private @@ -138,12 +136,6 @@ handle_info({udp, Sock, ClientIp, ClientPort, <>}, State = #state{socket = Sock}) -> - logger:debug("[sdlan_stun] get stun_probe_replay request, reply: ~p", [Reply]), - gen_udp:send(Sock, {Ip0, Ip1, Ip2, Ip3}, Port, Reply), - {noreply, State}; - handle_info({udp, _, _Ip, _Port, <>}, State = #state{socket = Sock}) -> Data = catch sdlan_pb:decode_msg(Body, sdl_data), maybe diff --git a/apps/sdlan/src/sdlan_stun_peer_assist.erl b/apps/sdlan/src/sdlan_stun_peer_assist.erl index d7f8327..226b620 100644 --- a/apps/sdlan/src/sdlan_stun_peer_assist.erl +++ b/apps/sdlan/src/sdlan_stun_peer_assist.erl @@ -58,7 +58,6 @@ init([]) -> {ok, Socket} = gen_udp:open(0, Opts), inet_udp:controlling_process(Socket, self()), logger:debug("[sdlan_stun_peer_assist] started"), - {ok, #state{socket = Socket, assist_ip = AssistIp, assist_port = AssistPort}}. %% @private diff --git a/apps/sdlan/src/sdlan_test.erl b/apps/sdlan/src/sdlan_test.erl deleted file mode 100644 index 1bd30d5..0000000 --- a/apps/sdlan/src/sdlan_test.erl +++ /dev/null @@ -1,18 +0,0 @@ -%%%------------------------------------------------------------------- -%%% @author anlicheng -%%% @copyright (C) 2024, -%%% @doc -%%% -%%% @end -%%% Created : 09. 3月 2024 15:25 -%%%------------------------------------------------------------------- --module(sdlan_test). --author("anlicheng"). - -%% API --export([test/1]). - -test(X) when X band 1 == 0 -> - ok; -test(_) -> - error.