<?php
/*******************************************************************
CONFIGURATION FILE FOR ALL API
WRITTEN BY JOSE MARI REYES

VERSIONl: REDPORT ENTERPRISE


HISTORY:

05-09-2019	ENTERPRISE
12-12-2019	MODIFYED TO USE SYSINFO
01-14-2020	CONVERTED TO UNIVERSAL API CONFIGURATION FOR ALL API
02-20-2020	FIX ISSUE ON ENTERPRISE WAN

********************************************************************/
include ("/www/cgi-bin/sysinfo");

$inf = sysinfo();

define('HARDWARE', "REDPORT");


if ($inf == LS) define('MACHINE', 'EN');  //enterprise
if ($inf == OV) define('MACHINE', 'OV');  //optimizer
if ($inf == OP) define('MACHINE', 'OP'); //premier


//GENERAL WAN INTERFACE
if ($inf == OV) //OV OPTIMIZER CREWCOMM (OC)
{
	define("IFACE", "eth0.2"); //REDPORT OV version
	define("WAN", "config interface 'wan'\n\toption ifname '" . IFACE . "'\n");
	define("CONFWAN", "/'wan'/");
	
	define('WAN_IFACE', 'eth0.2'); 
	define('WAN_ETH', 'eth0.2');  
	
	define('BUS_IFACE', '');      // no business lan
	
}


if ($inf == OP) //OP OPTIZER CREWOMM PREMIER (OCP)
{
	define("IFACE", "eth0.3"); //REDPORT OP
	define("WAN", "config interface 'wan2'\n\toption ifname '" . IFACE . "'\n");
 	define("CONFWAN", "/'wan2'/");

	define('WAN_IFACE', 'eth0.3'); 
	define('WAN_ETH', 'eth0.3');  
	
	define('BUS_IFACE', 'eth0.5'); //BUSINESS LAN
	
}


if ($inf == LS) //OPTIMIZER CREWCOMM ENTERPRISE (OCE)
{
    	define("IFACE", "eth1"); //REDPORT ENT
	define("WAN", "config interface 'wan2'\n\toption ifname '" . IFACE . "'\n");
    	define("CONFWAN", "/'wan2'/");
	
	define('WAN_IFACE', 'eth1');  
	define('WAN_ETH', 'eth1');  

	define('BUS_IFACE', 'eth3');  //BUSINESS LAN
	
}

?>
