91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 256KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-15
  • 語言: 其他
  • 標簽: AODV??linux??

資源簡介

完整的AODV協議代碼,包括頭文件,main.c和Makefile文件等。

資源截圖

代碼片段和文件信息

/*****************************************************************************
?*
?*?Copyright?(C)?2001?Uppsala?University?and?Ericsson?AB.
?*
?*?This?program?is?free?software;?you?can?redistribute?it?and/or?modify
?*?it?under?the?terms?of?the?GNU?General?Public?License?as?published?by
?*?the?Free?Software?Foundation;?either?version?2?of?the?License?or
?*?(at?your?option)?any?later?version.
?*
?*?This?program?is?distributed?in?the?hope?that?it?will?be?useful
?*?but?WITHOUT?ANY?WARRANTY;?without?even?the?implied?warranty?of
?*?MERCHANTABILITY?or?FITNESS?FOR?A?PARTICULAR?PURPOSE.??See?the
?*?GNU?General?Public?License?for?more?details.
?*
?*?You?should?have?received?a?copy?of?the?GNU?General?Public?License
?*?along?with?this?program;?if?not?write?to?the?Free?Software
?*?Foundation?Inc.?59?Temple?Place?Suite?330?Boston?MA??02111-1307??USA
?*
?*?Authors:?Erik?Nordstr鰉?
?*??????????
?*
?*****************************************************************************/

#ifdef?NS_PORT
#include?“ns-2/aodv-uu.h“
#else
#include?
#include?“aodv_hello.h“
#include?“aodv_timeout.h“
#include?“aodv_rrep.h“
#include?“aodv_rreq.h“
#include?“routing_table.h“
#include?“timer_queue.h“
#include?“params.h“
#include?“aodv_socket.h“
#include?“defs.h“
#include?“debug.h“

extern?int?unidir_hack?receive_n_hellos?hello_jittering?optimized_hellos;
static?struct?timer?hello_timer;

#endif

/*?#define?DEBUG_HELLO?*/


long?NS_CLASS?hello_jitter()
{
????if?(hello_jittering)?{
#ifdef?NS_PORT
return?(long)?(((float)?Random::integer(RAND_MAX?+?1)?/?RAND_MAX?-?0.5)
???????*?JITTER_INTERVAL);
#else
return?(long)?(((float)?random()?/?RAND_MAX?-?0.5)?*?JITTER_INTERVAL);
#endif
????}?else
return?0;
}

void?NS_CLASS?hello_start()
{
????if?(hello_timer.used)
return;

????gettimeofday(&this_host.fwd_time?NULL);

????DEBUG(LOG_DEBUG?0?“Starting?to?send?HELLOs!“);
????timer_init(&hello_timer?&NS_CLASS?hello_send?NULL);

????hello_send(NULL);
}

void?NS_CLASS?hello_stop()
{
????DEBUG(LOG_DEBUG?0
??“No?active?forwarding?routes?-?stopped?sending?HELLOs!“);
????timer_remove(&hello_timer);
}

void?NS_CLASS?hello_send(void?*arg)
{
????RREP?*rrep;
????AODV_ext?*ext?=?NULL;
????u_int8_t?flags?=?0;
????struct?in_addr?dest;
????long?time_diff?jitter;
????struct?timeval?now;
????int?msg_size?=?RREP_SIZE;
????int?i;

????gettimeofday(&now?NULL);

????if?(optimized_hellos?&&
timeval_diff(&now?&this_host.fwd_time)?>?ACTIVE_ROUTE_TIMEOUT)?{
hello_stop();
return;
????}

????time_diff?=?timeval_diff(&now?&this_host.bcast_time);
????jitter?=?hello_jitter();

????/*?This?check?will?ensure?we?don‘t?send?unnecessary?hello?msgs?in?case
???????we?have?sent?other?bcast?msgs?within?HELLO_INTERVAL?*/
????if?(time_diff?>=?HELLO_INTERVAL)?{

for?(i?=?0;?i? ????if?(!DEV_NR(i).enabled)
continue;
#ifdef?DEBUG_HELLO
????DEBUG(LOG_DEBUG?0?“sending?Hello?to?255.255.255.255“);
#endif
????rrep?=?rrep_create(flags?0?0?DEV

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2013-10-28?19:38??AODV-master\
?????文件???????10159??2013-10-28?19:38??AODV-master\ChangeLog
?????文件???????17992??2013-10-28?19:38??AODV-master\GPL
?????文件????????6937??2013-10-28?19:38??AODV-master\Makefile
?????文件????????6732??2013-10-28?19:38??AODV-master\MakefileBK
?????文件???????11133??2013-10-28?19:38??AODV-master\README
?????文件???????????0??2013-10-28?19:38??AODV-master\README.md
?????文件???????15077??2013-10-28?19:38??AODV-master\README.ns
?????文件???????13232??2013-10-28?19:38??AODV-master\TAGS
?????文件?????????107??2013-10-28?19:38??AODV-master\TODO
?????文件????????7904??2013-10-28?19:38??AODV-master\aodv_hello.c
?????文件????????1705??2013-10-28?19:38??AODV-master\aodv_hello.h
?????文件????????5900??2013-10-28?19:38??AODV-master\aodv_neighbor.c
?????文件????????1385??2013-10-28?19:38??AODV-master\aodv_neighbor.h
?????文件????????6180??2013-10-28?19:38??AODV-master\aodv_rerr.c
?????文件????????2416??2013-10-28?19:38??AODV-master\aodv_rerr.h
?????文件???????13066??2013-10-28?19:38??AODV-master\aodv_rrep.c
?????文件????????2692??2013-10-28?19:38??AODV-master\aodv_rrep.h
?????文件???????17878??2013-10-28?19:38??AODV-master\aodv_rreq.c
?????文件????????3493??2013-10-28?19:38??AODV-master\aodv_rreq.h
?????文件???????15088??2013-10-28?19:38??AODV-master\aodv_socket.c
?????文件????????2389??2013-10-28?19:38??AODV-master\aodv_socket.h
?????文件????????7537??2013-10-28?19:38??AODV-master\aodv_timeout.c
?????文件????????1559??2013-10-28?19:38??AODV-master\aodv_timeout.h
?????文件???????11233??2013-10-28?19:38??AODV-master\debug.c
?????文件????????1892??2013-10-28?19:38??AODV-master\debug.h
?????文件????????6484??2013-10-28?19:38??AODV-master\defs.h
?????文件????????1746??2013-10-28?19:38??AODV-master\endian.c
?????文件????????1842??2013-10-28?19:38??AODV-master\list.c
?????文件????????1994??2013-10-28?19:38??AODV-master\list.h
?????文件???????10128??2013-10-28?19:38??AODV-master\llf.c
............此處省略40個文件信息

評論

共有 條評論