29.7 Examining the UDP Checksum Field


28.8 Summary

Raw sockets provide three capabilities:

  • We can read and write ICMPv4, IGMPv4, and ICMPv6 packets.

  • We can read and write IP datagrams with a protocol field that the kernel does not handle.

  • We can build our own IPv4 header, normally used for diagnostic purposes (or by hackers, unfortunately ).

Two commonly used diagnostic tools, ping and traceroute , use raw sockets, and we have developed our own versions of both that support IPv4 and IPv6. We also developed our own icmpd daemon that provides access to ICMP errors for a UDP socket. This example also provided an example of descriptor passing across a Unix domain socket between an unrelated client and server.



UNIX Network Programming Volume 1, Third Edition
Unix Network Programming, Volume 1: The Sockets Networking API (3rd Edition)
ISBN: 0131411551
EAN: 2147483647
Year: 2003
Pages: 441

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net