91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

本源碼包含了在閱讀和分析源碼過程中添加的大量的注釋。與本源碼同時發(fā)布的是《iputils網(wǎng)絡(luò)工具源碼分析》系列文章,可在http://blog.csdn.net/fsdev中找到。

資源截圖

代碼片段和文件信息

/*
?*?arping.c
?*
?* This?program?is?free?software;?you?can?redistribute?it?and/or
?* modify?it?under?the?terms?of?the?GNU?General?Public?License
?* as?published?by?the?Free?Software?Foundation;?either?version
?* 2?of?the?License?or?(at?your?option)?any?later?version.
?*
?*?Authors: Alexey?Kuznetsov?
?*/

#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?

#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?

#include?“SNAPSHOT.h“

static?void?usage(void)?__attribute__((noreturn));

int?quit_on_reply=0;
char?*device=“eth0“;
int?ifindex;
char?*source;
struct?in_addr?src?dst;
char?*target;
int?dad?unsolicited?advert;
int?quiet;
int?count=-1;

int?timeout;
int?unicasting;
int?s;
int?broadcast_only;

struct?sockaddr_ll?me;
struct?sockaddr_ll?he;
/*
struct?sockaddr_ll
{
unsigned?short sll_family;
__be16 sll_protocol;
int sll_ifindex;
unsigned?short sll_hatype;
unsigned?char sll_pkttype;
unsigned?char sll_halen;
unsigned?char sll_addr[8];
};
linux-2.6.27/include/linux/if_packet.h
*/

struct?timeval?start?last;

int?sent?brd_sent;
int?received?brd_recv?req_recv;

#define?MS_TDIFF(tv1tv2)?(?((tv1).tv_sec-(tv2).tv_sec)*1000?+?\
???((tv1).tv_usec-(tv2).tv_usec)/1000?)

#define?lixiprintf?printf
void?usage(void)
{
fprintf(stderr
“Usage:?arping?[-fqbDUAV]?[-c?count]?[-w?timeout]?[-I?device]?[-s?source]?destination\n“
“??-f?:?quit?on?first?reply\n“
“??-q?:?be?quiet\n“
“??-b?:?keep?broadcasting?don‘t?go?unicast\n“
“??-D?:?duplicate?address?detection?mode\n“
“??-U?:?Unsolicited?ARP?mode?update?your?neighbours\n“
“??-A?:?ARP?answer?mode?update?your?neighbours\n“
“??-V?:?print?version?and?exit\n“
“??-c?count?:?how?many?packets?to?send\n“
“??-w?timeout?:?how?long?to?wait?for?a?reply\n“
“??-I?device?:?which?ethernet?device?to?use?(eth0)\n“
“??-s?source?:?source?ip?address\n“
“??destination?:?ask?for?what?ip?address\n“
);
exit(2);
}

void?set_signal(int?signo?void?(*handler)(void))
{
struct?sigaction?sa;

memset(&sa?0?sizeof(sa));
sa.sa_handler?=?(void?(*)(int))handler;
sa.sa_flags?=?SA_RESTART;
sigaction(signo?&sa?NULL);
}

int?send_pack(int?s?struct?in_addr?src?struct?in_addr?dst
??????struct?sockaddr_ll?*ME?struct?sockaddr_ll?*HE)
{
int?err;
struct?timeval?now;
unsigned?char?buf[256];
struct?arphdr?*ah?=?(struct?arphdr*)buf;
unsigned?char?*p?=?(unsigned?char?*)(ah+1);

/*
struct?arphdr
{
__be16 ar_hrd; ?//format?of?hardware?address
__be16 ar_pro; ?//format?of?protocol?address
unsigned?char ar_hln; ?//length?of?hardware?address
unsigned?char ar_pln; ?//length?of?protocol?address
__be16 a

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2009-04-13?18:13??iputils-s20071127-lixi\
?????文件???????19271??2008-12-03?18:47??iputils-s20071127-lixi\arping.c
?????文件???????22962??2008-12-03?18:47??iputils-s20071127-lixi\clockdiff.c
?????目錄???????????0??2009-04-13?18:13??iputils-s20071127-lixi\doc\
?????文件????????6044??2008-12-03?18:47??iputils-s20071127-lixi\doc\arping.sgml
?????文件????????4606??2008-12-03?18:47??iputils-s20071127-lixi\doc\clockdiff.sgml
?????文件????????4606??2008-12-03?18:47??iputils-s20071127-lixi\doc\clockdiff.sgml~
?????文件???????26655??2008-12-03?18:47??iputils-s20071127-lixi\doc\docbook2man-spec.pl
?????文件?????????622??2008-12-03?18:47??iputils-s20071127-lixi\doc\index.db
?????文件????????3533??2008-12-03?18:47??iputils-s20071127-lixi\doc\index.out
?????文件????????6678??2008-12-03?18:47??iputils-s20071127-lixi\doc\iputils.db
?????文件????????1165??2008-12-03?18:47??iputils-s20071127-lixi\doc\Makefile
?????文件????????4839??2008-12-03?18:47??iputils-s20071127-lixi\doc\pg3.sgml
?????文件???????19792??2008-12-03?18:47??iputils-s20071127-lixi\doc\ping.sgml
?????文件????????4794??2008-12-03?18:47??iputils-s20071127-lixi\doc\rarpd.sgml
?????文件????????6731??2008-12-03?18:47??iputils-s20071127-lixi\doc\rdisc.sgml
?????文件???????????7??2008-12-03?18:47??iputils-s20071127-lixi\doc\snapshot.db
?????文件????????5090??2008-12-03?18:47??iputils-s20071127-lixi\doc\tftpd.sgml
?????目錄???????????0??2008-12-22?13:39??iputils-s20071127-lixi\doc\tmp.db2html\
?????文件????????5334??2008-12-03?18:47??iputils-s20071127-lixi\doc\tracepath.sgml
?????文件????????2936??2008-12-03?18:47??iputils-s20071127-lixi\doc\traceroute6.sgml
?????文件?????????429??2008-12-03?18:47??iputils-s20071127-lixi\INSTALL
?????文件?????????571??2008-12-03?18:47??iputils-s20071127-lixi\ipg
?????文件????????2084??2008-12-03?18:47??iputils-s20071127-lixi\iputils.spec
?????文件????????2021??2008-12-03?18:47??iputils-s20071127-lixi\Makefile
?????目錄???????????0??2009-04-13?18:13??iputils-s20071127-lixi\Modules\
?????文件?????????215??2008-12-03?18:47??iputils-s20071127-lixi\Modules\Makefile
?????文件???????15506??2008-12-03?18:47??iputils-s20071127-lixi\Modules\pg3.c
?????文件???????48674??2008-12-03?18:47??iputils-s20071127-lixi\ping.c
?????文件???????25526??2008-12-03?18:47??iputils-s20071127-lixi\ping6.c
?????文件???????29934??2008-12-03?18:47??iputils-s20071127-lixi\ping_common.c
............此處省略11個文件信息

評論

共有 條評論