Github user cgivre commented on the issue:

    https://github.com/apache/drill/pull/971
  
    I applied the code formatting template from the Drill site in IntelliJ and 
resubmitted.   Regarding converting an IP to an int, there are tons of examples 
of this online and when I implemented it, I reviewed a few of them and adapted 
it to Drill.   I don't remember which one I used at this point, but here is a 
good explanation of it. 
    https://www.mkyong.com/java/java-convert-ip-address-to-decimal-number/
    
    Other examples:
    
https://stackoverflow.com/questions/12057853/how-to-convert-string-ip-numbers-to-integer-in-java
    
    If you'd prefer, I can resubmit using a pre-existing library. 
    
    For `is_private`, it really isn't that complicated.  Assuming the IP is 
valid to start with, there are three cases:
    1.  If the IP address starts with 192.168 it is private
    2.  If the IP starts with 172. and the second octet is between 16-31 
(inclusive) it is private
    3.  If the IP starts with 10. it is private. 
    
    Anything else is a public IP. 
    
    
    



---

Reply via email to