1=>"ICMP_HOST_UNREACH",
2=>"ICMP_PROT_UNREACH",
3=>"ICMP_PORT_UNREACH",
4=>"ICMP_FRAG_NEEDED",
5=>"ICMP_SR_FAILED",
6=>"ICMP_NET_UNKNOWN",
7=>"ICMP_HOST_UNKNOWN",
8=>"ICMP_HOST_ISOLATED",
9=>"ICMP_NET_ANO",
10=>"ICMP_HOST_ANO",
11=>"ICMP_NET_UNR_TOS",
12=>"ICMP_HOST_UNR_TOS",
13=>"ICMP_PKT_FILTERED",
14=>"ICMP_PREC_VIOLATION",
15=>"ICMP_PREC_CUTOFF",
15=>"NR_ICMP_UNREACH",
);
($>||$<) && die "Must have (UID|EUID) == 0 to use $0\n";
getopt('i:s:w:r:h',\%opts);
$opts{i} and $dev=eval { " "=~/$opts{i}/;$opts{i} };
$@ && usage;
$opts{s} and $capture=$opts{s};
$opts{w} and $dumpfile=$opts{w};
if ($opts{r})
{
open(FILE,"-|","tcpdump","-n","-r",$opts{r}) or die "Open file:$!\n";
print <FILE>;
exec "/bin/false";
}
$ARGV[0] and $filterstr=eval{" "=~/$ARGV[0]/;$ARGV[0]};
$@ && usage;
$opts{h} && usage;
$capture||=8192;
$filterstr||="any";
$optimize||=0;
$dev||=lookupdev(\$err) or die "lookupdev:$err\n";
$pcap=open_live($dev,$capture,0,5,\$err) or die "open_live:$err\n";
lookupnet(\$dev,\$net,\$mask,\$err)==-1 or die "lookupnet:$err\n";
compile($pcap, \$filter,\$filterstr,\$optimize,\$net) or die "compile:@{[geterr($pcap)]}";
上一页 1 2 3 4 5 67 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 下一页
| 论坛热门帖子: | [lch203] 写得蛮好的linux学习笔记(10-21) [黑马制造] 学习java的30个目标(10-19) [笑傲股林] 做测试半年了,有点迷茫,应该再学些什么提高自己的测试水平和测试能力呢?(10-19) [udp8589] 大家用google的来吱一声? 用百度的~~也来报道下?(10-18) [沂偌掳兆] 本人总结的一些认为C++比较经典的书籍,希望对大家有用(10-18) |
| TAG标签: | 格式 图解 my ip_obj- eth_obj- main::proto ip- tcp- |
注册
个人空间
