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

  • 大小: 1.22MB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2023-11-05
  • 語言: C/C++
  • 標簽: OLSR協議??C++代碼??

資源簡介

代碼包括OLSR協議的C++代碼實現,以及OLSRD的實現,其實就是你們搜到的olsrd協議實現程序或者olsrd-0.5.6-r4.rar。

資源截圖

代碼片段和文件信息


/*
?*?NetsimPcap?-?a?userspace?network?bridge?with?simulated?packet?loss
?*?????????????Copyright?2008?H.?Rogge?(rogge@fgan.de)
?*
?*?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?3?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?see?.
?*/

#include?
#include?
#include?

#include?“config.h“
#include?“debug.h“

/*
?*?stripString
?*
?*?this?function?strips?leading?and?trailing?whitespaces?from?a?string
?*
?*?@param?string?to?strip
?*?@return?stripped?string
?*/
char?*
stripString(char?*str)
{

??/*?strip?left?whitespaces?*/
??while?(*str?==?‘?‘?||?*str?==?‘\t‘)?{
????str++;
??}

??/*?strip?right?whitespaces?*/
??int?i?=?strlen(str);
??while?(--i?>=?0)?{
????if?(str[i]?==?‘?‘?||?str[i]?==?‘\r‘?||?str[i]?==?‘\n‘?||?str[i]?==?‘\t‘)?{
??????str[i]?=?0;
??????break;
????}
??}

??return?str;
}

/*
?*?readConnectionMatrix
?*
?*?This?function?reads?the?network?settings?and?place?them?in?the
?*?connection?matrix?(float?array?with?size?“len“?x?“len“.
?*
?*?@param?pointer?to?begin?of?connection?matrix
?*?@param?pointer?to?filename
?*?@param?number?of?elements?in?each?connection?matrix?line
?*?@return?0?if?function?was?successfull?1?if?an?error?happened
?*/
int
readConnectionMatrix(float?*connectionMatrix?char?*filename?int?len)
{
??FILE?*file?=?fopen(filename?“r“);
??if?(!file)?{
????return?1;
??}

??char?buffer[1024];
??while?(fgets(buffer?1024?file))?{
????int?from?to;
????float?propability;

????char?*line?=?stripString(buffer);
????DPRINT(“%s\n“?line);

????if?(line[0]?==?‘#‘?||?line[0]?==?0)?{
??????continue;
????}

????if?(sscanf(line?“%d?%d?%f“?&from?&to?&propability)?!=?3)?{
??????continue;
????}

????if?(from?=?len?||?to?=?len?||?from?==?to)?{
??????continue;
????}

????connectionMatrix[GRID(from?to?len)]?=?propability;
????if?(connectionMatrix[GRID(to?from?len)]?==?0)?{
??????connectionMatrix[GRID(to?from?len)]?=?propability;
????}
??}
??fclose(file);
??return?0;
}

/*
?*?Local?Variables:
?*?c-basic-offset:?2
?*?indent-tabs-mode:?nil
?*?End:
?*/

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件??????12049??2009-02-21?18:48??olsrd-0.5.6-r4\.cproject

?????文件???????2356??2009-02-21?18:48??olsrd-0.5.6-r4\.project

?????文件??????63899??2009-03-26?22:34??olsrd-0.5.6-r4\CHANGELOG

?????文件??????35147??2009-02-02?03:54??olsrd-0.5.6-r4\contrib\netsimpcap\LICENCE

?????文件????????311??2009-02-02?03:54??olsrd-0.5.6-r4\contrib\netsimpcap\Makefile

?????文件?????????54??2009-02-02?03:54??olsrd-0.5.6-r4\contrib\netsimpcap\sampleconf.txt

?????文件???????2590??2009-02-02?03:57??olsrd-0.5.6-r4\contrib\netsimpcap\src\config.c

?????文件???????1048??2009-02-02?03:57??olsrd-0.5.6-r4\contrib\netsimpcap\src\config.h

?????文件???????1368??2009-02-02?03:57??olsrd-0.5.6-r4\contrib\netsimpcap\src\debug.h

?????文件???????9833??2009-02-02?03:57??olsrd-0.5.6-r4\contrib\netsimpcap\src\netsimpcap.c

?????文件???????5328??2009-02-02?03:57??olsrd-0.5.6-r4\contrib\netsimpcap\src\network_tap.c

?????文件???????1127??2009-02-02?03:57??olsrd-0.5.6-r4\contrib\netsimpcap\src\network_tap.h

?????文件?????????43??2009-02-02?03:54??olsrd-0.5.6-r4\contrib\README

?????文件???????1061??2009-02-02?03:54??olsrd-0.5.6-r4\features.txt

?????文件???????1690??2009-02-02?03:54??olsrd-0.5.6-r4\files\olsrd.8.gz

?????文件???????4755??2009-03-26?23:58??olsrd-0.5.6-r4\files\olsrd.conf.5.gz

?????文件??????10979??2009-03-26?22:16??olsrd-0.5.6-r4\files\olsrd.conf.default.lq

?????文件??????10980??2009-03-26?22:17??olsrd-0.5.6-r4\files\olsrd.conf.default.lq-fisheye

?????文件??????11040??2009-03-26?22:15??olsrd-0.5.6-r4\files\olsrd.conf.default.rfc

?????文件????????721??2009-02-02?03:54??olsrd-0.5.6-r4\files\olsr_switch.8.gz

?????文件???????1268??2009-02-02?03:54??olsrd-0.5.6-r4\gcc-warnings

?????文件???????1133??2009-02-02?03:57??olsrd-0.5.6-r4\gnu-indent.sh

?????文件????????895??2009-02-02?03:54??olsrd-0.5.6-r4\gui\linux-gtk\CHANGELOG

?????文件????????361??2009-02-02?03:54??olsrd-0.5.6-r4\gui\linux-gtk\Makefile

?????文件???????1093??2009-02-02?03:57??olsrd-0.5.6-r4\gui\linux-gtk\README

?????文件???????5656??2009-02-02?03:57??olsrd-0.5.6-r4\gui\linux-gtk\src\callbacks.c

?????文件???????3612??2009-02-02?03:57??olsrd-0.5.6-r4\gui\linux-gtk\src\common.h

?????文件??????38225??2009-02-02?03:57??olsrd-0.5.6-r4\gui\linux-gtk\src\interface.c

?????文件???????2130??2009-02-02?03:57??olsrd-0.5.6-r4\gui\linux-gtk\src\interface.h

?????文件??????17029??2009-02-02?03:57??olsrd-0.5.6-r4\gui\linux-gtk\src\ipc.c

............此處省略575個文件信息

評論

共有 條評論