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

Merged
merged 4 commits into from Aug 8, 2017

Conversation

Projects
None yet
3 participants
@murrant
Member

murrant commented Aug 2, 2017

DO NOT DELETE THIS TEXT

Please note

Please read this information carefully. You can run ./scripts/pre-commit.php to check your code before submitting.

Testers

If you would like to test this pull request then please run: ./scripts/github-apply <pr_id>, i.e ./scripts/github-apply 5926

@murrant

This comment has been minimized.

Show comment
Hide comment
@murrant

murrant Aug 3, 2017

Member

Ready for review, sorry, I wasn't too happy with the initial implementation. Feeling happy with it now.

Member

murrant commented Aug 3, 2017

Ready for review, sorry, I wasn't too happy with the initial implementation. Feeling happy with it now.

@laf laf added Blocker 🚫 and removed Blocker 🚫 labels Aug 3, 2017

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

@murrant murrant added the Blocker 🚫 label Aug 3, 2017

@murrant murrant removed the Blocker 🚫 label Aug 3, 2017

@laf

This comment has been minimized.

Show comment
Hide comment
@laf

laf Aug 3, 2017

Member
Array ( [0] => 1 [1] => Call to undefined function is_ip() [2] => /opt/librenms/html/includes/dev-overview-data.inc.php [3] => 35 )

That's device overview page.

Member

laf commented Aug 3, 2017

Array ( [0] => 1 [1] => Call to undefined function is_ip() [2] => /opt/librenms/html/includes/dev-overview-data.inc.php [3] => 35 )

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') {

This comment has been minimized.

@laf

laf Aug 3, 2017

Member

Think this is muddled up. Two checks for mac and no ipv4_network now.

@laf

laf Aug 3, 2017

Member

Think this is muddled up. Two checks for mac and no ipv4_network now.

This comment has been minimized.

@murrant

murrant Aug 3, 2017

Member

shit, yeah, I started to change that, then changed it back (apparently only partially)

@murrant

murrant Aug 3, 2017

Member

shit, yeah, I started to change that, then changed it back (apparently only partially)

@laf

This comment has been minimized.

Show comment
Hide comment
@laf

laf Aug 3, 2017

Member

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.

Member

laf commented Aug 3, 2017

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.

@laf laf added the Blocker 🚫 label Aug 3, 2017

@laf

This comment has been minimized.

Show comment
Hide comment
@laf

laf Aug 3, 2017

Member
Checking BGP peer [IPV6 Address here] PHP Fatal error:  Call to undefined method LibreNMS\Util\IPv6::compress() in /opt/librenms/includes/functions.php on line 787

Fatal error: Call to undefined method LibreNMS\Util\IPv6::compress() in /opt/librenms/includes/functions.php on line 787
Member

laf commented Aug 3, 2017

Checking BGP peer [IPV6 Address here] PHP Fatal error:  Call to undefined method LibreNMS\Util\IPv6::compress() in /opt/librenms/includes/functions.php on line 787

Fatal error: Call to undefined method LibreNMS\Util\IPv6::compress() in /opt/librenms/includes/functions.php on line 787
@laf

This comment has been minimized.

Show comment
Hide comment
@laf

laf Aug 3, 2017

Member

Discovery ran through ok. So just that poller error and that's it.

Member

laf commented Aug 3, 2017

Discovery ran through ok. So just that poller error and that's it.

murrant added some commits Aug 3, 2017

Fix typo in bgp polling
Two passes of removing invalid characters from hex strings. (That way we don't mangle valid IPs)
@murrant

This comment has been minimized.

Show comment
Hide comment
@murrant

murrant Aug 3, 2017

Member

@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.

Member

murrant commented Aug 3, 2017

@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.

@laf

This comment has been minimized.

Show comment
Hide comment
@laf

laf Aug 3, 2017

Member

I could only test arista bgp. The rest are kit I don't have in my test lab.

Member

laf commented Aug 3, 2017

I could only test arista bgp. The rest are kit I don't have in my test lab.

@murrant

This comment has been minimized.

Show comment
Hide comment
@murrant

murrant Aug 3, 2017

Member

@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 :(

Member

murrant commented Aug 3, 2017

@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 :(

@scrutinizer-notifier

This comment has been minimized.

Show comment
Hide comment
@scrutinizer-notifier

scrutinizer-notifier Aug 3, 2017

The inspection completed: 4 new issues, 38 updated code elements

scrutinizer-notifier commented Aug 3, 2017

The inspection completed: 4 new issues, 38 updated code elements

@murrant murrant changed the title from refactor: remove use of pear Net_IPv4 and Net_IPv6 to feature: New IP parsing classes. Removes usage of Pear Net_IPv4 and Net_IPv6. Aug 3, 2017

@laf

This comment has been minimized.

Show comment
Hide comment
@laf

laf Aug 4, 2017

Member

Running another full disco to test. After that I can't test anything more.

Member

laf commented Aug 4, 2017

Running another full disco to test. After that I can't test anything more.

@laf

This comment has been minimized.

Show comment
Hide comment
@laf

laf Aug 4, 2017

Member

Discovery completed.

Member

laf commented Aug 4, 2017

Discovery completed.

@laf

laf approved these changes Aug 4, 2017

@murrant murrant removed the Blocker 🚫 label Aug 7, 2017

@murrant murrant merged commit 1d77769 into librenms:master Aug 8, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details

@murrant murrant deleted the murrant:pear_net_remove branch Aug 8, 2017

@BradHooper BradHooper referenced this pull request Aug 23, 2017

Closed

BGP prefixes no longer graphed #7217

5 of 5 tasks complete
@lock

This comment has been minimized.

Show comment
Hide comment
@lock

lock bot May 17, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed.

lock bot commented May 17, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed.

@lock lock bot locked as resolved and limited conversation to collaborators May 17, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.