- 博客(5)
- 资源 (5)
- 收藏
- 关注
转载 The Sniffer's Guide to Raw Traffic
(a libpcap tutorial) · Download libpcap source from www.tcpdump.org here · Download libpcap for win32 from www.winpcap.org · Check out a better pcap tutorial here
2009-05-04 20:26:00 1889
原创 ip 数据包校验和
u_short MyIPCore::checksum(u_short* data, int len){ u_long sum=0; for(;len>1;len-=2) { sum+=*data++; if(sum&0x80000000) sum=(sum&0xffff)+(sum>>16); } if(len==1)
2009-05-04 20:17:00 619
转载 获取系统所有IP地址
获取详细网卡信息,请参考ioctlnet/if.h 等相关文件与帮助。 struct if_nameindex * ifni, *p; int fd, numreqs = 30, n, err = -1; struct ifconf ifc; struct ifreq *ifr; if ((fd = socket (AF_INET, SOCK_DGRAM, 0
2009-05-04 20:13:00 706
原创 获取网卡地址 mac or ip or net mask
#include #include #include #include #include #include #include #include #include #define ETH_NAME "eth0" int main() {
2009-05-04 20:10:00 729
原创 ip结构体中len与libpcap pcap_pkthdr结构体中len区别
最近做毕业设计,搞到这里两个len搞了好久也没有搞清楚这个问题,终于在网上搜到有人回答这个问题,原地址是:http://www.cpptalk.net/request-for-code-review-vt5635.htmlIP->len means the length of the IP datagram, not MTU (I guess you meant MTU, not MSS
2009-05-02 18:34:00 2102 6
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人