--- a/src/internet-node/udp-impl.h Tue Dec 11 10:25:34 2007 +0100
+++ b/src/internet-node/udp-impl.h Tue Dec 11 23:02:47 2007 -0800
@@ -28,12 +28,26 @@
class UdpL4Protocol;
+/**
+ * \brief Object to create UDP socket instances
+ *
+ * This class implements the API for UDP sockets.
+ * It is a socket factory (deriving from class SocketFactory) and can
+ * also hold global variables used to initialize newly created sockets,
+ * such as values that are set through the sysctl or proc interfaces in Linux.
+ */
class UdpImpl : public Udp
{
public:
UdpImpl (Ptr<UdpL4Protocol> udp);
virtual ~UdpImpl ();
+ /**
+ * \return smart pointer to Socket
+ *
+ * Implements a method to create a UdpImpl-based socket and return
+ * a base class smart pointer to the socket.
+ */
virtual Ptr<Socket> CreateSocket (void);
protected:
--- a/src/node/socket-factory.h Tue Dec 11 10:25:34 2007 +0100
+++ b/src/node/socket-factory.h Tue Dec 11 23:02:47 2007 -0800
@@ -28,6 +28,22 @@
class Socket;
+/**
+ * \brief Object to create transport layer instances that provide a
+ * socket API to applications.
+ *
+ * This base class defines the API for creating sockets.
+ * The socket factory also can hold the global variables used to
+ * initialize newly created sockets, such as values that are
+ * set through the sysctl or proc interfaces in Linux.
+
+ * If you want to write a new transport protocol accessible through
+ * sockets, you need to subclass this factory class, implement CreateSocket,
+ * instantiate the object, and aggregate it to the node.
+ *
+ * \see Udp
+ * \see UdpImpl
+ */
class SocketFactory : public Object
{
public:
@@ -35,6 +51,11 @@
SocketFactory ();
+ /**
+ * \return smart pointer to Socket
+ *
+ * Base class method for creating socket instances.
+ */
virtual Ptr<Socket> CreateSocket (void) = 0;
};
--- a/src/node/udp.h Tue Dec 11 10:25:34 2007 +0100
+++ b/src/node/udp.h Tue Dec 11 23:02:47 2007 -0800
@@ -27,6 +27,19 @@
class Socket;
+/**
+ * \brief API to create UDP socket instances
+ *
+ * This abstract class defines the API for UDP sockets.
+ * This class also can hold the global default variables used to
+ * initialize newly created sockets, such as values that are
+ * set through the sysctl or proc interfaces in Linux.
+
+ * All UDP implementations must provide an implementation of CreateSocket
+ * below.
+ *
+ * \see UdpImpl
+ */
class Udp : public SocketFactory
{
public:
@@ -34,6 +47,12 @@
Udp ();
+ /**
+ * \return smart pointer to Socket
+ *
+ * API for creating socket instances; must be implemented by UDP
+ * implementations..
+ */
virtual Ptr<Socket> CreateSocket (void) = 0;
};