#include <packet.h>
Inheritance diagram for Packet:


Public Member Functions | |
| Packet () | |
| unsigned char *const | bits () |
| Packet * | copy () const |
| Packet * | refcopy () |
| int & | ref_count () |
| void | allocdata (int) |
| void | initdata () |
| unsigned char * | access (int off) const |
| unsigned char * | accessdata () const |
| AppData * | userdata () const |
| void | setdata (AppData *d) |
| int | datalen () const |
Static Public Member Functions | |
| Packet * | alloc () |
| Packet * | alloc (int) |
| void | free (Packet *) |
| void | dump_header (Packet *p, int offset, int length) |
Public Attributes | |
| Packet * | next_ |
| PacketStamp | txinfo_ |
| u_int8_t | incoming |
| Event * | prev_ |
| Handler * | handler_ |
| double | time_ |
| scheduler_uid_t | uid_ |
Static Public Attributes | |
| int | hdrlen_ = 0 |
Protected Attributes | |
| int | ref_count_ |
Static Protected Attributes | |
| Packet * | free_ |
Static Private Member Functions | |
| void | init (Packet *) |
Private Attributes | |
| unsigned char * | bits_ |
| AppData * | data_ |
| bool | fflag_ |
|
|
Definition at line 321 of file packet.h. References bits_, data_, next_, and ref_count_.
00321 : bits_(0), data_(0), ref_count_(0), next_(0) { } |
|
Here is the call graph for this function:

|
Here is the call graph for this function:

|
|
Definition at line 546 of file packet.h. References alloc(), and allocdata().
|
Here is the call graph for this function:

|
|
Definition at line 506 of file packet.h. References abort(), bits_, data_, hdr_cmn::DOWN, FALSE, fflag_, free_, HDR_CMN, hdrlen_, init(), next_, Event::time_, TRUE, and Event::uid_. Referenced by alloc(), Agent::allocpkt(), ARPTable::arprequest(), copy(), AODV::handle_link_failure(), imepAgent::handlerControlTimer(), PcapNetwork::phandler_callback(), AODV::recvError(), AODV::rt_resolve(), SMAC::sendACK(), Mac802_11::sendACK(), imepAgent::sendAck(), imepAgent::sendBeacon(), toraAgent::sendCLR(), SMAC::sendCTS(), Mac802_11::sendCTS(), imepAgent::sendHello(), AODV::sendHello(), toraAgent::sendQRY(), AODV::sendReply(), AODV::sendRequest(), SMAC::sendRTS(), Mac802_11::sendRTS(), SMAC::sendSYNC(), and toraAgent::sendUPD().
00507 {
00508 Packet* p = free_;
00509 if (p != 0) {
00510 assert(p->fflag_ == FALSE);
00511 free_ = p->next_;
00512 assert(p->data_ == 0);
00513 p->uid_ = 0;
00514 p->time_ = 0;
00515 } else {
00516 p = new Packet;
00517 p->bits_ = new unsigned char[hdrlen_];
00518 if (p == 0 || p->bits_ == 0)
00519 abort();
00520 }
00521 init(p); // Initialize bits_[]
00522 (HDR_CMN(p))->next_hop_ = -2; // -1 reserved for IP_BROADCAST
00523 (HDR_CMN(p))->last_hop_ = -2; // -1 reserved for IP_BROADCAST
00524 p->fflag_ = TRUE;
00525 (HDR_CMN(p))->direction() = hdr_cmn::DOWN;
00526 /* setting all direction of pkts to be downward as default;
00527 until channel changes it to +1 (upward) */
00528 p->next_ = 0;
00529 return (p);
00530 }
|
Here is the call graph for this function:

|
|
Definition at line 537 of file packet.h. References abort(), and data_. Referenced by alloc(), Agent::allocpkt(), SensorQueryAgent::generate_query(), LandmarkAgent::makeUpdate(), DSDV_Agent::makeUpdate(), and GAFAgent::makeUpDiscoveryMsg().
00538 {
00539 assert(data_ == 0);
00540 data_ = new PacketData(n);
00541 if (data_ == 0)
00542 abort();
00543 }
|
Here is the call graph for this function:

|
|
Definition at line 322 of file packet.h. References bits_. Referenced by copy(), RLM_Receiver::recv(), and RLM_Sender::sendpkt().
00322 { return (bits_); }
|
|
Here is the call graph for this function:

|
|
Definition at line 355 of file packet.h. References data_, and AppData::size(). Referenced by NatAgent::nat(), and RapAgent::recv().
|
Here is the call graph for this function:

|
||||||||||||||||
|
Definition at line 592 of file packet.h. References bits_, HDR_CMN, and hdrlen_. Referenced by imepAgent::imep_dump_header().
00593 {
00594 assert(offset + length <= p->hdrlen_);
00595 struct hdr_cmn *ch = HDR_CMN(p);
00596
00597 fprintf(stderr, "\nPacket ID: %d\n", ch->uid());
00598
00599 for(int i = 0; i < length ; i+=16) {
00600 fprintf(stderr, "%02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n",
00601 p->bits_[offset + i], p->bits_[offset + i + 1],
00602 p->bits_[offset + i + 2], p->bits_[offset + i + 3],
00603 p->bits_[offset + i + 4], p->bits_[offset + i + 5],
00604 p->bits_[offset + i + 6], p->bits_[offset + i + 7],
00605 p->bits_[offset + i + 8], p->bits_[offset + i + 9],
00606 p->bits_[offset + i + 10], p->bits_[offset + i + 11],
00607 p->bits_[offset + i + 12], p->bits_[offset + i + 13],
00608 p->bits_[offset + i + 14], p->bits_[offset + i + 15]);
00609 }
00610 }
|
|
Here is the call graph for this function:

|
|
Definition at line 501 of file packet.h. References bits_, and hdrlen_. Referenced by alloc(), and free().
00502 {
00503 bzero(p->bits_, hdrlen_);
00504 }
|
|
|
Definition at line 330 of file packet.h. References data_.
00330 { data_ = 0;}
|
|
|
Definition at line 325 of file packet.h. References ref_count_. Referenced by Mac802_3::recv_complete().
00325 { return (ref_count_); }
|
|
|
Definition at line 324 of file packet.h. References ref_count_. Referenced by SessionHelper::recv(), and NoDupChannel::sendUp().
00324 { ++ref_count_; return this; }
|
|
|
Definition at line 350 of file packet.h. References data_. Referenced by HttpInvalAgent::send(), UdpAgent::sendmsg(), and RapAgent::SendPacket().
|
|
|
Definition at line 347 of file packet.h. References data_. Referenced by UdpAgent::recv(), RapAgent::recv(), and HttpInvalAgent::recv().
00347 {
00348 return data_;
00349 }
|
|
|
Definition at line 308 of file packet.h. Referenced by access(), alloc(), bits(), copy(), dump_header(), init(), and Packet(). |
|
|
Definition at line 311 of file packet.h. Referenced by accessdata(), alloc(), allocdata(), copy(), datalen(), free(), initdata(), Packet(), setdata(), and userdata(). |
|
|
|
|
|
|
|
|
Definition at line 60 of file scheduler.h. Referenced by FQ::deque(), Scheduler::dispatch(), Scheduler::dumpq(), and Scheduler::schedule(). |
|
|
Definition at line 46 of file packet.cc. Referenced by alloc(), copy(), dump_header(), init(), and PacketHeaderManager::PacketHeaderManager(). |
|
|
|
|
|
|
Definition at line 59 of file scheduler.h. Referenced by CalendarScheduler::cancel(), CalendarScheduler::deque(), CalendarScheduler::insert(), CalendarScheduler::insert2(), and CalendarScheduler::resize(). |
|
|
Definition at line 316 of file packet.h. Referenced by free(), Packet(), ref_count(), and refcopy(). |
|
|
|
Definition at line 364 of file packet.h. Referenced by copy(), Mac802_11::discard(), SMAC::recv(), Mac802_11::recv(), WirelessPhy::sendDown(), and WirelessPhy::sendUp(). |
|
1.3.3