<commit_before># Remote Rogue Device Detector
# Written by <NAME>
#

use strict;
use Net::Ping;
use Getopt::Long;
use Win32::NetResource qw(:DEFAULT NetShareGetInfo GetError);
use c3p0; # shared subroutines

@dhcpservers = (
  '172.16.58.3',
);

%dcs = ( ### Domain-Controller-FQDN for use in dsquery ###
  'dc01'=>'DC=odd,DC=com',
  'dc10'=>'DC=odd,DC=com',
);

$sleeptime = 0;
$result = GetOptions (
  "sleep=i" => \$sleeptime,
  "verbose"  => \$verbose,
  "update" => \$update,
  "listall" => \$listall,
  "help|?" => \$showhelp,
  );

if ($showhelp) {
  &showhelp;
}

if ($update) {
  print STDERR "Updating vendor.txt file from the IEEE web site\n";
  &updatevendorlist;
  exit;
}

if ($sleeptime > 86400) {
  print STDERR "Sleep option must be no more than 86400 (24 hours).\n";
  exit;
} else {
	&printandpush ("Sleep set to $sleeptime seconds\n");
}

foreach $server (@dhcpservers) { # check that the server IP is a valid format
  $ok = 0;
  unless ($server =~ /[^\d\.]/g) {
    if ($server =~ /(.+)\.(.+)\.(.+)\.(.+)/) {
      if ($1 >= 1 && $1 <= 255) {
        if ($2 >= 1 && $2 <= 255) {
          if ($3 >= 1 && $3 <= 255) {
            if ($4 >= 1 && $4 <= 255) {
              $ok = 1;
            }
          }
        }
      }
    }
  }
  if ($ok == 0 ) { &printandpush ("DHCP server IP [$server] not valid\n"); }
}

&loadVendorCodes;<commit_msg>Fix valid IP format<commit_after># Remote Rogue Device Detector
# Written by <NAME>
#

use strict;
use Net::Ping;
use Getopt::Long;
use Win32::NetResource qw(:DEFAULT NetShareGetInfo GetError);
use c3p0; # shared subroutines

@dhcpservers = (
  '172.16.58.3',
);

%dcs = ( ### Domain-Controller-FQDN for use in dsquery ###
  'dc01'=>'DC=odd,DC=com',
  'dc10'=>'DC=odd,DC=com',
);

$sleeptime = 0;
$result = GetOptions (
  "sleep=i" => \$sleeptime,
  "verbose"  => \$verbose,
  "update" => \$update,
  "listall" => \$listall,
  "help|?" => \$showhelp,
  );

if ($showhelp) {
  &showhelp;
}

if ($update) {
  print STDERR "Updating vendor.txt file from the IEEE web site\n";
  &updatevendorlist;
  exit;
}

if ($sleeptime > 86400) {
  print STDERR "Sleep option must be no more than 86400 (24 hours).\n";
  exit;
} else {
	&printandpush ("Sleep set to $sleeptime seconds\n");
}

foreach $server (@dhcpservers) { # check that the server IP is a valid format
  $ok = 0;
  unless ($server =~ /[^\d\.]/g) {
    if ($server =~ /(.+)\.(.+)\.(.+)\.(.+)/) {
      if ($1 >= 0 && $1 <= 255) {
        if ($2 >= 0 && $2 <= 255) {
          if ($3 >= 0 && $3 <= 255) {
            if ($4 >= 0 && $4 <= 255) {
              $ok = 1;
            }
          }
        }
      }
    }
  }
  if ($ok == 0 ) { &printandpush ("DHCP server IP [$server] not valid\n"); }
}

&loadVendorCodes;
{'fraction_non_alphanumeric': 0.20702267739575714, 'fraction_numerical': 0.040965618141916606, 'mean_word_length': 2.589238845144357, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1097744', 'n_tokens_mistral': 1164, 'n_tokens_neox': 1076, 'n_words': 280}