Net::Packet::DescL4 - object for a transport layer (layer 4) descriptor


Net-Packet documentation  | view source Contained in the Net-Packet distribution.

Index


NAME

Top

Net::Packet::DescL4 - object for a transport layer (layer 4) descriptor

SYNOPSIS

Top

   require Net::Packet::DescL4;

   # Get NP_DESC_* constants
   use Net::Packet::Consts qw(:desc :layer);

   # Usually, you use it to send TCP and UDP frames over IPv4
   my $d4 = Net::Packet::DescL4->new(
      target   => '192.168.0.1',
      protocol => NP_DESC_IPPROTO_TCP,
      family   => NP_LAYER_IPv4,
   );

   $d4->send($rawStringToNetwork);

DESCRIPTION

Top

See also Net::Packet::Desc for other attributes and methods.

ATTRIBUTES

Top

target

IPv4 address of the target host. You must set it to be able to send frames.

protocol

Transport protocol to use, see NP_DESC_IPPROTO_* constants in Net::Packet::Desc. You must set it to be able to send frames.

family

The family address of target attribute. It is either NP_LAYER_IPv4 or NP_LAYER_IPv6.

METHODS

Top

new

Create the object, using default $Env object values for dev, ip, ip6 and mac (see Net::Packet::Env). When the object is created, the $Env global object has its desc attributes set to it. You can avoid this behaviour by setting noDescAutoSet in $Env object (see Net::Packet::Env).

Default values for attributes:

dev: $Env->dev

ip: $Env->ip

ip6: $Env->ip6

mac: $Env->mac

protocol: NP_DESC_IPPROTO_TCP

family: NP_LAYER_IPv4

isFamilyIpv4
isFamilyIpv6
isFamilyIp - either one of two previous

Helper method to know about the layer 3 type.

isProtocolTcp
isProtocolUdp
isProtocolIcmpv4

Returns if the protocol attribute is of specified type.

AUTHOR

Top

Patrice <GomoR> Auffret

COPYRIGHT AND LICENSE

Top

RELATED MODULES

Top


Net-Packet documentation  | view source Contained in the Net-Packet distribution.