View | Details | Raw Unified | Return to bug 705
Collapse All | Expand All

(-)a/src/contrib/net-anim/animation-interface.cc (-8 / +9 lines)
 Lines 21-34    Link Here 
21
#include <stdio.h>
21
#include <stdio.h>
22
#include <sstream>
22
#include <sstream>
23
23
24
#include "ns3/net-anim-config.h"
25
26
// Socket related includes
27
#if defined(HAVE_SYS_SOCKET_H) && defined(HAVE_NETINET_IN_H)
28
# include <sys/socket.h>
29
# include <netinet/in.h>
30
#endif
31
32
// ns3 includes
24
// ns3 includes
33
#include "ns3/animation-interface.h"
25
#include "ns3/animation-interface.h"
34
#include "ns3/channel.h"
26
#include "ns3/channel.h"
 Lines 37-42    Link Here 
37
#include "ns3/node-location.h"
29
#include "ns3/node-location.h"
38
#include "ns3/packet.h"
30
#include "ns3/packet.h"
39
#include "ns3/simulator.h"
31
#include "ns3/simulator.h"
32
33
// Socket related includes
34
#if defined(HAVE_SYS_SOCKET_H) && defined(HAVE_NETINET_IN_H)
35
# include <sys/socket.h>
36
# include <netinet/in.h>
37
#endif
38
40
39
41
using namespace std;
40
using namespace std;
42
41
 Lines 60-65   bool AnimationInterface::SetOutputFile ( Link Here 
60
  return true;
59
  return true;
61
}
60
}
62
61
62
#if defined(HAVE_SYS_SOCKET_H) && defined(HAVE_NETINET_IN_H)
63
bool AnimationInterface::SetServerPort (uint16_t port)
63
bool AnimationInterface::SetServerPort (uint16_t port)
64
{
64
{
65
  int s = socket (AF_INET, SOCK_STREAM, 0);
65
  int s = socket (AF_INET, SOCK_STREAM, 0);
 Lines 82-87   bool AnimationInterface::SetServerPort ( Link Here 
82
  setsockopt (s, SOL_SOCKET, SO_LINGER, &t, sizeof(t));
82
  setsockopt (s, SOL_SOCKET, SO_LINGER, &t, sizeof(t));
83
  return true;
83
  return true;
84
}
84
}
85
#endif
85
86
86
bool AnimationInterface::SetInternalAnimation ()
87
bool AnimationInterface::SetInternalAnimation ()
87
{
88
{
(-)a/src/contrib/net-anim/animation-interface.h (+4 lines)
 Lines 22-27    Link Here 
22
#define __ANIMATION_INTERFACE__H__
22
#define __ANIMATION_INTERFACE__H__
23
23
24
#include <string>
24
#include <string>
25
26
#include "ns3/net-anim-config.h"
25
27
26
#include "ns3/ptr.h"
28
#include "ns3/ptr.h"
27
#include "ns3/net-device.h"
29
#include "ns3/net-device.h"
 Lines 58-63   public: Link Here 
58
 */
60
 */
59
  bool SetOutputFile (const std::string& fn);
61
  bool SetOutputFile (const std::string& fn);
60
62
63
#if defined(HAVE_SYS_SOCKET_H) && defined(HAVE_NETINET_IN_H)
61
/**
64
/**
62
 * @brief Specify that animation commands are to be written to
65
 * @brief Specify that animation commands are to be written to
63
 * a socket.
66
 * a socket.
 Lines 71-76   public: Link Here 
71
 * @returns true if connection created, false if bind failed.
74
 * @returns true if connection created, false if bind failed.
72
 */
75
 */
73
  bool SetServerPort (uint16_t port);
76
  bool SetServerPort (uint16_t port);
77
#endif
74
78
75
/**
79
/**
76
 * @brief Specify that animation window is to be created as part
80
 * @brief Specify that animation window is to be created as part
(-)a/src/contrib/net-anim/point-to-point-dumbbell-helper.cc (-8 lines)
 Lines 20-33    Link Here 
20
20
21
#include <iostream>
21
#include <iostream>
22
#include <sstream>
22
#include <sstream>
23
24
#include "ns3/net-anim-config.h"
25
26
// Socket related includes
27
#if defined(HAVE_SYS_SOCKET_H) && defined(HAVE_NETINET_IN_H)
28
# include <sys/socket.h>
29
# include <netinet/in.h>
30
#endif
31
23
32
// ns3 includes
24
// ns3 includes
33
#include "ns3/animation-interface.h"
25
#include "ns3/animation-interface.h"
(-)a/src/contrib/net-anim/test-dumbbell.cc (+4 lines)
 Lines 17-22    Link Here 
17
 */
17
 */
18
18
19
#include <iostream>
19
#include <iostream>
20
21
#include "ns3/net-anim-config.h"
20
22
21
#include "ns3/core-module.h"
23
#include "ns3/core-module.h"
22
#include "ns3/simulator-module.h"
24
#include "ns3/simulator-module.h"
 Lines 98-104   int main (int argc, char *argv[]) Link Here 
98
  AnimationInterface anim;
100
  AnimationInterface anim;
99
  if (port > 0)
101
  if (port > 0)
100
    {
102
    {
103
#if defined(HAVE_SYS_SOCKET_H) && defined(HAVE_NETINET_IN_H)
101
      anim.SetServerPort(port);
104
      anim.SetServerPort(port);
105
#endif
102
    }
106
    }
103
  else if (!animFile.empty())
107
  else if (!animFile.empty())
104
    {
108
    {

Return to bug 705