Merge remote-tracking branch 'origin/main' into main

This commit is contained in:
Stephane Bourque
2020-12-10 19:20:50 -08:00
8 changed files with 11505 additions and 120 deletions

View File

@@ -17,18 +17,18 @@
%% auxiliary types
-record (version_matrix_map, {
'DATE' = <<"Mon Nov 2 09">> :: binary(),
'FIRMWARE' = <<"0.1.0-0-notgit-development">> :: binary(),
'FW_BUILD' = <<"0">> :: binary(),
'FW_COMMIT' = <<"notgit">> :: binary(),
'FW_IMAGE_ACTIVE' = <<"ea8300-2020-11-02-pending-97ebe9d">> :: binary(),
'FW_IMAGE_INACTIVE' = <<"unknown">> :: binary(),
'FW_PROFILE' = <<"development">> :: binary(),
'FW_VERSION' = <<"0.1.0">> :: binary(),
'HOST' = <<"runner@72477083da86">> :: binary(),
'OPENSYNC' = <<"2.0.5.0">> :: binary(),
'core' = <<"2.0.5.0/0/notgit">> :: binary(),
'vendor/tip' = <<"0.1.0/0/notgit">> :: binary()
'DATE' = <<"Mon Nov 2 09">> :: term(),
'FIRMWARE' = <<"0.1.0-0-notgit-development">> :: term(),
'FW_BUILD' = <<"0">> :: term(),
'FW_COMMIT' = <<"notgit">> :: term(),
'FW_IMAGE_ACTIVE' = <<"ea8300-2020-11-02-pending-97ebe9d">> :: term(),
'FW_IMAGE_INACTIVE' = <<"unknown">> :: term(),
'FW_PROFILE' = <<"development">> :: term(),
'FW_VERSION' = <<"0.1.0">> :: term(),
'HOST' = <<"runner@72477083da86">> :: term(),
'OPENSYNC' = <<"2.0.5.0">> :: term(),
'core' = <<"2.0.5.0/0/notgit">> :: term(),
'vendor/tip' = <<"0.1.0/0/notgit">> :: term()
}).
@@ -39,30 +39,123 @@
-record ('AWLAN_Node',{
row_idx = 0 :: integer() | ets_dont_care(),
mqtt_settings = [<<"map">>,[]] :: [binary()|[proplists:proplist()]] | ets_dont_care(),
redirector_addr = <<>> :: binary() | ets_dont_care(),
manager_addr = <<>> :: binary() | ets_dont_care(),
sku_number = [<<"set">>,[]] :: [binary()|[proplists:proplist()]] | ets_dont_care(),
serial_number = <<>> :: binary() | ets_dont_care(),
model = <<>>:: binary() | ets_dont_care(),
firmware_version = <<>> :: binary() | ets_dont_care(),
platform_version = <<>> :: binary() | ets_dont_care(),
revision = <<>> :: binary() | ets_dont_care(),
version_matrix = [<<"map">>,[]] :: [binary()|[any()]] | ets_dont_care()
mqtt_settings = [<<"map">>,[]] :: term() | ets_dont_care(),
redirector_addr = <<>> :: term() | ets_dont_care(),
manager_addr = <<>> :: term() | ets_dont_care(),
sku_number = [<<"set">>,[]] :: term() | ets_dont_care(),
serial_number = <<>> :: term() | ets_dont_care(),
model = <<>>:: term() | ets_dont_care(),
firmware_version = <<>> :: term() | ets_dont_care(),
platform_version = <<>> :: term() | ets_dont_care(),
revision = <<>> :: term() | ets_dont_care(),
version_matrix = [<<"map">>,[]] :: term() | ets_dont_care()
}).
-record ('Wifi_Inet_State',{
row_idx = 0 :: integer(),
inet_addr = <<>> :: binary(),
hwaddr = <<>> :: binary(),
if_name = <<>> :: binary(),
if_type = <<>> :: binary()
inet_addr = <<>> :: term(),
hwaddr = <<>> :: term(),
if_name = <<>> :: term(),
if_type = <<>> :: term()
}).
-record ('Wifi_Radio_State',{
row_idx = 0 :: integer(),
freq_band = <<>> :: binary(),
if_name = <<>> :: binary()
}).
row_idx = 0 :: integer() | ets_dont_care(),
freq_band = <<>> :: term(),
if_name = <<>> :: term(),
allowed_channels = <<>> :: term()
}).
-record ('Wifi_Stats_Config', {
row_idx = 0 :: integer() | ets_dont_care(),
channel_list = <<"">> :: term() | ets_dont_care(),
radio_type = <<"">> :: term() | ets_dont_care(),
reporting_interval = <<"">> :: term() | ets_dont_care(),
sampling_interval = <<"">> :: term() | ets_dont_care(),
stats_type = <<"">> :: term() | ets_dont_care(),
survey_interval_ms = <<"">> :: term() | ets_dont_care(),
survey_type = <<"">> :: term() | ets_dont_care(),
threshold = <<"">> :: term() | ets_dont_care(),
'_uuid' = <<"">> :: term() | ets_dont_care()
}).
-record ('Hotspot20_Config', {
row_idx = 0 :: integer() | ets_dont_care()
}).
-record ('Hotspot20_OSU_Providers', {
row_idx = 0 :: integer() | ets_dont_care()
}).
-record ('Hotspot20_Icon_Config', {
row_idx = 0 :: integer() | ets_dont_care()
}).
-record ('Wifi_RRM_Config', {
row_idx = 0 :: integer() | ets_dont_care()
}).
-record ('Wifi_VIF_Config', {
row_idx = 0 :: integer() | ets_dont_care(),
bridge = <<"">> :: term() | ets_dont_care(),
ap_bridge = <<"">> :: term() | ets_dont_care(),
'_uuid' = <<"">> :: term() | ets_dont_care(),
btm = <<"">> :: term() | ets_dont_care(),
enabled = <<"">> :: term() | ets_dont_care(),
ft_psk = <<"">> :: term() | ets_dont_care(),
ft_mobility_domain = <<"">> :: term() | ets_dont_care(),
group_rekey = <<"">> :: term() | ets_dont_care(),
if_name = <<"">> :: term() | ets_dont_care(),
min_hw_mode = <<"">> :: term() | ets_dont_care(),
mode = <<"">> :: term() | ets_dont_care(),
rrm = <<"">> :: term() | ets_dont_care(),
ssid = <<"">> :: term() | ets_dont_care(),
ssid_broadcast = <<"">> :: term() | ets_dont_care(),
uapsd_enable = <<"">> :: term() | ets_dont_care(),
vif_radio_idx = <<"">> :: term() | ets_dont_care(),
security = <<"">> :: term() | ets_dont_care(),
vlan_id = <<"">> :: term() | ets_dont_care(),
mac_list = <<"">> :: term() | ets_dont_care(),
mac_list_type = <<"">> :: term() | ets_dont_care()
}).
-record ('Wifi_Radio_Config', {
row_idx = 0 :: integer() | ets_dont_care(),
'_uuid' = <<"">> :: term() | ets_dont_care(),
if_name = <<"">> :: term() | ets_dont_care(),
bcn_int = <<"">> :: term() | ets_dont_care(),
channel = <<"">> :: term() | ets_dont_care(),
channel_mode = <<"">> :: term() | ets_dont_care(),
country = <<"">> :: term() | ets_dont_care(),
enabled = <<"">> :: term() | ets_dont_care(),
ht_mode = <<"">> :: term() | ets_dont_care(),
tx_power = <<"">> :: term() | ets_dont_care(),
vif_configs = <<"">> :: term() | ets_dont_care(),
freq_band = <<"">> :: term() | ets_dont_care(),
hw_config = <<"">> :: term() | ets_dont_care(),
hw_type = <<"">> :: term() | ets_dont_care()
}).
-record ('Wifi_Inet_Config', {
row_idx = 0 :: integer() | ets_dont_care(),
'NAT' = <<"">> :: term() | ets_dont_care(),
'_uuid' = <<"">> :: term() | ets_dont_care(),
broadcast = <<"">> :: term() | ets_dont_care(),
enabled = <<"">> :: term() | ets_dont_care(),
if_name = <<"">> :: term() | ets_dont_care(),
if_type = <<"">> :: term() | ets_dont_care(),
ip_assign_scheme = <<"">> :: term() | ets_dont_care(),
network = <<"">> :: term() | ets_dont_care(),
inet_addr = <<"">> :: term() | ets_dont_care(),
mtu = <<"">> :: term() | ets_dont_care(),
netmask = <<"">> :: term() | ets_dont_care(),
vlan_id = <<"">> :: term() | ets_dont_care(),
gateway = <<"">> :: term() | ets_dont_care(),
dns = <<"">> :: term() | ets_dont_care(),
dhcpd = <<"">> :: term() | ets_dont_care(),
parent_ifname = <<"">> :: term() | ets_dont_care()
}).

File diff suppressed because it is too large Load Diff

View File

@@ -123,9 +123,9 @@ cancel_ap (Node) ->
%%%============================================================================
-spec rpc_cmd (Node :: pid(), Rpc :: term()) -> ok | invalid.
-spec rpc_cmd (Node :: pid(), Rpc :: term()) -> ok.
rpc_cmd (Node,Rpc) ->
gen_server:call(Node,{exec_rpc,Rpc}).
gen_server:cast(Node,{exec_rpc,Rpc}).
-spec reset_comm (Node :: pid()) -> ok.
reset_comm (Node) ->
@@ -225,6 +225,68 @@ handle_cast ({stats_update,Event},State) ->
handle_cast (send_report,State) ->
{noreply, report_statistics(State)};
handle_cast ({exec_rpc, RPC}, #ap_state{status=paused}=State) when is_map(RPC) andalso
is_map_key(<<"method">>,RPC) andalso
is_map_key(<<"id">>,RPC) ->
case maps:get(<<"method">>,RPC) of
<<"echo">> ->
case ovsdb_ap_rpc:eval_req(<<"echo">>, maps:get(<<"id">>,RPC), RPC, State#ap_state.store) of
{ok, Result} when is_map(Result) andalso is_map_key(<<"result">>,Result) ->
ok = ovsdb_ap_comm:send_term(State#ap_state.comm,Result),
{reply,ok,State};
_ ->
{reply, ignored, State}
end;
_ ->
{noreply, State}
end;
handle_cast ({exec_rpc, _RPC}, #ap_state{status=paused}=State) ->
{noreply, State};
handle_cast ({exec_rpc, RPC}, State) when is_map(RPC) andalso
is_map_key(<<"method">>,RPC) andalso
is_map_key(<<"id">>,RPC) ->
case ovsdb_ap_rpc:eval_req(maps:get(<<"method">>,RPC),
maps:get(<<"id">>,RPC),
RPC,
State#ap_state.store) of
{ok, ignore} ->
{noreply, State};
{ok, Result} when is_map(Result) andalso is_map_key(<<"result">>,Result) ->
R= io_lib:format("~p",[Result]),
Bytes = length(lists:flatten(R)),
?L_I(?DBGSTR("RPC RESULT (~s): ~Bbytes",[maps:get(<<"id">>,RPC),Bytes])),
ok = ovsdb_ap_comm:send_term(State#ap_state.comm,Result),
{noreply, State};
{ok, Result} when is_binary(Result) ->
?L_I(?DBGSTR("RPC RAW RESULT (~s): ~Bbytes",[maps:get(<<"id">>,RPC),byte_size(Result)])),
ok = ovsdb_ap_comm:send_term(State#ap_state.comm,Result),
{noreply, State};
{error, Reason} ->
?L_E(?DBGSTR("RPC call '~s' failed with reason: ~s",[maps:get(<<"method">>,RPC),Reason])),
{norepl,State}
end;
handle_cast ({exec_rpc, RPC}, State) when is_map(RPC) andalso
is_map_key(<<"result">>,RPC) andalso
is_map_key(<<"id">>,RPC) ->
case ovsdb_ap_rpc:eval_resp(maps:get(<<"id">>,RPC),
RPC,
State#ap_state.req_queue,
State#ap_state.store) of
ok ->
{noreply,State};
{error, Reason} ->
?L_E(?DBGSTR("RPC response to request '~B' failed with reason: ~p",[maps:get(<<"id">>,RPC),Reason])),
{noreply,State}
end;
handle_cast ({exec_rpc, RPC}, State) ->
?L_E(?DBGSTR("invalid RPC: ~p~n",[RPC])),
{reply,noreply, State};
handle_cast (R,State) ->
?L_E(?DBGSTR("got unknown request: ~p",[R])),
{noreply, State}.
@@ -240,65 +302,7 @@ handle_cast (R,State) ->
Reason :: term(),
NewState :: #ap_state{}.
handle_call ({exec_rpc, RPC}, _From, #ap_state{status=paused}=State) when is_map(RPC) andalso
is_map_key(<<"method">>,RPC) andalso
is_map_key(<<"id">>,RPC) ->
case maps:get(<<"method">>,RPC) of
<<"echo">> ->
case ovsdb_ap_rpc:eval_req(<<"echo">>, maps:get(<<"id">>,RPC), RPC, State#ap_state.store) of
{ok, Result} when is_map(Result) andalso is_map_key(<<"result">>,Result) ->
ok = ovsdb_ap_comm:send_term(State#ap_state.comm,Result),
{reply,ok,State};
_ ->
{reply, ignored, State}
end;
_ ->
{reply, ignored, State}
end;
handle_call ({exec_rpc, _RPC}, _From, #ap_state{status=paused}=State) ->
{reply, ignored, State};
handle_call ({exec_rpc, RPC}, _From, State) when is_map(RPC) andalso
is_map_key(<<"method">>,RPC) andalso
is_map_key(<<"id">>,RPC) ->
case ovsdb_ap_rpc:eval_req(maps:get(<<"method">>,RPC),
maps:get(<<"id">>,RPC),
RPC,
State#ap_state.store) of
{ok, ignore} ->
{reply,ok,State};
{ok, Result} when is_map(Result) andalso is_map_key(<<"result">>,Result) ->
R= io_lib:format("~p",[Result]),
Bytes = length(lists:flatten(R)),
?L_I(?DBGSTR("RPC RESULT (~s): ~Bbytes",[maps:get(<<"id">>,RPC),Bytes])),
ok = ovsdb_ap_comm:send_term(State#ap_state.comm,Result),
{reply,ok,State};
{error, Reason} ->
?L_E(?DBGSTR("RPC call '~s' failed with reason: ~s",[maps:get(<<"method">>,RPC),Reason])),
{reply,invalid,State}
end;
handle_call ({exec_rpc, RPC}, _From, State) when is_map(RPC) andalso
is_map_key(<<"result">>,RPC) andalso
is_map_key(<<"id">>,RPC) ->
case ovsdb_ap_rpc:eval_resp(maps:get(<<"id">>,RPC),
RPC,
State#ap_state.req_queue,
State#ap_state.store) of
ok ->
{reply,ok,State};
{error, Reason} ->
?L_E(?DBGSTR("RPC response to request '~B' failed with reason: ~p",[maps:get(<<"id">>,RPC),Reason])),
{reply,invalid,State}
end;
handle_call ({exec_rpc, RPC}, _From, State) ->
?L_E(?DBGSTR("invalid RPC: ~p~n",[RPC])),
{reply,invalid, State};
handle_call (Request, From, State) ->
?L_E(?DBGSTR("got unknow request ~p from ~p",[Request,From])),

View File

@@ -52,6 +52,9 @@ start_link (Options) ->
send_term (Comm, Data) when is_pid(Comm) andalso is_map(Data) ->
Comm ! {send, self(), Data},
ok;
send_term (Comm, Data) when is_pid(Comm) andalso is_binary(Data) ->
Comm ! {send_raw, self(), Data},
ok;
send_term (_,_) ->
{error,"Data needs to be a map"}.
@@ -82,8 +85,8 @@ create_comm (Opts, AP) ->
comm_loop (#c_state{socket=S, rxb=Rx, ap=AP, id=ID, options=Opts}=State) ->
receive
{ssl, S, Data} ->
{Buffer, Pretty} = process_rx_data(<<Rx/binary,Data/binary>>,AP),
?L_I(?DBGSTR("GOT REQUEST: from ~s:~B to ~s~n~s",[proplists:get_value(host,Opts,"unknown"),proplists:get_value(port,Opts,0),ID,Pretty])),
{Buffer, JSON} = process_rx_data(<<Rx/binary,Data/binary>>,AP),
?L_I(?DBGSTR("GOT REQUEST: from ~s:~B to ~s~n~s",[proplists:get_value(host,Opts,"unknown"),proplists:get_value(port,Opts,0),ID,JSON])),
ovsdb_ap:post_event(AP,comm_event,{<<"RX">>,size(Data)},io_lib:format("receive ~Bbytes",[size(Data)])),
case ssl:setopts(S,[{active,once}]) of
ok ->
@@ -114,7 +117,7 @@ comm_loop (#c_state{socket=S, rxb=Rx, ap=AP, id=ID, options=Opts}=State) ->
ToSendP = jiffy:encode(Data,[pretty]),
%?L_I(?DBGSTR("Sending: ~B bytes of date",[size(ToSend)])),
?L_I(?DBGSTR("SENDING RESPONSE: from ~s to ~s:~B~n~s",[ID,proplists:get_value(host,Opts,"unknown"),proplists:get_value(port,Opts,0),ToSendP])),
case ssl:send(S,ToSend) of
case ssl:send(S,[ToSend,<<"\n">>]) of
ok ->
ovsdb_ap:post_event(AP,comm_event,{<<"TX">>,size(ToSend)},io_lib:format("sending ~Bbytes",[size(ToSend)])),
comm_loop(State#c_state{status=active});
@@ -125,6 +128,25 @@ comm_loop (#c_state{socket=S, rxb=Rx, ap=AP, id=ID, options=Opts}=State) ->
end
end;
{send_raw, AP, Data} ->
case S of
none ->
?L_E(?DBGSTR("trying to send raw data with no socket")),
ovsdb_ap:post_event(AP,comm_error,{<<"send_error">>},<<"trying to send raw data with no socket">>),
comm_loop(State#c_state{status=error});
_ ->
?L_I(?DBGSTR("SENDING RAW RESPONSE: from ~s to ~s:~B ~n~s~n",[ID,proplists:get_value(host,Opts,"unknown"),proplists:get_value(port,Opts,0),Data])),
case ssl:send(S,Data) of
ok ->
ovsdb_ap:post_event(AP,comm_event,{<<"TX">>,byte_size(Data)},io_lib:format("sending ~Bbytes",[byte_size(Data)])),
comm_loop(State#c_state{status=active});
{error, closed} ->
ovsdb_ap:post_event(AP,comm_error,{<<"send_error">>},<<"trying to send raw data with no socket">>),
?L_E(?DBGSTR("trying to send raw data with closed socket")),
comm_loop(try_reconnect(State))
end
end;
{start, AP} ->
NewState = start_connection(State),
ovsdb_ap:post_event(AP,comm_event,{<<"started">>},<<>>),
@@ -198,12 +220,13 @@ process_rx_data (Data, AP) ->
try jiffy:decode(Data,[return_maps,copy_strings,return_trailer]) of
{has_trailer,Map,Tail} ->
ovsdb_ap:rpc_cmd(AP,Map),
{iolist_to_binary(Tail),jiffy:encode(Map,[pretty])};
{iolist_to_binary(Tail),jiffy:encode(Map)};
Map ->
ovsdb_ap:rpc_cmd(AP,Map),
{<<"">>,jiffy:encode(Map,[pretty])}
{<<"">>,jiffy:encode(Map)}
catch
error:{_,truncated_json} ->
error:{N,Error} ->
?L_IA("JSON decode error: '~s' after ~B bytes",[Error,N]),
Data;
_:_ ->
<<"">>

View File

@@ -50,8 +50,16 @@ configure (#cfg{ca_name=CAName, id=ID, redirector=R}=Config) ->
{type,Info#client_info.type},
{wan_addr,make_ip_addr(ID)},
{wan_mac,Info#client_info.wan_mac0},
{lan_addr,<<"192.168.1.1">>},
{lan_mac,Info#client_info.lan_mac0},
{tip_redirector,R}
% {serial,<<"21P10C69717951">>},
% {type,<<"EA8300">>},
% {wan_addr,<<"10.20.0.113">>},
% {wan_mac,<<"58:ef:68:62:e7:f1">>},
% {lan_addr,<<"192.168.1.1">>},
% {lan_mac,<<"58:ef:68:62:e7:f0">>},
% {tip_redirector,<<"ssl:opensync-controller.wlan.local:6643">>}
],
initialize_ap_tables(Config#cfg.store_ref,validate_config(APC)),
Config#cfg{
@@ -141,22 +149,27 @@ get_host_or_port (Part, Addr) when is_binary(Addr) ->
%%------------------------------------------------------------------------------
%% table creation
-spec create_table (Table :: atom(), AP_Config :: [{atom(),term()}], Store :: ets:tid()) -> true.
create_table ('Wifi_Radio_State',_APC,Store) ->
ets:insert(Store, #'Wifi_Radio_State'{
row_idx = 0,
freq_band = <<"5GU">>,
if_name = <<"radio0">>
if_name = <<"radio0">>,
allowed_channels = [<<"set">>,[100,104,108,112,116,120,124,128,132,136,140,144,149,153,157,161,165]]
}),
ets:insert(Store, #'Wifi_Radio_State'{
row_idx = 1,
freq_band = <<"2.4G">>,
if_name = <<"radio1">>
if_name = <<"radio1">>,
allowed_channels = [<<"set">>,[1,2,3,4,5,6,7,8,9,10,11]]
}),
ets:insert(Store, #'Wifi_Radio_State'{
row_idx = 2,
freq_band = <<"5GL">>,
if_name = <<"radio2">>
if_name = <<"radio2">>,
allowed_channels = [<<"set">>,[36,40,44,48,52,56,60,64]]
});
create_table ('Wifi_Inet_State',APC,Store) ->

View File

@@ -21,32 +21,33 @@
-spec eval_req (Method :: binary(), Id :: binary(), Data :: map(), Store :: ets:tid()) -> {ok, ignore} | {ok, Result :: map()} | generic_error().
eval_req(<<"echo">>, Id, _Data, _Store) ->
?L_I(?DBGSTR("RPC request: ~s (~s)",[<<"echo">>,Id])),
{ok, make_result(Id,#{})};
{ok, make_result(Id,[])};
eval_req(<<"transact">>,Id,#{<<"params">>:=P},Store) ->
[DB,#{<<"table">>:=T, <<"op">>:=OP}] = P,
?L_I(?DBGSTR("RPC request: ~s (~s) => DB: ~s, table: ~s, operation: ~s",[<<"transact">>,Id,DB,T,OP])),
Qr = table_query(P,Store),
{ok, make_result(Id,Qr)};
Res = run_transactions(Id,P,Store,[]),
{ok, make_result(Id,Res)};
eval_req(<<"get_schema">>, Id,_,_Store) ->
eval_req(<<"monitor">>,Id,#{<<"params">>:=P},Store) ->
Res = run_monitor(Id,P,Store,#{}),
{ok, make_result(Id,Res)};
eval_req(<<"get_schema">>, Id,_,Store) ->
?L_I(?DBGSTR("RPC request: ~s (~s)",[<<"get_schema">>,Id])),
{ok, ignore};
Schema = read_schema(Store),
{ok, make_result(Id,Schema)};
eval_req (Method, Id, _Data, _Store) ->
?L_I(?DBGSTR("RPC request: ~s (~s)",[Method,Id])),
{error,io_lib:format("~s not recognized",[Method])}.
-spec make_result (Id :: binary(), Result :: map()) -> map().
make_result (Id, Res) when map_size(Res) == 0 ->
-spec make_result (Id :: binary(), Result :: [#{binary()=>any()}] | binary()) -> map().
make_result (Id, <<>>) ->
iolist_to_binary(io_lib:format("{\"result\":null,\"id\":\"~s\",\"error\":\"internal error\"}",[Id]));
make_result (Id, Res) when is_binary(Res) ->
iolist_to_binary(io_lib:format("{\"result\":~s,\"id\":\"~s\",\"error\":null}",[Res,Id]));
make_result (Id, Res) ->
#{
<<"result">> => [],
<<"id">> => Id,
<<"error">> => null
};
make_result (Id, Res) ->
#{
<<"result">> => [Res],
<<"result">> => Res,
<<"id">> => Id,
<<"error">> => null
}.
@@ -67,22 +68,60 @@ eval_resp (Id, _Data, Queue, _Store) ->
%%------------------------------------------------------------------------------
%% transaction and monitor handling
-spec run_transactions (Id :: binary(), Transactions :: binary() | #{binary() => term()}, Store :: ets:tid(), Acc :: [#{binary()=>any()}]) -> [#{binary()=>any()}].
run_transactions (_,[],_,Acc) ->
lists:reverse(Acc);
run_transactions (Id,[Trans|More],Store,Acc) when is_map(Trans) ->
#{<<"table">>:=T, <<"op">>:=OP} = Trans,
?L_I(?DBGSTR("=> table: ~s, operation: ~s",[T,OP])),
Qr = table_query(Trans,Store),
run_transactions (Id,More,Store,[Qr|Acc]);
run_transactions (Id,[DB|More],Store,Acc) ->
?L_I(?DBGSTR("RPC request ID: ~s / transaction for: ~s",[Id,DB])),
run_transactions (Id,More,Store,Acc).
-spec run_monitor (Id :: binary(), Transactions :: binary() | #{binary() => term()}, Store :: ets:tid(), Acc :: #{binary()=>any()}) -> #{binary()=>any()}.
run_monitor (_,[],_,Acc) ->
Acc;
run_monitor (Id,[DB|More],Store,Acc) when is_binary(DB) ->
?L_IA("RPC request ID: ~s / monitor for: ~s",[Id,DB]),
run_monitor (Id,More,Store,Acc);
run_monitor (Id,[_|More],Store,Acc) ->
run_monitor (Id,More,Store,Acc).
%%------------------------------------------------------------------------------
%% handling OVSDB tables
-spec table_query (P :: list(), Store :: ets:tid()) -> map().
table_query ([_,#{<<"table">>:=T, <<"op">>:= <<"select">>, <<"columns">>:=C, <<"where">>:=W}],S) ->
table_query (#{<<"table">>:=T, <<"op">>:= <<"select">>, <<"columns">>:=C, <<"where">>:=W},S) ->
Res = ets:select(S,create_match_spec(T,W)),
#{ <<"rows">> => make_res_rows(T,Res,C,[])};
table_query (#{<<"table">>:=T, <<"op">>:= <<"select">>, <<"where">>:=W},S) ->
Res = ets:select(S,create_match_spec(T,W)),
[_|Cols] = rec_fields(T),
#{ <<"rows">> => make_res_rows(T,Res,Cols,[])};
table_query ([_,#{<<"table">>:=T, <<"op">>:= <<"delete">>, <<"where">>:=W}],S) ->
table_query (#{<<"table">>:=T, <<"op">>:= <<"delete">>, <<"where">>:=W},S) ->
M = create_match_spec(T,W),
D = ets:select_delete(S,[setelement(3,hd(M),[true])]),
#{ <<"count">> => D};
table_query ([_,#{<<"table">>:=T, <<"op">>:= <<"update">>, <<"row">>:=C, <<"where">>:=W}],S) ->
table_query (#{<<"table">>:=T, <<"op">>:= <<"insert">>, <<"row">>:=R},S) ->
Fields = rec_fields(T),
Sel = list_to_tuple([binary_to_atom(T)|['_'||_<-Fields]]),
Idx = length(ets:match_object(S,Sel)),
Rwi = R#{<<"row_idx">>=>Idx},
Rec = list_to_tuple([binary_to_atom(T)|[maps:get(X,Rwi,<<>>) || X<-Fields]]),
ets:insert(S,Rec),
#{uuid=>[uuid,utils:uuid_b()]};
table_query (#{<<"table">>:=T, <<"op">>:= <<"update">>, <<"row">>:=C, <<"where">>:=W},S) ->
M = create_match_spec(T,W),
Res = ets:select(S,M),
D = ets:select_delete(S,[setelement(3,hd(M),[true])]),
@@ -98,7 +137,9 @@ check_update_actions (#{<<"manager_addr">>:=_}) ->
timer:apply_after(250,ovsdb_ap,reset_comm,[self()]); % delay to give a chance to empty buffer before we close socket
check_update_actions (#{<<"mqtt_settings">>:=[<<"map">>,MQTT]}) ->
Map = maps:from_list([{K,V}||[K,V]<-MQTT]),
ovsdb_ap:mqtt_conf(self(),Map).
ovsdb_ap:mqtt_conf(self(),Map);
check_update_actions (_) ->
ok.
%--------make_res_rows/3-----------------formats query results into proper rows map
-spec make_res_rows (Record :: binary(), Res :: [[{binary(),any()}]], Cols :: [binary()], Acc :: [#{}]) -> [#{}].
@@ -134,9 +175,41 @@ update_records (T,V,[R|Rest],Acc) ->
Updt = [Uv || {F,Ov} <- Cand, case maps:is_key(F,V) of true -> Uv=maps:get(F,V), true; _ -> Uv=Ov, true end],
update_records(T,V,Rest,[Updt|Acc]).
%--------read_schema/1-------------------reads the schema from disk for a particular device type
-spec read_schema(Store :: ets:tid()) -> binary().
read_schema (Store) ->
[#'AWLAN_Node'{model=Model}|_] = ets:match_object(Store,#'AWLAN_Node'{_='_'}),
FName = filename:join([code:priv_dir(?OWLS_APP),"templates",iolist_to_binary([string:uppercase(Model),"_schema.json"])]),
case filelib:is_regular(FName) of
true ->
{ok, Schema} = file:read_file(FName),
Schema;
false ->
?L_EA("Cannot read schmea file for model: ~s",[Model]),
<<>>
end.
%%------------------------------------------------------------------------------
%% record convertion helpers
-spec rec_fields (RecordName :: binary()) -> Fieldnames :: [binary()].
rec_fields (<<"Wifi_Inet_Config">>) ->
[atom_to_binary(X)||X<-record_info(fields,'Wifi_Inet_Config')];
rec_fields (<<"Wifi_Radio_Config">>) ->
[atom_to_binary(X)||X<-record_info(fields,'Wifi_Radio_Config')];
rec_fields (<<"Wifi_VIF_Config">>) ->
[atom_to_binary(X)||X<-record_info(fields,'Wifi_VIF_Config')];
rec_fields (<<"Wifi_RRM_Config">>) ->
[atom_to_binary(X)||X<-record_info(fields,'Wifi_RRM_Config')];
rec_fields (<<"Hotspot20_Icon_Config">>) ->
[atom_to_binary(X)||X<-record_info(fields,'Hotspot20_Icon_Config')];
rec_fields (<<"Hotspot20_OSU_Providers">>) ->
[atom_to_binary(X)||X<-record_info(fields,'Hotspot20_OSU_Providers')];
rec_fields (<<"Hotspot20_Config">>) ->
[atom_to_binary(X)||X<-record_info(fields,'Hotspot20_Config')];
rec_fields (<<"Wifi_Stats_Config">>) ->
[atom_to_binary(X)||X<-record_info(fields,'Wifi_Stats_Config')];
rec_fields (<<"Wifi_Radio_State">>) ->
[atom_to_binary(X)||X<-record_info(fields,'Wifi_Radio_State')];
rec_fields (<<"Wifi_Inet_State">>) ->

View File

@@ -0,0 +1,331 @@
================================================================================
2020-12-10T10:08:41+00005 : upstream message of 28 bytes
--------------------------------------------------------------------------------
<<16,26,0,4,77,81,84,84,4,2,0,180,0,14,50,49,80,49,48,67,54,57,55,49,55,57,53,
49>>
--------------------------------------------------------------------------------
================================================================================
2020-12-10T10:08:41+00005 : downstream message of 4 bytes
--------------------------------------------------------------------------------
<<32,2,0,0>>
--------------------------------------------------------------------------------
================================================================================
2020-12-10T10:10:37+00121 : upstream message of 360 bytes
--------------------------------------------------------------------------------
<<48,229,2,0,35,47,97,112,47,79,112,101,110,95,65,80,95,50,49,80,49,48,67,54,
57,55,49,55,57,53,49,47,111,112,101,110,115,121,110,99,120,156,227,226,51,50,
12,48,52,112,54,179,52,55,52,183,52,53,52,90,198,204,37,205,25,211,127,232,
171,70,204,115,123,193,66,91,174,235,139,11,238,218,75,6,237,144,107,125,29,
120,194,94,98,253,227,135,239,158,232,41,44,101,212,146,230,98,225,96,16,96,
6,146,204,96,146,73,128,89,128,65,98,10,88,222,136,135,227,196,10,126,129,15,
231,217,36,24,20,24,172,56,129,10,183,60,103,150,152,32,0,100,50,10,44,185,
194,46,177,128,201,137,137,131,203,139,147,227,173,176,16,83,94,174,4,131,
151,48,199,63,97,33,158,252,178,98,221,178,226,242,204,146,228,140,20,176,
224,33,33,176,96,74,146,110,113,106,81,89,106,17,80,144,135,227,21,151,16,
107,94,122,102,94,5,144,199,201,241,14,104,68,97,46,152,249,25,200,44,7,49,
249,56,14,72,9,177,103,228,23,151,36,22,128,12,18,229,184,196,41,196,87,94,
144,24,95,92,90,80,144,147,153,156,152,87,2,20,230,230,120,45,44,196,146,156,
155,2,209,254,1,168,189,24,200,12,226,130,185,171,197,43,72,4,211,97,71,204,
129,162,24,46,187,161,20,196,139,228,180,37,210,64,99,160,110,123,34,6,100,
67,29,215,33,24,196,143,226,186,39,252,65,98,216,156,119,135,47,136,7,225,
190,30,94,160,17,80,7,238,224,1,0,146,45,127,59>>
--------------------------------------------------------------------------------
================================================================================
2020-12-10T10:11:37+00181 : upstream message of 355 bytes
--------------------------------------------------------------------------------
<<48,224,2,0,35,47,97,112,47,79,112,101,110,95,65,80,95,50,49,80,49,48,67,54,
57,55,49,55,57,53,49,47,111,112,101,110,115,121,110,99,120,156,227,226,51,50,
12,48,52,112,54,179,52,55,52,183,52,53,52,234,103,230,146,230,108,125,29,184,
67,174,245,177,189,32,144,4,50,239,217,75,62,172,18,89,231,254,240,148,189,
196,236,29,79,223,61,209,83,120,200,104,196,195,113,98,5,191,192,156,243,108,
18,12,10,12,86,156,28,12,2,91,158,51,75,76,16,0,50,25,5,150,92,97,151,88,192,
228,196,196,193,232,37,204,113,72,72,136,39,191,172,56,37,73,183,56,181,168,
44,181,72,130,201,75,144,67,90,136,59,187,60,191,40,59,181,72,223,192,202,16,
40,196,201,241,89,88,136,169,60,87,130,209,139,135,227,21,151,16,107,94,122,
102,94,133,4,3,208,128,127,194,96,3,116,203,138,203,51,75,146,51,82,128,130,
156,28,111,129,170,243,114,129,76,62,142,3,82,66,236,25,249,197,37,137,5,32,
41,81,142,75,156,66,124,229,5,137,241,197,165,5,5,57,153,201,137,121,37,96,
29,239,128,58,10,115,193,204,15,64,102,49,144,25,196,5,51,167,197,43,72,4,
211,162,35,230,64,81,12,247,223,80,10,226,69,114,226,18,105,160,49,80,195,
159,72,1,217,80,143,116,8,6,241,163,184,237,9,127,144,24,54,199,221,225,11,
226,225,120,45,44,196,146,156,155,146,43,209,195,11,52,2,234,192,29,60,0,251,
39,123,226>>
--------------------------------------------------------------------------------
================================================================================
2020-12-10T10:11:41+00185 : upstream message of 2 bytes
--------------------------------------------------------------------------------
<<192,0>>
--------------------------------------------------------------------------------
================================================================================
2020-12-10T10:11:41+00185 : downstream message of 2 bytes
--------------------------------------------------------------------------------
<<208,0>>
--------------------------------------------------------------------------------
================================================================================
2020-12-10T10:12:37+00241 : upstream message of 374 bytes
--------------------------------------------------------------------------------
<<48,243,2,0,35,47,97,112,47,79,112,101,110,95,65,80,95,50,49,80,49,48,67,54,
57,55,49,55,57,53,49,47,111,112,101,110,115,121,110,99,120,156,227,226,51,50,
12,48,52,112,54,179,52,55,52,183,52,53,52,90,195,204,37,205,249,176,74,100,
157,251,195,91,246,130,103,207,128,192,29,123,73,136,200,41,123,137,175,61,
47,223,61,209,83,152,203,164,37,205,197,194,193,32,192,12,36,153,193,36,147,
0,179,0,131,196,156,29,79,129,242,70,60,28,39,86,240,11,60,56,199,38,193,160,
192,96,197,9,84,184,229,57,179,196,4,1,32,147,81,96,201,21,118,137,5,76,78,
76,28,140,94,194,28,135,132,132,120,242,203,138,83,146,116,139,83,139,202,82,
139,36,152,188,4,57,164,133,184,179,203,243,139,178,83,139,244,13,172,12,129,
66,156,28,159,133,133,152,202,115,37,24,189,120,56,94,113,9,177,230,165,103,
230,85,72,48,0,13,248,39,12,54,64,183,172,184,60,179,36,57,35,5,40,200,201,
241,22,168,58,47,23,200,228,227,56,32,37,196,158,145,95,92,146,88,0,146,18,
229,184,196,41,196,87,94,144,24,95,92,90,80,144,147,153,156,152,87,2,214,241,
14,168,163,48,23,204,252,0,100,22,3,153,65,92,48,115,90,188,130,68,48,45,58,
98,14,20,197,112,255,13,165,32,94,36,39,46,145,6,26,3,53,252,137,20,144,13,
245,72,135,96,16,63,138,219,158,240,7,137,97,115,220,29,190,32,30,142,215,
194,66,44,201,185,41,185,18,61,188,64,35,160,14,220,193,3,0,240,95,130,239>>
--------------------------------------------------------------------------------
================================================================================
2020-12-10T10:13:37+00301 : upstream message of 376 bytes
--------------------------------------------------------------------------------
<<48,245,2,0,35,47,97,112,47,79,112,101,110,95,65,80,95,50,49,80,49,48,67,54,
57,55,49,55,57,53,49,47,111,112,101,110,115,121,110,99,120,156,227,226,51,50,
12,48,52,112,54,179,52,55,52,183,52,53,52,90,195,204,37,205,169,25,211,127,
232,171,198,29,123,193,66,91,174,235,139,11,238,218,75,66,24,103,237,37,206,
61,124,243,238,137,158,194,77,38,45,105,46,22,14,6,1,102,32,201,12,38,153,4,
152,5,24,36,190,247,188,4,202,27,241,112,156,88,193,47,176,225,28,155,4,131,
2,131,21,39,80,225,150,231,204,18,19,4,128,76,70,129,37,87,216,37,22,48,57,
49,113,48,122,9,115,28,18,18,226,201,47,43,78,73,210,45,78,45,42,75,45,146,
96,242,18,228,144,22,226,206,46,207,47,202,78,45,210,55,176,50,4,10,113,114,
124,22,22,98,42,207,149,96,244,226,225,120,197,37,196,154,151,158,153,87,33,
193,0,52,224,159,48,216,0,221,178,226,242,204,146,228,140,20,160,32,39,199,
91,160,234,188,92,32,147,143,227,128,148,16,123,70,126,113,73,98,1,72,74,148,
227,18,167,16,95,121,65,98,124,113,105,65,65,78,102,114,98,94,9,88,199,59,
160,142,194,92,48,243,3,144,89,12,100,6,113,193,204,105,241,10,18,193,180,
232,136,57,80,20,195,253,55,148,130,120,145,156,184,68,26,104,12,212,240,39,
82,64,54,212,35,29,130,65,252,40,110,123,194,31,36,134,205,113,119,248,130,
120,56,94,11,11,177,36,231,166,228,74,244,240,2,141,128,58,112,7,15,0,162,50,
128,73>>
--------------------------------------------------------------------------------
================================================================================
2020-12-10T10:14:37+00361 : upstream message of 384 bytes
--------------------------------------------------------------------------------
<<48,253,2,0,35,47,97,112,47,79,112,101,110,95,65,80,95,50,49,80,49,48,67,54,
57,55,49,55,57,53,49,47,111,112,101,110,115,121,110,99,120,156,227,226,51,50,
12,48,52,112,54,179,52,55,52,183,52,53,52,58,201,204,37,205,249,176,74,100,
157,251,195,83,246,130,223,52,98,250,15,125,189,97,47,169,9,162,53,206,216,
75,172,217,246,225,221,19,61,133,169,204,90,210,92,44,28,12,2,204,64,146,25,
76,50,9,48,11,48,72,156,127,248,6,40,143,67,114,10,88,179,17,15,199,137,21,
252,2,83,206,179,73,48,40,48,88,113,2,21,110,121,206,44,49,65,0,200,100,20,
88,114,133,93,98,1,147,19,19,7,163,151,48,199,33,33,33,158,252,178,226,148,
36,221,226,212,162,178,212,34,9,38,47,65,14,105,33,238,236,242,252,162,236,
212,34,125,3,43,67,160,16,39,199,103,97,33,166,242,92,9,70,47,30,142,87,92,
66,172,121,233,153,121,21,18,12,64,3,254,9,131,13,208,45,43,46,207,44,73,206,
72,1,10,114,114,188,5,170,206,203,5,50,249,56,14,72,9,177,103,228,23,151,36,
22,128,164,68,57,46,113,10,241,149,23,36,198,23,151,22,20,228,100,38,39,230,
149,128,117,188,3,234,40,204,5,51,63,0,153,197,64,102,16,23,204,156,22,175,
32,17,76,139,142,152,3,69,49,220,127,67,41,136,23,201,137,75,164,129,198,64,
13,127,34,5,100,67,61,210,33,24,196,143,226,182,39,252,65,98,216,28,119,135,
47,136,135,227,181,176,16,75,114,110,74,174,68,15,47,208,8,168,3,119,240,0,0,
94,33,134,191>>
--------------------------------------------------------------------------------
================================================================================
2020-12-10T10:14:41+00365 : upstream message of 2 bytes
--------------------------------------------------------------------------------
<<192,0>>
--------------------------------------------------------------------------------
================================================================================
2020-12-10T10:14:41+00365 : downstream message of 2 bytes
--------------------------------------------------------------------------------
<<208,0>>
--------------------------------------------------------------------------------
================================================================================
2020-12-10T10:15:37+00421 : upstream message of 356 bytes
--------------------------------------------------------------------------------
<<48,225,2,0,35,47,97,112,47,79,112,101,110,95,65,80,95,50,49,80,49,48,67,54,
57,55,49,55,57,53,49,47,111,112,101,110,115,121,110,99,120,156,227,226,51,50,
12,48,52,112,54,179,52,55,52,183,52,53,52,234,103,230,146,230,188,190,184,
192,150,235,250,101,123,193,160,29,114,173,175,3,111,216,75,22,2,249,139,11,
206,218,75,244,116,127,121,247,68,79,225,34,179,17,15,199,137,21,252,2,45,
231,217,36,24,20,24,172,56,57,24,4,182,60,103,150,152,32,0,100,50,10,44,185,
194,46,177,128,201,137,137,131,209,75,152,227,144,144,16,79,126,89,113,74,
146,110,113,106,81,89,106,145,4,147,151,32,135,180,16,119,118,121,126,81,118,
106,145,190,129,149,33,80,136,147,227,179,176,16,83,121,174,4,163,23,15,199,
43,46,33,214,188,244,204,188,10,9,6,160,1,255,132,193,6,232,150,21,151,103,
150,36,103,164,0,5,57,57,222,2,85,231,229,2,153,124,28,7,164,132,216,51,242,
139,75,18,11,64,82,162,28,151,56,133,248,202,11,18,227,139,75,11,10,114,50,
147,19,243,74,192,58,222,1,117,20,230,130,153,31,128,204,98,32,51,136,11,102,
78,139,87,144,8,166,69,71,204,129,162,24,238,191,161,20,196,139,228,196,37,
210,64,99,160,134,63,145,2,178,161,30,233,16,12,226,71,113,219,19,254,32,49,
108,142,187,195,23,196,195,241,90,88,136,37,57,55,37,87,162,135,23,104,4,212,
129,59,120,0,192,96,122,95>>
--------------------------------------------------------------------------------
================================================================================
2020-12-10T10:16:37+00481 : upstream message of 382 bytes
--------------------------------------------------------------------------------
<<48,251,2,0,35,47,97,112,47,79,112,101,110,95,65,80,95,50,49,80,49,48,67,54,
57,55,49,55,57,53,49,47,111,112,101,110,115,121,110,99,120,156,227,226,51,50,
12,48,52,112,54,179,52,55,52,183,52,53,52,58,201,204,37,205,233,241,176,74,
100,157,251,69,123,193,52,48,184,102,47,89,104,203,117,125,113,193,89,123,
137,247,247,191,191,123,162,167,208,203,162,37,205,197,194,193,32,192,12,36,
153,193,36,147,0,179,0,131,68,111,247,23,160,60,14,201,235,96,205,70,60,28,
39,86,240,11,220,56,199,38,193,160,192,96,197,9,84,184,229,57,179,196,4,1,32,
147,81,96,201,21,118,137,5,76,78,76,28,140,94,194,28,135,132,132,120,242,203,
138,83,146,116,139,83,139,202,82,139,36,152,188,4,57,164,133,184,179,203,243,
139,178,83,139,244,13,172,12,129,66,156,28,159,133,133,152,202,115,37,24,189,
120,56,94,113,9,177,230,165,103,230,85,72,48,0,13,248,39,12,54,64,183,172,
184,60,179,36,57,35,5,40,200,201,241,22,168,58,47,23,200,228,227,56,32,37,
196,158,145,95,92,146,88,0,146,18,229,184,196,41,196,87,94,144,24,95,92,90,
80,144,147,153,156,152,87,2,214,241,14,168,163,48,23,204,252,0,100,22,3,153,
65,92,48,115,90,188,130,68,48,45,58,98,14,20,197,112,255,13,165,32,94,36,39,
46,145,6,26,3,53,252,137,20,144,13,245,72,135,96,16,63,138,219,158,240,7,137,
97,115,220,29,190,32,30,142,215,194,66,44,201,185,41,185,18,61,188,64,35,160,
14,220,193,3,0,80,55,133,17>>
--------------------------------------------------------------------------------
================================================================================
2020-12-10T10:17:37+00541 : upstream message of 358 bytes
--------------------------------------------------------------------------------
<<48,227,2,0,35,47,97,112,47,79,112,101,110,95,65,80,95,50,49,80,49,48,67,54,
57,55,49,55,57,53,49,47,111,112,101,110,115,121,110,99,120,156,227,226,51,50,
12,48,52,112,54,179,52,55,52,183,52,53,52,234,103,230,146,230,124,88,37,178,
206,253,225,41,123,65,249,214,215,129,59,228,174,218,75,22,218,114,93,95,92,
112,214,94,226,220,150,223,239,158,232,41,156,100,49,226,225,56,177,130,95,
160,227,28,155,4,131,2,131,21,39,7,131,192,150,231,204,18,19,4,128,76,70,129,
37,87,216,37,22,48,57,49,113,48,122,9,115,28,18,18,226,201,47,43,78,73,210,
45,78,45,42,75,45,146,96,242,18,228,144,22,226,206,46,207,47,202,78,45,210,
55,176,50,4,10,113,114,124,22,22,98,42,207,149,96,244,226,225,120,197,37,196,
154,151,158,153,87,33,193,0,52,224,159,48,216,0,221,178,226,242,204,146,228,
140,20,160,32,39,199,91,160,234,188,92,32,147,143,227,128,148,16,123,70,126,
113,73,98,1,72,74,148,227,18,167,16,95,121,65,98,124,113,105,65,65,78,102,
114,98,94,9,88,199,59,160,142,194,92,48,243,3,144,89,12,100,6,113,193,204,
105,241,10,18,193,180,232,136,57,80,20,195,253,55,148,130,120,145,156,184,68,
26,104,12,212,240,39,82,64,54,212,35,29,130,65,252,40,110,123,194,31,36,134,
205,113,119,248,130,120,56,94,11,11,177,36,231,166,228,74,244,240,2,141,128,
58,112,7,15,0,93,69,122,203>>
--------------------------------------------------------------------------------
================================================================================
2020-12-10T10:17:41+00545 : upstream message of 2 bytes
--------------------------------------------------------------------------------
<<192,0>>
--------------------------------------------------------------------------------
================================================================================
2020-12-10T10:17:41+00545 : downstream message of 2 bytes
--------------------------------------------------------------------------------
<<208,0>>
--------------------------------------------------------------------------------
================================================================================
2020-12-10T10:18:37+00601 : upstream message of 385 bytes
--------------------------------------------------------------------------------
<<48,254,2,0,35,47,97,112,47,79,112,101,110,95,65,80,95,50,49,80,49,48,67,54,
57,55,49,55,57,53,49,47,111,112,101,110,115,121,110,99,120,156,227,226,51,50,
12,48,52,112,54,179,52,55,52,183,52,53,52,58,201,204,37,205,169,25,211,127,
232,171,198,29,123,65,174,235,139,11,108,185,174,219,75,238,144,107,125,29,
184,227,156,189,196,174,206,255,239,158,232,41,180,178,106,73,115,177,112,48,
8,48,3,73,102,48,201,36,192,44,192,32,113,126,203,111,160,60,14,201,169,96,
205,70,60,28,39,86,240,11,220,57,207,38,193,160,192,96,197,9,84,184,229,57,
179,196,4,1,32,147,81,96,201,21,118,137,5,76,78,76,28,140,94,130,28,210,66,
220,217,229,249,69,217,169,69,250,6,86,134,18,76,94,194,28,135,132,132,120,
242,203,138,83,146,116,139,83,139,202,82,139,36,24,189,56,57,62,11,11,49,149,
231,2,153,60,28,175,184,132,88,243,210,51,243,42,36,24,128,170,255,9,131,85,
235,150,21,151,103,150,36,103,164,0,5,57,57,222,2,85,231,229,2,153,124,28,7,
164,132,216,51,242,139,75,18,11,64,82,162,28,151,56,133,248,202,11,18,227,
139,75,11,10,114,50,147,19,243,74,192,58,222,1,117,20,230,130,153,31,128,204,
98,32,51,136,11,102,78,139,87,144,8,166,69,71,204,129,162,24,142,189,161,20,
196,139,228,196,37,210,64,99,160,134,63,145,2,178,161,30,233,16,12,226,71,
113,219,19,254,32,49,108,142,187,195,23,196,195,241,90,88,136,37,57,55,37,87,
162,135,23,104,4,212,129,59,120,0,170,252,133,69>>
--------------------------------------------------------------------------------
================================================================================
2020-12-10T10:19:37+00661 : upstream message of 351 bytes
--------------------------------------------------------------------------------
<<48,220,2,0,35,47,97,112,47,79,112,101,110,95,65,80,95,50,49,80,49,48,67,54,
57,55,49,55,57,53,49,47,111,112,101,110,115,121,110,99,120,156,227,226,51,50,
12,48,52,112,54,179,52,55,52,183,52,53,52,234,103,230,146,230,60,252,85,35,
166,255,208,85,123,65,24,67,114,135,92,235,235,192,29,231,236,37,250,239,53,
189,127,162,167,112,144,213,136,135,227,196,10,126,129,37,231,216,36,24,20,
24,172,56,57,24,4,182,60,103,150,152,32,0,100,50,10,44,185,194,46,177,128,
201,137,137,131,209,75,152,227,144,144,16,79,126,89,113,74,146,110,113,106,
81,89,106,145,4,147,151,32,135,180,16,119,118,121,126,81,118,106,145,190,129,
149,33,80,136,147,227,179,176,16,83,121,174,4,163,23,15,199,43,46,33,214,188,
244,204,188,10,9,6,160,1,255,132,193,6,232,150,21,151,103,150,36,103,164,0,5,
57,57,222,2,85,231,229,2,153,124,28,7,164,132,216,51,242,139,75,18,11,64,82,
162,28,151,56,133,248,202,11,18,227,139,75,11,10,114,50,147,19,243,74,192,58,
222,1,117,20,230,130,153,31,128,204,98,32,51,136,11,102,78,139,87,144,8,166,
69,71,204,129,162,24,238,191,161,20,196,139,228,196,37,210,64,99,160,134,63,
145,2,178,161,30,233,16,12,226,71,113,219,19,254,32,49,108,142,187,195,23,
196,195,241,90,88,136,37,57,55,37,87,162,135,23,104,4,212,129,59,120,0,114,
173,124,43>>
--------------------------------------------------------------------------------
================================================================================
2020-12-10T10:20:37+00721 : upstream message of 380 bytes
--------------------------------------------------------------------------------
<<48,249,2,0,35,47,97,112,47,79,112,101,110,95,65,80,95,50,49,80,49,48,67,54,
57,55,49,55,57,53,49,47,111,112,101,110,115,121,110,99,120,156,227,226,51,50,
12,48,52,112,54,179,52,55,52,183,52,53,52,90,195,204,37,205,89,45,178,206,
253,97,213,17,123,193,254,67,95,53,98,250,47,217,75,22,218,114,93,95,92,112,
214,94,226,221,166,182,247,79,244,20,254,178,106,73,115,177,112,48,8,48,3,73,
102,48,201,36,192,44,192,32,49,241,94,19,80,222,136,135,227,196,10,126,129,
61,103,217,36,24,20,24,172,56,129,10,183,60,103,150,152,32,0,100,50,10,44,
185,194,46,177,128,201,137,137,131,209,75,144,67,90,136,59,187,60,191,40,59,
181,72,223,192,202,80,130,201,75,152,227,144,144,16,79,126,89,113,74,146,110,
113,106,81,89,106,145,4,163,23,39,199,103,97,33,166,242,92,32,147,135,227,21,
151,16,107,94,122,102,94,133,4,3,80,245,63,97,176,106,221,178,226,242,204,
146,228,140,20,160,32,39,199,91,160,234,188,92,32,147,143,227,128,148,16,123,
70,126,113,73,98,1,72,74,148,227,18,167,16,95,121,65,98,124,113,105,65,65,78,
102,114,98,94,9,88,199,59,160,142,194,92,48,243,3,144,89,12,100,6,113,193,
204,105,241,10,18,193,180,232,136,57,80,20,195,177,55,148,130,120,145,156,
184,68,26,104,12,212,240,39,82,64,54,212,35,29,130,65,252,40,110,123,194,31,
36,134,205,113,119,248,130,120,56,94,11,11,177,36,231,166,228,74,244,240,2,
141,128,58,112,7,15,0,64,213,128,12>>
--------------------------------------------------------------------------------
================================================================================
2020-12-10T10:20:41+00725 : upstream message of 2 bytes
--------------------------------------------------------------------------------
<<192,0>>
--------------------------------------------------------------------------------
================================================================================
2020-12-10T10:20:41+00725 : downstream message of 2 bytes
--------------------------------------------------------------------------------
<<208,0>>
--------------------------------------------------------------------------------
================================================================================
2020-12-10T10:21:37+00781 : upstream message of 385 bytes
--------------------------------------------------------------------------------
<<48,254,2,0,35,47,97,112,47,79,112,101,110,95,65,80,95,50,49,80,49,48,67,54,
57,55,49,55,57,53,49,47,111,112,101,110,115,121,110,99,120,156,227,226,51,50,
12,48,52,112,54,179,52,55,52,183,52,53,52,58,201,204,37,205,249,38,112,135,
92,235,235,139,246,130,253,135,190,106,196,244,95,178,151,44,180,229,186,190,
184,224,172,189,196,249,246,174,247,79,244,20,118,178,105,73,115,177,112,48,
8,48,3,73,102,48,201,36,192,44,192,32,241,126,83,27,80,30,135,228,118,176,
102,35,30,142,19,43,248,5,142,156,99,147,96,80,96,176,226,4,42,220,242,156,
89,98,130,0,144,201,40,176,228,10,187,196,2,38,39,38,14,70,47,65,14,105,33,
238,236,242,252,162,236,212,34,125,3,43,67,9,38,47,97,142,67,66,66,60,249,
101,197,41,73,186,197,169,69,101,169,69,18,140,94,156,28,159,133,133,152,202,
115,129,76,30,142,87,92,66,172,121,233,153,121,21,18,12,64,213,255,132,193,
170,117,203,138,203,51,75,146,51,82,128,130,156,28,111,129,170,243,114,129,
76,62,142,3,82,66,236,25,249,197,37,137,5,32,41,81,142,75,156,66,124,229,5,
137,241,197,165,5,5,57,153,201,137,121,37,96,29,239,128,58,10,115,193,204,15,
64,102,49,144,25,196,5,51,167,197,43,72,4,211,162,35,230,64,81,12,199,222,80,
10,226,69,114,226,18,105,160,49,80,195,159,72,1,217,80,143,116,8,6,241,163,
184,237,9,127,144,24,54,199,221,225,11,226,225,120,45,44,196,146,156,155,146,
43,209,195,11,52,2,234,192,29,60,0,237,251,133,70>>
--------------------------------------------------------------------------------

File diff suppressed because one or more lines are too long