Adding Ip Validate function to functions

* Added a function ip_validate to validate if the ip is  the range
* Added the test for ip_validate with all cases