make ns-3 compile on FreeBSD-8.2
This commit is contained in:
@@ -20,6 +20,11 @@
|
||||
#include <mach-o/dyld.h>
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#include <sys/types.h>
|
||||
#include <sys/sysctl.h>
|
||||
#endif
|
||||
|
||||
|
||||
#if defined (__win32__)
|
||||
#define SYSTEM_PATH_SEP "\\"
|
||||
@@ -110,6 +115,20 @@ std::string FindSelfDirectory (void)
|
||||
filename = buffer;
|
||||
free (buffer);
|
||||
}
|
||||
#elif defined (__FreeBSD__)
|
||||
{
|
||||
int mib[4];
|
||||
size_t bufSize = 1024;
|
||||
char *buf = (char *) malloc(bufSize);
|
||||
|
||||
mib[0] = CTL_KERN;
|
||||
mib[1] = KERN_PROC;
|
||||
mib[2] = KERN_PROC_PATHNAME;
|
||||
mib[3] = -1;
|
||||
|
||||
sysctl(mib, 4, buf, &bufSize, NULL, 0);
|
||||
filename = buf;
|
||||
}
|
||||
#endif
|
||||
return Dirname (filename);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
#include <netinet/in.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
#include "ipv4-raw-socket-impl.h"
|
||||
#include "ipv4-l3-protocol.h"
|
||||
#include "icmpv4.h"
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
*/
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
#include "ns3/inet6-socket-address.h"
|
||||
#include "ns3/node.h"
|
||||
#include "ns3/packet.h"
|
||||
|
||||
@@ -44,6 +44,8 @@
|
||||
#include <string>
|
||||
#include <limits>
|
||||
#include <netinet/in.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
namespace ns3 {
|
||||
|
||||
static void
|
||||
|
||||
@@ -23,6 +23,10 @@
|
||||
#include <ns3/log.h>
|
||||
#include <math.h>
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#define log2(x) (log(x)/M_LN2)
|
||||
#endif
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("AmcModule");
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
@@ -40,6 +40,10 @@
|
||||
#include <ns3/applications-module.h>
|
||||
#include <ns3/adhoc-aloha-noack-ideal-phy-helper.h>
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#define log2(x) (log(x)/M_LN2)
|
||||
#endif
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("TestAdhocOfdmAloha");
|
||||
|
||||
using namespace ns3;
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
#include <math.h>
|
||||
#include <ns3/log.h>
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#define log2(x) (log(x)/M_LN2)
|
||||
#endif
|
||||
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("SpectrumValue");
|
||||
|
||||
@@ -49,6 +49,10 @@
|
||||
#include <ns3/on-off-helper.h>
|
||||
#include <ns3/config.h>
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#define log2(x) (log(x)/M_LN2)
|
||||
#endif
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("SpectrumIdealPhyTest");
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
Reference in New Issue
Block a user