亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? packet.h

?? 用C++編寫的GPRS協議棧源代碼
?? H
?? 第 1 頁 / 共 2 頁
字號:
	static void init(Packet*);     // initialize pkt hdr 	bool fflag_;protected:	static Packet* free_;	// packet free listpublic:	Packet* next_;		// for queues and the free list	static int hdrlen_;	Packet() : bits_(0), data_(0), next_(0) { }	inline unsigned char* const bits() { return (bits_); }	inline Packet* copy() const;	static inline Packet* alloc();	static inline Packet* alloc(int);	inline void allocdata(int);	static inline void free(Packet*);	inline unsigned char* access(int off) const {		if (off < 0)			abort();		return (&bits_[off]);	}	// This is used for backward compatibility, i.e., assuming user data	// is PacketData and return its pointer.	inline unsigned char* accessdata() const { 		if (data_ == 0)			return 0;		assert(data_->type() == PACKET_DATA);		return (((PacketData*)data_)->data()); 	}	// This is used to access application-specific data, not limited 	// to PacketData.	inline AppData* userdata() const {		return data_;	}	inline void setdata(AppData* d) { 		if (data_ != NULL)			delete data_;		data_ = d; 	}	inline int datalen() const { return data_ ? data_->size() : 0; }	// Monarch extn	static void dump_header(Packet *p, int offset, int length);	// the pkt stamp carries all info about how/where the pkt        // was sent needed for a receiver to determine if it correctly        // receives the pkt        PacketStamp	txinfo_;  	/*         * According to cmu code:	 * This flag is set by the MAC layer on an incoming packet         * and is cleared by the link layer.  It is an ugly hack, but         * there's really no other way because NS always calls         * the recv() function of an object.	 *          */        u_int8_t        incoming;	//monarch extns end;};/*  * static constant associations between interface special (negative)  * values and their c-string representations that are used from tcl */class iface_literal {public:	enum iface_constant { 		UNKN_IFACE= -1, /* 				 * iface value for locally originated packets 				 */		ANY_IFACE= -2   /* 				 * hashnode with iif == ANY_IFACE_   				 * matches any pkt iface (imported from TCL);				 * this value should be different from 				 * hdr_cmn::UNKN_IFACE (packet.h)				 */ 	};	iface_literal(const iface_constant i, const char * const n) : 		value_(i), name_(n) {}	inline int value() const { return value_; }	inline const char * const name() const { return name_; }private:	const iface_constant value_;	/* strings used in TCL to access those special values */	const char * const name_; };static const iface_literal UNKN_IFACE(iface_literal::UNKN_IFACE, "?");static const iface_literal ANY_IFACE(iface_literal::ANY_IFACE, "*");/* * Note that NS_AF_* doesn't necessarily correspond with * the constants used in your system (because many * systems don't have NONE or ILINK). */enum ns_af_enum { NS_AF_NONE, NS_AF_ILINK, NS_AF_INET };struct hdr_cmn {	enum dir_t { DOWN= -1, NONE= 0, UP= 1 };	packet_t ptype_;	// packet type (see above)	int	size_;		// simulated packet size	int	uid_;		// unique id	int	error_;		// error flag	double	ts_;		// timestamp: for q-delay measurement	int	iface_;		// receiving interface (label)	dir_t	direction_;	// direction: 0=none, 1=up, -1=down	int	ref_count_;	// free the pkt until count to 0	int chan_ ;// the "freq channel" this pkt shud be sent on. for GPRS -rj		//Monarch extn begins	nsaddr_t prev_hop_;     // IP addr of forwarding hop	nsaddr_t next_hop_;	// next hop for this packet	int      addr_type_;    // type of next_hop_ addr	nsaddr_t last_hop_;     // for tracing on multi-user channels        // called if pkt can't obtain media or isn't ack'd. not called if        // droped by a queue    FailureCallback xmit_failure_;     void *xmit_failure_data_;        /*         * MONARCH wants to know if the MAC layer is passing this back because         * it could not get the RTS through or because it did not receive         * an ACK.         */    int     xmit_reason_;#define XMIT_REASON_RTS 0x01#define XMIT_REASON_ACK 0x02        // filled in by GOD on first transmission, used for trace analysis    int num_forwards_;	// how many times this pkt was forwarded    int opt_num_forwards_;   // optimal #forwards	// Monarch extn ends;	static int offset_;	// offset for this header	inline static int& offset() { return offset_; }	inline static hdr_cmn* access(const Packet* p) {		return (hdr_cmn*) p->access(offset_);	}	        /* per-field member functions */	inline packet_t& ptype() { return (ptype_); }	inline int& size() { return (size_); }	inline int& uid() { return (uid_); }	inline int& error() { return error_; }	inline double& timestamp() { return (ts_); }	inline int& iface() { return (iface_); }	inline int& chan() { return (chan_); } ;//for GPRS -rj	inline dir_t& direction() { return (direction_); }	inline int& ref_count() { return (ref_count_); }	// monarch_begin	inline nsaddr_t& next_hop() { return (next_hop_); }	inline int& addr_type() { return (addr_type_); }	inline int& num_forwards() { return (num_forwards_); }	inline int& opt_num_forwards() { return (opt_num_forwards_); }        //monarch_end};class PacketHeaderClass : public TclClass {protected:	PacketHeaderClass(const char* classname, int hdrsize);	virtual int method(int argc, const char*const* argv);	void field_offset(const char* fieldname, int offset);	inline void bind_offset(int* off) { offset_ = off; }	inline void offset(int* off) {offset_= off;}	int hdrlen_;		// # of bytes for this header	int* offset_;		// offset for this headerpublic:	virtual void bind();	virtual void export_offsets();	TclObject* create(int argc, const char*const* argv);};inline void Packet::init(Packet* p){	bzero(p->bits_, hdrlen_);}inline Packet* Packet::alloc(){	Packet* p = free_;	if (p != 0) {		assert(p->fflag_ == FALSE);		free_ = p->next_;		assert(p->data_ == 0);		p->uid_ = 0;		p->time_ = 0;	} else {		p = new Packet;		p->bits_ = new unsigned char[hdrlen_];		if (p == 0 || p->bits_ == 0)			abort();	}	init(p); // Initialize bits_[]	(HDR_CMN(p))->next_hop_ = -2; // -1 reserved for IP_BROADCAST	(HDR_CMN(p))->last_hop_ = -2; // -1 reserved for IP_BROADCAST	p->fflag_ = TRUE;	(HDR_CMN(p))->direction() = hdr_cmn::DOWN;	/* setting all direction of pkts to be downward as default; 	   until channel changes it to +1 (upward) */	p->next_ = 0;	return (p);}/*  * Allocate an n byte data buffer to an existing packet  *  * To set application-specific AppData, use Packet::setdata() */inline void Packet::allocdata(int n){	assert(data_ == 0);	data_ = new PacketData(n);	if (data_ == 0)		abort();}/* allocate a packet with an n byte data buffer */inline Packet* Packet::alloc(int n){	Packet* p = alloc();	if (n > 0) 		p->allocdata(n);	return (p);}inline void Packet::free(Packet* p){	hdr_cmn* ch = hdr_cmn::access(p);	if (p->fflag_) {		if (ch->ref_count() == 0) {			/*			 * A packet's uid may be < 0 (out of a event queue), or			 * == 0 (newed but never gets into the event queue.			 */			assert(p->uid_ <= 0);			// Delete user data because we won't need it any more.			if (p->data_ != 0) {				delete p->data_;				p->data_ = 0;			}			init(p);			p->next_ = free_;			free_ = p;			p->fflag_ = FALSE;		} else {			ch->ref_count() = ch->ref_count() - 1;		}	}}inline Packet* Packet::copy() const{		Packet* p = alloc();	memcpy(p->bits(), bits_, hdrlen_);	if (data_) 		p->data_ = data_->copy();	p->txinfo_.init(&txinfo_); 	return (p);}inline voidPacket::dump_header(Packet *p, int offset, int length){        assert(offset + length <= p->hdrlen_);        struct hdr_cmn *ch = HDR_CMN(p);        fprintf(stderr, "\nPacket ID: %d\n", ch->uid());        for(int i = 0; i < length ; i+=16) {                fprintf(stderr, "%02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n",                        p->bits_[offset + i],     p->bits_[offset + i + 1],                        p->bits_[offset + i + 2], p->bits_[offset + i + 3],                        p->bits_[offset + i + 4], p->bits_[offset + i + 5],                        p->bits_[offset + i + 6], p->bits_[offset + i + 7],                        p->bits_[offset + i + 8], p->bits_[offset + i + 9],                        p->bits_[offset + i + 10], p->bits_[offset + i + 11],                        p->bits_[offset + i + 12], p->bits_[offset + i + 13],                        p->bits_[offset + i + 14], p->bits_[offset + i + 15]);        }}#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
最新日韩av在线| 久久久久亚洲蜜桃| 成人免费的视频| 捆绑调教美女网站视频一区| 婷婷丁香久久五月婷婷| 亚洲一级二级在线| 亚洲狠狠丁香婷婷综合久久久| 国产欧美日韩卡一| 欧美激情一区二区在线| 日本一区二区三区在线不卡| 久久久精品免费免费| 国产精品网站在线| 国产精品久久久久久久久久免费看| 国产偷国产偷精品高清尤物| 精品少妇一区二区三区在线播放| 欧美成人一区二区三区在线观看| 日韩精品一区二区三区三区免费 | 亚洲欧美另类图片小说| 国产精品国产精品国产专区不蜜 | 成人免费黄色大片| 99热精品国产| 欧美午夜片在线观看| 欧美日韩电影在线| 亚洲精品在线观| 国产精品污污网站在线观看| 亚洲欧美日韩在线不卡| 日韩中文字幕1| 极品少妇一区二区三区精品视频| 国产九九视频一区二区三区| 丁香六月综合激情| 91福利视频在线| 欧美电影免费观看高清完整版在线| 精品国产一区二区三区av性色| 久久久久久99精品| 亚洲女同ⅹxx女同tv| 青青草一区二区三区| 丁香婷婷综合五月| 欧美日韩精品一区二区| 久久久久国产一区二区三区四区| 中文字幕一区二区三区在线观看| 午夜婷婷国产麻豆精品| 国产一区二区免费看| 色国产精品一区在线观看| 日韩欧美色综合| 亚洲免费av网站| 精品制服美女久久| 欧美色图免费看| 国产人妖乱国产精品人妖| 亚洲成人激情社区| 成人a区在线观看| 91精品中文字幕一区二区三区| 中文字幕第一页久久| 日本最新不卡在线| 色综合久久综合中文综合网| 精品88久久久久88久久久| 亚洲午夜日本在线观看| 国产91色综合久久免费分享| 日韩视频123| 亚洲一区二区三区影院| 99国产一区二区三精品乱码| 26uuu国产日韩综合| 午夜精品久久久久久久久久| 99久久er热在这里只有精品66| 日韩欧美中文字幕公布| 亚洲mv在线观看| 在线亚洲欧美专区二区| 国产精品毛片a∨一区二区三区| 秋霞国产午夜精品免费视频| 欧美色视频在线| 一区二区三区丝袜| 色婷婷激情综合| 综合久久给合久久狠狠狠97色| 国产精品一区不卡| 精品国产99国产精品| 日本不卡123| 欧美一级生活片| 午夜不卡在线视频| 欧美高清精品3d| 亚洲成av人片在线| 6080国产精品一区二区| 亚洲v中文字幕| 欧美日韩免费高清一区色橹橹 | 亚洲男女毛片无遮挡| 不卡免费追剧大全电视剧网站| 久久久国产精品麻豆| 国产乱码精品一区二区三区忘忧草| 欧美一区二区三区婷婷月色| 午夜精品久久一牛影视| 91精品国产入口在线| 日韩高清一级片| 日韩亚洲欧美在线| 国产乱一区二区| 欧美国产丝袜视频| 91天堂素人约啪| 亚洲国产成人高清精品| 在线91免费看| 国产美女精品人人做人人爽| 国产色91在线| 日本高清不卡视频| 午夜伊人狠狠久久| 精品av久久707| av在线不卡网| 午夜电影一区二区| 精品成人一区二区三区四区| 国产电影精品久久禁18| 成人欧美一区二区三区小说| 色婷婷av一区二区三区gif | 在线成人av网站| 美女视频免费一区| 亚洲欧洲三级电影| 欧美高清视频在线高清观看mv色露露十八 | 国产精品一区二区在线看| 国产精品第一页第二页第三页| av激情成人网| 免费亚洲电影在线| 欧美高清在线视频| 91精品免费观看| 粉嫩aⅴ一区二区三区四区 | 不卡av电影在线播放| 亚洲成人自拍网| 久久日韩粉嫩一区二区三区| 91国产精品成人| 韩国毛片一区二区三区| 一区二区三区在线不卡| 久久久久久久综合色一本| 欧美在线观看禁18| 国产.欧美.日韩| 日韩高清在线观看| 一个色妞综合视频在线观看| 亚洲精品一区二区三区福利| 欧美中文字幕亚洲一区二区va在线| 久久精品99国产精品| 亚洲综合精品自拍| 国产精品美女久久久久aⅴ国产馆| 欧美日韩亚洲综合一区二区三区| 成人精品电影在线观看| 久久精品二区亚洲w码| 天堂av在线一区| 亚洲精品视频在线| 亚洲国产精品成人综合| 精品美女在线播放| 欧美一区二区三区四区视频 | 亚洲制服丝袜在线| 国产精品久久久久三级| 久久综合色播五月| 欧美成人欧美edvon| 欧美日韩激情在线| 欧美午夜视频网站| 色综合欧美在线| 99精品视频一区二区| 国产·精品毛片| 成人免费看视频| 国产69精品久久久久毛片| 国产一区二区视频在线播放| 蜜臀av性久久久久蜜臀aⅴ| 亚洲第四色夜色| 亚洲高清不卡在线| 午夜av区久久| 日韩综合在线视频| 男女男精品视频| 蜜桃视频在线观看一区二区| 日韩av在线发布| 全部av―极品视觉盛宴亚洲| 免费精品视频最新在线| 麻豆视频观看网址久久| 麻豆精品精品国产自在97香蕉| 三级一区在线视频先锋 | 午夜欧美电影在线观看| 午夜国产精品一区| 另类中文字幕网| 黄一区二区三区| 国产成人免费视频| 成人激情电影免费在线观看| 99久久精品国产毛片| 欧洲精品一区二区三区在线观看| 在线精品国精品国产尤物884a| 色婷婷久久久综合中文字幕| 欧美一区二区三区在线观看| 国产美女精品在线| 国产精品久久久一本精品 | 成人18视频日本| 中文字幕亚洲区| 亚洲成a人片在线观看中文| 福利一区二区在线| 精品日韩一区二区三区免费视频| 中文字幕亚洲欧美在线不卡| 国产高清精品久久久久| 日韩一区二区三免费高清| 亚洲国产精品尤物yw在线观看| 国产福利一区二区| 精品91自产拍在线观看一区| 日韩高清一级片| 欧美日韩国产电影| 亚洲午夜久久久| 色婷婷精品大视频在线蜜桃视频| 国产精品久久久久久久裸模| 国产盗摄女厕一区二区三区| 欧美xxxx在线观看| 久久国产精品色婷婷| 日韩精品一区二区在线|