* Refactor remove use of pear Net_IPv4 and Net_IPv6
Caution, I added tests to test the functionality of the new functions, but I'm not 100% certain the replaced usages match 100%. Please test.
Left usage in generate-iplist.php because I'm not sure the use of that script, so I didn't want to implement additional functionality to support it.
Add support for ipv6 fo ipInNetwork() function
Add phpdocs to functions
Remove accidental inclusion
Use binary operations instead of string for networKFromIp()
Tidy up binary operations in ipInNetwork()
tidy parsing cidr network
Change to a class based implementation.
Update phpdocs.
Fully catch exceptions for hex parsing.
Fix mistake.
support older phpunit versions
Fix php shifting to negative with php 5
* Fix graph authorization. Uncaught exception and checking an ipv4 against an ipv6 network == fail.
* Also remove colons from hex strings.
* Fix typo in bgp polling
Two passes of removing invalid characters from hex strings. (That way we don't mangle valid IPs)
* Fix bug get_graph_by_port_hostname() only hostname
From the documentation:
Function: get_graph_by_port_hostname top
Get a graph of a port for a particular device.
hostname can be either the device hostname or id
But the function is only works with a hostname and not with a ID.
I have modified a few things that solve the problem.
* Update api_functions.inc.php
* Fixed an issue with the output including all services from a host that had a single matched service regardless of whether they matched the filter.
* Cleaned up some bits
* Updated based on murrants suggestions
* A couple small cleanups
* api: API allow cidr network searches of the ARP table
* Allow non-encoded / in request
I also noticed that all is allowed to be called without device, which the sql query does not support.
* fix: API call for graphs not working (#6184)
* I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md
* updated set_image_type to use new function
* Adding location based filter for api-device calls
* I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md.
* configured linting etc, now pr should pass
* rebase and add entry to docs
* Added severity field from the alert rule to the output of list_alerts.
* I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md.
* Implement an autoloader
When cleaning up classes for psr2, things got a bit unwieldy, so I implemented a class autoloader.
I created a PSR-0 compliant LibreNMS directory and moved all classes there that made sense.
Implemented LibreNMS\ClassLoader which supports adding manual class mappings
This reduces the file includes needed and only loads classes when needed.
* Add teh autoloader to graph.php
* Add a small bit of docs
Fix incomplete class in includes/discovery/functions.inc.php
Use exceptions for addHost()
Gets rid of silly mixed return and only returns the device_id. Throwing an exception if we run into any issues.
Slightly modifies api add host output again to include device_id
Update addHost() to return either device_id or a string
modify print_error(), print_message() to allow for $quiet variable
Only call addHost() once in addhost.php, if the snmp version isn't set, addHost will cope
Fix up snmp-scan.php and discovery-protocols.inc.php to detect when a device already exists
change in ip_exists() to make it more readable