Compare commits
2 Commits
39dd454be0
...
d0a764ac48
| Author | SHA1 | Date | |
|---|---|---|---|
| d0a764ac48 | |||
| 46a7bcca87 |
@ -1,6 +1,6 @@
|
|||||||
syntax = "proto3";
|
syntax = "proto3";
|
||||||
|
|
||||||
package message;
|
//package message;
|
||||||
|
|
||||||
// 基础公共类型定义
|
// 基础公共类型定义
|
||||||
|
|
||||||
|
|||||||
19
proto/tun.proto
Normal file
19
proto/tun.proto
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
// 事件定义
|
||||||
|
|
||||||
|
message NEMessage {
|
||||||
|
// 网络出口ip改变映射变化, 空字符串表示关闭
|
||||||
|
message ExitNodeIpChanged {
|
||||||
|
string ip = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
oneof message {
|
||||||
|
ExitNodeIpChanged exit_node_ip_changed = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
message NEReply {
|
||||||
|
int32 code = 1;
|
||||||
|
string message = 2;
|
||||||
|
}
|
||||||
@ -46,7 +46,7 @@ handle_request("POST", "/network/exit_node_control", _, #{<<"id">> := NetworkId,
|
|||||||
action = Action,
|
action = Action,
|
||||||
remark = Remark
|
remark = Remark
|
||||||
}},
|
}},
|
||||||
case sdlan_network:command(NetworkId, ReceiverPid, ClientId, SubCommand) of
|
case sdlan_network:command(NetworkPid, ReceiverPid, ClientId, SubCommand) of
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
{ok, 200, sdlan_util:json_error(-1, Reason)};
|
{ok, 200, sdlan_util:json_error(-1, Reason)};
|
||||||
{ok, Ref} ->
|
{ok, Ref} ->
|
||||||
|
|||||||
16
swift_pb.sh
Executable file
16
swift_pb.sh
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
rm -rf tmp
|
||||||
|
mkdir tmp
|
||||||
|
cp proto/sdlan.proto tmp/sdlan_pb.proto
|
||||||
|
cp proto/tun.proto tmp/tun_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/
|
||||||
|
|
||||||
|
protoc tun_pb.proto --swift_out=.
|
||||||
|
cp tun_pb.pb.swift TunMessage.pb.swift
|
||||||
|
cp TunMessage.pb.swift /usr/local/code/macos/punchnet/Tun/Punchnet/
|
||||||
Loading…
x
Reference in New Issue
Block a user