Index: /source/ariba/AribaModule.h
===================================================================
--- /source/ariba/AribaModule.h	(revision 9662)
+++ /source/ariba/AribaModule.h	(revision 9684)
@@ -67,5 +67,6 @@
 }
 
-/**
+/** \addtogroup public
+ * @{
  * This class implements a container class for ariba base services. Each node
  * is a running using this base-module. It also manages Bootstrap information
@@ -272,3 +273,5 @@
 } // namespace ariba
 
+/** @}*/
+
 #endif /* ENVIRONMENT_H_ */
Index: /source/ariba/CommunicationListener.h
===================================================================
--- /source/ariba/CommunicationListener.h	(revision 9662)
+++ /source/ariba/CommunicationListener.h	(revision 9684)
@@ -52,5 +52,6 @@
 }
 
-/**
+/** \addtogroup public
+ * @{
  * Listener for communication events on links.
  */
@@ -136,3 +137,5 @@
 } // namespace ariba
 
+/** @} */
+
 #endif /* COMMUNICATIONLISTENER_H_ */
Index: /source/ariba/DataMessage.h
===================================================================
--- /source/ariba/DataMessage.h	(revision 9662)
+++ /source/ariba/DataMessage.h	(revision 9684)
@@ -21,4 +21,6 @@
 
 /**
+ * \addtogroup public
+ * @{
  * This class wraps different representations of a message. In its current
  * version is allows to specify binary data (as void*) with a size specifying
@@ -148,3 +150,5 @@
 } // namespace ariba
 
+/** @} */
+
 #endif /* DATAMESSAGE_H_ */
Index: /source/ariba/Identifiers.h
===================================================================
--- /source/ariba/Identifiers.h	(revision 9662)
+++ /source/ariba/Identifiers.h	(revision 9684)
@@ -44,4 +44,7 @@
 #include "ariba/utility/types/LinkID.h"
 #include "ariba/utility/types/SpoVNetID.h"
+/** \addtogroup public
+ * @{
+ */
 
 namespace ariba {
@@ -52,3 +55,5 @@
 } // namespace ariba
 
+/** @} */
+
 #endif /* IDENTIFIERS_H_ */
Index: /source/ariba/LinkProperties.h
===================================================================
--- /source/ariba/LinkProperties.h	(revision 9662)
+++ /source/ariba/LinkProperties.h	(revision 9684)
@@ -54,4 +54,7 @@
 
 /**
+ * \addtogroup public
+ * @{
+ *
  * Link properties storage. Currently empty but will
  * contain properties to create the link in the future
@@ -83,3 +86,5 @@
 } // namespace ariba
 
+/** @} */
+
 #endif /* LINKPROPERTIES_H_ */
Index: /source/ariba/Message.h
===================================================================
--- /source/ariba/Message.h	(revision 9662)
+++ /source/ariba/Message.h	(revision 9684)
@@ -43,8 +43,16 @@
 #include "ariba/utility/messages.h"
 
+/** \addtogroup public
+ * @{
+ */
+
+
 namespace ariba {
 	typedef uint16_t seqnum_t;
+	//! \addtogroup public
 	typedef utility::Message Message;
 } // namespace ariba
 
+/** @} */
+
 #endif /* MESSAGE_H_ */
Index: /source/ariba/Module.h
===================================================================
--- /source/ariba/Module.h	(revision 9662)
+++ /source/ariba/Module.h	(revision 9684)
@@ -50,4 +50,7 @@
 
 /**
+ * \addtogroup public
+ * @{
+ *
  * This class serves as base class for generic modules that
  * can be initialized, started, stopped and configured using standard
@@ -110,3 +113,5 @@
 } // namespace ariba
 
+/** @} */
+
 #endif /* MODULE_H_ */
Index: /source/ariba/Name.cpp
===================================================================
--- /source/ariba/Name.cpp	(revision 9662)
+++ /source/ariba/Name.cpp	(revision 9684)
@@ -38,4 +38,8 @@
 
 #include "Name.h"
+
+#include "ariba/utility/types/Identifier.h"
+
+using ariba::utility::Identifier;
 
 std::ostream& operator<<( std::ostream& s, const ariba::Name& n ) {
Index: /source/ariba/Name.h
===================================================================
--- /source/ariba/Name.h	(revision 9662)
+++ /source/ariba/Name.h	(revision 9684)
@@ -56,4 +56,7 @@
 
 /**
+ * \addtogroup public
+ * @{
+ *
  * This class is a wrapper for canonical names.
  * Currently only human readable names are supported.
@@ -159,3 +162,5 @@
 } // namespace ariba
 
+/** @} */
+
 #endif /* NAME_H_ */
Index: /source/ariba/Node.h
===================================================================
--- /source/ariba/Node.h	(revision 9662)
+++ /source/ariba/Node.h	(revision 9684)
@@ -67,4 +67,7 @@
 
 /**
+ * \addtogroup public
+ * @{
+ *
  * This class should implement all ariba node functionality.
  *
@@ -338,3 +341,5 @@
 } // namespace ariba
 
+/** @} */
+
 #endif /* NODE_H_ */
Index: /source/ariba/NodeListener.h
===================================================================
--- /source/ariba/NodeListener.h	(revision 9662)
+++ /source/ariba/NodeListener.h	(revision 9684)
@@ -50,4 +50,7 @@
 
 /**
+ * \addtogroup public
+ * @{
+ *
  * This class is used to inform a listener about node changes.
  *
@@ -98,3 +101,5 @@
 } // namespace ariba
 
+/** @} */
+
 #endif /* NODELISTENER_H_ */
Index: /source/ariba/SideportListener.h
===================================================================
--- /source/ariba/SideportListener.h	(revision 9662)
+++ /source/ariba/SideportListener.h	(revision 9684)
@@ -61,4 +61,7 @@
 
 /**
+ * \addtogroup public
+ * @{
+ *
  * A sideport class to gather advanced information about nodes, links,
  * their endpoints and get information about all link activity on a node.
@@ -265,3 +268,5 @@
 } // namespace ariba
 
+/** @} */
+
 #endif // SIDEPORTLISTENER_H_
Index: /source/ariba/SpoVNetProperties.h
===================================================================
--- /source/ariba/SpoVNetProperties.h	(revision 9662)
+++ /source/ariba/SpoVNetProperties.h	(revision 9684)
@@ -57,4 +57,7 @@
 
 /**
+ * \addtogroup public
+ * @{
+ *
  * This class implements a container that holds all properties of a
  * SpoVNet instance. It may evolve with new features when new features
@@ -117,3 +120,5 @@
 } // namespace ariba
 
+/** @} */
+
 #endif /* SPOVNETPROPERTIES_H_ */
Index: /source/ariba/communication/BaseCommunication.h
===================================================================
--- /source/ariba/communication/BaseCommunication.h	(revision 9662)
+++ /source/ariba/communication/BaseCommunication.h	(revision 9684)
@@ -131,11 +131,8 @@
 
 	/// Establishes a link to another end-point.
-	const LinkID establishLink(const EndpointDescriptor& descriptor,
-		const LinkID& linkid = LinkID::UNSPECIFIED, const QoSParameterSet& qos =
-				QoSParameterSet::DEFAULT, const SecurityParameterSet& sec =
-				SecurityParameterSet::DEFAULT);
+	const LinkID establishLink(const EndpointDescriptor& descriptor );
 
 	/// Drops a link
-	void dropLink(const LinkID link);
+	void dropLink( LinkID link );
 
 	/**
@@ -146,5 +143,5 @@
 	 * @return A sequence number for this message
 	 */
-	seqnum_t sendMessage(const LinkID lid, const Message* message);
+	seqnum_t sendMessage( LinkID lid, const Message* message );
 
 	/**
@@ -154,6 +151,6 @@
 	 * @return The end-point descriptor of the link's end-point
 	 */
-	const EndpointDescriptor& getEndpointDescriptor(const LinkID link =
-			LinkID::UNSPECIFIED) const;
+	const EndpointDescriptor& getEndpointDescriptor(
+			LinkID link = LinkID::UNSPECIFIED) const;
 
 	/**
@@ -212,11 +209,6 @@
 	class LinkDescriptor {
 	public:
-
 		/// default constructor
-		LinkDescriptor() :
-			localLink(LinkID::UNSPECIFIED), localLocator(NULL),
-			remoteLink(LinkID::UNSPECIFIED), remoteLocator(NULL),
-			up(false) {
-		}
+		LinkDescriptor() : up(false), id(), localLocator(NULL), remoteLocator(NULL) {}
 
 		~LinkDescriptor() {
@@ -226,28 +218,19 @@
 
 		bool isUnspecified() const {
-			return (this == &UNSPECIFIED());
+			return id.isUnspecified();
 		}
 
-		static LinkDescriptor& UNSPECIFIED(){
-			static LinkDescriptor* unspec = NULL;
-			if(unspec == NULL) unspec = new LinkDescriptor();
-			return *unspec;
-		}
-
-		bool unspecified;
-
-		/// link identifiers
-		LinkID localLink;
+		/// flag, whether this link is up
+		bool up;
+
+		/// link identifier
+		LinkID id;
+
+		/// locators
 		const address_v* localLocator;
-
-		/// used underlay addresses for the link
-		LinkID remoteLink;
 		const address_v* remoteLocator;
 
 		/// the remote end-point descriptor
 		EndpointDescriptor remoteEndpoint;
-
-		/// flag, whether this link is up
-		bool up;
 	};
 
@@ -259,14 +242,11 @@
 
 	/// Link management: add a link
-	void addLink( LinkDescriptor* link );
+	LinkDescriptor& addLink( LinkID link );
 
 	/// Link management: remove a link
-	void removeLink(const LinkID& localLink);
+	void removeLink( LinkID link);
 
 	/// Link management: get link information using the local link
-	LinkDescriptor& queryLocalLink(const LinkID& localLink) const;
-
-	/// Link management: get link information using the remote link
-	LinkDescriptor& queryRemoteLink(const LinkID& remoteLink) const;
+	LinkDescriptor& queryLink( LinkID link) const;
 
 	/// The local end-point descriptor
@@ -307,9 +287,9 @@
 	/// convenience: send message to peer
 	void send( Message* message, const EndpointDescriptor& endpoint );
+
 	void send( Message* message, const LinkDescriptor& descriptor );
 
 	/// state of the base communication
 	bool started;
-
 };
 
Index: /source/ariba/communication/messages/AribaBaseMsg.cpp
===================================================================
--- /source/ariba/communication/messages/AribaBaseMsg.cpp	(revision 9662)
+++ /source/ariba/communication/messages/AribaBaseMsg.cpp	(revision 9684)
@@ -44,8 +44,6 @@
 vsznDefault(AribaBaseMsg);
 
-AribaBaseMsg::AribaBaseMsg( type_ _type,
-	const LinkID& localLink, const LinkID& remoteLink ) :
-	type((uint8_t)_type),
-	localLink(localLink),remoteLink(remoteLink) {
+AribaBaseMsg::AribaBaseMsg( type_ _type, LinkID link ) :
+	type((uint8_t)_type), link(link){
 }
 
Index: /source/ariba/communication/messages/AribaBaseMsg.h
===================================================================
--- /source/ariba/communication/messages/AribaBaseMsg.h	(revision 9662)
+++ /source/ariba/communication/messages/AribaBaseMsg.h	(revision 9684)
@@ -41,7 +41,9 @@
 
 #include <string>
-#include <boost/cstdint.hpp>
+#include <stdint.h>
+
 #include "ariba/utility/messages.h"
 #include "ariba/utility/serialization.h"
+
 #include "ariba/utility/types/LinkID.h"
 #include "ariba/utility/types/Address.h"
@@ -72,8 +74,5 @@
 	};
 
-	AribaBaseMsg( type_ type = typeData,
-			const LinkID& localLink = LinkID::UNSPECIFIED,
-			const LinkID& remoteLink = LinkID::UNSPECIFIED );
-
+	AribaBaseMsg( type_ type = typeData, LinkID link = LinkID::UNSPECIFIED );
 	virtual ~AribaBaseMsg();
 
@@ -84,10 +83,6 @@
 	}
 
-	const LinkID& getLocalLink() const {
-		return localLink;
-	}
-
-	const LinkID& getRemoteLink() const {
-		return remoteLink;
+	const LinkID& getLink() const {
+		return link;
 	}
 
@@ -101,11 +96,11 @@
 
 private:
-	uint8_t type;		// the link message type
+	// link message type
+	uint8_t type;
 
-	// remote and local link ids
-	LinkID localLink;	// the local link id
-	LinkID remoteLink;	// the remote link id
+	// link identifier
+	LinkID  link;
 
-	// remote and local endpoint descriptors
+	// remote and local endpoint descriptors (link reply/request only)
 	EndpointDescriptor localDescriptor;
 	EndpointDescriptor remoteDescriptor;
@@ -115,7 +110,8 @@
 
 sznBeginDefault( ariba::communication::AribaBaseMsg, X ) {
-	X && type && &localLink && &remoteLink;
-	if (type == typeLinkReply || type == typeLinkRequest)
+	X && type && link;
+	if (type == typeLinkReply || type == typeLinkRequest) {
 		X && localDescriptor && remoteDescriptor;
+	}
 	X && Payload();
 } sznEnd();
Index: /source/ariba/utility/serialization/Data.hpp
===================================================================
--- /source/ariba/utility/serialization/Data.hpp	(revision 9662)
+++ /source/ariba/utility/serialization/Data.hpp	(revision 9684)
@@ -351,5 +351,5 @@
 	}
 public:
-	finline DefaultDataModel() {
+	DefaultDataModel() {
 		bufferPtr = NULL;
 		bufferLen = -1;
Index: /source/ariba/utility/types/LinkID.cpp
===================================================================
--- /source/ariba/utility/types/LinkID.cpp	(revision 9662)
+++ /source/ariba/utility/types/LinkID.cpp	(revision 9684)
@@ -39,35 +39,51 @@
 #include "LinkID.h"
 
+#include <boost/unordered_map.hpp>
+
 namespace ariba {
 namespace utility {
 
-const LinkID LinkID::UNSPECIFIED; // for this link isvalid is always false!
+/// the unspecified link id
+const LinkID LinkID::UNSPECIFIED;
 
-LinkID::LinkID() : isvalid(false) {
+const char* UNSPECIFIED_LINK 	= "<LINKID-UNSPECIFIED>";
+const char* UNKNOWN_LINK 		= "<LINKID-UNKNOWN>";
+const char* NULL_INFO 			= "<NO-INFO-AVAILABLE>";
+
+boost::unordered_map<uint16_t, const char*> link_ids;
+
+bool LinkID::isValid( const LinkID& id ) {
+	return link_ids.count(id.local_id)!=0;
 }
 
-LinkID::LinkID(const Identifier& identifier) : Identifier(identifier), isvalid(true) {
+const char* LinkID::getInfo( const LinkID& id ) {
+	if (!id.valid())
+		return UNSPECIFIED_LINK;
+	if ( link_ids.count(id.local_id) == 0 )
+		return UNKNOWN_LINK;
+	const char* info = link_ids.find( id.local_id )->second;
+	if (info == NULL)
+		return NULL_INFO;
+	return info;
 }
 
-LinkID::~LinkID() {
+/// create a new locally unique link id
+LinkID LinkID::create( const char* info ) {
+	assert( link_ids.size() != 0xFFFE );
+	uint16_t id;
+	do {
+		id = rand() & 0xFFFF;
+	} while (id == 0 || link_ids.count(id) != 0);
+	link_ids.insert( std::make_pair(id, info) );
+	return LinkID(id);
 }
 
-LinkID::LinkID(const LinkID& rh) : Identifier(rh) {
+/// free a locally unique link id
+void LinkID::destroy( const LinkID& id ) {
+	link_ids.erase(id.local_id);
 }
 
-LinkID& LinkID::operator=(const LinkID& rh){
-
-	Identifier::operator=( rh );
-	this->isvalid = rh.isvalid;
-
-	return *this;
-}
-
-bool LinkID::valid(){
-	return isvalid;
-}
-
-LinkID LinkID::create() {
-	return LinkID( Identifier::random() );
+std::ostream& operator<<(std::ostream& s, const LinkID& id ) {
+	return s << id.toString();
 }
 
Index: /source/ariba/utility/types/LinkID.h
===================================================================
--- /source/ariba/utility/types/LinkID.h	(revision 9662)
+++ /source/ariba/utility/types/LinkID.h	(revision 9684)
@@ -40,9 +40,14 @@
 #define LINKID_H_
 
+#include <stdlib.h>
+#include <stdint.h>
+#include <stdio.h>
+
 #include <vector>
-#include "ariba/utility/types/Identifier.h"
+#include <string>
+
+#include "ariba/utility/serialization.h"
 
 using std::vector;
-using ariba::utility::Identifier;
 
 namespace ariba {
@@ -50,26 +55,190 @@
 
 /**
- * Represents a link from the base communication.
+ * The link id identifies a link between two devices/nodes.
+ *
+ * Its a 32-bit value, that is composed out of two 16-bit values
+ * identifing a initiator and acceptor id.
  */
-class LinkID : public Identifier {
+class LinkID {
+private:
+	uint16_t local_id;
+	uint16_t initiator_id;
+	uint16_t acceptor_id;
+
+
+	LinkID(uint16_t local_id) {
+		this->local_id = local_id;
+		this->initiator_id = 0;
+		this->acceptor_id = 0;
+	}
+
+	/// returns the full id
+	inline uint32_t getFullId() const {
+		return (initiator_id << 16) + acceptor_id;
+	}
+
+	inline int compareTo( const LinkID& rhs ) const {
+		// compare local id
+		if (rhs.isLocal() && this->isLocal())
+			return local_id - rhs.local_id;
+
+		// compare initiator id
+		else if ((initiator_id == 0 || rhs.initiator_id == 0)
+				&& (acceptor_id == rhs.acceptor_id) ) return 0;
+
+		// compare acceptor id
+		else if ((acceptor_id == 0 || rhs.acceptor_id == 0)
+				&& (initiator_id == rhs.initiator_id) ) return 0;
+
+		// compare full id
+		else if (getFullId() == rhs.getFullId()) return 0;
+		else if (getFullId() <  rhs.getFullId()) return -1;
+		else if (getFullId() >  rhs.getFullId()) return 1;
+		return -1;
+	}
+
+	static const char* getInfo( const LinkID& id );
+
+	static bool isValid( const LinkID& id );
+
 public:
+	/// the unspecified link id
 	static const LinkID UNSPECIFIED;
 
-	LinkID();
-	LinkID(const LinkID& rh);
-	LinkID(const Identifier& identifier);
-	virtual ~LinkID();
-	LinkID& operator=(const LinkID& rh);
-
-	bool valid();
-	static LinkID create();
-
-private:
-	bool isvalid;
+	/// create a new locally unique link id
+	static LinkID create( const char* info = NULL );
+
+	/// free a locally unique link id
+	static void destroy( const LinkID& id );
+
+	/// construct a unspecified id
+	LinkID() {
+		local_id = 0;
+		initiator_id = 0;
+		acceptor_id = 0;
+	}
+
+	/// copy constructor
+	LinkID( const LinkID& rh );
+
+	/// assigns another link id
+	LinkID& operator=(const LinkID& rh) {
+		local_id = rh.local_id;
+		initiator_id = rh.initiator_id;
+		acceptor_id = rh.acceptor_id;
+		return *this;
+	}
+
+	/// returns true, if the local link id is known and registered
+	bool isValid() const {
+		return isValid(*this);
+	}
+
+	bool isUnspecified() const {
+		return local_id == 0 && initiator_id == 0 && acceptor_id == 0;
+	}
+
+	/// returns true, if this is a local id only
+	bool isLocal() const {
+		return acceptor_id == 0 && initiator_id == 0;
+	}
+
+	/// returns true, if this is a remote id only
+	bool isRemote() const {
+		return local_id == 0;
+	}
+
+	/// returns true, if this is a full link id (with acceptor/initiator id)
+	bool isLink() const {
+		return acceptor_id != 0 && initiator_id != 0;
+	}
+
+	/// returns the local id
+	uint16_t getLocalId() const {
+		return local_id;
+	}
+
+	/// returns the remote id
+	uint16_t getRemoteId() const {
+		return local_id == initiator_id ? acceptor_id : initiator_id;
+	}
+
+	/// returns the initiators local link id
+	uint16_t getInitiatorId() const {
+		return initiator_id;
+	}
+
+	/// returns the acceptors local link id
+	uint16_t getAcceptorId() const {
+		return acceptor_id;
+	}
+
+	/// sets the local initiator id of the link
+	/// if id is unspecified a new local id is used as initiator id
+	void setInitiatorId( const LinkID& id = UNSPECIFIED ) {
+		assert(initiator_id == 0);
+		if ( id == UNSPECIFIED ) {
+			assert(local_id == 0);
+			local_id = LinkID::create().local_id;
+			initiator_id = local_id;
+		} else {
+			assert(local_id == acceptor_id && id.local_id == 0 && id.initiator_id != 0);
+			initiator_id = id.initiator_id;
+		}
+	}
+
+	/// sets the local acceptor id of the link
+	/// if id is unspecified a new local id is used as acceptor id
+	void setAcceptorId( const LinkID& id = UNSPECIFIED ) {
+		assert(acceptor_id == 0);
+		if ( id == UNSPECIFIED ) {
+			assert(local_id == 0);
+			local_id = LinkID::create().local_id;
+			acceptor_id = local_id;
+		} else {
+			assert(local_id == initiator_id && id.local_id == 0 && id.acceptor_id != 0);
+			acceptor_id = id.acceptor_id;
+		}
+	}
+
+	void combine( const LinkID& id ) {
+
+	}
+
+	/// returns a string representation of the link id
+	std::string toString() const {
+		char str[20];
+		if (isLocal())
+			sprintf(str, "l%04x", local_id);
+		else
+			sprintf(str, "i%04x.a%04x", initiator_id, acceptor_id );
+		return std::string(str);
+	}
+
+	/// returns the info of the link id
+	const char* getInfo() const {
+		return getInfo(*this);
+	}
+
+	/// convenience operators
+	bool operator==( const LinkID& rhs ) const { return compareTo(rhs) == 0; }
+	bool operator!=( const LinkID& rhs ) const { return compareTo(rhs) != 0; }
+	bool operator< ( const LinkID& rhs ) const { return compareTo(rhs) <  0; }
+	bool operator<=( const LinkID& rhs ) const { return compareTo(rhs) <= 0; }
+	bool operator> ( const LinkID& rhs ) const { return compareTo(rhs) >  0; }
+	bool operator>=( const LinkID& rhs ) const { return compareTo(rhs) >= 0; }
 };
 
+std::ostream& operator<<(std::ostream& s, const LinkID& id );
+
 typedef vector<LinkID> LinkIDs;
 
 }} // namespace ariba, utility
 
+sznBeginDefault( ariba::utility::LinkID, X ) {
+	if (X.isDeserializer()) local_id = 0;
+	X && initiator_id && acceptor_id;
+} sznEnd();
+
+
 #endif /* LINKID_H_ */
