From: Mario D. S. <md...@me...> - 2002-06-28 20:22:40
|
We've hammered out the protocol meta-spec. It'll be useful to formalize the individual details. It'll help the refactoring slide into place more quickly and comfortably. macs looks like |--> AUS <--| methods <--|--> RPS <--|--> clients |--> ATS <--| Below, words in MiXeD CaSe are case-insensitive. Words in <angle-brackets> describe the data that goes in that spot. Words are always single-space delimited. Morsels are free-form, with explicit lengths. For each of the 6 different protocols, there are some paragraphs below. The first line in each paragraph describes the request, the rest of the lines describe possible replies. This isn't an RFC or anything, so you can figure out who sends the request and who the replies. To save space and reduce redundancy, I'll say here that the following reply is always possible: REP ERR <err_len> END\n<err> Note that <GaRbAgE> is how I spell "method name goes here but it's useless so you can put whatever you want except whitespace." It can (and should) be the empty string. Now, notice the hack in the AUS LOGIN call. We've got two potential items with spaces, the login and passwd. In fact, they're both potentially binary data, eg, using a public-key signature, or a thumb print. (This is the sort of problem we run into when we don't encode. In fact, even XML doesn't let you stick random binary data in there.) So we stick them both back to back in the adm and give an offset. Seem broken to you? Take this, I suppose, and massage it into something that makes sense for you as you write stuff, and back and forth until everybody's happy. Or too tired to care. AUS <--> clients AUS PING <adm_len> <GaRbAgE> END\n<adm> REP PONG <adm_len> END\n<adm> AUS LOGIN <lp_len> <MeTh> <login_len> <ip> <port> END\n<login and passwd> REP YES <skey_len> END\n<skey> REP NO 0 END\n AUS AUTH <skey_len> <GaRbAgE> <ip> <port> END\n<skey> REP YES <uid> END\n REP NO 0 END\n AUS LOGOUT <skey_len> <GaRbAgE> END\n<skey> REP OK <skey_len> END\n<skey> AUS <--> methods AUS REG 0 <MeTh> END\n REP OK 0 END\n AUS DEREG 0 <MeTh> END\n REP OK 0 END\n LMC AUTH <lp_len> <MeTh> <login_len> END\n<login and passwd> REP YES <rule_len> END\n<rule> REP NO <msg_len> END\n<msg> RPS <--> clients RPS PING <adm_len> <GaRbAgE> END\n<adm> REP PONG <adm_len> END\n<adm> RPS GET 0 <MeTh> <res_id> <res_path> <ns_id> <ns_path> <type> END\n REP OK <len> <res_id> <res_path> <ns_id> <ns_path> <type> END\n<val> RPS SET <len> <MeTh> <res_id> <res_path> <ns_id> <ns_path> <type> END\n<val> REP OK <len> <res_id> <res_path> <ns_id> <ns_path> <type> END\n<val> RPS DEL 0 <MeTh> <res_id> <res_path> <ns_id> <ns_path> <type> END\n REP OK <len> <res_id> <res_path> <ns_id> <ns_path> <type> END\n<val> RPS <--> methods RPS REG 0 <MeTh> END\n REP OK 0 END\n RPS DEREG 0 <MeTh> END\n REP OK 0 END\n PMC GET 0 <MeTh> <res_id> <res_path> <ns_id> <ns_path> <type> END\n REP OK <len> <res_id> <res_path> <ns_id> <ns_path> <type> END\n<val> PMC SET <len> <MeTh> <res_id> <res_path> <ns_id> <ns_path> <type> END\n<val> REP OK <len> <res_id> <res_path> <ns_id> <ns_path> <type> END\n<val> PMC DEL 0 <MeTh> <res_id> <res_path> <ns_id> <ns_path> <type> END\n REP OK <len> <res_id> <res_path> <ns_id> <ns_path> <type> END\n<val> ATS <--> clients ATS PING <adm_len> <GaRbAgE> END\n<adm> REP PONG <adm_len> END\n<adm> ATS LOGIN 0 <MeTh> <uid> END\n REP YES 0 <grp_id> [<grp_id> ...] END\n REP NO 0 END\n ATS AUTH 0 <MeTh> <uid> <action> <res_id> <res_path> END\n REP YES 0 END\n REP NO 0 END\n ATS LOGOUT 0 <MeTh> <uid> END\n REP OK 0 END\n ATS <--> methods ATS REG 0 <MeTh> END\n REP OK 0 END\n ATS DEREG 0 <MeTh> END\n REP OK 0 END\n AMC LOGIN 0 <MeTh> <uid> <action> END\n REP YES <rule_len> END\n<rule> REP NO <msg_len> END\n<msg> AMC AUTH 0 <MeTh> <uid> <action> <res_id> <res_path> END\n REP YES 0 END\n REP NO <msg_len> END\n<msg> AMC LOGOUT 0 <MeTh> <uid> END\n REP OK 0 END\n |