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

資源簡介

CruiseYoung提供的帶有詳細書簽的電子書籍目錄 http://blog.csdn.net/fksec/article/details/7888251 該資料是《TCP/IP詳解 卷1:協議》的源代碼 對應的書籍資料見: TCP/IP詳解 卷1:協議(09年度暢銷榜TOP50)(08年度暢銷榜TOP50) http://download.csdn.net/detail/fksec/4657587 基本信息 原書名: TCP/IP Illustracted Volume 1:The Protocols 原出版社: Addison Wesley/Pearson 作者: W.Richard Stevens 譯者: 范建華等 叢書名: 計算機科學叢書 出版社:機械工業出版社 ISBN:7111075668 上架時間:2000-7-1 出版日期:2000 年4月 頁碼:423 版次:1-1 所屬分類:計算機 > 計算機網絡 > 網絡協議 > TCP/IP 教材 > 研究生/本科/專科教材 > 工學 > 計算機 教材 > 計算機教材 > 本科/研究生 > 計算機專業教材 > 計算機專業課程 > 計算機網絡 編輯推薦   09年度暢銷榜TOP50    08年度暢銷榜TOP50 作譯者 作者: W.Richard Stevens 國際知名的Unix和網絡專家,《TCP/IP 詳解》(三卷本)作者   W.Richard Stevens(1951-1999),是國際知名的Unix和網絡專家;受人尊敬的計算機圖書作家;同時他還是廣受歡迎的 教師和顧問。Stevens先生1951年生于贊比亞,他的家庭曾多次搬遷,最終定居于南非。早年,他就讀于美國弗吉尼亞州的費什本軍事學校,后獲得密歇根大學學士、亞利桑那大學系統工程碩 士和博士學位。他曾就職于基特峰國家天文臺,從事計算機編程;還曾在康涅狄格州紐黑文市的健康系統國際公司任主管計算機服務的副總裁。Stevens先生不幸病逝于1999年9月1日,他的離 去是計算機界的巨大損失。 目錄 封面 -1 第1章 概述 1 1.1 引言 1 1.2 分層 1 1.3 TCP/IP的分層 4 1.4 互聯網的地址 5 1.5 域名系統 6 1.6 封裝 6 1.7 分用 8 1.8 客戶-服務器模型 8 1.9 端口號 9 1.10 標準化過程 10 1.11 RFC 10 1.12 標準的簡單服務 11 1.13 互聯網 12 1.14 實現 12 1.15 應用編程接口 12 1.16 測試網絡 13 1.17 小結 13 第2章 鏈路層 15 2.1 引言 15 2.2 以太網和IEEE 802封裝 15 2.3 尾部封裝 17 2.4 SLIP:串行線路IP 17 2.5 壓縮的SLIP 18 2.6 PPP:點對點協議 18 2.7 環回接口 20 2.8 最大傳輸單元MTU 21 2.9 路徑MTU 21 2.10 串行線路吞吐量計算 21 2.11 小結 22 第3章 IP:網際協議 24 3.1 引言 24 3.2 IP首部 24 3.3 IP路由選擇 27 3.4 子網尋址 30 3.5 子網掩碼 32 3.6 特殊情況的IP地址 33 3.7 一個子網的例子 33 3.8 ifconfig命令 35 3.9 netstat命令 36 3.10 IP的未來 36 3.11 小結 37 第4章 ARP:地址解析協議 38 4.1 引言 38 4.2 一個例子 38 4.3 ARP高速緩存 40 4.4 ARP的分組格式 40 4.5 ARP舉例 41 4.5.1 一般的例子 41 4.5.2 對不存在主機的ARP請求 42 4.5.3 ARP高速緩存超時設置 43 4.6 ARP代理 43 4.7 免費ARP 45 4.8 arp命令 45 4.9 小結 46 第5章 RARP:逆地址解析協議 47 5.1 引言 47 5.2 RARP的分組格式 47 5.3 RARP舉例 47 5.4 RARP服務器的設計 48 5.4.1 作為用戶進程的RARP服務器 49 5.4.2 每個網絡有多個RARP服務器 49 5.5 小結 49 第6章 ICMP:Internet控制報文協議 50 6.1 引言 50 6.2 ICMP報文的類型 50 6.3 ICMP地址掩碼請求與應答 52 6.4 ICMP時間戳請求與應答 53 6.4.1 舉例 54 6.4.2 另一種方法 55 6.5 ICMP端口不可達差錯 56 6.6 I

資源截圖

代碼片段和文件信息

/*
?*?Issue?an?ICMP?address?mask?request?and?print?the?reply.
?*
?*?This?program?originated?from?the?public?domain?ping?program?written
?*?by?Mike?Muuss.
?*
?*?You?must?be?superuser?to?run?this?program?(or?it?must?be?suid?to?root)
?*?since?it?requires?a?raw?socket.
?*/

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

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

#define DEFDATALEN (12) /*?default?data?length?*/
#define MAXIPLEN 60
#define MAXICMPLEN 76
#define MAXPACKET (65536?-?60?-?8)/*?max?packet?size?*/

struct?sockaddr whereto; /*?who?to?send?request?to?*/
int datalen?=?DEFDATALEN;
int s;
u_char outpack[MAXPACKET];
char *hostname;
u_long inet_addr();
char *inet_ntoa();
void sig_alrm(int);
int response?=?0;

main(argc?argv)
int argc;
char **argv;
{
int i?ch?fdmask?hold?packlen?preload;
extern?int errno;
struct?hostent *hp;
struct?sockaddr_in *to;
struct?protoent *proto;
u_char *packet;
char *target?hnamebuf[MAXHOSTNAMELEN]?*malloc();

if?(argc?!=?2)
exit(1);

target?=?argv[1];

bzero((char?*)&whereto?sizeof(struct?sockaddr));
to?=?(struct?sockaddr_in?*)&whereto;
to->sin_family?=?AF_INET;

/*?try?to?convert?as?dotted?decimal?address
???else?if?that?fails?assume?it‘s?a?hostname?*/
to->sin_addr.s_addr?=?inet_addr(target);
if?(to->sin_addr.s_addr?!=?(u_int)-1)
hostname?=?target;
else?{
hp?=?gethostbyname(target);
if?(!hp)?{
fprintf(stderr?“unknown?host?%s\n“?target);
exit(1);
}
to->sin_family?=?hp->h_addrtype;
bcopy(hp->h_addr?(caddr_t)&to->sin_addr?hp->h_length);
strncpy(hnamebuf?hp->h_name?sizeof(hnamebuf)?-?1);
hostname?=?hnamebuf;
}

packlen?=?datalen?+?MAXIPLEN?+?MAXICMPLEN;
if?(?(packet?=?(u_char?*)malloc((u_int)packlen))?==?NULL)?{
fprintf(stderr?“malloc?error\n“);
exit(1);
}

if?(?(proto?=?getprotobyname(“icmp“))?==?NULL)?{
fprintf(stderr?“unknown?protocol?icmp\n“);
exit(1);
}

if?(?(s?=?socket(AF_INET?SOCK_RAW?proto->p_proto))? perror(“socket“); /*?probably?not?running?as?superuser?*/
exit(1);
}

/*
?*?We?send?one?request?then?wait?5?seconds?printing?any
?*?replies?that?come?back.??This?lets?us?send?a?request?to
?*?a?broadcast?address?and?print?multiple?replies.
?*/

signal(SIGALRM?sig_alrm);
alarm(5); /*?5?second?time?limit?*/

sender(); /*?send?the?request?*/

for?(;;)?{
struct?sockaddr_in from;
int cc?fromlen;

fromlen?=?sizeof(from);
if?(?(cc?=?recvfrom(s?(char?*)packet?packlen?0
???? ????(struct?sockaddr?*)&from?&fromlen))? if?(errno?==?EINTR)
continue;
perror(“recvfrom?error“);
continue;
}
procpack((char?*)packet?cc?&from);
}
}

/*
?*?Send?the?ICMP?address?mask?request.
?*/

sende

評論

共有 條評論