Add Book to My BookshelfPurchase This Book Online

Appendix E - Accessing the Network at the Link Level

UNIX Systems Programming for SVR4
David A. Curry
 Copyright © 1996 O'Reilly & Associates, Inc.

Sample Program
Because accessing the network at the link layer is so complex, we can't include an example in the text of this appendix. Aside from the code to set up the DLPI, which is straight-forward but non-trivial, it is necessary to show how to process the data once it is received, or how to format it in order to be sent. However, the topic is of sufficient interest to systems programmers that a sample program has been included in the electronic distribution of the example programs for this book. The preface to this book provides instructions on how to obtain this distribution.
The sample program is a complete packet monitoring tool. It monitors a network and captures all packets transmitting it. These packets are broken down into numerous classifications (local or foreign traffic, network protocol, application protocol, etc.) and recorded in a series of counters. The counters are saved periodically to a file, from which they can later be added together and printed out. The tool can thus be used to perform long-term traffic analysis of a network. The program is well-commented, and should be sufficient for understanding not only the DLPI, but also how to process the various packet formats transmitted on an Ethernet network.
 NoteThis sample program makes use of extensions to the DLPI interface that are available only in Solaris 2.x.

Previous SectionNext Section
Books24x7.com, Inc © 2000 –  Feedback