Vlan server protocol and library *draft* ======================================== telnet-based protocol. Client commands are text, server responses are numbers followed by an explicative text (like irc). Common messages number should probalbly be grouped. Two different notions: session and connexion session has a long timeout (several hours), and should not use server-side resources connexion has a short timeout (a few minutes) and can use server-side resources (thread) A vlan resource (switch+port) is identified by a unique id. Changes can obviously be done with this id, but also, for administrative facilities, with other identifiers. Client commands: LOGIN [] -> open connexion, required before any communication with server. Login and password should correspond to groups (admin, users...) rather than individual ids. Application is for stats. answers: 100: ok 101: rejected, invalid login 102: rejected, too many connexions 103: rejected, forbidden source 104: rejected, already logged in 109: rejected, other reason password required PASS LOGOUT -> close connexion answer: 200: ok, session closed OPEN -> open session. required before any write operations answers: 300: 301: rejected, not authorized 302: rejected, too many sessions 399: rejected, other reason RECOVER -> recover session. Both id are required for security. answer: 400: ok 401: rejected, not authorized (invalid login or something else) 402: rejected, invalid ids 403: rejected, session already active on another connexion 499: rejected, other reason CLOSE [] -> close session. Session must be active for normal users. answer: 500: ok, session closed 501: error, not loged in 502: error: active session 503: error: not authorized STATUS ME STATUS MAC STATUS IP STATUS ID give informations about something answer: 600: mark beginning of status info 601: mark end of status info 602: error, not authorized 603: error, unknown 604: error, request failed 610: 611: 612: 613: 614: 615: 616: 617: 699: error, other reason LOCK ME LOCK MAC LOCK IP LOCK ID lock a resource id (session required) answers: UNLOCK ME UNLOCK MAC UNLOCK IP UNLOCK ID unlock a resource id (session required) answers: CHANGE ME CHANGE MAC CHANGE IP CHANGE ID change a vlan (session required) Administrative commands: HELP print list of commands answer: KICK RESET LIST IDS LIST MACS LIST IPS LIST SESSIONS LIST CONNECTIONS LIST LOGINS QUIT CONFIRM