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

(-)a/src/contrib/net-anim/animation-interface.cc (-2 / +13 lines)
 Lines 21-29    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
#ifdef MINGW
27
#include <fcntl.h>
28
#endif
29
24
// Socket related includes
30
// Socket related includes
25
#include <sys/socket.h>
31
#if defined(HAVE_SYS_SOCKET_H) && defined(HAVE_NETINET_IN_H)
26
#include <netinet/in.h>
32
# include <sys/socket.h>
33
# include <netinet/in.h>
34
#endif
27
35
28
// ns3 includes
36
// ns3 includes
29
#include "ns3/animation-interface.h"
37
#include "ns3/animation-interface.h"
 Lines 58-63    Link Here 
58
66
59
bool AnimationInterface::SetServerPort (uint16_t port)
67
bool AnimationInterface::SetServerPort (uint16_t port)
60
{
68
{
69
#if (!(defined(HAVE_SYS_SOCKET_H)) || !(defined(HAVE_NETINET_IN_H)))
61
  int s = socket (AF_INET, SOCK_STREAM, 0);
70
  int s = socket (AF_INET, SOCK_STREAM, 0);
62
  struct sockaddr_in addr;
71
  struct sockaddr_in addr;
63
  addr.sin_family = AF_INET;
72
  addr.sin_family = AF_INET;
 Lines 77-82    Link Here 
77
  int t = 1;
86
  int t = 1;
78
  setsockopt (s, SOL_SOCKET, SO_LINGER, &t, sizeof(t));
87
  setsockopt (s, SOL_SOCKET, SO_LINGER, &t, sizeof(t));
79
  return true;
88
  return true;
89
#endif
90
  return false;//never reached unless the above is disabled
80
}
91
}
81
92
82
bool AnimationInterface::SetInternalAnimation ()
93
bool AnimationInterface::SetInternalAnimation ()
(-)a/src/contrib/net-anim/point-to-point-dumbbell-helper.cc (-4 lines)
 Lines 21-30    Link Here 
21
#include <iostream>
21
#include <iostream>
22
#include <sstream>
22
#include <sstream>
23
23
24
// Socket related includes
25
#include <sys/socket.h>
26
#include <netinet/in.h>
27
28
// ns3 includes
24
// ns3 includes
29
#include "ns3/animation-interface.h"
25
#include "ns3/animation-interface.h"
30
#include "ns3/point-to-point-dumbbell-helper.h"
26
#include "ns3/point-to-point-dumbbell-helper.h"
(-)a/src/contrib/net-anim/wscript (+6 lines)
 Lines 1-5    Link Here 
1
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
1
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
2
2
3
def configure(conf):
4
    conf.check(header_name='sys/socket.h', define_name='HAVE_SYS_SOCKET_H')
5
    conf.check(header_name='netinet/in.h', define_name='HAVE_NETINET_IN_H')
6
    conf.write_config_header('ns3/net-anim-config.h', top=True)
7
8
3
def build(bld):
9
def build(bld):
4
    obj = bld.create_ns3_module('net-anim')
10
    obj = bld.create_ns3_module('net-anim')
5
    obj.source = [
11
    obj.source = [
(-)a/src/contrib/wscript (-1 / +3 lines)
 Lines 14-22    Link Here 
14
    conf.report_optional_feature("XmlIo", "XmlIo",
14
    conf.report_optional_feature("XmlIo", "XmlIo",
15
                                 conf.env['ENABLE_LIBXML2'],
15
                                 conf.env['ENABLE_LIBXML2'],
16
                                 "library 'libxml-2.0 >= 2.7' not found")
16
                                 "library 'libxml-2.0 >= 2.7' not found")
17
    conf.write_config_header('ns3/contrib-config.h', top=True)
18
17
    conf.sub_config('stats')
19
    conf.sub_config('stats')
20
    conf.sub_config('net-anim')
18
21
19
    conf.write_config_header('ns3/contrib-config.h', top=True)
20
22
21
def build(bld):
23
def build(bld):
22
    module = bld.create_ns3_module('contrib', ['simulator', 'common'])
24
    module = bld.create_ns3_module('contrib', ['simulator', 'common'])

Return to bug 705