Net::Packet::Desc(3)

NAME
Net::Packet::Desc - base class for all desc modules

DESCRIPTION
This is the base class for Net::Packet::DescL2, Net::Packet::DescL3 and Net::Packet::DescL4 modules.

It just provides those layers with inheritable attributes and methods.

A descriptor is required when you want to send frames over network.

ATTRIBUTES

dev Network device to use to send frames. Default to use dev set in default $Env object.

ip  Same as above for IP. This is the source IP address to use.

ip6 Same as above for IPv6. This is the source IPv6 address to use.

mac Same as above for MAC. This is the source MAC address to use.

gatewayIp
    Same as above, for gateway IP address.

gatewayMac
    Same as above, for gateway MAC address. It is not automatically set here. It is automatically set only under Windows, when using a Net::Packet::DescL3 object.

target
    Used to create a Net::Packet::DescL3 and Net::Packet::DescL4. At these layers, one MUST specifiy the target IP address to tell kernel where to send frames.

targetMac
    Used to automatically build layer 2 when using a Net::Packet::DescL3 object under Windows.

protocol
    This is the transport protocol to use (TCP, UDP, ...). Used in Net::Packet::DescL4 objects. Default to TCP.

family
    Same as abose, to tell which network protocol to use (IPv4, IPv6).

METHODS

send (scalar)
    Send the raw data passed as a parameter.

close
    Close the descriptor.

isDescL2
isDescL3
isDescL4
    Returns true if Desc is of specified type, false otherwise.

CONSTANTS
Load them: use Net::Packet::Consts qw(:desc);

NP_DESC_IPPROTO_IP
NP_DESC_IPPROTO_IPv6
NP_DESC_IPPROTO_RAW
NP_DESC_IPPROTO_TCP
NP_DESC_IPPROTO_UDP
NP_DESC_IPPROTO_ICMPv4
NP_DESC_IP_HDRINCL
NP_DESC_L2
NP_DESC_L3
NP_DESC_L4

AUTHOR
Patrice <GomoR> Auffret

COPYRIGHT AND LICENSE
Copyright (c) 2004-2009, Patrice <GomoR> Auffret

You may distribute this module under the terms of the Artistic license. See LICENSE.Artistic file in the source distribution archive.

RELATED MODULES
NetPacket, Net::RawIP, Net::RawSock