{"id":108,"date":"2006-12-26T11:45:36","date_gmt":"2006-12-26T19:45:36","guid":{"rendered":"http:\/\/www.ericfeminella.com\/blog\/2006\/12\/26\/ipv4-inspector-api\/"},"modified":"2012-03-11T23:56:45","modified_gmt":"2012-03-12T03:56:45","slug":"ipv4-inspector-api","status":"publish","type":"post","link":"https:\/\/www.ericfeminella.com\/blog\/2006\/12\/26\/ipv4-inspector-api\/","title":{"rendered":"IPV4 Inspector API"},"content":{"rendered":"<p>I recently had to write a component for an application which allows users to inspect an IP address in detail as well as validate the address against various different criteria. I couldn&#8217;t find an API which provides this type of functionality in any of the Adobe classes so I wrote my own. I figured someone else may need to do something similar at some point so I am publishing the API under the <a target=\"_blank\" href=\"http:\/\/en.wikipedia.org\/wiki\/MIT_License\">MIT License.<\/a><\/p>\n<p>The IPV4 API allows detailed inspection of an IP version 4 address (IPv4). It provides a robust API which is not available from Adobe at the moment. Usage is simple and straight forward and contains methods which perform the following:<\/p>\n<ul>\n<li>Determine if the address specified is a valid IP address<\/li>\n<li>Determine the network class of the specified IP Address<\/li>\n<li>Determine the network octet of the specified IP Address<\/li>\n<li>Determine the host octet of the specified IP Address<\/li>\n<li>Determine if the IP Address is valid for Network assignment<\/li>\n<li>Determine if the IP Address is within the Class range specified<\/li>\n<li>Determine if the IP Address is a loopback address.<\/li>\n<\/ul>\n<p>Below is a simple usage example which performs various operations on a specific IP Address:<\/p>\n<pre lang=\"actionscript\">\r\nimport com.ericfeminella.net.IPV4Inspector;\r\n\r\nvar ip:IPV4Inspector = new IPV4Inspector(\"23.14.189.200\"); \r\ntrace(\"Network Class: \" + ip.getNetworkClass());\r\ntrace(\"Is valid IP Address: \" + ip.isValid());\r\ntrace(\"Network: \" + ip.getNetworkOctet());\r\ntrace(\"Host: \" + ip.getHostOctet());\r\ntrace(\"Is loopback: \" + ip.isLoopback());\r\ntrace(\"Is valid network host: \" + ip.isValidNetworkHost());\r\n\r\n\r\nOutputs:\r\n\/\/ Network Class: Class A\r\n\/\/ Is valid IP Address: true\r\n\/\/ Network: 23\r\n\/\/ Host: 14.189.200\r\n\/\/ Is loopback: false\r\n\/\/ Is valid network host: true\r\n\r\n<\/pre>\n<p>The IPV4 inspector API can be used for inspecting and validating an IP Address. I plan on adding an update which  contains methods for dealing with masks and prefix notation as well.<\/p>\n<p>You can view the <a target=\"_blank\" href=\"http:\/\/code.ericfeminella.com\/asdocs\/IPV4API-asdoc\/class-summary.html\">ASDoc<\/a> as well as download the source <a target=\"_blank\" href=\"http:\/\/code.ericfeminella.com\/apis\/IPV4API.zip\">swc<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently had to write a component for an application which allows users to inspect an IP address in detail as well as validate the address against various different criteria. I couldn&#8217;t find an API which provides this type of functionality in any of the Adobe classes so I wrote my own. I figured someone else may need to do&#8230; <a class=\"read-more\" href=\"https:\/\/www.ericfeminella.com\/blog\/2006\/12\/26\/ipv4-inspector-api\/\">Continue Reading<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[9],"tags":[],"class_list":["post-108","post","type-post","status-publish","format-standard","hentry","category-news"],"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ericfeminella.com\/blog\/wp-json\/wp\/v2\/posts\/108","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ericfeminella.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ericfeminella.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ericfeminella.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ericfeminella.com\/blog\/wp-json\/wp\/v2\/comments?post=108"}],"version-history":[{"count":0,"href":"https:\/\/www.ericfeminella.com\/blog\/wp-json\/wp\/v2\/posts\/108\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.ericfeminella.com\/blog\/wp-json\/wp\/v2\/media?parent=108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ericfeminella.com\/blog\/wp-json\/wp\/v2\/categories?post=108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ericfeminella.com\/blog\/wp-json\/wp\/v2\/tags?post=108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}