{"id":1151,"date":"2025-05-20T13:44:27","date_gmt":"2025-05-20T12:44:27","guid":{"rendered":"https:\/\/monkey.ploogie.co.uk\/?page_id=1151"},"modified":"2026-01-09T15:20:10","modified_gmt":"2026-01-09T15:20:10","slug":"included-network-functions","status":"publish","type":"page","link":"https:\/\/monkey.ploogie.co.uk\/index.php\/included-network-functions\/","title":{"rendered":"Included Network Functions"},"content":{"rendered":"<p>Mwnci network functions that are not part of the builtin functions can be loaded with:<\/p>\n<pre>include(\"net\")<\/pre>\n<h2>Functions<\/h2>\n<div class=\"table-wrap\">\n<table class=\"confluenceTable\">\n<tbody>\n<tr>\n<td class=\"confluenceTd\"><strong>Command<\/strong><\/td>\n<td class=\"confluenceTd\"><strong>Definition<\/strong><\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\" colspan=\"1\"><a class=\"conf-macro output-inline\" href=\"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-addresscount-function\/\" data-macro-name=\"sp-nobody-link\" data-hasbody=\"false\">addresscount()<\/a><\/td>\n<td class=\"confluenceTd\" colspan=\"1\">Returns the total count of IP addresses in a CIDR block.<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\" colspan=\"1\"><a class=\"conf-macro output-inline\" href=\"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-cidrrange-function\/\" data-macro-name=\"sp-nobody-link\" data-hasbody=\"false\">cidrrange()<\/a><\/td>\n<td class=\"confluenceTd\" colspan=\"1\">Returns an array of two IP addresses that represent the start and end IP&#8217;s on a given CIDR block<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\" colspan=\"1\"><a class=\"conf-macro output-inline\" href=\"https:\/\/monkey.ploogie.co.uk\/index.php\/mwni-conncount-function\/\" data-macro-name=\"sp-nobody-link\" data-hasbody=\"false\">conncount()<\/a><\/td>\n<td class=\"confluenceTd\" colspan=\"1\">Returns a hash of connection types and totals.<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\" colspan=\"1\"><a class=\"conf-macro output-inline\" href=\"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-lookupport-function\/\" data-macro-name=\"sp-nobody-link\" data-hasbody=\"false\">lookupport()<\/a><\/td>\n<td class=\"confluenceTd\" colspan=\"1\">Returns the service name of a given port number.<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\" colspan=\"1\"><a class=\"conf-macro output-inline\" href=\"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-myip-function\/\" data-macro-name=\"sp-nobody-link\" data-hasbody=\"false\">myip()<\/a><\/td>\n<td class=\"confluenceTd\" colspan=\"1\">Returns an array of IP\u2019s that are configured on the servers\u2019 network interfaces.<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\" colspan=\"1\"><a class=\"conf-macro output-inline\" href=\"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-netstat-function\/\" data-macro-name=\"sp-nobody-link\" data-hasbody=\"false\">netstat()<\/a><\/td>\n<td class=\"confluenceTd\" colspan=\"1\">Returns an array of current network connections.<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\" colspan=\"1\"><a class=\"conf-macro output-inline\" href=\"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-nettrans-function\/\" data-macro-name=\"sp-nobody-link\" data-hasbody=\"false\">nettrans()<\/a><\/td>\n<td class=\"confluenceTd\" colspan=\"1\">Returns a hash of network transaction counts keyed by network interface.<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\" colspan=\"1\"><a class=\"conf-macro output-inline\" href=\"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-openports-function\/\" data-macro-name=\"sp-nobody-link\" data-hasbody=\"false\">openports()<\/a><\/td>\n<td class=\"confluenceTd\" colspan=\"1\">Returns an array of open (listening) ports.<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\" colspan=\"1\"><a class=\"conf-macro output-inline\" href=\"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-ping-function\/\" data-macro-name=\"sp-nobody-link\" data-hasbody=\"false\">ping()<\/a><\/td>\n<td class=\"confluenceTd\" colspan=\"1\">Returns <em>true<\/em> if a successful IMCP_ECHO_RESPONSE is found.<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\" colspan=\"1\"><a class=\"conf-macro output-inline\" href=\"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-port2pid-function\/\" data-macro-name=\"sp-nobody-link\" data-hasbody=\"false\">port2pid()<\/a><\/td>\n<td class=\"confluenceTd\" colspan=\"1\">Returns a hash of process Id&#8217;s and process names keyed on port number.<\/td>\n<\/tr>\n<tr>\n<td class=\"confluenceTd\" colspan=\"1\"><a class=\"conf-macro output-inline\" href=\"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-route-function\/\" data-macro-name=\"sp-nobody-link\" data-hasbody=\"false\">route()<\/a><\/td>\n<td class=\"confluenceTd\" colspan=\"1\">Returns an array of hashes of the current routing table.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Mwnci network functions that are not part of the builtin functions can be loaded with: include(&#8220;net&#8221;) Functions Command Definition addresscount() Returns the total count of IP addresses in a CIDR block. cidrrange() Returns an array of two IP addresses that represent the start and end IP&#8217;s on a given CIDR block conncount() Returns a hash &hellip; <a href=\"https:\/\/monkey.ploogie.co.uk\/index.php\/included-network-functions\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Included Network Functions&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1151","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/1151","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/comments?post=1151"}],"version-history":[{"count":7,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/1151\/revisions"}],"predecessor-version":[{"id":1287,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/1151\/revisions\/1287"}],"wp:attachment":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=1151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}