Building.Open.Source.Network.Security.Tools.Components.And.Techniques [Electronic resources]

Mike D. Schiffman

نسخه متنی -صفحه : 135/ 57
نمايش فراداده

Chapter 6: The Libdnet Library

Overview

URL:

http://www.libdnet.sourceforge.net

Primary author:

Dug Song

Component type:

C language library, low-level network routines

License:

Modified BSD

Version profiled:

1.4

Dependencies:

None

In days gone by, if an application programmer wanted to write a program to access the kernel's ARP cache or route table and maybe set or clear some flags on a network interface, he or she had to perform a great deal of digging into the guts of the OS. This development scheme is cumbersome and not portable. If the application programmer wanted this program to work on a separate machine with a different operating system, chances are that he or she would dig into the guts of that one as well. Libdnet alleviates these burdens by providing a simplified, high-level, portable interface to low-level networking routines in the following eight areas:

Robust network address manipulation

Kernel ARP cache lookup and manipulation

Kernel route table lookup and manipulation

Network interface lookup and manipulation

Network firewall rule manipulation

Ethernet frame and IP packet transmission

Binary buffer manipulation

Random number manipulation

Libdnet is incredibly useful for handling the low-level network-oriented parameters—something that no application programmer wants to deal with. For instance, if the application programmer wanted to write a program that needed to send raw Ethernet frames to an arbitrary destination, he or she might require an ARP cache lookup to find the MAC address of the default gateway. Libdnet performs this task seamlessly across multiple platforms.