4
use Test::More tests => 3;
10
src_ip => '127.0.0.1',
11
dest_ip => '192.168.0.1',
14
bless $ip, 'NetPacket::IP';
27
bless $tcp, 'NetPacket::TCP';
29
is NetPacket::TCP::checksum( $tcp, $ip ) => 25303;
31
$tcp->{data} = "DEADBEEF\x01";
32
my $odd_checksum = NetPacket::TCP::checksum( $tcp, $ip );
34
is $odd_checksum => 25046, 'TCP padding done correctly';
43
bless $udp, 'NetPacket::UDP';
45
is NetPacket::UDP::checksum( $udp, $ip ) => 49177, 'UDP padding';