The cynagora protocol ===================== Introduction ------------ ### Notations: - c->s: from client to cynagora server - s->c: from cynagora server to client - EXPIRE: if missing, means forever if positive, a number of second since EPOCH, invalid after it - CACHEID: a 32 bits positive integer - ID: a string Messages -------- ### hello synopsis: c->s cynagora 1 s->c done 1 CACHEID The client present itself with the version of the protocol it expects to speak (today version 1 only). The server answer yes with the acknoledged version it will use and the CACHEID that identify the cache (see note on CACHEID) If hello is used, it must be the first message. If it is not used, the protocol implicitely switch to the default version. ### invalidate cache synopsis: s->c clear CACHEID The server ask the client to clear its cache and to start the cache whose identifier is CACHEID ### test a permission synopsis: c->s test ID CLIENT SESSION USER PERMISSION s->c (ack|yes|no) ID [EXPIRE] ### check a permission synopsis: c->s check ID CLIENT SESSION USER PERMISSION s->c (yes|no) ID [EXPIRE] ### enter critical (admin) synopsis: c->s enter s->c done ### leave critical (admin) synopsis: c->s leave [commit|rollback] s->c done|error ... ### erase (admin) synopsis: c->s drop CLIENT SESSION USER PERMISSION s->c done|error ... ### set (admin) synopsis: c->s set CLIENT SESSION USER PERMISSION VALUE [EXPIRE] s->c done|error ... ### list permissions (admin): synopsis: c->s get CLIENT SESSION USER PERMISSION s->c item CLIENT SESSION USER PERMISSION VALUE [EXPIRE] s->c ... s->c done ### logging set/get (admin) synopsis: c->s log [on|off] s->c done (on|off) ### register agent (agent) synopsis: c->s agent NAME s->c done|error ... ### ask agent (agent): synopsis: s->c ask ASKID NAME VALUE CLIENT SESSION USER PERMISSION c->s reply ASKID ([yes|no] [always|session|one-time|EXPIRE]) ### sub check (agent): synopsis: c->s sub ASKID ID CLIENT SESSION USER PERMISSION s->c (yes|no) ID [EXPIRE] Notes ----- ### CACHEID The cacheid identify the current cache. It changes each time the database changes. After a disconnection, clients can use HELLO to check whether their version of cache is still valid. This is implemented by the default C library.