add tutorial directory and hello-simulator

This commit is contained in:
Craig Dowell
2007-09-13 11:04:47 -07:00
parent 6c30d76401
commit 873176a3e6
5 changed files with 42 additions and 6 deletions

View File

@@ -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.
//

View 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
View File

@@ -0,0 +1 @@
exec "`dirname "$0"`"/../waf "$@"

6
tutorial/wscript Normal file
View 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'

View File

@@ -173,7 +173,7 @@ def build(bld):
# process subfolders from here
bld.add_subdirs('src')
bld.add_subdirs('samples utils examples')
bld.add_subdirs('samples utils examples tutorial')
## Create a single ns3 library containing all modules
lib = bld.create_obj('cpp', 'shlib')