fix
This commit is contained in:
parent
2f341e6319
commit
86effab931
126
API.md
126
API.md
@ -1,30 +1,10 @@
|
||||
# SDLAN API交互文档
|
||||
|
||||
## 检测客户端版本
|
||||
|
||||
```text
|
||||
url: /api/upgrade
|
||||
method: post
|
||||
params:
|
||||
client_id: string
|
||||
version: int
|
||||
channel: string // 客户端的渠道信息
|
||||
return:
|
||||
{"result": {
|
||||
"upgrade_type": 0, // 升级类型,0: 不升级,1: 普通升级,2: 强制升级
|
||||
"upgrade_prompt": "升级提升语"
|
||||
"upgrade_address": "升级提升语"
|
||||
}}
|
||||
|
||||
{"error": {"code": 1, "message": "错误描述"}}
|
||||
|
||||
```
|
||||
# SDLAN 交互文档
|
||||
|
||||
## SDL主动请求的接口
|
||||
|
||||
### 1. 获取全部的可用网络信息
|
||||
```text
|
||||
url: /api/get_all_networks
|
||||
url: get_all_networks
|
||||
method: get
|
||||
return:
|
||||
|
||||
@ -36,7 +16,7 @@ return:
|
||||
|
||||
### 2. 获取单个网络信息
|
||||
```text
|
||||
url: /api/get_network?id=:id
|
||||
url: get_network?id=:id
|
||||
method: get
|
||||
return:
|
||||
{"result":
|
||||
@ -47,6 +27,7 @@ return:
|
||||
"ipaddr": "192.168.0.1/24",
|
||||
"domain": "punchnet.cn",
|
||||
"owner_id": 1234,
|
||||
"algorithm": "aes|chacha20",
|
||||
"disabled_clients": ["client_id_xyz", "client_id_xyz1"]
|
||||
}
|
||||
}
|
||||
@ -55,58 +36,30 @@ return:
|
||||
|
||||
```
|
||||
|
||||
### 3.token校验
|
||||
### 3. access_token校验
|
||||
```text
|
||||
url: /api/auth_token
|
||||
url: auth/access_token
|
||||
method: post
|
||||
params:
|
||||
network_id: int,
|
||||
client_id: string
|
||||
token: string,
|
||||
version: int // 当前客户端版本
|
||||
mac: string,
|
||||
ip: string,
|
||||
mask_len: int,
|
||||
hostname: string,
|
||||
access_token: string,
|
||||
return:
|
||||
|
||||
{"result":
|
||||
{
|
||||
"network_id": 8,
|
||||
"upgrade_type": 0, // 升级类型,0: 不升级,1: 普通升级,2: 强制升级
|
||||
"upgrade_prompt": "升级提升语"
|
||||
"upgrade_address": "升级提升语"
|
||||
}
|
||||
}
|
||||
{"result": "ok"}
|
||||
|
||||
{"error": {"code": 1, "message": "错误描述"}}
|
||||
code = 1, Token does not exists
|
||||
code = 2, Client Connection Disable
|
||||
```
|
||||
|
||||
### 3.网络校验
|
||||
```text
|
||||
url: /api/check_network
|
||||
method: post
|
||||
params:
|
||||
client_id: string
|
||||
code: string,
|
||||
version: int // 当前客户端版本
|
||||
return:
|
||||
|
||||
{"result":
|
||||
{
|
||||
"network_id": 8,
|
||||
"upgrade_type": 0, // 升级类型,0: 不升级,1: 普通升级,2: 强制升级
|
||||
"upgrade_prompt": "升级提升语"
|
||||
"upgrade_address": "升级提升语"
|
||||
}
|
||||
}
|
||||
|
||||
{"error": {"code": 1, "message": "错误描述"}}
|
||||
code = 1, Token does not exists
|
||||
code = 2, Client Connection Disable
|
||||
```
|
||||
|
||||
|
||||
### 4.设置节点的状态
|
||||
```text
|
||||
url: /api/set_node_status
|
||||
url: set_node_status
|
||||
method: post
|
||||
params:
|
||||
client_id: string
|
||||
@ -118,21 +71,6 @@ return:
|
||||
{"result": "success"}
|
||||
```
|
||||
|
||||
### 5. 节点流量汇报(每分钟汇报一次,单位为字节数)
|
||||
```text
|
||||
url: /api/flow_report
|
||||
method: post
|
||||
params:
|
||||
client_id: string
|
||||
network_id: int,
|
||||
forward_num: int,
|
||||
p2p_num: int,
|
||||
inbound_num: int
|
||||
return:
|
||||
|
||||
{"result": "success"}
|
||||
```
|
||||
|
||||
## 管理平台请求SDLAN
|
||||
|
||||
### 网络管理接口
|
||||
@ -176,6 +114,23 @@ return:
|
||||
|
||||
```
|
||||
|
||||
#### 3. 设置网络出口
|
||||
```text
|
||||
url: /network/exit_node_control
|
||||
method: post
|
||||
params:
|
||||
id: int, //网络id
|
||||
action: int // 0: 关闭,1: 开启
|
||||
dst_mac: string // 目标节点的mac地址
|
||||
remark: string // 下发的标签,用于跟踪测试问题,可为空
|
||||
timeout: int // 超时设置,单位为秒
|
||||
return:
|
||||
|
||||
{"result": "success"}
|
||||
{"error": {"code": 1, "message": "错误描述"}}
|
||||
|
||||
```
|
||||
|
||||
### 客户端节点管理
|
||||
|
||||
#### 1. 禁用节点
|
||||
@ -193,22 +148,3 @@ return:
|
||||
{"error": {"code": 1, "message": "错误描述"}}
|
||||
|
||||
```
|
||||
|
||||
#### 2. 迁移到新网络
|
||||
|
||||
```text
|
||||
url: /node/move
|
||||
method: post
|
||||
params:
|
||||
client_id: int
|
||||
to_network_id: int
|
||||
timeout: int
|
||||
|
||||
return:
|
||||
|
||||
{"result": "success"}
|
||||
{"error": {"code": 1, "message": "错误描述"}}
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
@ -158,9 +158,7 @@
|
||||
-define('SDLCOMMAND.EXITNODECONTROL_PB_H', true).
|
||||
-record('SDLCommand.ExitNodeControl',
|
||||
{action = 0 :: integer() | undefined, % = 1, optional, 32 bits
|
||||
node_mac = <<>> :: iodata() | undefined, % = 2, optional
|
||||
node_ip = 0 :: non_neg_integer() | undefined, % = 3, optional, 32 bits
|
||||
remark = <<>> :: unicode:chardata() | undefined % = 4, optional
|
||||
remark = <<>> :: unicode:chardata() | undefined % = 2, optional
|
||||
}).
|
||||
-endif.
|
||||
|
||||
|
||||
@ -51,12 +51,13 @@ handle_request("POST", "/network/exit_node_control", _, #{<<"id">> := NetworkId,
|
||||
{ok, 200, sdlan_util:json_error(-1, Reason)};
|
||||
{ok, Ref} ->
|
||||
case sdlan_network:wait_command_ack(Ref, Timeout * 1000) of
|
||||
{ok, #'SDLCommandAck'{code = Code, message = Message, data = Data}} ->
|
||||
{ok, 200, sdlan_util:json_data(#{
|
||||
<<"code">> => Code,
|
||||
<<"message">> => Message,
|
||||
<<"data">> => Data
|
||||
})};
|
||||
{ok, #'SDLCommandAck'{code = Code, message = Message}} ->
|
||||
case Code == 0 of
|
||||
true ->
|
||||
{ok, 200, sdlan_util:json_data(<<"success">>)};
|
||||
false ->
|
||||
{ok, 200, sdlan_util:json_error(Code, Message)}
|
||||
end;
|
||||
{error, timeout} ->
|
||||
{ok, 200, sdlan_util:json_error(-1, <<"任务执行超时"/utf8>>)}
|
||||
end
|
||||
|
||||
298
src/sdlan_pb.erl
298
src/sdlan_pb.erl
@ -698,7 +698,7 @@ encode_msg_SDLEvent(#'SDLEvent'{event = F1}, Bin, TrUserData) ->
|
||||
'encode_msg_SDLCommand.ExitNodeControl'(Msg, TrUserData) -> 'encode_msg_SDLCommand.ExitNodeControl'(Msg, <<>>, TrUserData).
|
||||
|
||||
|
||||
'encode_msg_SDLCommand.ExitNodeControl'(#'SDLCommand.ExitNodeControl'{action = F1, node_mac = F2, node_ip = F3, remark = F4}, Bin, TrUserData) ->
|
||||
'encode_msg_SDLCommand.ExitNodeControl'(#'SDLCommand.ExitNodeControl'{action = F1, remark = F2}, Bin, TrUserData) ->
|
||||
B1 = if F1 == undefined -> Bin;
|
||||
true ->
|
||||
begin
|
||||
@ -708,32 +708,13 @@ encode_msg_SDLEvent(#'SDLEvent'{event = F1}, Bin, TrUserData) ->
|
||||
end
|
||||
end
|
||||
end,
|
||||
B2 = if F2 == undefined -> B1;
|
||||
true ->
|
||||
begin
|
||||
TrF2 = id(F2, TrUserData),
|
||||
case iolist_size(TrF2) of
|
||||
0 -> B1;
|
||||
_ -> e_type_bytes(TrF2, <<B1/binary, 18>>, TrUserData)
|
||||
end
|
||||
end
|
||||
end,
|
||||
B3 = if F3 == undefined -> B2;
|
||||
true ->
|
||||
begin
|
||||
TrF3 = id(F3, TrUserData),
|
||||
if TrF3 =:= 0 -> B2;
|
||||
true -> e_varint(TrF3, <<B2/binary, 24>>, TrUserData)
|
||||
end
|
||||
end
|
||||
end,
|
||||
if F4 == undefined -> B3;
|
||||
if F2 == undefined -> B1;
|
||||
true ->
|
||||
begin
|
||||
TrF4 = id(F4, TrUserData),
|
||||
case is_empty_string(TrF4) of
|
||||
true -> B3;
|
||||
false -> e_type_string(TrF4, <<B3/binary, 34>>, TrUserData)
|
||||
TrF2 = id(F2, TrUserData),
|
||||
case is_empty_string(TrF2) of
|
||||
true -> B1;
|
||||
false -> e_type_string(TrF2, <<B1/binary, 18>>, TrUserData)
|
||||
end
|
||||
end
|
||||
end.
|
||||
@ -2321,72 +2302,56 @@ skip_32_SDLEvent(<<_:32, Rest/binary>>, Z1, Z2, F, F@_1, TrUserData) -> dfp_read
|
||||
|
||||
skip_64_SDLEvent(<<_:64, Rest/binary>>, Z1, Z2, F, F@_1, TrUserData) -> dfp_read_field_def_SDLEvent(Rest, Z1, Z2, F, F@_1, TrUserData).
|
||||
|
||||
'decode_msg_SDLCommand.ExitNodeControl'(Bin, TrUserData) -> 'dfp_read_field_def_SDLCommand.ExitNodeControl'(Bin, 0, 0, 0, id(0, TrUserData), id(<<>>, TrUserData), id(0, TrUserData), id(<<>>, TrUserData), TrUserData).
|
||||
'decode_msg_SDLCommand.ExitNodeControl'(Bin, TrUserData) -> 'dfp_read_field_def_SDLCommand.ExitNodeControl'(Bin, 0, 0, 0, id(0, TrUserData), id(<<>>, TrUserData), TrUserData).
|
||||
|
||||
'dfp_read_field_def_SDLCommand.ExitNodeControl'(<<8, Rest/binary>>, Z1, Z2, F, F@_1, F@_2, F@_3, F@_4, TrUserData) -> 'd_field_SDLCommand.ExitNodeControl_action'(Rest, Z1, Z2, F, F@_1, F@_2, F@_3, F@_4, TrUserData);
|
||||
'dfp_read_field_def_SDLCommand.ExitNodeControl'(<<18, Rest/binary>>, Z1, Z2, F, F@_1, F@_2, F@_3, F@_4, TrUserData) -> 'd_field_SDLCommand.ExitNodeControl_node_mac'(Rest, Z1, Z2, F, F@_1, F@_2, F@_3, F@_4, TrUserData);
|
||||
'dfp_read_field_def_SDLCommand.ExitNodeControl'(<<24, Rest/binary>>, Z1, Z2, F, F@_1, F@_2, F@_3, F@_4, TrUserData) -> 'd_field_SDLCommand.ExitNodeControl_node_ip'(Rest, Z1, Z2, F, F@_1, F@_2, F@_3, F@_4, TrUserData);
|
||||
'dfp_read_field_def_SDLCommand.ExitNodeControl'(<<34, Rest/binary>>, Z1, Z2, F, F@_1, F@_2, F@_3, F@_4, TrUserData) -> 'd_field_SDLCommand.ExitNodeControl_remark'(Rest, Z1, Z2, F, F@_1, F@_2, F@_3, F@_4, TrUserData);
|
||||
'dfp_read_field_def_SDLCommand.ExitNodeControl'(<<>>, 0, 0, _, F@_1, F@_2, F@_3, F@_4, _) -> #'SDLCommand.ExitNodeControl'{action = F@_1, node_mac = F@_2, node_ip = F@_3, remark = F@_4};
|
||||
'dfp_read_field_def_SDLCommand.ExitNodeControl'(Other, Z1, Z2, F, F@_1, F@_2, F@_3, F@_4, TrUserData) -> 'dg_read_field_def_SDLCommand.ExitNodeControl'(Other, Z1, Z2, F, F@_1, F@_2, F@_3, F@_4, TrUserData).
|
||||
'dfp_read_field_def_SDLCommand.ExitNodeControl'(<<8, Rest/binary>>, Z1, Z2, F, F@_1, F@_2, TrUserData) -> 'd_field_SDLCommand.ExitNodeControl_action'(Rest, Z1, Z2, F, F@_1, F@_2, TrUserData);
|
||||
'dfp_read_field_def_SDLCommand.ExitNodeControl'(<<18, Rest/binary>>, Z1, Z2, F, F@_1, F@_2, TrUserData) -> 'd_field_SDLCommand.ExitNodeControl_remark'(Rest, Z1, Z2, F, F@_1, F@_2, TrUserData);
|
||||
'dfp_read_field_def_SDLCommand.ExitNodeControl'(<<>>, 0, 0, _, F@_1, F@_2, _) -> #'SDLCommand.ExitNodeControl'{action = F@_1, remark = F@_2};
|
||||
'dfp_read_field_def_SDLCommand.ExitNodeControl'(Other, Z1, Z2, F, F@_1, F@_2, TrUserData) -> 'dg_read_field_def_SDLCommand.ExitNodeControl'(Other, Z1, Z2, F, F@_1, F@_2, TrUserData).
|
||||
|
||||
'dg_read_field_def_SDLCommand.ExitNodeControl'(<<1:1, X:7, Rest/binary>>, N, Acc, F, F@_1, F@_2, F@_3, F@_4, TrUserData) when N < 32 - 7 ->
|
||||
'dg_read_field_def_SDLCommand.ExitNodeControl'(Rest, N + 7, X bsl N + Acc, F, F@_1, F@_2, F@_3, F@_4, TrUserData);
|
||||
'dg_read_field_def_SDLCommand.ExitNodeControl'(<<0:1, X:7, Rest/binary>>, N, Acc, _, F@_1, F@_2, F@_3, F@_4, TrUserData) ->
|
||||
'dg_read_field_def_SDLCommand.ExitNodeControl'(<<1:1, X:7, Rest/binary>>, N, Acc, F, F@_1, F@_2, TrUserData) when N < 32 - 7 -> 'dg_read_field_def_SDLCommand.ExitNodeControl'(Rest, N + 7, X bsl N + Acc, F, F@_1, F@_2, TrUserData);
|
||||
'dg_read_field_def_SDLCommand.ExitNodeControl'(<<0:1, X:7, Rest/binary>>, N, Acc, _, F@_1, F@_2, TrUserData) ->
|
||||
Key = X bsl N + Acc,
|
||||
case Key of
|
||||
8 -> 'd_field_SDLCommand.ExitNodeControl_action'(Rest, 0, 0, 0, F@_1, F@_2, F@_3, F@_4, TrUserData);
|
||||
18 -> 'd_field_SDLCommand.ExitNodeControl_node_mac'(Rest, 0, 0, 0, F@_1, F@_2, F@_3, F@_4, TrUserData);
|
||||
24 -> 'd_field_SDLCommand.ExitNodeControl_node_ip'(Rest, 0, 0, 0, F@_1, F@_2, F@_3, F@_4, TrUserData);
|
||||
34 -> 'd_field_SDLCommand.ExitNodeControl_remark'(Rest, 0, 0, 0, F@_1, F@_2, F@_3, F@_4, TrUserData);
|
||||
8 -> 'd_field_SDLCommand.ExitNodeControl_action'(Rest, 0, 0, 0, F@_1, F@_2, TrUserData);
|
||||
18 -> 'd_field_SDLCommand.ExitNodeControl_remark'(Rest, 0, 0, 0, F@_1, F@_2, TrUserData);
|
||||
_ ->
|
||||
case Key band 7 of
|
||||
0 -> 'skip_varint_SDLCommand.ExitNodeControl'(Rest, 0, 0, Key bsr 3, F@_1, F@_2, F@_3, F@_4, TrUserData);
|
||||
1 -> 'skip_64_SDLCommand.ExitNodeControl'(Rest, 0, 0, Key bsr 3, F@_1, F@_2, F@_3, F@_4, TrUserData);
|
||||
2 -> 'skip_length_delimited_SDLCommand.ExitNodeControl'(Rest, 0, 0, Key bsr 3, F@_1, F@_2, F@_3, F@_4, TrUserData);
|
||||
3 -> 'skip_group_SDLCommand.ExitNodeControl'(Rest, 0, 0, Key bsr 3, F@_1, F@_2, F@_3, F@_4, TrUserData);
|
||||
5 -> 'skip_32_SDLCommand.ExitNodeControl'(Rest, 0, 0, Key bsr 3, F@_1, F@_2, F@_3, F@_4, TrUserData)
|
||||
0 -> 'skip_varint_SDLCommand.ExitNodeControl'(Rest, 0, 0, Key bsr 3, F@_1, F@_2, TrUserData);
|
||||
1 -> 'skip_64_SDLCommand.ExitNodeControl'(Rest, 0, 0, Key bsr 3, F@_1, F@_2, TrUserData);
|
||||
2 -> 'skip_length_delimited_SDLCommand.ExitNodeControl'(Rest, 0, 0, Key bsr 3, F@_1, F@_2, TrUserData);
|
||||
3 -> 'skip_group_SDLCommand.ExitNodeControl'(Rest, 0, 0, Key bsr 3, F@_1, F@_2, TrUserData);
|
||||
5 -> 'skip_32_SDLCommand.ExitNodeControl'(Rest, 0, 0, Key bsr 3, F@_1, F@_2, TrUserData)
|
||||
end
|
||||
end;
|
||||
'dg_read_field_def_SDLCommand.ExitNodeControl'(<<>>, 0, 0, _, F@_1, F@_2, F@_3, F@_4, _) -> #'SDLCommand.ExitNodeControl'{action = F@_1, node_mac = F@_2, node_ip = F@_3, remark = F@_4}.
|
||||
'dg_read_field_def_SDLCommand.ExitNodeControl'(<<>>, 0, 0, _, F@_1, F@_2, _) -> #'SDLCommand.ExitNodeControl'{action = F@_1, remark = F@_2}.
|
||||
|
||||
'd_field_SDLCommand.ExitNodeControl_action'(<<1:1, X:7, Rest/binary>>, N, Acc, F, F@_1, F@_2, F@_3, F@_4, TrUserData) when N < 57 -> 'd_field_SDLCommand.ExitNodeControl_action'(Rest, N + 7, X bsl N + Acc, F, F@_1, F@_2, F@_3, F@_4, TrUserData);
|
||||
'd_field_SDLCommand.ExitNodeControl_action'(<<0:1, X:7, Rest/binary>>, N, Acc, F, _, F@_2, F@_3, F@_4, TrUserData) ->
|
||||
'd_field_SDLCommand.ExitNodeControl_action'(<<1:1, X:7, Rest/binary>>, N, Acc, F, F@_1, F@_2, TrUserData) when N < 57 -> 'd_field_SDLCommand.ExitNodeControl_action'(Rest, N + 7, X bsl N + Acc, F, F@_1, F@_2, TrUserData);
|
||||
'd_field_SDLCommand.ExitNodeControl_action'(<<0:1, X:7, Rest/binary>>, N, Acc, F, _, F@_2, TrUserData) ->
|
||||
{NewFValue, RestF} = {begin <<Res:32/signed-native>> = <<(X bsl N + Acc):32/unsigned-native>>, id(Res, TrUserData) end, Rest},
|
||||
'dfp_read_field_def_SDLCommand.ExitNodeControl'(RestF, 0, 0, F, NewFValue, F@_2, F@_3, F@_4, TrUserData).
|
||||
'dfp_read_field_def_SDLCommand.ExitNodeControl'(RestF, 0, 0, F, NewFValue, F@_2, TrUserData).
|
||||
|
||||
'd_field_SDLCommand.ExitNodeControl_node_mac'(<<1:1, X:7, Rest/binary>>, N, Acc, F, F@_1, F@_2, F@_3, F@_4, TrUserData) when N < 57 -> 'd_field_SDLCommand.ExitNodeControl_node_mac'(Rest, N + 7, X bsl N + Acc, F, F@_1, F@_2, F@_3, F@_4, TrUserData);
|
||||
'd_field_SDLCommand.ExitNodeControl_node_mac'(<<0:1, X:7, Rest/binary>>, N, Acc, F, F@_1, _, F@_3, F@_4, TrUserData) ->
|
||||
'd_field_SDLCommand.ExitNodeControl_remark'(<<1:1, X:7, Rest/binary>>, N, Acc, F, F@_1, F@_2, TrUserData) when N < 57 -> 'd_field_SDLCommand.ExitNodeControl_remark'(Rest, N + 7, X bsl N + Acc, F, F@_1, F@_2, TrUserData);
|
||||
'd_field_SDLCommand.ExitNodeControl_remark'(<<0:1, X:7, Rest/binary>>, N, Acc, F, F@_1, _, TrUserData) ->
|
||||
{NewFValue, RestF} = begin Len = X bsl N + Acc, <<Bytes:Len/binary, Rest2/binary>> = Rest, Bytes2 = binary:copy(Bytes), {id(Bytes2, TrUserData), Rest2} end,
|
||||
'dfp_read_field_def_SDLCommand.ExitNodeControl'(RestF, 0, 0, F, F@_1, NewFValue, F@_3, F@_4, TrUserData).
|
||||
'dfp_read_field_def_SDLCommand.ExitNodeControl'(RestF, 0, 0, F, F@_1, NewFValue, TrUserData).
|
||||
|
||||
'd_field_SDLCommand.ExitNodeControl_node_ip'(<<1:1, X:7, Rest/binary>>, N, Acc, F, F@_1, F@_2, F@_3, F@_4, TrUserData) when N < 57 -> 'd_field_SDLCommand.ExitNodeControl_node_ip'(Rest, N + 7, X bsl N + Acc, F, F@_1, F@_2, F@_3, F@_4, TrUserData);
|
||||
'd_field_SDLCommand.ExitNodeControl_node_ip'(<<0:1, X:7, Rest/binary>>, N, Acc, F, F@_1, F@_2, _, F@_4, TrUserData) ->
|
||||
{NewFValue, RestF} = {id((X bsl N + Acc) band 4294967295, TrUserData), Rest},
|
||||
'dfp_read_field_def_SDLCommand.ExitNodeControl'(RestF, 0, 0, F, F@_1, F@_2, NewFValue, F@_4, TrUserData).
|
||||
'skip_varint_SDLCommand.ExitNodeControl'(<<1:1, _:7, Rest/binary>>, Z1, Z2, F, F@_1, F@_2, TrUserData) -> 'skip_varint_SDLCommand.ExitNodeControl'(Rest, Z1, Z2, F, F@_1, F@_2, TrUserData);
|
||||
'skip_varint_SDLCommand.ExitNodeControl'(<<0:1, _:7, Rest/binary>>, Z1, Z2, F, F@_1, F@_2, TrUserData) -> 'dfp_read_field_def_SDLCommand.ExitNodeControl'(Rest, Z1, Z2, F, F@_1, F@_2, TrUserData).
|
||||
|
||||
'd_field_SDLCommand.ExitNodeControl_remark'(<<1:1, X:7, Rest/binary>>, N, Acc, F, F@_1, F@_2, F@_3, F@_4, TrUserData) when N < 57 -> 'd_field_SDLCommand.ExitNodeControl_remark'(Rest, N + 7, X bsl N + Acc, F, F@_1, F@_2, F@_3, F@_4, TrUserData);
|
||||
'd_field_SDLCommand.ExitNodeControl_remark'(<<0:1, X:7, Rest/binary>>, N, Acc, F, F@_1, F@_2, F@_3, _, TrUserData) ->
|
||||
{NewFValue, RestF} = begin Len = X bsl N + Acc, <<Bytes:Len/binary, Rest2/binary>> = Rest, Bytes2 = binary:copy(Bytes), {id(Bytes2, TrUserData), Rest2} end,
|
||||
'dfp_read_field_def_SDLCommand.ExitNodeControl'(RestF, 0, 0, F, F@_1, F@_2, F@_3, NewFValue, TrUserData).
|
||||
|
||||
'skip_varint_SDLCommand.ExitNodeControl'(<<1:1, _:7, Rest/binary>>, Z1, Z2, F, F@_1, F@_2, F@_3, F@_4, TrUserData) -> 'skip_varint_SDLCommand.ExitNodeControl'(Rest, Z1, Z2, F, F@_1, F@_2, F@_3, F@_4, TrUserData);
|
||||
'skip_varint_SDLCommand.ExitNodeControl'(<<0:1, _:7, Rest/binary>>, Z1, Z2, F, F@_1, F@_2, F@_3, F@_4, TrUserData) -> 'dfp_read_field_def_SDLCommand.ExitNodeControl'(Rest, Z1, Z2, F, F@_1, F@_2, F@_3, F@_4, TrUserData).
|
||||
|
||||
'skip_length_delimited_SDLCommand.ExitNodeControl'(<<1:1, X:7, Rest/binary>>, N, Acc, F, F@_1, F@_2, F@_3, F@_4, TrUserData) when N < 57 ->
|
||||
'skip_length_delimited_SDLCommand.ExitNodeControl'(Rest, N + 7, X bsl N + Acc, F, F@_1, F@_2, F@_3, F@_4, TrUserData);
|
||||
'skip_length_delimited_SDLCommand.ExitNodeControl'(<<0:1, X:7, Rest/binary>>, N, Acc, F, F@_1, F@_2, F@_3, F@_4, TrUserData) ->
|
||||
'skip_length_delimited_SDLCommand.ExitNodeControl'(<<1:1, X:7, Rest/binary>>, N, Acc, F, F@_1, F@_2, TrUserData) when N < 57 -> 'skip_length_delimited_SDLCommand.ExitNodeControl'(Rest, N + 7, X bsl N + Acc, F, F@_1, F@_2, TrUserData);
|
||||
'skip_length_delimited_SDLCommand.ExitNodeControl'(<<0:1, X:7, Rest/binary>>, N, Acc, F, F@_1, F@_2, TrUserData) ->
|
||||
Length = X bsl N + Acc,
|
||||
<<_:Length/binary, Rest2/binary>> = Rest,
|
||||
'dfp_read_field_def_SDLCommand.ExitNodeControl'(Rest2, 0, 0, F, F@_1, F@_2, F@_3, F@_4, TrUserData).
|
||||
'dfp_read_field_def_SDLCommand.ExitNodeControl'(Rest2, 0, 0, F, F@_1, F@_2, TrUserData).
|
||||
|
||||
'skip_group_SDLCommand.ExitNodeControl'(Bin, _, Z2, FNum, F@_1, F@_2, F@_3, F@_4, TrUserData) ->
|
||||
'skip_group_SDLCommand.ExitNodeControl'(Bin, _, Z2, FNum, F@_1, F@_2, TrUserData) ->
|
||||
{_, Rest} = read_group(Bin, FNum),
|
||||
'dfp_read_field_def_SDLCommand.ExitNodeControl'(Rest, 0, Z2, FNum, F@_1, F@_2, F@_3, F@_4, TrUserData).
|
||||
'dfp_read_field_def_SDLCommand.ExitNodeControl'(Rest, 0, Z2, FNum, F@_1, F@_2, TrUserData).
|
||||
|
||||
'skip_32_SDLCommand.ExitNodeControl'(<<_:32, Rest/binary>>, Z1, Z2, F, F@_1, F@_2, F@_3, F@_4, TrUserData) -> 'dfp_read_field_def_SDLCommand.ExitNodeControl'(Rest, Z1, Z2, F, F@_1, F@_2, F@_3, F@_4, TrUserData).
|
||||
'skip_32_SDLCommand.ExitNodeControl'(<<_:32, Rest/binary>>, Z1, Z2, F, F@_1, F@_2, TrUserData) -> 'dfp_read_field_def_SDLCommand.ExitNodeControl'(Rest, Z1, Z2, F, F@_1, F@_2, TrUserData).
|
||||
|
||||
'skip_64_SDLCommand.ExitNodeControl'(<<_:64, Rest/binary>>, Z1, Z2, F, F@_1, F@_2, F@_3, F@_4, TrUserData) -> 'dfp_read_field_def_SDLCommand.ExitNodeControl'(Rest, Z1, Z2, F, F@_1, F@_2, F@_3, F@_4, TrUserData).
|
||||
'skip_64_SDLCommand.ExitNodeControl'(<<_:64, Rest/binary>>, Z1, Z2, F, F@_1, F@_2, TrUserData) -> 'dfp_read_field_def_SDLCommand.ExitNodeControl'(Rest, Z1, Z2, F, F@_1, F@_2, TrUserData).
|
||||
|
||||
decode_msg_SDLCommand(Bin, TrUserData) -> dfp_read_field_def_SDLCommand(Bin, 0, 0, 0, id(0, TrUserData), id(undefined, TrUserData), TrUserData).
|
||||
|
||||
@ -3352,20 +3317,11 @@ merge_msg_SDLEvent(#'SDLEvent'{event = PFevent}, #'SDLEvent'{event = NFevent}, T
|
||||
end}.
|
||||
|
||||
-compile({nowarn_unused_function,'merge_msg_SDLCommand.ExitNodeControl'/3}).
|
||||
'merge_msg_SDLCommand.ExitNodeControl'(#'SDLCommand.ExitNodeControl'{action = PFaction, node_mac = PFnode_mac, node_ip = PFnode_ip, remark = PFremark},
|
||||
#'SDLCommand.ExitNodeControl'{action = NFaction, node_mac = NFnode_mac, node_ip = NFnode_ip, remark = NFremark}, _) ->
|
||||
'merge_msg_SDLCommand.ExitNodeControl'(#'SDLCommand.ExitNodeControl'{action = PFaction, remark = PFremark}, #'SDLCommand.ExitNodeControl'{action = NFaction, remark = NFremark}, _) ->
|
||||
#'SDLCommand.ExitNodeControl'{action =
|
||||
if NFaction =:= undefined -> PFaction;
|
||||
true -> NFaction
|
||||
end,
|
||||
node_mac =
|
||||
if NFnode_mac =:= undefined -> PFnode_mac;
|
||||
true -> NFnode_mac
|
||||
end,
|
||||
node_ip =
|
||||
if NFnode_ip =:= undefined -> PFnode_ip;
|
||||
true -> NFnode_ip
|
||||
end,
|
||||
remark =
|
||||
if NFremark =:= undefined -> PFremark;
|
||||
true -> NFremark
|
||||
@ -3856,18 +3812,12 @@ v_msg_SDLEvent(X, Path, _TrUserData) -> mk_type_error({expected_msg, 'SDLEvent'}
|
||||
|
||||
-compile({nowarn_unused_function,'v_msg_SDLCommand.ExitNodeControl'/3}).
|
||||
-dialyzer({nowarn_function,'v_msg_SDLCommand.ExitNodeControl'/3}).
|
||||
'v_msg_SDLCommand.ExitNodeControl'(#'SDLCommand.ExitNodeControl'{action = F1, node_mac = F2, node_ip = F3, remark = F4}, Path, TrUserData) ->
|
||||
'v_msg_SDLCommand.ExitNodeControl'(#'SDLCommand.ExitNodeControl'{action = F1, remark = F2}, Path, TrUserData) ->
|
||||
if F1 == undefined -> ok;
|
||||
true -> v_type_int32(F1, [action | Path], TrUserData)
|
||||
end,
|
||||
if F2 == undefined -> ok;
|
||||
true -> v_type_bytes(F2, [node_mac | Path], TrUserData)
|
||||
end,
|
||||
if F3 == undefined -> ok;
|
||||
true -> v_type_uint32(F3, [node_ip | Path], TrUserData)
|
||||
end,
|
||||
if F4 == undefined -> ok;
|
||||
true -> v_type_string(F4, [remark | Path], TrUserData)
|
||||
true -> v_type_string(F2, [remark | Path], TrUserData)
|
||||
end,
|
||||
ok;
|
||||
'v_msg_SDLCommand.ExitNodeControl'(X, Path, _TrUserData) -> mk_type_error({expected_msg, 'SDLCommand.ExitNodeControl'}, X, Path).
|
||||
@ -4167,11 +4117,7 @@ get_msg_defs() ->
|
||||
#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 = []}],
|
||||
opts = []}]},
|
||||
{{msg, 'SDLCommand.ExitNodeControl'},
|
||||
[#field{name = action, fnum = 1, rnum = 2, type = int32, occurrence = defaulty, opts = []},
|
||||
#field{name = node_mac, fnum = 2, rnum = 3, type = bytes, occurrence = defaulty, opts = []},
|
||||
#field{name = node_ip, fnum = 3, rnum = 4, type = uint32, occurrence = defaulty, opts = []},
|
||||
#field{name = remark, fnum = 4, rnum = 5, type = string, occurrence = defaulty, 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'},
|
||||
[#field{name = pkt_id, fnum = 1, rnum = 2, type = uint32, occurrence = defaulty, opts = []},
|
||||
#gpb_oneof{name = command, rnum = 3, fields = [#field{name = exit_node, fnum = 2, rnum = 3, type = {msg, 'SDLCommand.ExitNodeControl'}, occurrence = optional, opts = []}], opts = []}]},
|
||||
@ -4355,11 +4301,7 @@ find_msg_def('SDLEvent') ->
|
||||
#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 = []}],
|
||||
opts = []}];
|
||||
find_msg_def('SDLCommand.ExitNodeControl') ->
|
||||
[#field{name = action, fnum = 1, rnum = 2, type = int32, occurrence = defaulty, opts = []},
|
||||
#field{name = node_mac, fnum = 2, rnum = 3, type = bytes, occurrence = defaulty, opts = []},
|
||||
#field{name = node_ip, fnum = 3, rnum = 4, type = uint32, occurrence = defaulty, opts = []},
|
||||
#field{name = remark, fnum = 4, rnum = 5, type = string, occurrence = defaulty, 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') ->
|
||||
[#field{name = pkt_id, fnum = 1, rnum = 2, type = uint32, occurrence = defaulty, opts = []},
|
||||
#gpb_oneof{name = command, rnum = 3, fields = [#field{name = exit_node, fnum = 2, rnum = 3, type = {msg, 'SDLCommand.ExitNodeControl'}, occurrence = optional, opts = []}], opts = []}];
|
||||
@ -4461,61 +4403,61 @@ fqbins_to_service_and_rpc_name(S, R) -> error({gpb_error, {badservice_or_rpc, {S
|
||||
service_and_rpc_name_to_fqbins(S, R) -> error({gpb_error, {badservice_or_rpc, {S, R}}}).
|
||||
|
||||
|
||||
fqbin_to_msg_name(<<"mypkg.SDLV4Info">>) -> 'SDLV4Info';
|
||||
fqbin_to_msg_name(<<"mypkg.SDLV6Info">>) -> 'SDLV6Info';
|
||||
fqbin_to_msg_name(<<"mypkg.SDLWelcome">>) -> 'SDLWelcome';
|
||||
fqbin_to_msg_name(<<"mypkg.SDLRegisterSuper">>) -> 'SDLRegisterSuper';
|
||||
fqbin_to_msg_name(<<"mypkg.SDLRegisterSuperAck">>) -> 'SDLRegisterSuperAck';
|
||||
fqbin_to_msg_name(<<"mypkg.SDLRegisterSuperNak">>) -> 'SDLRegisterSuperNak';
|
||||
fqbin_to_msg_name(<<"mypkg.SDLQueryInfo">>) -> 'SDLQueryInfo';
|
||||
fqbin_to_msg_name(<<"mypkg.SDLPeerInfo">>) -> 'SDLPeerInfo';
|
||||
fqbin_to_msg_name(<<"mypkg.SDLArpRequest">>) -> 'SDLArpRequest';
|
||||
fqbin_to_msg_name(<<"mypkg.SDLArpResponse">>) -> 'SDLArpResponse';
|
||||
fqbin_to_msg_name(<<"mypkg.SDLPolicyRequest">>) -> 'SDLPolicyRequest';
|
||||
fqbin_to_msg_name(<<"mypkg.SDLPolicyResponse">>) -> 'SDLPolicyResponse';
|
||||
fqbin_to_msg_name(<<"mypkg.SDLEvent.NatChanged">>) -> 'SDLEvent.NatChanged';
|
||||
fqbin_to_msg_name(<<"mypkg.SDLEvent.SendRegister">>) -> 'SDLEvent.SendRegister';
|
||||
fqbin_to_msg_name(<<"mypkg.SDLEvent.NetworkShutdown">>) -> 'SDLEvent.NetworkShutdown';
|
||||
fqbin_to_msg_name(<<"mypkg.SDLEvent">>) -> 'SDLEvent';
|
||||
fqbin_to_msg_name(<<"mypkg.SDLCommand.ExitNodeControl">>) -> 'SDLCommand.ExitNodeControl';
|
||||
fqbin_to_msg_name(<<"mypkg.SDLCommand">>) -> 'SDLCommand';
|
||||
fqbin_to_msg_name(<<"mypkg.SDLCommandAck">>) -> 'SDLCommandAck';
|
||||
fqbin_to_msg_name(<<"mypkg.SDLStunRequest">>) -> 'SDLStunRequest';
|
||||
fqbin_to_msg_name(<<"mypkg.SDLStunReply">>) -> 'SDLStunReply';
|
||||
fqbin_to_msg_name(<<"mypkg.SDLData">>) -> 'SDLData';
|
||||
fqbin_to_msg_name(<<"mypkg.SDLStunProbe">>) -> 'SDLStunProbe';
|
||||
fqbin_to_msg_name(<<"mypkg.SDLStunProbeReply">>) -> 'SDLStunProbeReply';
|
||||
fqbin_to_msg_name(<<"mypkg.SDLRegister">>) -> 'SDLRegister';
|
||||
fqbin_to_msg_name(<<"mypkg.SDLRegisterAck">>) -> 'SDLRegisterAck';
|
||||
fqbin_to_msg_name(<<"message.SDLV4Info">>) -> 'SDLV4Info';
|
||||
fqbin_to_msg_name(<<"message.SDLV6Info">>) -> 'SDLV6Info';
|
||||
fqbin_to_msg_name(<<"message.SDLWelcome">>) -> 'SDLWelcome';
|
||||
fqbin_to_msg_name(<<"message.SDLRegisterSuper">>) -> 'SDLRegisterSuper';
|
||||
fqbin_to_msg_name(<<"message.SDLRegisterSuperAck">>) -> 'SDLRegisterSuperAck';
|
||||
fqbin_to_msg_name(<<"message.SDLRegisterSuperNak">>) -> 'SDLRegisterSuperNak';
|
||||
fqbin_to_msg_name(<<"message.SDLQueryInfo">>) -> 'SDLQueryInfo';
|
||||
fqbin_to_msg_name(<<"message.SDLPeerInfo">>) -> 'SDLPeerInfo';
|
||||
fqbin_to_msg_name(<<"message.SDLArpRequest">>) -> 'SDLArpRequest';
|
||||
fqbin_to_msg_name(<<"message.SDLArpResponse">>) -> 'SDLArpResponse';
|
||||
fqbin_to_msg_name(<<"message.SDLPolicyRequest">>) -> 'SDLPolicyRequest';
|
||||
fqbin_to_msg_name(<<"message.SDLPolicyResponse">>) -> 'SDLPolicyResponse';
|
||||
fqbin_to_msg_name(<<"message.SDLEvent.NatChanged">>) -> 'SDLEvent.NatChanged';
|
||||
fqbin_to_msg_name(<<"message.SDLEvent.SendRegister">>) -> 'SDLEvent.SendRegister';
|
||||
fqbin_to_msg_name(<<"message.SDLEvent.NetworkShutdown">>) -> 'SDLEvent.NetworkShutdown';
|
||||
fqbin_to_msg_name(<<"message.SDLEvent">>) -> 'SDLEvent';
|
||||
fqbin_to_msg_name(<<"message.SDLCommand.ExitNodeControl">>) -> 'SDLCommand.ExitNodeControl';
|
||||
fqbin_to_msg_name(<<"message.SDLCommand">>) -> 'SDLCommand';
|
||||
fqbin_to_msg_name(<<"message.SDLCommandAck">>) -> 'SDLCommandAck';
|
||||
fqbin_to_msg_name(<<"message.SDLStunRequest">>) -> 'SDLStunRequest';
|
||||
fqbin_to_msg_name(<<"message.SDLStunReply">>) -> 'SDLStunReply';
|
||||
fqbin_to_msg_name(<<"message.SDLData">>) -> 'SDLData';
|
||||
fqbin_to_msg_name(<<"message.SDLStunProbe">>) -> 'SDLStunProbe';
|
||||
fqbin_to_msg_name(<<"message.SDLStunProbeReply">>) -> 'SDLStunProbeReply';
|
||||
fqbin_to_msg_name(<<"message.SDLRegister">>) -> 'SDLRegister';
|
||||
fqbin_to_msg_name(<<"message.SDLRegisterAck">>) -> 'SDLRegisterAck';
|
||||
fqbin_to_msg_name(E) -> error({gpb_error, {badmsg, E}}).
|
||||
|
||||
|
||||
msg_name_to_fqbin('SDLV4Info') -> <<"mypkg.SDLV4Info">>;
|
||||
msg_name_to_fqbin('SDLV6Info') -> <<"mypkg.SDLV6Info">>;
|
||||
msg_name_to_fqbin('SDLWelcome') -> <<"mypkg.SDLWelcome">>;
|
||||
msg_name_to_fqbin('SDLRegisterSuper') -> <<"mypkg.SDLRegisterSuper">>;
|
||||
msg_name_to_fqbin('SDLRegisterSuperAck') -> <<"mypkg.SDLRegisterSuperAck">>;
|
||||
msg_name_to_fqbin('SDLRegisterSuperNak') -> <<"mypkg.SDLRegisterSuperNak">>;
|
||||
msg_name_to_fqbin('SDLQueryInfo') -> <<"mypkg.SDLQueryInfo">>;
|
||||
msg_name_to_fqbin('SDLPeerInfo') -> <<"mypkg.SDLPeerInfo">>;
|
||||
msg_name_to_fqbin('SDLArpRequest') -> <<"mypkg.SDLArpRequest">>;
|
||||
msg_name_to_fqbin('SDLArpResponse') -> <<"mypkg.SDLArpResponse">>;
|
||||
msg_name_to_fqbin('SDLPolicyRequest') -> <<"mypkg.SDLPolicyRequest">>;
|
||||
msg_name_to_fqbin('SDLPolicyResponse') -> <<"mypkg.SDLPolicyResponse">>;
|
||||
msg_name_to_fqbin('SDLEvent.NatChanged') -> <<"mypkg.SDLEvent.NatChanged">>;
|
||||
msg_name_to_fqbin('SDLEvent.SendRegister') -> <<"mypkg.SDLEvent.SendRegister">>;
|
||||
msg_name_to_fqbin('SDLEvent.NetworkShutdown') -> <<"mypkg.SDLEvent.NetworkShutdown">>;
|
||||
msg_name_to_fqbin('SDLEvent') -> <<"mypkg.SDLEvent">>;
|
||||
msg_name_to_fqbin('SDLCommand.ExitNodeControl') -> <<"mypkg.SDLCommand.ExitNodeControl">>;
|
||||
msg_name_to_fqbin('SDLCommand') -> <<"mypkg.SDLCommand">>;
|
||||
msg_name_to_fqbin('SDLCommandAck') -> <<"mypkg.SDLCommandAck">>;
|
||||
msg_name_to_fqbin('SDLStunRequest') -> <<"mypkg.SDLStunRequest">>;
|
||||
msg_name_to_fqbin('SDLStunReply') -> <<"mypkg.SDLStunReply">>;
|
||||
msg_name_to_fqbin('SDLData') -> <<"mypkg.SDLData">>;
|
||||
msg_name_to_fqbin('SDLStunProbe') -> <<"mypkg.SDLStunProbe">>;
|
||||
msg_name_to_fqbin('SDLStunProbeReply') -> <<"mypkg.SDLStunProbeReply">>;
|
||||
msg_name_to_fqbin('SDLRegister') -> <<"mypkg.SDLRegister">>;
|
||||
msg_name_to_fqbin('SDLRegisterAck') -> <<"mypkg.SDLRegisterAck">>;
|
||||
msg_name_to_fqbin('SDLV4Info') -> <<"message.SDLV4Info">>;
|
||||
msg_name_to_fqbin('SDLV6Info') -> <<"message.SDLV6Info">>;
|
||||
msg_name_to_fqbin('SDLWelcome') -> <<"message.SDLWelcome">>;
|
||||
msg_name_to_fqbin('SDLRegisterSuper') -> <<"message.SDLRegisterSuper">>;
|
||||
msg_name_to_fqbin('SDLRegisterSuperAck') -> <<"message.SDLRegisterSuperAck">>;
|
||||
msg_name_to_fqbin('SDLRegisterSuperNak') -> <<"message.SDLRegisterSuperNak">>;
|
||||
msg_name_to_fqbin('SDLQueryInfo') -> <<"message.SDLQueryInfo">>;
|
||||
msg_name_to_fqbin('SDLPeerInfo') -> <<"message.SDLPeerInfo">>;
|
||||
msg_name_to_fqbin('SDLArpRequest') -> <<"message.SDLArpRequest">>;
|
||||
msg_name_to_fqbin('SDLArpResponse') -> <<"message.SDLArpResponse">>;
|
||||
msg_name_to_fqbin('SDLPolicyRequest') -> <<"message.SDLPolicyRequest">>;
|
||||
msg_name_to_fqbin('SDLPolicyResponse') -> <<"message.SDLPolicyResponse">>;
|
||||
msg_name_to_fqbin('SDLEvent.NatChanged') -> <<"message.SDLEvent.NatChanged">>;
|
||||
msg_name_to_fqbin('SDLEvent.SendRegister') -> <<"message.SDLEvent.SendRegister">>;
|
||||
msg_name_to_fqbin('SDLEvent.NetworkShutdown') -> <<"message.SDLEvent.NetworkShutdown">>;
|
||||
msg_name_to_fqbin('SDLEvent') -> <<"message.SDLEvent">>;
|
||||
msg_name_to_fqbin('SDLCommand.ExitNodeControl') -> <<"message.SDLCommand.ExitNodeControl">>;
|
||||
msg_name_to_fqbin('SDLCommand') -> <<"message.SDLCommand">>;
|
||||
msg_name_to_fqbin('SDLCommandAck') -> <<"message.SDLCommandAck">>;
|
||||
msg_name_to_fqbin('SDLStunRequest') -> <<"message.SDLStunRequest">>;
|
||||
msg_name_to_fqbin('SDLStunReply') -> <<"message.SDLStunReply">>;
|
||||
msg_name_to_fqbin('SDLData') -> <<"message.SDLData">>;
|
||||
msg_name_to_fqbin('SDLStunProbe') -> <<"message.SDLStunProbe">>;
|
||||
msg_name_to_fqbin('SDLStunProbeReply') -> <<"message.SDLStunProbeReply">>;
|
||||
msg_name_to_fqbin('SDLRegister') -> <<"message.SDLRegister">>;
|
||||
msg_name_to_fqbin('SDLRegisterAck') -> <<"message.SDLRegisterAck">>;
|
||||
msg_name_to_fqbin(E) -> error({gpb_error, {badmsg, E}}).
|
||||
|
||||
|
||||
@ -4527,7 +4469,7 @@ fqbin_to_enum_name(E) -> error({gpb_error, {badenum, E}}).
|
||||
enum_name_to_fqbin(E) -> error({gpb_error, {badenum, E}}).
|
||||
|
||||
|
||||
get_package_name() -> mypkg.
|
||||
get_package_name() -> message.
|
||||
|
||||
|
||||
%% Whether or not the message names
|
||||
@ -4600,32 +4542,32 @@ get_enum_containment("sdlan") -> [];
|
||||
get_enum_containment(P) -> error({gpb_error, {badproto, P}}).
|
||||
|
||||
|
||||
get_proto_by_msg_name_as_fqbin(<<"mypkg.SDLData">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"mypkg.SDLRegisterSuper">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"mypkg.SDLRegister">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"mypkg.SDLEvent.SendRegister">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"mypkg.SDLStunRequest">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"mypkg.SDLPolicyRequest">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"mypkg.SDLEvent.NatChanged">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"mypkg.SDLEvent">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"mypkg.SDLCommand">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"mypkg.SDLArpRequest">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"mypkg.SDLWelcome">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"mypkg.SDLStunProbe">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"mypkg.SDLPolicyResponse">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"mypkg.SDLArpResponse">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"mypkg.SDLStunReply">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"mypkg.SDLStunProbeReply">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"mypkg.SDLRegisterSuperNak">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"mypkg.SDLRegisterSuperAck">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"mypkg.SDLRegisterAck">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"mypkg.SDLCommandAck">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"mypkg.SDLCommand.ExitNodeControl">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"mypkg.SDLEvent.NetworkShutdown">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"mypkg.SDLV6Info">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"mypkg.SDLV4Info">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"mypkg.SDLQueryInfo">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"mypkg.SDLPeerInfo">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"message.SDLData">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"message.SDLRegisterSuper">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"message.SDLRegister">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"message.SDLEvent.SendRegister">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"message.SDLStunRequest">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"message.SDLPolicyRequest">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"message.SDLEvent.NatChanged">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"message.SDLEvent">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"message.SDLCommand">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"message.SDLArpRequest">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"message.SDLWelcome">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"message.SDLStunProbe">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"message.SDLPolicyResponse">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"message.SDLArpResponse">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"message.SDLStunReply">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"message.SDLStunProbeReply">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"message.SDLRegisterSuperNak">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"message.SDLRegisterSuperAck">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"message.SDLRegisterAck">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"message.SDLCommandAck">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"message.SDLCommand.ExitNodeControl">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"message.SDLEvent.NetworkShutdown">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"message.SDLV6Info">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"message.SDLV4Info">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"message.SDLQueryInfo">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(<<"message.SDLPeerInfo">>) -> "sdlan";
|
||||
get_proto_by_msg_name_as_fqbin(E) -> error({gpb_error, {badmsg, E}}).
|
||||
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
-author("anlicheng").
|
||||
|
||||
%% API
|
||||
-export([rand_byte/1, md5/1, format_mac/1, assert_call/2]).
|
||||
-export([rand_byte/1, md5/1, format_mac/1, assert_call/2, mac_str_to_bin/1]).
|
||||
-export([json_data/1, json_error/2]).
|
||||
-export([is_broadcast_mac/1, is_multicast_mac/1]).
|
||||
-export([ipv4_to_int/1, int_to_ipv4/1, ips/2, format_ip/1]).
|
||||
@ -28,6 +28,14 @@ format_mac(Mac) when is_binary(Mac) ->
|
||||
Y = [[Hex(X0), Hex(X1)] || <<X0:4, X1:4>> <= Mac],
|
||||
list_to_binary(lists:flatten(lists:join(":", Y))).
|
||||
|
||||
-spec mac_str_to_bin(MacBin :: binary()) -> binary().
|
||||
mac_str_to_bin(MacBin) when is_binary(MacBin) ->
|
||||
% 过滤掉 : 和 -,只保留十六进制字符
|
||||
HexBin = binary:replace(MacBin, <<":">>, <<>>, [global]),
|
||||
HexBin2 = binary:replace(HexBin, <<"-">>, <<>>, [global]),
|
||||
% 解码为 6 字节 MAC 二进制
|
||||
binary:decode_hex(HexBin2).
|
||||
|
||||
%% 生成随机字节
|
||||
rand_byte(Num) when is_integer(Num), Num > 0 ->
|
||||
rand_byte0(Num, <<>>).
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user