/* -*- Mode:C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t; font-lock-mode:t -*- */ #ifndef _HDR_PAMPA_H #define _HDR_PAMPA_H struct hdr_pampa { // ns-2 stuff static int offset_; inline int& offset() { return offset_;} inline static hdr_pampa* access(const Packet* p) { return (hdr_pampa*)p->access(offset_); } // Our stuff nsaddr_t source_; // Originator of the packet int uid_; // Unique ID (at the originator) int size_; // "Real" size of the packet (from a simulation point of view) double timesent_; // time at the sender of the packet int nHops_; // number of hops already traveled }; // Alterar em: // vi common/packet.h // bugs:ns-2.28$ vi tcl/lib/ns-packet.tcl // bugs:ns-2.28$ vi trace/cmu-trace.h // bugs:ns-2.28$ vi trace/cmu-trace.cc // void CMUTrace::format_pampa(Packet* pkt,int offset) { // hdr_pampa *pampahdr=hdr_pampa::access(pkt); // sprintf(pt_->buffer() + offset,"-P pampa -Ps %d -Pi %d -Ps %d " // "-Pt %g -Ph %d", // pampahdr->source_,pampahdr->uid_,pampahdr->size_, // pampahdr->timesent_,pampahdr->nHops_); // } #endif