Initial routines for ContentObjectHeader.  Another round of moving files around

diff --git a/model/content-object-header.cc b/model/content-object-header.cc
new file mode 100644
index 0000000..79b5ed0
--- /dev/null
+++ b/model/content-object-header.cc
@@ -0,0 +1,85 @@
+/* -*-  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 "content-object-header.h"
+
+namespace ns3
+{
+namespace NDNabstraction
+{
+
+  ContentObjectHeader::ContentObjectHeader ()
+  {
+  }
+
+  void
+  ContentObjectHeader::SetName (const Ptr<Name::Components> &name)
+  {
+    m_name = name;
+  }
+
+  const Name::Components&
+  ContentObjectHeader::GetName () const
+  {
+    return *m_name;
+  }
+
+  uint32_t
+  ContentObjectHeader::GetSerializedSize (void) const
+  {
+    return 0;
+  }
+    
+  void
+  ContentObjectHeader::Serialize (Buffer::Iterator start) const
+  {
+    return;
+  }
+
+  uint32_t
+  ContentObjectHeader::Deserialize (Buffer::Iterator start)
+  {
+    return 0;
+  }
+
+  TypeId
+  ContentObjectHeader::GetTypeId (void)
+  {
+    static TypeId tid = TypeId ("ns3::NDNabstraction::ContentObjectHeader")
+      .SetParent<Header> ()
+      .AddConstructor<ContentObjectHeader> ()
+      ;
+    return tid;
+  }
+  
+  TypeId
+  ContentObjectHeader::GetInstanceTypeId (void) const
+  {
+    return GetTypeId ();
+  }
+  
+  void
+  ContentObjectHeader::Print (std::ostream &os) const
+  {
+    os << "ContentObject: " << *m_name;
+  }
+}
+}
diff --git a/model/content-object-header.h b/model/content-object-header.h
new file mode 100644
index 0000000..454f8e2
--- /dev/null
+++ b/model/content-object-header.h
@@ -0,0 +1,108 @@
+/* -*-  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>
+ *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
+
+#ifndef _CONTENT_OBJECT_HEADER_H_
+#define _CONTENT_OBJECT_HEADER_H_
+
+#include <ns3/integer.h>
+#include <ns3/header.h>
+
+#include <string>
+#include <vector>
+#include <list>
+
+#include "name-components.h"
+
+namespace ns3
+{
+namespace NDNabstraction
+{
+
+/**
+ * CCNx XML definition of ContentObject
+ * 
+ * Only few important fields are actually implemented in the simulation
+ *
+ *
+ * NDN ContentObjectHeader and routines to serialize/deserialize
+ *
+ *  Simplifications:
+ */
+  
+class ContentObjectHeader : public Header
+{
+public:
+  /**
+   * Constructor
+   *
+   * Creates a null header
+   **/
+  ContentObjectHeader ();
+
+  /**
+   * \brief Set interest name
+   *
+   * Sets name of the interest. For example, SetName( Name::Components("prefix")("postfix") );
+   **/
+  void
+  SetName (const Ptr<Name::Components> &name);
+
+  const Name::Components&
+  GetName () const;
+
+  // void
+  // SetSignature ();
+
+  // ?
+  // GetSignature () const;
+
+  // void
+  // SetSignedInfo ();
+
+  // ?
+  // GetSignedInfo () const;
+
+  // void
+  // SetContent ();
+
+  // ?
+  // GetContent ();
+  
+  //////////////////////////////////////////////////////////////////
+  
+  static TypeId GetTypeId (void);
+  virtual TypeId GetInstanceTypeId (void) const;
+  virtual void Print (std::ostream &os) const;
+  virtual uint32_t GetSerializedSize (void) const;
+  virtual void Serialize (Buffer::Iterator start) const;
+  virtual uint32_t Deserialize (Buffer::Iterator start);
+
+private:
+  Ptr<Name::Components> m_name;
+  // m_signature;
+  // m_signedInfo;
+  // ? content
+};
+
+} // namespace NDNabstraction
+} // namespace ns3
+
+#endif // _CONTENT_OBJECT_HEADER_H_
diff --git a/model/interest-packet.cc b/model/interest-header.cc
similarity index 98%
rename from model/interest-packet.cc
rename to model/interest-header.cc
index eecb753..ef974a9 100644
--- a/model/interest-packet.cc
+++ b/model/interest-header.cc
@@ -23,7 +23,7 @@
 ///< #CCN_PR_SCOPE2 (0x80) immediate neighborhood
 
 
-#include "interest-packet.h"
+#include "interest-header.h"
 
 namespace ns3
 {
diff --git a/model/interest-header.h b/model/interest-header.h
new file mode 100644
index 0000000..4f2b948
--- /dev/null
+++ b/model/interest-header.h
@@ -0,0 +1,227 @@
+/* -*-  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>
+ *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
+
+#ifndef _INTEREST_HEADER_H_
+#define _INTEREST_HEADER_H_
+
+#include <ns3/integer.h>
+#include <ns3/header.h>
+
+#include <string>
+#include <vector>
+#include <list>
+
+#include "name-components.h"
+
+namespace ns3
+{
+namespace NDNabstraction
+{
+
+/**
+ * CCNx XML definition of Interest
+ * 
+ * Only few important fields are actually implemented in the simulation
+ *
+ * <xs:element name="Interest" type="InterestType"/>
+ * <xs:complexType name="InterestType">
+ *   <xs:sequence>
+ *     <xs:element name="Name" type="NameType"/>
+ *     <xs:element name="MinSuffixComponents" type="xs:nonNegativeInteger"
+ *                         minOccurs="0" maxOccurs="1"/>
+ *     <xs:element name="MaxSuffixComponents" type="xs:nonNegativeInteger"
+ *                         minOccurs="0" maxOccurs="1"/>
+ *     <xs:choice minOccurs="0" maxOccurs="1">
+ *         <xs:element name="PublisherPublicKeyDigest" type="DigestType"/>
+ *         <xs:element name="PublisherCertificateDigest" type="DigestType"/>
+ *         <xs:element name="PublisherIssuerKeyDigest" type="DigestType"/>
+ *         <xs:element name="PublisherIssuerCertificateDigest" type="DigestType"/>
+ *     </xs:choice>
+ *     <xs:element name="Exclude" type="ExcludeType"
+ *                         minOccurs="0" maxOccurs="1"/>
+ *     <xs:element name="ChildSelector" type="xs:nonNegativeInteger"
+ *                         minOccurs="0" maxOccurs="1"/>
+ *     <xs:element name="AnswerOriginKind" type="xs:nonNegativeInteger"
+ *                         minOccurs="0" maxOccurs="1"/>
+ *     <xs:element name="Scope" type="xs:nonNegativeInteger"
+ * 			minOccurs="0" maxOccurs="1"/>
+ *     <xs:element name="InterestLifetime" type="FinegrainLifetimeType"
+ * 			minOccurs="0" maxOccurs="1"/>
+ *     <xs:element name="Nonce" type="Base64BinaryType"
+ * 			minOccurs="0" maxOccurs="1"/>
+ *   </xs:sequence>
+ * </xs:complexType>
+ *
+ * <xs:complexType name="NameType">
+ *   <xs:sequence>
+ *     <xs:element name="Component" type="Base64BinaryType"
+ *                 minOccurs="0" maxOccurs="unbounded"/>
+ *   </xs:sequence>
+ * </xs:complexType>
+ * 
+ * <xs:complexType name="ExcludeType">
+ *   <xs:sequence>
+ *     <xs:choice minOccurs="0" maxOccurs="1">
+ *         <xs:element name="Any" type="EmptyType"/>
+ *         <xs:element name="Bloom" type="Base64BinaryType"/> <!-- Bloom is deprecated --!>
+ *     </xs:choice>
+ *      <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ *         <xs:element name="Component" type="Base64BinaryType"/>
+ *         <xs:choice minOccurs="0" maxOccurs="1">
+ *             <xs:element name="Any" type="EmptyType"/>
+ *             <xs:element name="Bloom" type="Base64BinaryType"/> <!-- Bloom is deprecated --!>
+ *         </xs:choice>
+ *      </xs:sequence>
+ *   </xs:sequence>
+ * </xs:complexType>
+ * 
+ * <!-- Binary representation of time, Unix time epoch, units 2**-12 sec (0.000244140625 sec) -->
+ * <!-- The length limit limit of 6 bytes is not actually to be enforced, but
+ *      it will be a loooooooong time before anyone cares. --> 
+ * 
+ * <!-- Binary representation of relative time, relative to "now" -->
+ * <xs:complexType name="FinegrainLifetimeType">
+ *   <xs:simpleContent>
+ *     <xs:extension base="BinaryTime12">
+ *       <xs:attribute name="ccnbencoding" type="xs:string" fixed="base64Binary"/>
+ *     </xs:extension>
+ *   </xs:simpleContent>
+ * </xs:complexType>
+ *
+ * <xs:simpleType name="BinaryTime12">
+ *     <xs:restriction base="xs:base64Binary">
+ *       <xs:length value="6" fixed="true"/>
+ *     </xs:restriction>
+ * </xs:simpleType>
+ *
+ **/
+
+/**
+   NDN InterestHeader and routines to serialize/deserialize
+
+   Simplifications:
+   - Name:  binary name components are not supported
+   - MinSuffixComponents and MasSuffixComponents: if value is negative (default), will not be serialized
+   - ChildSelector, AnswerOriginKind: 0 - false, 1 - true, -1 not set
+   - Publisher* elements are not supported
+   - Exclude: only simple name matching is supported (Bloom support has been deprecated in CCNx)
+   - InterestLifetime: not used if negative
+   - Nonce: 32 bit random integer.  If value is 0, will not be serialized
+ */
+class InterestHeader : public Header
+{
+public:
+  /**
+   * Constructor
+   *
+   * Creates a null header
+   **/
+  InterestHeader ();
+
+  /**
+   * \brief Set interest name
+   *
+   * Sets name of the interest. For example, SetName( Name::Components("prefix")("postfix") );
+   **/
+  void
+  SetName (const Ptr<Name::Components> &name);
+
+  const Name::Components&
+  GetName () const;
+
+  void
+  SetMinSuffixComponents (int32_t value);
+
+  int32_t
+  GetMinSuffixComponents () const;
+
+  void
+  SetMaxSuffixComponents (int32_t value);
+
+  int32_t
+  GetMaxSuffixComponents () const;
+
+  /**
+   * \brief Set exclude filer
+   *
+   * For example, SetExclude (Name::Components("exclude1")("exclude2")("exclude3"))
+   **/
+  void
+  SetExclude (const Ptr<Name::Components> &exclude);
+
+  const Name::Components&
+  GetExclude () const;
+
+  void
+  EnableChildSelector ();
+
+  bool
+  IsEnabledChildSelector () const;
+
+  void
+  EnableAnswerOriginKind ();
+
+  bool
+  IsEnabledAnswerOriginKind () const;
+
+  void
+  SetScope (int8_t scope);
+
+  int8_t
+  GetScope () const;
+
+  void
+  SetInterestLifetime (intmax_t lifetime);
+
+  intmax_t
+  GetInterestLifetime () const;
+
+  void
+  SetNonce (uint32_t nonce);
+
+  uint32_t
+  GetNonce () const;
+
+  //////////////////////////////////////////////////////////////////
+  
+  static TypeId GetTypeId (void);
+  virtual TypeId GetInstanceTypeId (void) const;
+  virtual void Print (std::ostream &os) const;
+  virtual uint32_t GetSerializedSize (void) const;
+  virtual void Serialize (Buffer::Iterator start) const;
+  virtual uint32_t Deserialize (Buffer::Iterator start);
+
+private:
+  Ptr<Name::Components> m_name;
+  int32_t m_minSuffixComponents; ///< minimum suffix components. not used if negative
+  int32_t m_maxSuffixComponents; ///< maximum suffix components. not used if negative
+  Ptr<Name::Components> m_exclude; ///< exclude filter
+  bool m_childSelector;    
+  bool m_answerOriginKind; 
+  int8_t m_scope;            ///< -1 not set, 0 local scope, 1 this host, 2 immediate neighborhood
+  intmax_t m_interestLifetime; ///< InterestLifetime in 2^{-12} (0.000244140625 sec). not used if negative
+  uint32_t m_nonce; ///< Nonce. not used if zero
+};
+
+} // namespace NDNabstraction
+} // namespace ns3
+
+#endif // _INTEREST_HEADER_H_
diff --git a/model/interest-packet.h b/model/interest-packet.h
deleted file mode 100644
index d4b2f9f..0000000
--- a/model/interest-packet.h
+++ /dev/null
@@ -1,254 +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>
- */
-
-#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/integer.h>
-#include <ns3/header.h>
-#include <ns3/packet.h>
-
-#include <string>
-#include <vector>
-#include <list>
-
-#include "name-components.h"
-
-namespace ns3
-{
-namespace NDNabstraction
-{
-
-/**
- * CCNx XML definition of Interest
- * 
- * Only few important fields are actually implemented in the simulation
- *
- * <xs:element name="Interest" type="InterestType"/>
- * <xs:complexType name="InterestType">
- *   <xs:sequence>
- *     <xs:element name="Name" type="NameType"/>
- *     <xs:element name="MinSuffixComponents" type="xs:nonNegativeInteger"
- *                         minOccurs="0" maxOccurs="1"/>
- *     <xs:element name="MaxSuffixComponents" type="xs:nonNegativeInteger"
- *                         minOccurs="0" maxOccurs="1"/>
- *     <xs:choice minOccurs="0" maxOccurs="1">
- *         <xs:element name="PublisherPublicKeyDigest" type="DigestType"/>
- *         <xs:element name="PublisherCertificateDigest" type="DigestType"/>
- *         <xs:element name="PublisherIssuerKeyDigest" type="DigestType"/>
- *         <xs:element name="PublisherIssuerCertificateDigest" type="DigestType"/>
- *     </xs:choice>
- *     <xs:element name="Exclude" type="ExcludeType"
- *                         minOccurs="0" maxOccurs="1"/>
- *     <xs:element name="ChildSelector" type="xs:nonNegativeInteger"
- *                         minOccurs="0" maxOccurs="1"/>
- *     <xs:element name="AnswerOriginKind" type="xs:nonNegativeInteger"
- *                         minOccurs="0" maxOccurs="1"/>
- *     <xs:element name="Scope" type="xs:nonNegativeInteger"
- * 			minOccurs="0" maxOccurs="1"/>
- *     <xs:element name="InterestLifetime" type="FinegrainLifetimeType"
- * 			minOccurs="0" maxOccurs="1"/>
- *     <xs:element name="Nonce" type="Base64BinaryType"
- * 			minOccurs="0" maxOccurs="1"/>
- *   </xs:sequence>
- * </xs:complexType>
- *
- * <xs:complexType name="NameType">
- *   <xs:sequence>
- *     <xs:element name="Component" type="Base64BinaryType"
- *                 minOccurs="0" maxOccurs="unbounded"/>
- *   </xs:sequence>
- * </xs:complexType>
- * 
- * <xs:complexType name="ExcludeType">
- *   <xs:sequence>
- *     <xs:choice minOccurs="0" maxOccurs="1">
- *         <xs:element name="Any" type="EmptyType"/>
- *         <xs:element name="Bloom" type="Base64BinaryType"/> <!-- Bloom is deprecated --!>
- *     </xs:choice>
- *      <xs:sequence minOccurs="0" maxOccurs="unbounded">
- *         <xs:element name="Component" type="Base64BinaryType"/>
- *         <xs:choice minOccurs="0" maxOccurs="1">
- *             <xs:element name="Any" type="EmptyType"/>
- *             <xs:element name="Bloom" type="Base64BinaryType"/> <!-- Bloom is deprecated --!>
- *         </xs:choice>
- *      </xs:sequence>
- *   </xs:sequence>
- * </xs:complexType>
- * 
- * <!-- Binary representation of time, Unix time epoch, units 2**-12 sec (0.000244140625 sec) -->
- * <!-- The length limit limit of 6 bytes is not actually to be enforced, but
- *      it will be a loooooooong time before anyone cares. --> 
- * 
- * <!-- Binary representation of relative time, relative to "now" -->
- * <xs:complexType name="FinegrainLifetimeType">
- *   <xs:simpleContent>
- *     <xs:extension base="BinaryTime12">
- *       <xs:attribute name="ccnbencoding" type="xs:string" fixed="base64Binary"/>
- *     </xs:extension>
- *   </xs:simpleContent>
- * </xs:complexType>
- *
- * <xs:simpleType name="BinaryTime12">
- *     <xs:restriction base="xs:base64Binary">
- *       <xs:length value="6" fixed="true"/>
- *     </xs:restriction>
- * </xs:simpleType>
- *
- **/
-
-  /**
-     NDN InterestPacket and routes to serialize/deserialize
-
-     Simplifications:
-     - Name:  binary name components are not supported
-     - MinSuffixComponents and MasSuffixComponents: if value is negative (default), will not be serialized
-     - ChildSelector, AnswerOriginKind: 0 - false, 1 - true, -1 not set
-     - Publisher* elements are not supported
-     - Exclude: only simple name matching is supported (Bloom support has been deprecated in CCNx)
-     - InterestLifetime: not used if negative
-     - Nonce: 32 bit random integer.  If value is 0, will not be serialized
-   */
-  class InterestHeader : public Header
-  {
-  public:
-    /**
-     * Constructor
-     *
-     * Creates a null header
-     **/
-    InterestHeader ();
-
-    /**
-     * \brief Set interest name
-     *
-     * Sets name of the interest. For example, SetName( Name::Components("prefix")("postfix") );
-     **/
-    void
-    SetName (const Ptr<Name::Components> &name);
-
-    const Name::Components&
-    GetName () const;
-
-    void
-    SetMinSuffixComponents (int32_t value);
-
-    int32_t
-    GetMinSuffixComponents () const;
-
-    void
-    SetMaxSuffixComponents (int32_t value);
-
-    int32_t
-    GetMaxSuffixComponents () const;
-
-    /**
-     * \brief Set exclude filer
-     *
-     * For example, SetExclude (Name::Components("exclude1")("exclude2")("exclude3"))
-     **/
-    void
-    SetExclude (const Ptr<Name::Components> &exclude);
-
-    const Name::Components&
-    GetExclude () const;
-
-    void
-    EnableChildSelector ();
-
-    bool
-    IsEnabledChildSelector () const;
-
-    void
-    EnableAnswerOriginKind ();
-
-    bool
-    IsEnabledAnswerOriginKind () const;
-
-    void
-    SetScope (int8_t scope);
-
-    int8_t
-    GetScope () const;
-
-    void
-    SetInterestLifetime (intmax_t lifetime);
-
-    intmax_t
-    GetInterestLifetime () const;
-
-    void
-    SetNonce (uint32_t nonce);
-
-    uint32_t
-    GetNonce () const;
-
-    //////////////////////////////////////////////////////////////////
-    
-    static TypeId GetTypeId (void);
-    virtual TypeId GetInstanceTypeId (void) const;
-    virtual void Print (std::ostream &os) const;
-    virtual uint32_t GetSerializedSize (void) const;
-    virtual void Serialize (Buffer::Iterator start) const;
-    virtual uint32_t Deserialize (Buffer::Iterator start);
-
-  private:
-    Ptr<Name::Components> m_name;
-    int32_t m_minSuffixComponents; ///< minimum suffix components. not used if negative
-    int32_t m_maxSuffixComponents; ///< maximum suffix components. not used if negative
-    Ptr<Name::Components> m_exclude; ///< exclude filter
-    bool m_childSelector;    
-    bool m_answerOriginKind; 
-    int8_t m_scope;            ///< -1 not set, 0 local scope, 1 this host, 2 immediate neighborhood
-    intmax_t m_interestLifetime; ///< InterestLifetime in 2^{-12} (0.000244140625 sec). not used if negative
-    uint32_t m_nonce; ///< Nonce. not used if zero
-  };
-
-
-  // Not sure that we need a separate NndPacket class. Everything useful will be inside (Interest|ContentObject)Header
-// class NdnPacket : public Packet 
-// {
-// public:
-//   NdnPacket( )
-    // ; 
-  // 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 // _NDN_PACKET_H_
diff --git a/apps/stupid-interest-generator.cc b/model/stupid-interest-generator.cc
similarity index 97%
rename from apps/stupid-interest-generator.cc
rename to model/stupid-interest-generator.cc
index 15548a6..bd2cb6d 100644
--- a/apps/stupid-interest-generator.cc
+++ b/model/stupid-interest-generator.cc
@@ -12,7 +12,8 @@
 #include "ns3/socket-factory.h"
 #include "ns3/simulator.h"
 
-#include "model/interest-packet.h"
+#include "interest-header.h"
+#include "content-object-header.h"
 
 NS_LOG_COMPONENT_DEFINE ("StupidInterestGenerator");
 
@@ -163,6 +164,8 @@
         // NameBuilder name;
 		// name("prefix1")("prefix2")("filename");
 		InterestHeader ();
+
+		ContentObjectHeader ();
 		
         // const ccn_charbuf *output = name.GetName();
         // Ptr<InterestPacket> packet = Create<InterestPacket>(name,(uint32_t)output->length);
diff --git a/apps/stupid-interest-generator.h b/model/stupid-interest-generator.h
similarity index 99%
rename from apps/stupid-interest-generator.h
rename to model/stupid-interest-generator.h
index d2533c2..8d927cd 100644
--- a/apps/stupid-interest-generator.h
+++ b/model/stupid-interest-generator.h
@@ -13,9 +13,9 @@
 #include <ns3/nstime.h>
 #include <ns3/event-id.h>
 #include <ns3/ptr.h>
+#include <ns3/udp-socket-factory.h>
 
 #include "ccn/ccn.h"
-#include <ns3/udp-socket-factory.h>
 
 namespace ns3 
 {
diff --git a/apps/stupid-interest-sink.cc b/model/stupid-interest-sink.cc
similarity index 100%
rename from apps/stupid-interest-sink.cc
rename to model/stupid-interest-sink.cc
diff --git a/apps/stupid-interest-sink.h b/model/stupid-interest-sink.h
similarity index 100%
rename from apps/stupid-interest-sink.h
rename to model/stupid-interest-sink.h
diff --git a/wscript b/wscript
index 42ca6d9..153e3a2 100644
--- a/wscript
+++ b/wscript
@@ -5,22 +5,19 @@
     module.includes = '.'
     module.source = [
         'model/ccn/ccn_charbuf.cc',
-		'model/ccn/ccn_name_util.cc',
-		'model/ccn/ccn_coding.cc',
-		'model/ccn/ccn_indexbuf.cc',
-		'model/ccn/ccn_random.cc',
-		'model/ccn/ccn_buf_decoder.cc',
-		'model/ccn/ccn_buf_encoder.cc',
+        'model/ccn/ccn_name_util.cc',
+        'model/ccn/ccn_coding.cc',
+        'model/ccn/ccn_indexbuf.cc',
+        'model/ccn/ccn_random.cc',
+        'model/ccn/ccn_buf_decoder.cc',
+        'model/ccn/ccn_buf_encoder.cc',
         
-        'model/ndn_face.cc',
-        'model/interest-packet.cc',
-        'model/ndn_contentpacket.cc',
-        'model/ndn_timeoutheader.cc',
-        'model/ndn_nonceheader.cc',
         'model/name-components.cc',
+        'model/interest-header.cc',
+        'model/content-object-header.cc',
 
-        'apps/stupid-interest-generator.cc',
-        'apps/stupid-interest-sink.cc',
+        'model/stupid-interest-generator.cc',
+        'model/stupid-interest-sink.cc',
         ]
 
     module_test = bld.create_ns3_module_test_library('NDNabstraction')
@@ -32,23 +29,23 @@
     headers.module = 'NDNabstraction'
     headers.source = [
         'model/ccn/ccn.h',
-		'model/ccn/ccn_charbuf.h',
-		'model/ccn/ccn_coding.h',
-		'model/ccn/ccn_name_util.h',
-		'model/ccn/ccn_indexbuf.h',
-		'model/ccn/ccn_random.h',
+        'model/ccn/ccn_charbuf.h',
+        'model/ccn/ccn_coding.h',
+        'model/ccn/ccn_name_util.h',
+        'model/ccn/ccn_indexbuf.h',
+        'model/ccn/ccn_random.h',
 
-        'model/ndn_face.h',
-        'model/interest-packet.h',
-        'model/ndn_contentpacket.h',
-        'model/ndn_timeoutheader.h',
-        'model/ndn_nonceheader.h',
+        # 'model/ndnabstraction-header.h',
+
         'model/name-components.h',
+        'model/interest-header.h',
+        'model/content-object-header.h',
+
         # 'helper/ndnabstraction-helper.h',
         'helper/ndn_stupidinterestgenerator_helper.h',
 
-        'apps/stupid-interest-generator.h',
-        'apps/stupid-interest-sink.h'
+        'model/stupid-interest-generator.h',
+        'model/stupid-interest-sink.h'
         ]