This article defines the IPC protocol between the xivpn app (java) and libxivpn.
Server: android app
Client: libxivpn
Server must pass the path where the unix domain socket is listening on via IPC_PATH environment variable. The path is usually /data/data/io.github.exclude0122.xivpn/cache/ipcsock.
ping\n
Receiver must reply with Pong. Server should send this packet along with the fd to the TUN device.
pong\n
stop\n
Client must exit after receiving this message.
protect\n
Client must send this packet followed by sending a fd. Client must not send any new protect requests until the previous protect request has been acknowledged.
protect_ack\n
Server must send this packet once the fd sent from the client has been protected.
find_process tcp/udp local_ip local_port remote_ip remote_port\n
Client must not send any new protect requests until the previous find process request has been acknowledged.
find_process_resp [uid]\n
If uid could not be determined, return -1.