摘要: ns2中的链表定义在ns\lib\bsd-list.h下面,下面看一下里面的代码:#define LIST_HEAD(name, type) \struct name { \ type *lh_first; /* first element */ \} 定义了一个结构... 阅读全文
posted @ 2012-06-02 12:25 应律 阅读(230) 评论(0) 推荐(0) 编辑
摘要: AODV路由协议提供了一个特定的头部,在aodv_packet.h里面/* * General AODV Header - shared by all formats */struct hdr_aodv { u_int8_t ah_type; /* u_... 阅读全文
posted @ 2012-06-01 13:02 应律 阅读(206) 评论(0) 推荐(0) 编辑
摘要: strcmp函数比较两个字符串是否相等; 使用方法:int strcmp ( const char * str1, const char * str2 );举个例子,在网上看到的: /* strcmp example */#include #include int main (){ char ... 阅读全文
posted @ 2012-05-29 20:02 应律 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 条件编译,也就是预编译命令主要有以下几种: 第一种: #ifdef 标识符 程序段 1#else程序段 2#endif如果指定标识符之前已经被#define命令定义过了,则它会编译程序段1;否则会编译程序段2 第二种: #ifndef 标识符 程序段 1#else程序段 2#endif如果指定标... 阅读全文
posted @ 2012-05-28 20:51 应律 阅读(123) 评论(0) 推荐(0) 编辑
摘要: //#include #include #include #include #include //#include #define max(a,b) ( (a) > (b) ? (a) : (b) )#define CURRENT_TIME Scheduler::instan... 阅读全文
posted @ 2012-05-28 20:23 应律 阅读(274) 评论(0) 推荐(0) 编辑
摘要: 转自:http://tieba.baidu.com/p/1084398250 首先将尾注文本及后面的致谢文本等内容复制粘贴到别处。按Ctrl+H组合键,打开“查找和替换”对话框,“查找内容”文本框中输入“^e”,“替换为”文本框中输入一个代替符号,如“▲”等,然后单击“全部替换”按钮。这时原插入... 阅读全文
posted @ 2012-05-28 00:07 应律 阅读(1675) 评论(0) 推荐(0) 编辑
摘要: 转自: http://tieba.baidu.com/p/1084398250 毕业论文写作是每个大学生必须完成的综合性独立作业。本文愿为即将开始论文写作和已经完成论文写作初稿的学子们提供一点有关论文尾注问题的帮助。 论文中一般要求将注释和参考文献用插入尾注的方法显示,如果对尾注没有... 阅读全文
posted @ 2012-05-28 00:05 应律 阅读(893) 评论(0) 推荐(0) 编辑
摘要: 数据流生成工具cbrgen用来产生传输负载,可以产生cbr流和tcp流。cbrgen的使用方法是,首先切换到 ,使用方法如下: ns cbrgen.tcl [-type cbr|tcp] [-nn nodes] [-seed seed] [-mc connections][-rate ra... 阅读全文
posted @ 2012-05-25 23:18 应律 阅读(190) 评论(0) 推荐(0) 编辑
摘要: # 使用的是无线trace的旧格式BEGIN { pkt_route_sum=0; pkt_cbr_sum=0;}{ pktsize = $8; } $0 ~/^s.* AODV/ { pkt_route_sum += pktsize ;}# 我只计算了正确接收到的... 阅读全文
posted @ 2012-05-22 16:47 应律 阅读(256) 评论(0) 推荐(0) 编辑
摘要: BEGIN {init=0;i=0;}{event = $1;time = $2;node = $3;trace_type = $4;flag = $5;uid = $6;pkt_type = $7;pkt_size = $8;if(event=="r"&& pkt_type=="cbr") {... 阅读全文
posted @ 2012-05-22 16:42 应律 阅读(183) 评论(0) 推荐(0) 编辑