Commit d5731209 authored by Martín Ferrari's avatar Martín Ferrari

protocol draft

parent 7906d070
Protocol format:
----------------
RFC 2821-like.
At start-up, server sends 220 code and greeting text
To close the connection and the node, client sends QUIT command, and server
replies with 221 code.
Command Subcmd Arguments Response Effect
QUIT 221 Close the netns
IF LIST [if#] 200 serialised data
IF SET if# key val 200/500 ip link set (1)
IF RTRN if# 200/500 ip link set netns 1
ADDR LIST [if#] 200 serialised data ip addr list
ADDR ADD if# addr_spec 200/500 ip addr add
ADDR DEL if# addr_spec 200/500 ip addr del
ROUT LIST 200 serialised data ip route list
ROUT ADD route_spec 200/500 ip route add
ROUT DEL route_spec 200/500 ip route del
PROC CRTE args_len 354+200/500 (2)
PROC SIN 354+200/500 (3)
PROC SOUT 354+200/500 (3)
PROC SERR 354+200/500 (3)
PROC RUN 200 <pid>/500 (4)
PROC ABRT 200 (4)
PROC POLL <pid> 200 <code>/500 check if process alive
PROC WAIT <pid> 200 <code>/500 waitpid(pid)
PROC KILL <pid> <signal> 200/500 kill(pid, signal)
(1) valid arguments: mtu <n>, state <up|down>, name <name>, lladdr <addr>
(2) After PROC CRTE, only secondary PROC cmds are accepted until finished.
Server waits for serialized data (lenght pre-specified) specifying complex
arguments: cwd, env, argv.
After receiving the arguments, answers with 200 or 500.
(3) Secondary PROC commands, only valid after PROC CRTE. Server reply 354 and
waits for a file descriptor to be passed along with a duplicate of the same
command. Answers 200/500 after processing the file descriptor.
(4) Secondary PROC commands, unconditionally end the PROC transaction. If RUN
was successful, the process is started and the process ID is returned.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment