⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 trace-paths.pl

📁 采用蚂蚁算法实现ad hoc网络路由协议,平台为ns2
💻 PL
字号:
#!/usr/bin/perl#printf "PacketId\tFrom\tTo\tTime\tEvent\tHopFrom\tReceivedBy\tHopTo\tAge\n";while (<>) {    if (/^(.).*-Nl RTR.*-P swarm/){    	$event=$1;	if ($event eq "s") {next;}	# Packet processed by the swarm agent	if (!/-t (\S+).*-Ii (\S+).*-Pvalsrc (\S+).*-Pd (\S) -Ps (\S+)/) {next;}	$time = $1;	$id = $2;	$age = $3;	$src = $5;	$dst = $4;	if (!/-Hs (\S+).*-Md (\S+) -Ms (\S+)/) {next;}	$receivedBy=$1;	$hopTo=hex $2;	$hopFrom=hex $3;	if($hopTo==4294967295) {$hopTo="*";}	printf "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n", $id, $src, $dst, $time, $event, $hopFrom, $receivedBy, $hopTo, $age;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -