From: "Withers, Robert" <rwithers@quallaby.com>
Date: Tue, 26 Nov 2002 17:05:07 -0500
Subject: RE: [e-lang] Serialization in Squeak-E (was: MAC calculation)

Tyler,  I think the network protocol is in VatTP, like you use HTTPS. 
CapTP is the application protocol, like your WOMP and the serialization is
one of {WOS, Java, Squeak}.  Since the api for CapTP is just 5 messages or
so (DeliverOp, DeliverOnlyOp, GCExport, GCAnswer, and Shutdown) it should be
easy  -  err. well ok, not with the 4 or 6 tables...but not bad. tyler

So when you say:


> If you don't have SSL, then continuing with CapTP would be the
> most efficient path. I wish the network protocol of CapTP was
> already stripped out and easily reusable. Putting WOMP on a CapTP
> like network protocol, instead of SSL, is an important goal.

I think you mean the VatTP protocol.  Other than the state machine, you need
to know msg content and all the handshaking and finally the encryption.    I
have this extracted and am fast approaching completion, so perhaps you could
use what I have learned.   Here is my state machine, still only partially
tested: tyler

rob 

"define states, with names, and provide a default transition (action ->
nextState).   add additional transitions, with an event, then a transition
(action -> nextState)"

!VatTPCombinedProtocol class methodsFor: 'class initialization' stamp: 'rww
11/5/2002 09:42'! 
protocol
	"(((VatTPCombinedProtocol protocol)))"

	| desc |
	desc _ StatefulProtocolDescription initialState: #initial. 
	(desc newState: #initial -> (#processInvalidRequest: -> #initial))
		add: #call -> (nil  -> #callingExpectIAm);
		add: #answer -> (nil -> #answeringExpectIWant).
	(desc newState: #connected -> (#processInvalidRequest: -> nil))
		addInteger: 4 -> (#processSuspend: -> nil);
		addInteger: 5 -> (#processPing: -> nil);
		addInteger: 6 -> (#processPong: -> nil);
		addInteger: 7 -> (#processEMsg: -> nil);
		addInteger: 8 -> (#processTunnelMsg: -> nil).
	(desc newState: #suspending -> (#processInvalidRequest: -> nil))
		addInteger: 5 -> (#processPing: -> nil);
		addInteger: 6 -> (#processPong: -> nil);
		addInteger: 7 -> (#processEMsg: -> nil);
		addInteger: 8 -> (#processTunnelMsg: -> nil).
	(desc newState: #suspended -> (#processInvalidRequest: -> nil)).
	(desc newState: #dieing -> (#processInvalidRequest: -> nil)).
	(desc newState: #dead -> (#errorDead: -> nil)).

	(desc newState: #callingExpectIAm ->  (#processInvalidRequest: ->
#callingExpectIAm))
		addInteger: 1 -> (#processProtocolOffered: -> nil);
		addInteger: 2 -> (nil -> #receivingExpectIAm);
		addInteger: 3 -> (#processProtocolAccepted: -> nil);
		addInteger: 4 -> (#processSuspend: -> nil);
		addInteger: 5 -> (#processPing: -> nil);
		addInteger: 6 -> (#processPong: -> nil).
	(desc newState: #answeringExpectIWant -> (#processInvalidRequest: ->
#answeringExpectIWant))
		addInteger: 1 -> (#processProtocolOffered: -> nil);
		addInteger: 2 -> (nil -> #receivingExpectIWant);
		addInteger: 3 -> (#processProtocolAccepted: -> nil);
		addInteger: 4 -> (#processSuspend: -> nil);
		addInteger: 5 -> (#processPing: -> nil);
		addInteger: 6 -> (#processPong: -> nil).
	(desc newState: #expectGiveInfo -> (#processInvalidRequest: ->
#expectGiveInfo))
		addInteger: 2 -> (nil -> #receivingExpectGiveInfo);
		addInteger: 4 -> (#processSuspend: -> nil);
		addInteger: 5 -> (#processPing: -> nil);
		addInteger: 6 -> (#processPong: -> nil).
	(desc newState: #expectReplyInfo -> (#processInvalidRequest: ->
#expectReplyInfo))
		addInteger: 2 -> (nil -> #receivingExpectReplyInfo);
		addInteger: 4 -> (#processSuspend: -> nil);
		addInteger: 5 -> (#processPing: -> nil);
		addInteger: 6 -> (#processPong: -> nil).
	(desc newState: #expectGo -> (#processInvalidRequest: -> #expectGo))
		addInteger: 2 -> (nil -> #receivingExpectGo);
		addInteger: 4 -> (#processSuspend: -> nil);
		addInteger: 5 -> (#processPing: -> nil);
		addInteger: 6 -> (#processPong: -> nil).
	(desc newState: #expectGoToo -> (#processInvalidRequest: ->
#expectGoToo))
		addInteger: 2 -> (nil -> #receivingExpectGoToo);
		addInteger: 4 -> (#processSuspend: -> nil);
		addInteger: 5 -> (#processPing: -> nil);
		addInteger: 6 -> (#processPong: -> nil).

	(desc newState: #receivingExpectIAm ->  (#processInvalidRequest: ->
#dead))
		addInteger: 2 -> (#processDuplicateConnection: -> #dead);
		addInteger: 6 -> (#processIAm: -> #expectReplyInfo);
		addInteger: 8 -> (#processNotMe: -> #dead);
		addInteger: 10 -> (#processTryAnother: -> #dead).
	(desc newState: #receivingExpectIWant -> (#processInvalidRequest: ->
#dead))
		addInteger: 7 -> (#processIWant: -> #expectGiveInfo).
	(desc newState: #receivingExpectGiveInfo -> (#processInvalidRequest:
-> #dead))
		addInteger: 2 -> (#processDuplicateConnection: -> #dead);
		addInteger: 3 -> (#processGiveInfo: -> #expectGo);
		addInteger: 8 -> (#processNotMe: -> #dead).
	(desc newState: #receivingExpectReplyInfo ->
(#processInvalidRequest: -> #dead))
		addInteger: 2 -> (#processDuplicateConnection: -> #dead);
		addInteger: 9 -> (#processReplyInfo: -> #expectGoToo);
		addInteger: 12 -> (#processYouChoose: -> #expectGoToo).
	(desc newState: #receivingExpectGo -> (#processInvalidRequest: ->
#dead))
		addInteger: 2 -> (#processDuplicateConnection: -> #dead);
		addInteger: 4 -> (#processGo: -> #connected);
		addInteger: 11 -> (#processResume: -> #connected).
	(desc newState: #receivingExpectGoToo -> (#processInvalidRequest: ->
#dead))
		addInteger: 1 -> (#processBye: -> #dead);
		addInteger: 5 -> (#processGoToo: -> #connected).
	^desc.
! !
_______________________________________________
e-lang mailing list
e-lang@mail.eros-os.org
http://www.eros-os.org/mailman/listinfo/e-lang