⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 protoname.h

📁 在ns2下实现无线传感器网络仿真
💻 H
字号:
#ifndef __protoname_h__
#define __protoname_h__

#include "protoname_pkt.h"
// #include "protoname_rtable.h"
#include <agent.h>
#include <packet.h>
#include <trace.h>
#include <timer-handler.h>
#include <random.h>
#include <classifier-port.h>
#include <mobilenode.h>
#include "arp.h"
#include "ll.h"
#include "mac.h"
#include "ip.h"
#include "delay.h"

#define CURRENT_TIME Scheduler::instance().clock()
#define JITTER (Random::uniform()*0.5)

class Protoname; // forward declaration

/* Timers */

//class Protoname_PktTimer : public TimerHandler {
//    public:
//    Protoname_PktTimer(Protoname* agent) : TimerHandler() {
//    	agent_ = agent;
//    }
//    
//    protected:
//    Protoname* agent_;
//    virtual void expire(Event* e);
//};

/* Agent */

class Protoname : public Agent {

//   /* Friends */
//   friend class Protoname_PktTimer;

   /* Private members */
   nsaddr_t ra_addr_;
//    protoname_rtable rtable_;
   int accesible_var_;
   u_int8_t seq_num_;     u_int16_t key_element;           //afeirgoo add here 20/06/07   u_int16_t pkt_pairkeys_[10];   nsaddr_t  pkt_neighbours_[10];        int index;

   protected:

   MobileNode* node_;
   PortClassifier* dmux_; // For passing packets up to agents.
   Trace* logtarget_; // For logging.
//    Protoname_PktTimer pkt_timer_; // Timer for sending packets.

   inline nsaddr_t& ra_addr() { return ra_addr_; }
   //inline int& accessible_var() { return accesible_var_; }
 
   void forward_data(Packet*);
   void recv_protoname_pkt(Packet*);
   void send_protoname_pkt(nsaddr_t);   void send_protoname_pairkey();      void init();
  
//   void reset_protoname_pkt_timer();
 
   public:

   Protoname(nsaddr_t);
   int command(int, const char*const*);
   void recv(Packet*, Handler*);
   //void mac_failed(Packet*);
};

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -