Compiles, but almost everything is commented out.
diff --git a/model/ndn_stupidinterestgenerator.cc b/apps/stupid-interest-generator.cc
similarity index 86%
rename from model/ndn_stupidinterestgenerator.cc
rename to apps/stupid-interest-generator.cc
index 7c59f6c..5b47759 100644
--- a/model/ndn_stupidinterestgenerator.cc
+++ b/apps/stupid-interest-generator.cc
@@ -6,14 +6,14 @@
// Copyright 2011 UCLA. All rights reserved.
//
-#include "ndn_stupidinterestgenerator.h"
+#include "stupid-interest-generator.h"
+
#include "ns3/socket.h"
#include "ns3/socket-factory.h"
#include "ns3/simulator.h"
-#include "ndn_interestpacket.h"
-#include "ndn_namebuilder.h"
-#include "ccn/ccn_charbuf.h"
+#include "model/interest-packet.h"
+#include "model/name-builder.h"
NS_LOG_COMPONENT_DEFINE ("StupidInterestGenerator");
@@ -157,21 +157,21 @@
void StupidInterestGenerator::SendPacket ()
{
- NS_LOG_FUNCTION_NOARGS ();
- NS_LOG_LOGIC ("sending packet at " << Simulator::Now ());
- NS_ASSERT (m_sendEvent.IsExpired ());
+ // NS_LOG_FUNCTION_NOARGS ();
+ // NS_LOG_LOGIC ("sending packet at " << Simulator::Now ());
+ // NS_ASSERT (m_sendEvent.IsExpired ());
- NameBuilder name;
- name("prefix1")("prefix2")("filename");
+ // NameBuilder name;
+ // name("prefix1")("prefix2")("filename");
- const ccn_charbuf *output = name.GetName();
- Ptr<InterestPacket> packet = Create<InterestPacket>(name,(uint32_t)output->length);
- packet->AddTimeout(4000);
- UniformVariable var;
- packet->AddNonce(var.GetInteger(1,10000));
- m_socket->Send(packet);
+ // const ccn_charbuf *output = name.GetName();
+ // Ptr<InterestPacket> packet = Create<InterestPacket>(name,(uint32_t)output->length);
+ // packet->AddTimeout(4000);
+ // UniformVariable var;
+ // packet->AddNonce(var.GetInteger(1,10000));
+ // m_socket->Send(packet);
- ScheduleStartEvent();
+ // ScheduleStartEvent();
}
//}
diff --git a/model/ndn_stupidinterestgenerator.h b/apps/stupid-interest-generator.h
similarity index 100%
rename from model/ndn_stupidinterestgenerator.h
rename to apps/stupid-interest-generator.h
diff --git a/examples/wscript b/examples/wscript
index f3bca13..0d2e449 100644
--- a/examples/wscript
+++ b/examples/wscript
@@ -1,6 +1,8 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
- obj = bld.create_ns3_program('syntactic-topology-ndnabstraction',
- ['core-module'])
- obj.source = 'syntactic-topology-ndnabstraction.cc'
\ No newline at end of file
+ if not bld.env['ENABLE_EXAMPLES']:
+ return;
+
+ # obj = bld.create_ns3_program('stupid-interest-generator', ['NDNabstraction'])
+ # obj.source = 'stupid-interest-generator.cc'
diff --git a/model/interest-packet.cc b/model/interest-packet.cc
new file mode 100644
index 0000000..350095a
--- /dev/null
+++ b/model/interest-packet.cc
@@ -0,0 +1,87 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2011 University of California, Los Angeles
+ *
+ * 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
+ *
+ * Author: Ilya Moiseenko <iliamo@cs.ucla.edu>
+ */
+
+#include "interest-packet.h"
+
+namespace ns3
+{
+namespace NDNabstraction
+{
+ InterestPacket::InterestPacket ()
+ {
+ }
+ // InterestPacket::InterestPacket(const unsigned char *name, uint32_t size)
+ // :Packet(name,size)
+ // {
+ // maxNameLength = 10240;
+ // }
+
+ // uint32_t
+ // InterestPacket::GetName(unsigned char *name)
+ // {
+ // //uint32_t Packet::CopyData (uint8_t *buffer, uint32_t size) const
+ // return CopyData((uint8_t*) name, maxNameLength);
+ // }
+
+ // void
+ // InterestPacket::AddTimeout(uint32_t milliseconds)
+ // {
+ // TimeoutHeader tHeader (milliseconds);
+ // AddHeader (tHeader);
+ // }
+
+ // uint32_t
+ // InterestPacket::GetTimeout(void)
+ // {
+ // TimeoutHeader tHeader;
+ // PeekHeader(tHeader);
+ // return tHeader.GetValue();
+ // }
+
+ // void
+ // InterestPacket::RemoveTimeout(void)
+ // {
+ // TimeoutHeader tHeader;
+ // RemoveHeader(tHeader);
+ // }
+
+ // void
+ // InterestPacket::AddNonce(uint32_t nonce)
+ // {
+ // NonceHeader tHeader (nonce);
+ // AddHeader (tHeader);
+ // }
+
+ // uint32_t
+ // InterestPacket::GetNonce(void)
+ // {
+ // NonceHeader tHeader;
+ // PeekHeader(tHeader);
+ // return tHeader.GetValue();
+ // }
+
+ // void
+ // InterestPacket::RemoveNonce(void)
+ // {
+ // NonceHeader tHeader;
+ // RemoveHeader(tHeader);
+ // }
+}
+}
diff --git a/model/ndn_interestpacket.h b/model/interest-packet.h
similarity index 64%
rename from model/ndn_interestpacket.h
rename to model/interest-packet.h
index 51f2a9a..df04403 100644
--- a/model/ndn_interestpacket.h
+++ b/model/interest-packet.h
@@ -18,42 +18,43 @@
* Author: Ilya Moiseenko <iliamo@cs.ucla.edu>
*/
-#ifndef ndn_interestpacket_h
-#define ndn_interestpacket_h
+#ifndef _INTEREST_PACKET_H_
+#define _INTEREST_PACKET_H_
//#define CCN_INTEREST_LIFETIME_SEC 4
//#define CCN_INTEREST_LIFETIME_MICROSEC (CCN_INTEREST_LIFETIME_SEC * 1000000)
-#include "ns3/header.h"
+#include <ns3/header.h>
#include <ns3/packet.h>
#include <string>
-#include "ndn_timeoutheader.h"
-#include "ndn_nonceheader.h"
namespace ns3
{
namespace NDNabstraction
{
- class InterestPacket : public Packet
- {
- public:
- InterestPacket(const unsigned char *name, uint32_t size);
-
- uint32_t GetName(unsigned char *name);
-
- void AddTimeout(uint32_t milliseconds);
- uint32_t GetTimeout(void);
- void RemoveTimeout(void);
-
- void AddNonce(uint32_t nonce);
- uint32_t GetNonce(void);
- void RemoveNonce(void);
-
- uint32_t maxNameLength;
- };
+class InterestPacket : public Packet
+{
+public:
+ InterestPacket( );
+ // InterestPacket (const unsigned char *name, uint32_t size);
+
+
+ // uint32_t GetName (unsigned char *name);
+
+ // void AddTimeout (uint32_t milliseconds);
+ // uint32_t GetTimeout (void);
+ // void RemoveTimeout (void);
+
+ // void AddNonce (uint32_t nonce);
+ // uint32_t GetNonce (void);
+ // void RemoveNonce (void);
+
+ // uint32_t maxNameLength;
+
+};
}
}
-#endif
+#endif // _NDN_PACKET_H_
diff --git a/model/ndn_namebuilder.cc b/model/name-builder.cc
similarity index 97%
rename from model/ndn_namebuilder.cc
rename to model/name-builder.cc
index e907e01..2ee432a 100644
--- a/model/ndn_namebuilder.cc
+++ b/model/name-builder.cc
@@ -18,7 +18,7 @@
* Author: Ilya Moiseenko <iliamo@cs.ucla.edu>
*/
-#include "ndn_namebuilder.h"
+#include "name-builder.h"
#include <ccn/ccn.h>
using namespace std;
diff --git a/model/ndn_namebuilder.h b/model/name-builder.h
similarity index 100%
rename from model/ndn_namebuilder.h
rename to model/name-builder.h
diff --git a/model/ndn_interestpacket.cc b/model/ndn_interestpacket.cc
deleted file mode 100644
index bb3a878..0000000
--- a/model/ndn_interestpacket.cc
+++ /dev/null
@@ -1,84 +0,0 @@
-/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2011 University of California, Los Angeles
- *
- * 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
- *
- * Author: Ilya Moiseenko <iliamo@cs.ucla.edu>
- */
-
-#include "ndn_interestpacket.h"
-
-namespace ns3
-{
-namespace NDNabstraction
-{
- InterestPacket::InterestPacket(const unsigned char *name, uint32_t size)
- :Packet(name,size)
- {
- maxNameLength = 10240;
- }
-
- uint32_t
- InterestPacket::GetName(unsigned char *name)
- {
- //uint32_t Packet::CopyData (uint8_t *buffer, uint32_t size) const
- return CopyData((uint8_t*) name, maxNameLength);
- }
-
- void
- InterestPacket::AddTimeout(uint32_t milliseconds)
- {
- TimeoutHeader tHeader (milliseconds);
- AddHeader (tHeader);
- }
-
- uint32_t
- InterestPacket::GetTimeout(void)
- {
- TimeoutHeader tHeader;
- PeekHeader(tHeader);
- return tHeader.GetValue();
- }
-
- void
- InterestPacket::RemoveTimeout(void)
- {
- TimeoutHeader tHeader;
- RemoveHeader(tHeader);
- }
-
- void
- InterestPacket::AddNonce(uint32_t nonce)
- {
- NonceHeader tHeader (nonce);
- AddHeader (tHeader);
- }
-
- uint32_t
- InterestPacket::GetNonce(void)
- {
- NonceHeader tHeader;
- PeekHeader(tHeader);
- return tHeader.GetValue();
- }
-
- void
- InterestPacket::RemoveNonce(void)
- {
- NonceHeader tHeader;
- RemoveHeader(tHeader);
- }
-}
-}
diff --git a/wscript b/wscript
index f7be7cb..2d3630c 100644
--- a/wscript
+++ b/wscript
@@ -12,17 +12,14 @@
'model/ccn/ccn_buf_decoder.c',
'model/ccn/ccn_buf_encoder.c',
- 'model/ndnabstraction-header.cc',
-
'model/ndn_face.cc',
- 'model/ndn_interestpacket.cc',
+ 'model/interest-packet.cc',
'model/ndn_contentpacket.cc',
'model/ndn_timeoutheader.cc',
'model/ndn_nonceheader.cc',
- 'model/ndn_namebuilder.cc',
- 'model/ndn_stupidinterestgenerator.cc',
- 'helper/ndnabstraction-helper.cc',
- 'helper/ndn_stupidinterestgenerator_helper.cc',
+ 'model/name-builder.cc',
+
+ 'apps/stupid-interest-generator.cc',
]
module_test = bld.create_ns3_module_test_library('NDNabstraction')
@@ -40,22 +37,23 @@
'model/ccn/ccn_indexbuf.h',
'model/ccn/ccn_random.h',
- 'model/ndnabstraction-header.h',
+ # 'model/ndnabstraction-header.h',
'model/ndn_face.h',
- 'model/ndn_interestpacket.h',
+ 'model/interest-packet.h',
'model/ndn_contentpacket.h',
'model/ndn_timeoutheader.h',
'model/ndn_nonceheader.h',
- 'model/ndn_namebuilder.h',
- 'model/ndn_stupidinterestgenerator.h',
- 'helper/ndnabstraction-helper.h',
- 'helper/ndn_stupidinterestgenerator_helper.h',
+ 'model/name-builder.h',
+ # 'helper/ndnabstraction-helper.h',
+ # 'helper/ndn_stupidinterestgenerator_helper.h',
+
+ 'apps/stupid-interest-generator.h',
]
if bld.env['ENABLE_OPENSSL']:
- module.uselib = 'OPENSSL'
+ module.uselib = 'OPENSSL'
if bld.env['ENABLE_EXAMPLES']:
bld.add_subdirs('examples')