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

📄 hdr_span.h

📁 ns-2 code for coverage and connectivity protocol for wireless sensor network
💻 H
字号:
#ifndef SPANPACKET_H#define SPANPACKET_H#define MAX_SPAN_NEIGHBORS    	256#define MAX_SPAN_COORDINATORS 	32#define SPAN_DEF_TTL       	32#define SPAN_DROP_RECEIVED	"RCV"#define SPAN_DROP_TX_FAILED	"TXF"#define SPAN_DROP_BUF		"BUF"#define SPAN_GF_TTL		"TTL"#define SPAN_GF_HOLE		"GFH"#include <packet.h>struct hdr_span {#define SPAN_DATA		0#define SPAN_HELLO              1  unsigned char type;  bool is_coordinator;  bool is_tentative;  bool to_coordinator;  int node_id;  int x;  int y;  int dst_x;  int dst_y;  int nounce;  inline int size() { return sizeof(struct hdr_span); }  static int _offset;};struct span_hello {  static int _offset;  unsigned ncoordinators;  unsigned nneighbors;#ifdef TWO_HOP_BEACON  unsigned coordinators_pos[2*MAX_SPAN_COORDINATORS];#endif  unsigned coordinators[MAX_SPAN_COORDINATORS];  unsigned neighbors[MAX_SPAN_NEIGHBORS];  inline int size() { #ifdef TWO_HOP_BEACON    return (2+3*ncoordinators+nneighbors)*sizeof(unsigned);#else    return (2+ncoordinators+nneighbors)*sizeof(unsigned);#endif  }};struct span_poll {  static int _offset;  inline int size() { return sizeof(struct span_poll); }};#endif

⌨️ 快捷键说明

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