BBS水木清华站∶精华区

发信人: mephisto (梦菲斯特*大宝宝), 信区: Linux        
标  题: Re: 看过源码的高手解释一下? 
发信站: BBS 水木清华站 (Thu Dec 14 18:04:26 2000) 
 
It is really complicate. The best suggestion is use the pcap. 
It is a some what like asssember language. The syntax code you can look at 
the source code of the filter.c in socket filter. It is worser than assember, 
you have to write the hex code by yourself. I am not go into this game... 
 
【 在 lightofstar (star) 的大作中提到: 】 
 再次请教,如何设一个过滤器, 
 struct bpf_program bp; 
 setsockopt(fd, SOL_SOCKET, SO_ATTACH_FILTER, &bp, sizeof(bp)); 
 但是,如何构造bp,若不用pcap_compile的话。 
 多谢! 
 
 
-- 
约塞连怀疑地摇了摇头,拒绝接受丹比的劝告."当我抬起来时,我看到人们全在设法赚钱.我 
看不见天堂,看不见圣人,也看不见天使.我只看见人们利用每一次正当的冲动和每一场人类 
的悲剧大把大把地捞钱." 
 
 
※ 来源:·BBS 水木清华站 smth.org·[FROM: 211.99.241.146] 

BBS水木清华站∶精华区