New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: New IP parsing classes. Removes usage of Pear Net_IPv4 and Net_IPv6. #7106
Conversation
Ready for review, sorry, I wasn't too happy with the initial implementation. Feeling happy with it now. |
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
6001091
to
c656ea9
Compare
…nst an ipv6 network == fail.
That's device overview page. |
if ($_POST['search_type'] == 'ipv6') { | ||
list($prefix, $length) = explode('/', $interface['ipv6_network']); | ||
$address = Net_IPv6::compress($interface['ipv6_address']).'/'.$length; | ||
if ($_POST['search_type'] == 'mac') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think this is muddled up. Two checks for mac and no ipv4_network now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shit, yeah, I started to change that, then changed it back (apparently only partially)
Going through a full discovery now, tested all the webui elements changed + api which are all fine except the one above. Will see how polling is going after 15 minutes. |
|
Discovery ran through ok. So just that poller error and that's it. |
Two passes of removing invalid characters from hex strings. (That way we don't mangle valid IPs)
@laf I only was able to fully test discovery modules ipv4-addresses and ipv6-addresses. Can you (or anyone) test bgp-peers, cisco-sla, loadbalancers/f5-ltm, ntp/cisco Edit: looks like laf tested bgp-peers. |
I could only test arista bgp. The rest are kit I don't have in my test lab. |
@laf: I think the parts of bgp I touched are in a common code area. But my kit doesn't support IPv6 peer info via snmp :( |
The inspection completed: 4 new issues, 38 updated code elements |
Running another full disco to test. After that I can't test anything more. |
Discovery completed. |
This thread has been automatically locked since there has not been any recent activity after it was closed. |
DO NOT DELETE THIS TEXT
Please note
Testers
If you would like to test this pull request then please run:
./scripts/github-apply <pr_id>
, i.e./scripts/github-apply 5926