blob: ca0bc48bfc466bad16686999256b97dd0352f6af [file] [log] [blame]
Ilya Moiseenko1eff17d2011-08-17 10:55:53 -07001/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2011 University of California, Los Angeles
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Ilya Moiseenko <iliamo@cs.ucla.edu>
19 */
20
21#ifndef __ANNOTATED_TOPOLOGY_READER_H__
22#define __ANNOTATED_TOPOLOGY_READER_H__
23
Ilya Moiseenko1eff17d2011-08-17 10:55:53 -070024#include "ns3/topology-reader.h"
Ilya Moiseenko7dd43be2011-08-18 18:57:12 -070025#include "ns3/nstime.h"
26#include "ns3/log.h"
27#include "ns3/net-device-container.h"
28#include "ns3/point-to-point-helper.h"
29#include "ns3/point-to-point-net-device.h"
Ilya Moiseenko58d26672011-12-08 13:48:06 -080030#include "ns3/internet-stack-helper.h"
31#include "ns3/ipv4-address-helper.h"
32#include "ns3/ipv4-global-routing-helper.h"
Ilya Moiseenko7dd43be2011-08-18 18:57:12 -070033#include "ns3/drop-tail-queue.h"
Ilya Moiseenko58d26672011-12-08 13:48:06 -080034#include "ns3/ipv4-interface.h"
35#include "ns3/ipv4.h"
Ilya Moiseenko7dd43be2011-08-18 18:57:12 -070036#include "ns3/string.h"
37#include "ns3/pointer.h"
38#include "ns3/uinteger.h"
Ilya Moiseenko58d26672011-12-08 13:48:06 -080039#include "ns3/ipv4-address.h"
Ilya Moiseenko7dd43be2011-08-18 18:57:12 -070040#include <string>
41#include <fstream>
42#include <cstdlib>
43#include <iostream>
44#include <sstream>
Ilya Moiseenko1eff17d2011-08-17 10:55:53 -070045
Ilya Moiseenko58d26672011-12-08 13:48:06 -080046#include "ns3/animation-interface.h"
47#include "ns3/constant-position-mobility-model.h"
48#include "ns3/random-variable.h"
49
Ilya Moiseenko1eff17d2011-08-17 10:55:53 -070050namespace ns3
51{
Ilya Moiseenko7dd43be2011-08-18 18:57:12 -070052
53/**
54* \brief This class reads annotated topology and apply settings to the corresponding nodes and links
55* Input File Format
56* 1st line is NumberOfNodes TAB NumberofLinks
Ilya Moiseenko58d26672011-12-08 13:48:06 -080057* Nth line is NodeID1 TAB NodeID2 TAB DataRateKBPS TAB OSPF TAB DelayMiliseconds TAB QueueSizeInPacketsNode1 TAB QueueSizeInPacketsNode2
Ilya Moiseenko7dd43be2011-08-18 18:57:12 -070058*
59*/
60class AnnotatedTopologyReader : public TopologyReader
61{
62public:
63 typedef std::list< Link >::iterator LinksIterator;
64 static TypeId GetTypeId (void);
65
66 AnnotatedTopologyReader ();
67 virtual ~AnnotatedTopologyReader ();
68
69
Ilya Moiseenko1eff17d2011-08-17 10:55:53 -070070 /**
Ilya Moiseenko7dd43be2011-08-18 18:57:12 -070071 * \brief Main annotated topology reading function.
72 *
73 * This method opens an input stream and reads topology file with annotations.
74 *
75 * \return the container of the nodes created (or empty container if there was an error)
76 */
77 virtual NodeContainer Read (void);
78
79 /**
80 * \brief This method applies setting to corresponding nodes and links
81 * NetDeviceContainer must be allocated
82 * NodeContainer from Read method
Ilya Moiseenko1eff17d2011-08-17 10:55:53 -070083 */
Ilya Moiseenko7dd43be2011-08-18 18:57:12 -070084 void ApplySettings(NetDeviceContainer *ndc, NodeContainer* nc);
Ilya Moiseenko58d26672011-12-08 13:48:06 -080085
86 //void ApplyOspfMetric(NetDeviceContainer* ndc, NodeContainer* nc);
87 void BoundingBox (NodeContainer* nc, double ulx, double uly, double lrx, double lry);
Ilya Moiseenko1eff17d2011-08-17 10:55:53 -070088
Ilya Moiseenko7dd43be2011-08-18 18:57:12 -070089private:
90 AnnotatedTopologyReader (const AnnotatedTopologyReader&);
91 AnnotatedTopologyReader& operator= (const AnnotatedTopologyReader&);
92};
Ilya Moiseenko1eff17d2011-08-17 10:55:53 -070093}
94
95
96#endif
97
98