![UNIX 网络编程 卷I 套接字联网API(英文版 第三版)[按需印刷]](http://images.china-pub.com/ebook20001-25000/20159/zcover.jpg)
最 低 价:¥198.00
定 价:¥99.00
作 者:(美)W.Richard Stevens,Bill Fenner,Andrew M.Rudoff 著
出 版 社:机械工业出版社
出版时间:2004 年7月
I S B N:7111146859
| 已故的W.Richard Stevens是本书第1版和第2版的最初作者。 Bill Fenner是位于加州Menlo Park的AT&T实验室的主要技术成员,专门从事IP组播、网络管理和测量方面的研究。他是IETF路由领域的主管之一,负责审批作为RFC发布的所有与路由有关的文档。 Andrew M.Rudoff是Sun公司的资深软件工程师,专门从事网络、操作系统内核、文件系统及高可靠性软件结构的研究。 .. << 查看详细 |
| part 1. introduction and tcp/ip chapter 1. introduction 1.1 introduction 3 1.2 a simple daytime client 6 1.3 protocol independence 10 1.4 error handling: wrapper functions 11 1.5 a simple daytime server 13 1.6 roadmap to client/server examples in the text 16 1.7 osi model !8 1.8 bsd networking history 20 1.9 test networks and hosts 22 1.10 unix standards 25 1.11 64-bit architectures 28 1.12 summary 29 chapter 2. the transport layer: tcp, udp, and sctp 2.1 introduction 31 2.2 the big picture 32 2.3 user datagram protocol (udp) 34 2.4 transmission control protocol (tcp) 35 2.5 stream control transmission protocol (sctp) 36 . 2.6 tcp connection establishment and termination 37 2.7 time_wait state 43 2.8 sctp association establishment and termination 44 2.9 port numbers 50 2.10 tcp port numbers and concurrent servers 52 2.11 buffer sizes and limitations 55 2.12 standard internet services 61 2.13 protocol usage by common internet applications 62 2.14 summary 63 part 2. elementary sockets chapter 3. sockets introduction 3.1 introduction 67 3.2 socket address structures 67 3.3 value-result arguments 74 3.4 byte ordering functions 77 3.5 byte manipulation functions 80 3.6 inet_aton, inet_addr, and inet_ntoa functions 82 3.7 inet_pton and inet_ntop functions 83 3.8 sock_ntop and related functions 86 3.9 readn, writen, and readline functions 88 3.10 summary 92 chapter 4. elementary tcp sockets 4.1 introduction 9,5 4.2 socket function 95 4.3 connect function 99 4.4 bind function 101 4.5 listen function 104 4.6 accept function 109 4.7 fork and exec functions 111 4.8 concurrent servers 114 4.9 close function 117 4.10 getsockname and getpeername functions 117 4.11 summary 120 chapter 5, tcp client/server example 5.1 introduction 121 5.2 tcp echo server: main function 122 5.3 tcp echo server: str echo function 123 5.4 tcp echo client: main function 124 5.5 tcp echo client: str cli function 125 5.6 normal startup 126 5.7 normal termination 128 5.8 posix signal handling 129 5.9 handling sigchld signals 132 5.10 wait and waitpid functions 135 5.11 connection,abort before accept returns 139 5.12 termination of server process 141 5.13 sigpipe signal 142 5.14 crashing of server host 144 5.15 crashing and rebooting of server host 144 5.16 shutdown of server host 145 5.17 summary of tcp example 146 5.18 data format 147 5.19 summary 151 chapter 6. i/o multiplexing: the select and poll functions 6,1 introduction 153 6.2 i/o models 154 6,3 select function 160 6.4 str_cli function (revisited) 167 6.5 batch input and buffering 169 6.6 shutdown function 172 6,7 str eli function (revisited again) 173 6.8 tcp echo server (revisited) 175 6.9 pselect function 181 6.10 poll function 182 6.11 tcp echo server (revisited again) 185 6.12 summary 188 chapter 7. socket options 7.1 introduction 191 7.2 getsockopt and setsockopt functions 192 7.3 checking if an option is supported and obtaining the default 7.4 socket states 198 7.5 generic socket options 198 7.6 ipv4 socket options 214 7.7 icmpv6 socket option 216 7.8 ipv6 socket options 216 7.9 tcp socket options 219 7.10 sctp socket options 222 7.11 fcnt1 function 233 7.12 summary 236 chapter 8. elementary udp sockets 8.1 introduction 239 8.2 recvfrom and sendto functions 240 8.3 udp echo server: main function 241 8.4 udp echo server: dg_echo function 242 8.5 udp echo client: main function 244 8.6 udp echo client: dg_cli function 245 8.7 lost datagrams 245 8.8 verifying received response 246 8.9 server not running 248 8.10 summary of udp example 250 8.11 connect function with udp 252 8.12 dg_cli function (revisited) 256 8,13 lack of flow control with udp 257 8.14 determining outgoing interface with udp 261 8.15 tcp and udp echo server using select 262 8.16 summary 264 chapter 9. elementary sctp sockets 9.1 introduction 267 9.2 interface models 268 9.3 sctp_bindx function 272 9.4 sctp_connectx function 274 9.5 sctp_getpaddrs function 275 9.6 sctp_freepaddrs function 275 9.7 sctp_get laddrs function 275 9.8 sctp_freeladdrs function 276 9.9 sctp_sendmsg function 276 9.10 sctp_recvmsg function 277 9.11 sctp_opt_info function 278 9.12 sctp_peeloff function 278 9.13 shutdown function 278 9.14 notifications 280 9.15 summary 286 chapter 10. sctp client/server example 10.1 introduction 287 10.2 sctp one-to-many-style streaming echo server: main function 10.3 sctp one-to-many-style streaming echo client: main function 10.4 sctp streaming echo client: str_cli function 292 10.5 exploring head-of-line blocking 293 10.6 controlling the number of streams 299 10.7 controlling termination 300 10.8 summary 301 chapter 11. name and address conversions 11.1 introduction 303 11.2 domain name system (dns) 303 11.3 gethostbyname function 307 11.4 gethostbyaddr function 310 11.5 getservbyname and getservbyport functions 311 11.6 getaddrinfo function 315 11.7 gai_strerror function 320 11.8 freeaddrinfo function 321 11.9 getaddrinfo function: ipv6 322 11.10 getaddrinfo function: examples 324 11.11 host serv function 325 11.12 tcp_connect function 326 11.13 tcp_listen function 330 11.14 udp_client function 334 11.15 udp_connect function 337 11.16 udp_server function 338 11.17 getnameinfo function 340 11.18 re-entrant functions 341 11.19 gethostbyname_r and gethostbyaddr_r functions 344 11.20 obsolete ipv6 address lookup functions 346 11.21 other networking information 348 11.22 summary 349 part 3. advanced sockets chapter 12. ipv4 and ipv6 interoperability 12.1 introduction 353 12.2 ipv4 client, ipv6 server 354 12.3 ipv6 client, ipv4 server 357 12.4 ipv6 address-testing macros 360 12.5 source code portability 361 12.6 summary 362 chapter 13. daemon processes and the inetd superserver 13.1 introduction 363 13.2 syslogd daemon 364 13.3 syslo9 function 365 13.4 daemon init function 367 13.5 inetd daemon 371 13.6 daemon inetd function 377 13.7 summary 379 chapter 14. advanced i/o functions 14.1 introduction 381 14,2 socket timeouts 381 14.3 recv and send functions 387 14.4 readv and writev functions 389 14.5 recvmsg and sendmsg functions 390 14,6 ancillary data 395 14.7 how much data is queued? 398 14.8 sockets and standard i/o 399 14.9 advanced polling 402 14.10 summary 408 chapter 15. unix domain protocols 411 15.1 introduction 411 15.2 unix domain socket address structure 412 15.3 socketpair function 414 15.4 socket functions 415 15.5 unix domain stream client/server 416 15.6 unix domain datagram client/server 418 15.7 passing descriptors 420 15.8 receiving sender credentials 429 15.9 summary 432 chapter 16. nonblocking i/o 435 16.1 introduction 435 16.2 nonblocking reads and writes: str cli function (revisited) 437 16.3 nonblocking connect 448 16.4 nonblocking connect: daytime client 449 16.5 nonblocking connect: web client 452 16.6 nonblocking accept 461 16.7 summary 463 chapter 17. ioct1 operations 465 17.1 introduction 465 17.2 ioctl function 466 17.3 socket operations 466 17.4 file operations 468 17.5 interface configuration 468 17.6 get ifi info function 469 17.7 interface dperations 480 17.8 arp cache operations 481 17.9 routing table operations 483 17.10 summary 484 chapter 18. routing sockets 485 18.1 introduction 485 18.2 datalink socket address structure 486 18.3 reading and writing 487 18.4 sysctl operations 495 18.5 get_ifi_info function (revisited) 500 18.6 interface name and index functions 504 18.7 summary 508 chapter 19. key management sockets 511 19.1 introduction 511 19.2 reading and writing 512 19.3 dumping the security association database (sadb) 514 19.4 creating a static security association (sa) 517 19.5 dynamically maintaining sas 524 19.6 summary 528 chapter 20. broadcasting 529 20.1 introduction 529 20.2 broadcast addresses 531 20.3 unicast versus broadcast 532 20.4 dg_cli function using broadcasting 535 20.5 race conditions 538 20.6 summary 547 chapter 21. multicasting 549 21.1 introduction 549 21.2 multicast addresses 549 21.3 multicasting versus broadcasting on a lan 553 21.4 multicasting on a wan 556 21.5 source-specific multicast 558 21.6 multicast socket options 559 21.7 mcast_join and related functions 565 21.8 dg_cli function using multicasting 570 21.9 receiving ip multicast infrastructure session announcements 571 21.10 sending and receiving 575 21.11 simple network time protocol (sntp) 579 21.12 summary 584 chapter 22. advanced udp sockets 587 22.1 introduction 587 22.2 receiving flags, destination ip address, and interface index 588 22.3 datagram truncation 594 22.4 when to use udp instead of tcp 594 22.5 adding reliability to a udp application 597 22.6 binding interface addresses 608 22.7 concurrent udp servers 612 22.8 ipv6 packet information 615 22.9 ipv6 path mtu control 618 22.10 summary 620 chapter 23. advanced sctp sockets 621 23.1 introduction 621 23.2 an autoclosing one-to-many-style server 621 23.3 partial delivery 622 23.4 notifications 625 23.5 unordered data 629 23.6 binding a subset of addresses 630 23.7 determining peer and local address information 631 23.8 finding an association id given an ip address 635 23.9 heartbeating and address failure 636 23.10 peeling off an association 637 23.11 controlling timing 639 23.12 when to use sctp instead of tcp 641 23.13 summary 643 chapter 24. out-of-band data 645 24.1 introduction 645 24.2 tcp out-of-band data 645 24.3 sockatmark function 654 24.4 tcp out-of-band data recap 661 24.5 summary 662 chapter 25. signal-driven i/o 663 25.1 introduction 663 25.2 signal-driven i/o for sockets 664 25.3 udp echo server using sigio 666 25.4 summary 672 chapter 26. threads 675 26.1 introduction 675 26.2 basic thread functions: creation and termination 676 26.3 str cli function using threads 679 26.4 tcp-echo server using threads 681 26.5 thread-specific data 686 26.6 web client and simultaneous connections (continued) 694 26.7 mutexes: mutual exclusion 697 26.8 condition variables 701 26.9 web client and simultaneous connections (continued) 705 26.10 summary 707 chapter 27. ip options 709 27.1 introduction 709 27.2 ipv4 options 709 27.3 ipv4 source route options 711 27.4 i pv6 extension headers 719 27.5 ipv6 hop-by-hop options and destination options 719 27.6 ipv6 routing header 725 27.7 ipv6 sticky options 731 27.8 historical ipv6 advanced api 732 27.9 summary 733 chapter 28. raw sockets 735 28.1 introduction 735 28.2 raw socket creation 736 28.3 raw socket output 737 28.4 raw socket input 739 28.5 ping program 741 28.6 traceroute program 755 28.7 an icmp message daemon 769 28.8 summary 786 chapter 29. datalink access 787 29.1 introduction 787 29.2 bsd packet filter (bpf) 788 29.3 datalink provider interface (dlpi) 790 29.4 linux: sock' packet and pf packet 791 29.5 libpcap: packet capture library 792 29.6 libnet: packet creation and injection library 793 29.7 examining the udp checksum field 793 29.8 summary 815 chapter 30. client/server design alternatives 817 30.1 introduction 817 30.2 tcp client alternatives 819 30.3 tcp test client 820 30.4 tcp iterative server 821 30.5 tcp concurrent server, one child per client 822 30.6 tcp preforked server, no locking around accept 826 30.7 tcp preforked server, file locking around accept 832 30.8 tcp preforked server, thread locking around accept 835 30.9 tcp preforked server, descriptor passing 836 30.10 tcp concurrent server, one thread per client 842 30.11 tcp prethreaded server, per-thread accept 844 30.12 tcp prethreaded server, main thread accept 846 30.13 summary 849 chapter 31. streams 851 31.1 introduction 851 31.2 overview 851 31.3 getmsg and putmsg functions 856 31.4 getpmsg and putpmsg functions 857 31.5 ioctl function 857 31.6 transport provider interface (tpi) 858 31.7 summary 868 appendix a. ipv4, ipv6, icmpv4, and icmpv6 869 a. 1 introduction 869 a.2 ipv4 header 869 a.3 ipv6 header 871 a.4 ipv4 addresses 874 a.5 ipv6 addresses 877 a.6 internet control message protocols (icmpv4 and icmpv6) 882 appendix b. virtual networks 885 b.1 introduction 885 b.2 the mbone 885 b.3 the 6bone 887 b.4 ipv6 transition: 6to4 889 appendix c. debugging techniques 891 c.1 system call tracing 891 c.2 standard internet services 893 0.3 sock program 893 c.4 small test programs 896 c.5 tcpdump program 896 c.6 netstat program 896 c.7 lsof program 897 appendix d. miscellaneous source code 899 d. 1 unp.h header 899 d.2 config, h header 904 d.3 standard error functions 910 appendix e. solutions to selected exercises 913 bibliography 947 index 955 |
商品评论(0条)