I am developing an inventory agent daemon so I am currently trying to create a perl script that will parse Ethernet packets using the LLDP protocol.
Im using tshark ethernet filters to obtain these details and then print them out
@ARGV = ``tshark -i ether proto \0x88cc'`;
while (@ARGV)
{
my $item = @ARGV;
print "$item \n";
}
This results in compilation errors: Can't exec "tshark"
.
I think I'm not correctly passing the tshark filter options to the command line but as far as I am aware the backticks are used to capture the output of command line arguments.
I'm not aware of tshark
. But if tshark -i ether proto \0x88cc
is an executable command from shell try following else please provide more details
my @output= `tshark -i ether proto \0x88cc`;
foreach my $item (@output) {
print "${item}\n";
}