Skip to content

Commit

Permalink
Modified ios detector
Browse files Browse the repository at this point in the history
  • Loading branch information
ohtarr committed Feb 6, 2019
1 parent ef017c0 commit d7ba817
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions lib/cisco_parse.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,16 @@ class CiscoParse
//public $interfaces = [];
public $output = [];

public function __construct()
public function __construct($array)
{

foreach($array as $key => $value)
{
if(array_key_exists($key,$this->input))
{
$this->input[$key] = $value;
}
$this->update();
}
}

public function __destruct()
Expand Down Expand Up @@ -81,27 +88,30 @@ public function update()
if($this->os == "ios")
{
require_once("cisco_ios_parse.php");
$parser = new \ohtarr\CiscoIosParse();
$parser = new \ohtarr\CiscoIosParse($this->input);
return $parser;
}

if($this->os == "iosxe")
{
require_once("cisco_iosxe_parse.php");
$parser = new \ohtarr\CiscoIosxeParse();
$parser = new \ohtarr\CiscoIosxeParse($this->input);
return $parser;
}

if($this->os == "nxos")
{
require_once("cisco_nxos_parse.php");
$parser = new \ohtarr\CisconxosParse();
$parser = new \ohtarr\CisconxosParse($this->input);
return $parser;
}

if($this->os == "iosxr")
{
//require_once("cisco_iosxr_parse.php");
}

if($this->os)
/* if($this->os)
{
$parser->input_data($this->input['run'],"run");
$parser->input_data($this->input['version'],"version");
Expand All @@ -113,7 +123,7 @@ public function update()
$parser->input_data($this->input['switchport'],"switchport");
//$parser->update();
$this->output = $parser->output;
}
} */
}

public function parse_version_to_os()
Expand Down

0 comments on commit d7ba817

Please sign in to comment.