==============
The first step is to fetch (http://read.cs.ucla.edu/click/download)and build Click. At the top of your Click source directory::
The --enable-wifi flag may be skipped if you don't intend on usingClick with Wifi.
* Note: You don't need to do a 'make install'.
Once Click has been built successfully, change into the ns-3directory and
configure ns-3 with Click Integration support::
If it says 'enabled' beside 'NS-3 Click Integration Support', thenyou're good to go. Note: If running modular ns-3, the minimum setof modules required to run all ns-3-click examples is wifi, csmaand config-store.
Next, try running one of the examples::
You may then view the resulting .pcap traces, which are namednsclick-simple-lan-0-0.pcap and nsclick-simple-lan-0-1.pcap.
====================
在$: make后,出现问题:
../elements/standard/addressinfo.cc:361: error: ‘e’ was not declared inmake好后,执行this scope make[1]: ***
[addressinfo.o] Error 1
make: *** [ns] Error 2
解决方法:
修改addressinfo文件部分内容:
addressionfo文件在click目录/element/standard/addressinfo.cc
中找到以下语句
if (context && type == 'i') {
char tmp[255];
int r = simclick_sim_command(e->router()->master()->simnode(), SIMCLICK_IPADDR_FROM_NAME, s.c_str(), tmp, 255);
return true;
} else if (context && type == 'e') {
char tmp[255];
int r = simclick_sim_command(e->router()->master()->simnode(), SIMCLICK_MACADDR_FROM_NAME, s.c_str(), tmp, 255);
if (r >= 0 && tmp[0] && EtherAddressArg().parse(tmp, store))
return true;
}*
替换成:
if (context && type == 'i') {
char tmp[255];
int r = simclick_sim_command(context->router()->master()->simnode(), SIMCLICK_IPADDR_FROM_NAME, s.c_str(), tmp, 255);
if (r >= 0 && tmp[0] && IPAddressArg().parse(tmp, *reinterpret_cast<IPAddress *>(store)))
return true;
} else if (context && type == 'e') {
char tmp[255];
int r = simclick_sim_command(context->router()->master()->simnode(), SIMCLICK_MACADDR_FROM_NAME, s.c_str(), tmp, 255);
if (r >= 0 && tmp[0] && EtherAddressArg().parse(tmp, store))
return true;
}
保存后,再重新执行 make就行了。
另外
$:
其中/path/to/click/source为click的安装目录,以我自己为例,我安装在/home/gpf/click/
执行的命令是:
$: