From c86c3ce16d8c0b8c52c464115b2dd10bbfa801f9 Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Fri, 1 Feb 2008 19:37:27 +0000 Subject: [PATCH 1/4] UDP sockets are fixed, remove the hack and note. --- src/routing/olsr/olsr-agent-impl.cc | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/routing/olsr/olsr-agent-impl.cc b/src/routing/olsr/olsr-agent-impl.cc index 5ecb1dde3..bbfde8de2 100644 --- a/src/routing/olsr/olsr-agent-impl.cc +++ b/src/routing/olsr/olsr-agent-impl.cc @@ -349,29 +349,21 @@ AgentImpl::RecvOlsr (Ptr socket, if (duplicated == NULL) { - // Note: normally inetSourceAddr.GetIpv4 () should be equal - // to messageHeader.GetOriginatorAddress (), but something - // was broken inside NS-3 UDP sockets and the ability to - // override source address (via Bind()) is no longer - // available. Bottom line is, OLSR packets are no longer - // being sent with the main address, and to work around this - // issue we look at the Originator Address field of OLSR - // messages contained in the packet. switch (messageHeader.GetMessageType ()) { case olsr::MessageHeader::HELLO_MESSAGE: NS_LOG_DEBUG ("OLSR node received HELLO message of size " << messageHeader.GetSerializedSize ()); - ProcessHello (messageHeader, m_mainAddress, messageHeader.GetOriginatorAddress ()); + ProcessHello (messageHeader, m_mainAddress, inetSourceAddr.GetIpv4 ()); break; case olsr::MessageHeader::TC_MESSAGE: NS_LOG_DEBUG ("OLSR node received TC message of size " << messageHeader.GetSerializedSize ()); - ProcessTc (messageHeader, messageHeader.GetOriginatorAddress ()); + ProcessTc (messageHeader, inetSourceAddr.GetIpv4 ()); break; case olsr::MessageHeader::MID_MESSAGE: NS_LOG_DEBUG ("OLSR node received MID message of size " << messageHeader.GetSerializedSize ()); - ProcessMid (messageHeader, messageHeader.GetOriginatorAddress ()); + ProcessMid (messageHeader, inetSourceAddr.GetIpv4 ()); break; default: @@ -404,7 +396,7 @@ AgentImpl::RecvOlsr (Ptr socket, // Remaining messages are also forwarded using the default algorithm. if (messageHeader.GetMessageType () != olsr::MessageHeader::HELLO_MESSAGE) ForwardDefault (messageHeader, duplicated, - m_mainAddress, messageHeader.GetOriginatorAddress ()); + m_mainAddress, inetSourceAddr.GetIpv4 ()); } } From c8a76b7dd5791f418291ffb7e8349194f46a709d Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Fri, 1 Feb 2008 21:31:15 -0800 Subject: [PATCH 2/4] typos and formatting of Introduction section --- doc/tutorial/introduction.texi | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/tutorial/introduction.texi b/doc/tutorial/introduction.texi index 330d5848d..5c761b88f 100644 --- a/doc/tutorial/introduction.texi +++ b/doc/tutorial/introduction.texi @@ -14,7 +14,7 @@ The @command{ns-3} simulator is a discrete-event network simulator targeted primarily for research and educational use. The @uref{http://www.nsnam.org,,@command{ns-3} project}, started in 2006, is an open-source project. The goal of the project is to -build a new netework simulator primarily for research and educational use. +build a new network simulator primarily for research and educational use. The purpose of this tutorial is to introduce new @command{ns-3} users to the system in a structured way. It is sometimes difficult for new users to @@ -31,14 +31,14 @@ into the workings of the system. Primary documentation for the @command{ns-3} project is available in three forms: @itemize @bullet -@item ns-3 Manual: Documentation of the public APIs of the simulator +@item @uref{http://www.nsnam.org/doxygen/index.html,,ns-3 Doxygen/Manual}: Documentation of the public APIs of the simulator @item Tutorial (this document) -@item ns-3 wiki (http://www.nsnam.org/wiki/index.php) +@item @uref{http://www.nsnam.org/wiki/index.php,, ns-3 wiki} @end itemize - + A few key points are worth noting at the onset: @itemize @bullet -@item @command{ns-3} is not an extension of @command{ns-2}; it is a new +@item @command{ns-3} is not an extension of @uref{http://www.isi.edu/nsnam/ns,,ns-2}; it is a new simulator. The two simulators are both written in C++ but @command{ns-3} is a new simulator that does not support the @command{ns-2} APIs. Some models from @command{ns-2} have already been ported from @command{ns-2} @@ -322,11 +322,11 @@ There is a similar book on Multicast Sockets, that covers material you may need to understand for the multicast examples. @c ======================================================================== -@c The Basics +@c Downloading and Compiling @c ======================================================================== -@node The-Basics -@chapter The Basics +@node Downloading and Compiling +@chapter Downloading and Compiling @cindex Linux @cindex Cygwin From a0e14bd52328b429c2bf095c52330f65aaa307b3 Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Sat, 2 Feb 2008 15:52:54 -0800 Subject: [PATCH 3/4] formatting cleanup --- src/node/socket.h | 50 ++++++++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/src/node/socket.h b/src/node/socket.h index 39a45672c..bf5e1c8d4 100644 --- a/src/node/socket.h +++ b/src/node/socket.h @@ -78,21 +78,24 @@ public: * \param closeCompleted Callback invoked when the close operation is * completed. */ - void SetCloseCallback (Callback > closeCompleted); + void SetCloseCallback (Callback > closeCompleted); /** - * \param connectionSucceeded this callback is invoked when the connection request - * initiated by the user is successfully completed. The callback is passed - * back a pointer to the same socket object. - * \param connectionFailed this callback is invoked when the connection request - * initiated by the user is unsuccessfully completed. The callback is passed - * back a pointer to the same socket object. - * \param halfClose XXX When exactly is this callback invoked ? If it invoked when the - * other side closes the connection ? Or when I call Close ? + * \param connectionSucceeded this callback is invoked when the + * connection request initiated by the user is successfully + * completed. The callback is passed back a pointer to + * the same socket object. + * \param connectionFailed this callback is invoked when the + * connection request initiated by the user is unsuccessfully + * completed. The callback is passed back a pointer to the + * same socket object. + * \param halfClose XXX When exactly is this callback invoked? If + * it invoked when the other side closes the connection ? + * Or when I call Close ? */ void SetConnectCallback (Callback > connectionSucceeded, - Callback > connectionFailed, - Callback > halfClose); + Callback > connectionFailed, + Callback > halfClose); /** * \brief Accept connection requests from remote hosts * \param connectionRequest Callback for connection request from peer. @@ -100,28 +103,31 @@ public: * ip address and the port number of the connection originator. * This callback must return true to accept the incoming connection, * false otherwise. If the connection is accepted, the - * "newConnectionCreated" callback will be invoked later to give access - * to the user to the socket created to match this new connection. If the - * user does not explicitely specify this callback, all incoming - * connections will be refused. + * "newConnectionCreated" callback will be invoked later to + * give access to the user to the socket created to match + * this new connection. If the user does not explicitly + * specify this callback, all incoming connections will be refused. * \param newConnectionCreated Callback for new connection: when a new * is accepted, it is created and the corresponding socket is passed - * back to the user through this callback. This user callback is passed - * a pointer to the new socket, and the ip address and port number - * of the connection originator. + * back to the user through this callback. This user callback is + * passed a pointer to the new socket, and the ip address and + * port number of the connection originator. * \param closeRequested Callback for connection close request from peer. * XXX: when is this callback invoked ? */ - void SetAcceptCallback (Callback, const Address &> connectionRequest, - Callback, const Address&> newConnectionCreated, - Callback > closeRequested); + void SetAcceptCallback (Callback, + const Address &> connectionRequest, + Callback, + const Address&> newConnectionCreated, + Callback > closeRequested); void SetSendCallback (Callback, uint32_t> dataSent); /** * \brief Receive data * \param receivedData Invoked whenever new data is received. * */ - void SetRecvCallback (Callback, Ptr,const Address&> receivedData); + void SetRecvCallback (Callback, Ptr, + const Address&> receivedData); /** * \param address the address to try to allocate From 438036550fd8b71f118253b1abf0817883c3f35f Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Sat, 2 Feb 2008 20:46:04 -0800 Subject: [PATCH 4/4] Fix tutorial TOC --- doc/tutorial/tutorial.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/tutorial/tutorial.texi b/doc/tutorial/tutorial.texi index add933fb5..7494449e0 100644 --- a/doc/tutorial/tutorial.texi +++ b/doc/tutorial/tutorial.texi @@ -80,7 +80,7 @@ see @uref{http://www.nsnam.org/docs/tutorial.pdf}. Part 1: Overview * Overview:: * Resources:: -* The-Basics:: +* Downloading and Compiling:: * Some-Prerequisites:: * A-First-ns-3-Script:: Part 2: Details