hdr_span.h

来自「ns-2 code for coverage and connectivity 」· C头文件 代码 · 共 64 行

H
64
字号
#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 + =
减小字号Ctrl + -
显示快捷键?