Remove snmp functions that are barely used (#15377)

* Remove snmp functions that are barely used
Replace them with SnmpQuery calls

* Apply fixes from StyleCI

* Fix missing namespace

* Import Oid

* No more variables left may be repeated multiple times at the end with snmpsim, remove them all

* update data fixed by SnmpResponse bugfix

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
This commit is contained in:
Tony Murray
2023-10-05 01:29:22 -05:00
committed by GitHub
parent e0444bffcf
commit be24993cbb
15 changed files with 101 additions and 229 deletions

View File

@@ -85,4 +85,17 @@ class Oid
return $numeric_oid;
}
/**
* Convert a string to an oid encoded string
*/
public static function ofString(string $string): string
{
$oid = strlen($string);
for ($i = 0; $i != strlen($string); $i++) {
$oid .= '.' . ord($string[$i]);
}
return $oid;
}
}