Add "quiet" flag.

This commit is contained in:
Stefan `Sec` Zehl 2012-04-04 20:56:24 +02:00
parent 69bfec0359
commit 2c03614af8
1 changed files with 4 additions and 3 deletions

View File

@ -13,6 +13,7 @@ use Time::HiRes;
our $verbose=0;
our $bridge; # Open device
our $quiet=0;
### Utility
sub sprint{
@ -111,7 +112,7 @@ sub get_packet{
if($firstpkt){
$firstpkt--;
}else{
print STDERR "Unparseable stuff: <",sprint($1),">\n";
print STDERR "Unparseable stuff: <",sprint($1),">\n" if(!$quiet);
};
}elsif ($buffer =~ s/^\\2\\0//s){
return 'ack'; # In-band signalling. Evil %)
@ -128,7 +129,7 @@ sub get_packet{
sub rest{
if(length($buffer)>0){
print "rest: <", sprint($buffer), ">\n";
print "rest: <", sprint($buffer), ">\n" if(!$quiet);
};
};
@ -255,7 +256,7 @@ sub nice_beacon{
$out->{idx},
$out->{beacon};
if(unpack("H*",substr($pkt,12,2)) ne "ffff"){
print "unused=",unpack("H*",substr($pkt,12,2))," ";
print "unused=",unpack("H*",substr($pkt,12,2))," " if (!$quiet);
};
}elsif($type eq "\x23"){
$out->{type}= "nick";