src/netanim/model/animation-interface.h
changeset 7769 ccd721b6a755
parent 7766 c72c3511728f
child 7804 5ccfa6a97f71
--- a/src/netanim/model/animation-interface.h	Sun Mar 18 20:43:18 2012 +0100
+++ b/src/netanim/model/animation-interface.h	Mon Mar 19 13:20:16 2012 -0700
@@ -225,6 +225,14 @@
    */
   void ShowAll802_11 (bool showAll); 
 
+  /**
+   *
+   * \brief Enable Packet metadata
+   * \param enable if true enables writing the packet metadata to the XML trace file
+   *        if false disables writing the packet metadata
+   */
+  void EnablePacketMetadata (bool enable);
+
 private:
 #ifndef WIN32
   int m_fHandle;  // File handle for output (-1 if none)
@@ -289,8 +297,8 @@
   // Write a string to the specified handle;
   int  WriteN (int, const std::string&);
 
-  void OutputWirelessPacket (AnimPacketInfo& pktInfo, AnimRxInfo pktrxInfo);
-  void OutputCsmaPacket (AnimPacketInfo& pktInfo, AnimRxInfo pktrxInfo);
+  void OutputWirelessPacket (Ptr<const Packet> p, AnimPacketInfo& pktInfo, AnimRxInfo pktrxInfo);
+  void OutputCsmaPacket (Ptr<const Packet> p, AnimPacketInfo& pktInfo, AnimRxInfo pktrxInfo);
   void MobilityAutoCheck ();
   
   uint64_t gAnimUid ;    // Packet unique identifier used by Animtion
@@ -336,6 +344,7 @@
 
   bool m_started;
   bool m_enforceWifiMacRx;
+  bool m_enablePacketMetadata; 
 
   // Path helper
   std::vector<std::string> GetElementsFromContext (std::string context);
@@ -349,6 +358,8 @@
   double topo_maxX;
   double topo_maxY;
 
+  std::string GetPacketMetadata (Ptr<const Packet> p);
+
   std::string GetXMLOpen_anim (uint32_t lp);
   std::string GetXMLOpen_topology (double minX,double minY,double maxX,double maxY);
   std::string GetXMLOpenClose_node (uint32_t lp,uint32_t id,double locX,double locY);
@@ -357,6 +368,7 @@
   std::string GetXMLOpenClose_rx (uint32_t toLp, uint32_t toId, double fbRx, double lbRx);
   std::string GetXMLOpen_wpacket (uint32_t fromLp,uint32_t fromId, double fbTx, double lbTx, double range);
   std::string GetXMLClose (std::string name) {return "</" + name + ">\n"; }
+  std::string GetXMLOpenClose_meta (std::string metaInfo);
 
 };