diff -r 05ca1da6d38c src/contrib/net-anim/animation-interface.cc --- a/src/contrib/net-anim/animation-interface.cc Tue Nov 03 12:00:53 2009 -0500 +++ b/src/contrib/net-anim/animation-interface.cc Tue Nov 03 12:27:07 2009 -0500 @@ -21,14 +21,6 @@ #include #include -#include "ns3/net-anim-config.h" - -// Socket related includes -#if defined(HAVE_SYS_SOCKET_H) && defined(HAVE_NETINET_IN_H) -# include -# include -#endif - // ns3 includes #include "ns3/animation-interface.h" #include "ns3/channel.h" @@ -37,6 +29,13 @@ #include "ns3/node-location.h" #include "ns3/packet.h" #include "ns3/simulator.h" + +// Socket related includes +#if defined(HAVE_SYS_SOCKET_H) && defined(HAVE_NETINET_IN_H) +# include +# include +#endif + using namespace std; @@ -60,6 +59,7 @@ bool AnimationInterface::SetOutputFile ( return true; } +#if defined(HAVE_SYS_SOCKET_H) && defined(HAVE_NETINET_IN_H) bool AnimationInterface::SetServerPort (uint16_t port) { int s = socket (AF_INET, SOCK_STREAM, 0); @@ -82,6 +82,7 @@ bool AnimationInterface::SetServerPort ( setsockopt (s, SOL_SOCKET, SO_LINGER, &t, sizeof(t)); return true; } +#endif bool AnimationInterface::SetInternalAnimation () { diff -r 05ca1da6d38c src/contrib/net-anim/animation-interface.h --- a/src/contrib/net-anim/animation-interface.h Tue Nov 03 12:00:53 2009 -0500 +++ b/src/contrib/net-anim/animation-interface.h Tue Nov 03 12:27:07 2009 -0500 @@ -22,6 +22,8 @@ #define __ANIMATION_INTERFACE__H__ #include + +#include "ns3/net-anim-config.h" #include "ns3/ptr.h" #include "ns3/net-device.h" @@ -58,6 +60,7 @@ public: */ bool SetOutputFile (const std::string& fn); +#if defined(HAVE_SYS_SOCKET_H) && defined(HAVE_NETINET_IN_H) /** * @brief Specify that animation commands are to be written to * a socket. @@ -71,6 +74,7 @@ public: * @returns true if connection created, false if bind failed. */ bool SetServerPort (uint16_t port); +#endif /** * @brief Specify that animation window is to be created as part diff -r 05ca1da6d38c src/contrib/net-anim/point-to-point-dumbbell-helper.cc --- a/src/contrib/net-anim/point-to-point-dumbbell-helper.cc Tue Nov 03 12:00:53 2009 -0500 +++ b/src/contrib/net-anim/point-to-point-dumbbell-helper.cc Tue Nov 03 12:27:07 2009 -0500 @@ -20,14 +20,6 @@ #include #include - -#include "ns3/net-anim-config.h" - -// Socket related includes -#if defined(HAVE_SYS_SOCKET_H) && defined(HAVE_NETINET_IN_H) -# include -# include -#endif // ns3 includes #include "ns3/animation-interface.h" diff -r 05ca1da6d38c src/contrib/net-anim/test-dumbbell.cc --- a/src/contrib/net-anim/test-dumbbell.cc Tue Nov 03 12:00:53 2009 -0500 +++ b/src/contrib/net-anim/test-dumbbell.cc Tue Nov 03 12:27:07 2009 -0500 @@ -17,6 +17,8 @@ */ #include + +#include "ns3/net-anim-config.h" #include "ns3/core-module.h" #include "ns3/simulator-module.h" @@ -98,7 +100,9 @@ int main (int argc, char *argv[]) AnimationInterface anim; if (port > 0) { +#if defined(HAVE_SYS_SOCKET_H) && defined(HAVE_NETINET_IN_H) anim.SetServerPort(port); +#endif } else if (!animFile.empty()) {