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

📄 protoname_pkt.h

📁 Implementing a New Manet Unicast Routing Protocol in 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
    u_int16_t pkt_len_; // Packet length (in bytes)
    u_int8_t pkt_seq_num_; // Packet sequence number

    inline nsaddr_t& pkt_src() { return pkt_src_; }
    inline u_int16_t& pkt_len() { return pkt_len_; }
    inline u_int8_t& pkt_seq_num() { return pkt_seq_num_; }

    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 + -