Index: source/ariba/overlay/modules/onehop/OneHop.h
===================================================================
--- source/ariba/overlay/modules/onehop/OneHop.h	(revision 12775)
+++ source/ariba/overlay/modules/onehop/OneHop.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef _ONE_HOP_H
@@ -42,18 +42,26 @@
 #include <map>
 #include "ariba/overlay/modules/OverlayInterface.h"
+#include "ariba/overlay/modules/onehop/messages/OneHopMessage.h"
+#include "ariba/overlay/modules/onehop/messages/NodeListingRequest.h"
+#include "ariba/overlay/modules/onehop/messages/NodeListingReply.h"
 #include "ariba/utility/logging/Logging.h"
-#include "ariba/utility/system/Timer.h"
 
 using std::map;
-using ariba::utility::Timer;
+using ariba::overlay::OverlayInterface;
+using ariba::overlay::OneHopMessage;
+using ariba::overlay::NodeListingRequest;
+using ariba::overlay::NodeListingReply;
 
 namespace ariba {
 namespace overlay {
 
-class OneHop : public OverlayInterface, protected Timer {
+class OneHop : public OverlayInterface {
 	use_logging_h( OneHop );
 public:
-	OneHop(BaseOverlay& _overlay, const NodeID& _nodeid,
-			OverlayStructureEvents* _eventsReceiver, const OverlayParameterSet& param);
+	OneHop(
+		BaseOverlay& _overlay,
+		const NodeID& _nodeid,
+		OverlayStructureEvents* _eventsReceiver
+	);
 
 	virtual ~OneHop();
@@ -61,64 +69,50 @@
 protected:
 
-	/// @see Timer.h
-	virtual void eventFunction();
+	//
+	// OverlayInterface.h
+	//
 
-	/// @see OverlayInterface.h
 	virtual void createOverlay();
-
-	/// @see OverlayInterface.h
 	virtual void deleteOverlay();
 
-	/// @see OverlayInterface.h
-	virtual void joinOverlay(const EndpointDescriptor& boot =
-			EndpointDescriptor::UNSPECIFIED());
-
-	/// @see OverlayInterface.h
+	virtual void joinOverlay(const EndpointDescriptor& bootstrapEp = EndpointDescriptor::UNSPECIFIED);
 	virtual void leaveOverlay();
 
-	/// @see OverlayInterface.h
-	virtual const EndpointDescriptor& resolveNode(const NodeID& node);
+	virtual const EndpointDescriptor& resolveNode( const NodeID& node );
+	virtual void routeMessage( const NodeID& destnode, Message* msg );
 
-	/// @see OverlayInterface.h
-	virtual bool isClosestNodeTo( const NodeID& node );
+	virtual NodeList getKnownNodes() const;
 
-	/// @see OverlayInterface.h
-	virtual const LinkID& getNextLinkId( const NodeID& id ) const;
-	
-	/// @see OverlayInterface.h
-	virtual const NodeID& getNextNodeId( const NodeID& id ) const;
+	//
+	// see ServiceInterface.h and OverlayInterface.h
+	//
 
-	/// @see OverlayInterface.h
-	virtual void routeMessage(const NodeID& destnode, Message* msg);
-
-	/// @see OverlayInterface.h
-	virtual void routeMessage(const NodeID& node, const LinkID& link, Message* msg);
-
-	/// @see OverlayInterface.h
-	virtual NodeList getKnownNodes(bool deep = true) const;
-
-	/// @see CommunicationListener.h or @see OverlayInterface.h
-	virtual void onLinkUp(const LinkID& lnk, const NodeID& remote);
-
-	/// @see CommunicationListener.h or @see OverlayInterface.h
-	virtual void onLinkDown(const LinkID& lnk, const NodeID& remote);
-
-	/// @see CommunicationListener.h or @see OverlayInterface.h
-	virtual void onMessage(const DataMessage& msg, const NodeID& remote,
-			const LinkID& lnk = LinkID::UNSPECIFIED);
+	virtual void onLinkUp( const LinkID& link, const NodeID& local, const NodeID& remote );
+	virtual void onLinkDown( const LinkID& link, const NodeID& local, const NodeID& remote );
+	virtual bool receiveMessage( const Message* message, const LinkID& link, const NodeID& node );
 
 private:
-	/// The other nodes in the overlay
-	typedef map<const NodeID, const LinkID> OverlayNodeMapping;
+
+	/**
+	 * The other nodes in the overlay
+	 */
+	typedef map<const NodeID,const LinkID> OverlayNodeMapping;
 	OverlayNodeMapping overlayNodes;
 
-	/// The current state of the overlay
+	/**
+	 * The current state of the overlay
+	 */
 	typedef enum _OneHopState {
-		OneHopStateInvalid = 0,
-		OneHopStateCompleted = 1,
+		OneHopStateInvalid                = 0,
+		OneHopStateJoinInitiated          = 1,
+		OneHopStateJoinListingRequested   = 2,
+		OneHopStateCompleted              = 3,
 	} OneHopState;
 
 	OneHopState state;
-	vector<LinkID> bootstrapLinks;
+
+	uint16_t pendingLinks;
+	LinkID bootstrapLink;
+
 };
 
