This commit is contained in:
anlicheng 2026-04-09 11:30:13 +08:00
parent 39dd454be0
commit 46a7bcca87
3 changed files with 36 additions and 1 deletions

View File

@ -1,6 +1,6 @@
syntax = "proto3";
package message;
//package message;
//

19
proto/tun.proto Normal file
View 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;
}

16
swift_pb.sh Executable file
View 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/