Skip to content

Latest commit

 

History

History
87 lines (51 loc) · 1.52 KB

File metadata and controls

87 lines (51 loc) · 1.52 KB

IPC Protocol

This article defines the IPC protocol between the xivpn app (java) and libxivpn.

Definition

Server: android app
Client: libxivpn

IPC Socket

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.

Packets

Ping (Clientbound & Serverbound)

ping\n

Receiver must reply with Pong. Server should send this packet along with the fd to the TUN device.

Pong (Clientbound & Serverbound)

pong\n

Stop (Clientbound)

stop\n

Client must exit after receiving this message.

Protect (Serverbound)

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 (Clientbound)

protect_ack\n

Server must send this packet once the fd sent from the client has been protected.

Find process (Serverbound)

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 response (Clientbound)

find_process_resp [uid]\n

If uid could not be determined, return -1.

Stats Request (Clientbound)

stats\n

Stats Response (Clientbound)

stats_resp [bytes read] [bytes written]\n

Returns the total number of bytes read from and written to the tun interface.