File: ethernet.t

package info (click to toggle)
libnetpacket-perl 1.7.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 360 kB
  • sloc: perl: 1,715; xml: 291; makefile: 2
file content (23 lines) | stat: -rw-r--r-- 543 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use strict;
use warnings;

use Test::More tests => 3;

use NetPacket::Ethernet qw/ :types /;

is ETH_TYPE_PPPOES() => 0x8864, 'imports';

is NetPacket::Ethernet::ETH_TYPE_IP() => 0x0800, 'with namespace';

subtest "don't invert the mac ports" => sub {
    my $packet = NetPacket::Ethernet->decode(
        NetPacket::Ethernet::encode({
            src_mac => '001',
            dest_mac => '002',
            data => '',
        })
    );

    like $packet->{src_mac}, qr'001', 'src_mac';
    like $packet->{dest_mac}, qr'002', 'dest_mac';
};