add tutorial directory and hello-simulator
This commit is contained in:
@@ -39,7 +39,7 @@
|
||||
#include "ns3/csma-net-device.h"
|
||||
#include "ns3/csma-topology.h"
|
||||
#include "ns3/csma-ipv4-topology.h"
|
||||
#include "ns3/eui48-address.h"
|
||||
#include "ns3/mac48-address.h"
|
||||
#include "ns3/ipv4-address.h"
|
||||
#include "ns3/inet-socket-address.h"
|
||||
#include "ns3/ipv4.h"
|
||||
@@ -126,16 +126,16 @@ main (int argc, char *argv[])
|
||||
// zero.
|
||||
//
|
||||
uint32_t nd0 = CsmaIpv4Topology::AddIpv4CsmaNetDevice (n0, lan,
|
||||
Eui48Address("08:00:2e:00:00:00"));
|
||||
Mac48Address("08:00:2e:00:00:00"));
|
||||
|
||||
uint32_t nd1 = CsmaIpv4Topology::AddIpv4CsmaNetDevice (n1, lan,
|
||||
Eui48Address("08:00:2e:00:00:01"));
|
||||
Mac48Address("08:00:2e:00:00:01"));
|
||||
|
||||
uint32_t nd2 = CsmaIpv4Topology::AddIpv4CsmaNetDevice (n2, lan,
|
||||
Eui48Address("08:00:2e:00:00:02"));
|
||||
Mac48Address("08:00:2e:00:00:02"));
|
||||
|
||||
uint32_t nd3 = CsmaIpv4Topology::AddIpv4CsmaNetDevice (n3, lan,
|
||||
Eui48Address("08:00:2e:00:00:03"));
|
||||
Mac48Address("08:00:2e:00:00:03"));
|
||||
//
|
||||
// We've got the "hardware" in place. Now we need to add IP addresses.
|
||||
//
|
||||
|
||||
29
tutorial/hello-simulator.cc
Normal file
29
tutorial/hello-simulator.cc
Normal file
@@ -0,0 +1,29 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation;
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "ns3/debug.h"
|
||||
|
||||
using namespace ns3;
|
||||
|
||||
NS_DEBUG_COMPONENT_DEFINE ("HelloSimulator");
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
DebugComponentEnable("HelloSimulator");
|
||||
|
||||
NS_DEBUG("Hello Simulator");
|
||||
}
|
||||
1
tutorial/waf
vendored
Executable file
1
tutorial/waf
vendored
Executable file
@@ -0,0 +1 @@
|
||||
exec "`dirname "$0"`"/../waf "$@"
|
||||
6
tutorial/wscript
Normal file
6
tutorial/wscript
Normal file
@@ -0,0 +1,6 @@
|
||||
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
|
||||
|
||||
def build(bld):
|
||||
obj = bld.create_ns3_program('hello-simulator',
|
||||
['core'])
|
||||
obj.source = 'hello-simulator.cc'
|
||||
Reference in New Issue
Block a user