merge
This commit is contained in:
@@ -263,6 +263,12 @@ int main (int argc, char *argv[])
|
||||
dataset = experiment.Run (wifi, wifiPhy, wifiChannel);
|
||||
gnuplot.AddDataset (dataset);
|
||||
|
||||
NS_LOG_DEBUG ("rraa");
|
||||
experiment = Experiment ("rraa");
|
||||
wifi.SetRemoteStationManager ("ns3::RraaWifiManager");
|
||||
dataset = experiment.Run (wifi, wifiPhy, wifiChannel);
|
||||
gnuplot.AddDataset (dataset);
|
||||
|
||||
NS_LOG_DEBUG ("ideal");
|
||||
experiment = Experiment ("ideal");
|
||||
wifi.SetRemoteStationManager ("ns3::IdealWifiManager");
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <stdint.h>
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
#include <stdint.h>
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
|
||||
@@ -138,13 +138,17 @@ AsciiToMac48 (const char *str, uint8_t addr[6])
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
SetInetAddress (sockaddr *ad, uint32_t networkOrder)
|
||||
static sockaddr
|
||||
CreateInetAddress (uint32_t networkOrder)
|
||||
{
|
||||
struct sockaddr_in *sin = (struct sockaddr_in*)ad;
|
||||
sin->sin_family = AF_INET;
|
||||
sin->sin_port = 0; // unused
|
||||
sin->sin_addr.s_addr = htonl (networkOrder);
|
||||
union {
|
||||
struct sockaddr any_socket;
|
||||
struct sockaddr_in si;
|
||||
} s;
|
||||
s.si.sin_family = AF_INET;
|
||||
s.si.sin_port = 0; // unused
|
||||
s.si.sin_addr.s_addr = htonl (networkOrder);
|
||||
return s.any_socket;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -330,7 +334,7 @@ CreateTap (const char *dev, const char *gw, const char *ip, const char *mac, con
|
||||
//
|
||||
// Set the IP address of the new interface/device.
|
||||
//
|
||||
SetInetAddress (&ifr.ifr_addr, AsciiToIpv4 (ip));
|
||||
ifr.ifr_addr = CreateInetAddress (AsciiToIpv4 (ip));
|
||||
status = ioctl (fd, SIOCSIFADDR, &ifr);
|
||||
ABORT_IF (status == -1, "Could not set IP address", true);
|
||||
LOG ("Set device IP address to " << ip);
|
||||
@@ -338,7 +342,7 @@ CreateTap (const char *dev, const char *gw, const char *ip, const char *mac, con
|
||||
//
|
||||
// Set the net mask of the new interface/device
|
||||
//
|
||||
SetInetAddress (&ifr.ifr_netmask, AsciiToIpv4 (netmask));
|
||||
ifr.ifr_netmask = CreateInetAddress (AsciiToIpv4 (netmask));
|
||||
status = ioctl (fd, SIOCSIFNETMASK, &ifr);
|
||||
ABORT_IF (status == -1, "Could not set net mask", true);
|
||||
LOG ("Set device Net Mask to " << netmask);
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
#include <stdint.h>
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
NS_LOG_COMPONENT_DEFINE ("RraaWifiManager");
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
NS_OBJECT_ENSURE_REGISTERED(RraaWifiManager);
|
||||
|
||||
RraaWifiRemoteStation::RraaWifiRemoteStation (Ptr<RraaWifiManager> stations)
|
||||
: m_stations (stations)
|
||||
@@ -188,7 +190,7 @@ RraaWifiRemoteStation::ARts (void)
|
||||
TypeId
|
||||
RraaWifiManager::GetTypeId (void)
|
||||
{
|
||||
static TypeId tid = TypeId ("RraaWifiManager")
|
||||
static TypeId tid = TypeId ("ns3::RraaWifiManager")
|
||||
.SetParent<WifiRemoteStationManager> ()
|
||||
.AddConstructor<RraaWifiManager> ()
|
||||
.AddAttribute ("Basic",
|
||||
|
||||
Reference in New Issue
Block a user