Building.Open.Source.Network.Security.Tools.Components.And.Techniques [Electronic resources] نسخه متنی

This is a Digital Library

With over 100,000 free electronic resource in Persian, Arabic and English

Building.Open.Source.Network.Security.Tools.Components.And.Techniques [Electronic resources] - نسخه متنی

Mike D. Schiffman

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید







Native Datatypes

Libnet provides a few native datatypes that the application programmer needs to know about.



libnet_t


libnet_t is a typedef from the libnet_context structure, which is libnet's core context datatype. It is the main monolithic control data structure that describes a complete libnet packet shaping/injection session. Every major function inside libnet takes a libnet_t argument. Like libpcap's pcap_t, libnet_t is fully opaque to the application programmer.



libnet_ptag_t


libnet_ptag_t is the protocol tag identifier datatype. Every packet-building function returns this datatype and accepts one as an optional argument. It tracks the protocol units (headers or data) that the application programmer builds in his or her application. If a given protocol header needs to be modified after being created (say, for example, that a port number needs to be changed in a packet injection loop), you can specify it with the protocol tag.



struct libnet_stats {


struct libnet_stats holds libnet's packet statistics as returned from libnet_stats().



u_long packets_sent;


packets_sent records the total number of packets.



u_long packet_errors;


packet_errors records the total number of packet writes that generated an error of some kind.



u_long bytes_written;


bytes_written records the total number of bytes written.



};
libnet_plist_t


You use libnet_plist_t when a port list chain is required. This functionality offers the application programmer a convenient (and memory-efficient) way to build port lists (such as 7-25,123,135-139, 6000) from user-driven command line arguments. We talk about this functionality in more detail in the libnet_plist_chain*() functions.

/ 135