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

📄 protoname_pkt.h

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

#include <packet.h>

#define HDR_PROTONAME_PKT(p) hdr_protoname_pkt::access(p)

struct hdr_protoname_pkt {
    nsaddr_t pkt_src_; // Node which originated this packet
	nsaddr_t pkt_dst_;
    u_int16_t pkt_len_; // Packet length (in bytes)
    u_int8_t pkt_seq_num_; // Packet sequence number    u_int16_t pkt_app_;    //the variable to differ serv    u_int16_t pkt_temp_;   inline u_int16_t& pkt_temp() { return pkt_temp_; }           //u_int16_t pkt_pairkeys_[10];            //inline u_int16_t& pkt_pairkeys(int i) { return pkt_pairkeys_[i]; }                   u_int8_t pkt_ran_;inline u_int8_t& pkt_ran() { return pkt_ran_; }             

    inline nsaddr_t& pkt_src() { return pkt_src_; }
	 inline nsaddr_t& pkt_dst() { return pkt_dst_; }
    inline u_int16_t& pkt_len() { return pkt_len_; }
    inline u_int8_t& pkt_seq_num() { return pkt_seq_num_; }
    inline u_int16_t& pkt_app() { return pkt_app_; }
    static int offset_;
    inline static int& offset() { return offset_; }
    inline static hdr_protoname_pkt* access(const Packet* p) {
    	return (hdr_protoname_pkt*)p->access(offset_);
    }
};

#endif

⌨️ 快捷键说明

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