<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">###############################################################################
## Copyright 2005-2016 OCSInventory-NG/OCSInventory-Server contributors.
## See the Contributors file for more details about them.
## 
## This file is part of OCSInventory-NG/OCSInventory-ocsreports.
##
## OCSInventory-NG/OCSInventory-Server is free software: you can redistribute
## it and/or modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation, either version 2 of the License,
## or (at your option) any later version.
##
## OCSInventory-NG/OCSInventory-Server is distributed in the hope that it
## will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
## of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with OCSInventory-NG/OCSInventory-ocsreports. if not, write to the
## Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
## MA 02110-1301, USA.
################################################################################
package Apache::Ocsinventory::Server::Constants;

use strict;

use Apache::Ocsinventory::Map;

require Exporter;

our @ISA = qw /Exporter/;

our @EXPORT = qw/
	PROLOG_RESP_BREAK
	PROLOG_RESP_STOP
	PROLOG_RESP_SEND
	OPTION_TYPE_SYNC
	OPTION_TYPE_ASYNC
	LOGPATH
	CHECKSUM_MAX_VALUE
	DUP_HOSTNAME_FL
	DUP_SERIAL_FL
	DUP_MACADDR_FL
	DUP_SMODEL_FL
	DUP_UUID_FL
	DUP_ASSETTAG_FL
	PROLOG_STOP
	PROLOG_CONTINUE
	INVENTORY_STOP
	INVENTORY_CONTINUE
   	BAD_USERAGENT
/;

use constant PROLOG_RESP_BREAK =&gt; 0;
use constant PROLOG_RESP_STOP =&gt; 1;
use constant PROLOG_RESP_SEND =&gt; 2;

use constant OPTION_TYPE_SYNC =&gt; 0;
use constant OPTION_TYPE_ASYNC =&gt; 1;

my $checksum_max_value = &amp;get_checksum();
use constant CHECKSUM_MAX_VALUE =&gt; $checksum_max_value;

# To enable user to set how auto-duplicates works
use constant DUP_HOSTNAME_FL =&gt; 1  ;
use constant DUP_SERIAL_FL   =&gt; 2  ;
use constant DUP_MACADDR_FL  =&gt; 4  ;
use constant DUP_SMODEL_FL   =&gt; 8  ;
use constant DUP_UUID_FL     =&gt; 16 ; 
use constant DUP_ASSETTAG_FL =&gt; 32 ;

use constant PROLOG_STOP =&gt; 1;
use constant BAD_USERAGENT =&gt; 2;
use constant PROLOG_CONTINUE =&gt; 0;
use constant INVENTORY_STOP =&gt; 1;
use constant INVENTORY_CONTINUE =&gt; 0;

sub get_checksum {
  my $checksum;

  for my $section (keys %DATA_MAP){
    $checksum|=$DATA_MAP{$section}-&gt;{mask};
  }  
  return $checksum;
}
1;
</pre></body></html>