Subversion Repositories oidinfo_api

Rev

Rev 24 | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. <html>
  2.  
  3. <head>
  4. <title>oid-info.com API for PHP</title>
  5. <style>
  6. code, pre {
  7.         color:blue;
  8. }
  9. pre.cmd {
  10.         background-color:#BBBBBB;
  11. }
  12. .attention {
  13.         color:red;
  14. }
  15. </style>
  16. </head>
  17.  
  18. <body>
  19.  
  20. <h1>oid-info.com API for PHP</h1>
  21.  
  22. <p><i>24 November 2021</i></p>
  23.  
  24. <h2>Introduction</h2>
  25.  
  26. <p><a href="http://oid-info.com/">oid-info.com</a> is a public repository for Object Identifiers (OIDs). This API is available in PHP and can be used in web-interfaces (Apache module, cgi-bin, etc.) but can also be used in command line tools written in PHP (on Linux with shebang <code>#!/usr/bin/php</code>) .</p>
  27.  
  28. <p>The majority of the functions provided by this API helps developers in creating XML files which can be uploaded to the OID repository to add multiple OIDs, but the API also contains other helpful utilities related to OIDs, UUIDs and the OID repository in general. The XML generation can be useful for Registration Authorities (RAs) that want to deliver their assignments to oid-info.com , but also for people who want to support the OID repository by adding OIDs from public sources. The XML files generated by these API functions are conform with the <a href="http://www.oid-info.com/oid.xsd">XML schema of oid-info.com</a> and can be uploaded <a href="http://www.oid-info.com/submit.htm">here</a> - you will also find more information about the XML submission at these pages.</p>
  29.  
  30. <p>An example of a XML generation code can be found here: <a href="oidinfo_example.phps">oidinfo_example.phps</a></p>
  31.  
  32. <p>The API is licensed under the terms of the <a href="https://www.apache.org/licenses/LICENSE-2.0">Apache 2.0 License</a> and was written by <a href="http://www.daniel-marschall.de/">Daniel Marschall</a>.</p>
  33.  
  34. <h2>Download</h2>
  35.  
  36. <p><a href="https://www.viathinksoft.com/projects/oidinfo_api">Download the current version of the API here</a> / <a href="https://svn.viathinksoft.com/cgi-bin/viewvc.cgi/oidinfo_api/">Browse SVN repository</a></p>
  37.  
  38. <p>Browse the source code online:</p>
  39.  
  40. <ul>
  41.         <li><a href="oid_illegality_rules">oid_illegality_rules</a></li>
  42.         <li><a href="oidinfo_api.inc.phps">oidinfo_api.inc.phps</a></li>
  43.         <li><a href="oidinfo_test.phps">oidinfo_test.phps</a> (optional)</li>
  44.         <li><a href="oidinfo_example.phps">oidinfo_example.phps</a> (optional)</li>
  45.         <li><a href="oid_utils.inc.phps">oid_utils.inc.phps</a> (dependent unit)</li>
  46.         <li><a href="uuid_utils.inc.phps">uuid_utils.inc.phps</a> (dependent unit)</li>
  47.         <li><a href="mac_utils.inc.phps">mac_utils.inc.phps</a> (dependent unit)</li>
  48.         <li><a href="xml_utils.inc.phps">xml_utils.inc.phps</a> (dependent unit)</li>
  49.         <li>Example for a simple ping provider (<a href="#part6">see part 6</a>): <a href="csv_lookup_server_example/">CSV Lookup Server</a></li>
  50. </ul>
  51.  
  52. <h2>Table of Contents</h1>
  53.  
  54. <ul>
  55.         <li><a href="#part1">Part 1: "Ping API" / "Verbose Ping Provider" for checking if OIDs are available or allowed to create</a></li>
  56.         <li><a href="#part2">Part 2: Syntax checking</a></li>
  57.         <li><a href="#part3">Part 3: XML file creation</a></li>
  58.         <li><a href="#part4">Part 4: Offline check if OIDs are illegal</a></li>
  59.         <li><a href="#part5">Part 5: Misc functions</a></li>
  60.         <li><a href="#part6">Part 6: Simple Ping Providers</a></li>
  61. </ul>
  62.  
  63. <h2>Class <code>OIDInfoAPI</code></h2>
  64.  
  65. <p><i>Note: Not every throwable Exception (they are all of type <code>OIDInfoException</code>) is described in the method descriptions.</i></p>
  66.  
  67. <h3><a name="part1">Part 1: "Ping API" / "Verbose Ping Provider" for checking if OIDs are available or allowed to create</h3>
  68.  
  69. <h4>Online check functions</h4>
  70.  
  71. <p><i>Note: These 4 functions include the <code>strictCheckSyntax()</code> check (see <a href="#part2">Part 2: Syntax checking</a>).</i></p>
  72.  
  73. <pre class="cmd">public function checkOnlineExists($oid)</pre>
  74.         <p>An online check will be performed, to check if <code>$oid</code> <i>exists</i>. "Exist" means, the OID was added to the repository. Exist does not mean that the OID is also validated by the OID repository admin (i.e. available through the web interface).</p>
  75.         <p>You can use the function <code>oidExisting</code> which uses the online-check (verbose ping provider) and the simple-ping-provider, if available, in combination.</p>
  76. <pre class="cmd">public function checkOnlineAvailable($oid)</pre>
  77.         <p>An online check will be performed, to check if <code>$oid</code> is <i>available</i>. "Available" means, the OID was added to the repository and is validated by the OID repository admin.</p>
  78. <pre class="cmd">public function checkOnlineAllowed($oid)</pre>
  79.         <p>An online check will be performed, to check if <code>$oid</code> is <i>allowed</i>. "Allowed" means, that the OID repository allows the creation of this OID. This is the case for OIDs which are not created in a frozen or leaf arc of the OID tree and are not known as illegal.</p>
  80.         <p><font class="attention">Attention!</font> "Allowed" will also be <code>true</code> if the OID already exists in the OID repository.</p>
  81.         <p><font class="attention">Attention!</font> Before using this function, you should verify that <code>$oid</code> is not listed in the local blacklist (please see <a href="#part4">Part 4: Offline check if OIDs are illegal</a>), by using <code>illegalOID($oid)</code>, because this low level function does not include this check by design.</p>
  82. <pre class="cmd">public function checkOnlineMayCreate($oid)</pre>
  83.         <p>An online check will be performed, to check if <code>$oid</code> may be <i>created</i>. This means that the OID is <i>allowed</i> (<code>checkOnlineAllowed</code>) and does not <i>exist</i> (<code>!checkOnlineExists</code>).</p>
  84. <!--    <p><font class="attention">Attention!</font> This check will NOT include a check against the local blacklist of illegal OIDs (please see <a href="#part4">Part 4: Offline check if OIDs are illegal</a>). This step needs to be done separately.</p> -->
  85.         <p><font class="attention">Attention!</font> Before using this function, you should verify that <code>$oid</code> is not listed in the local blacklist (please see <a href="#part4">Part 4: Offline check if OIDs are illegal</a>), by using <code>illegalOID($oid)</code>, because this low level function does not include this check by design. It is recommended to use <code>oidMayCreate()</code> instead.</p>
  86.  
  87. <h4>Caching</h4>
  88. <pre class="cmd">pingCacheMaxAge = 3600</pre>
  89.         <p>The results of <code>checkOnlineExists</code>, <code>checkOnlineAvailable</code>, <code>checkOnlineAllowed</code> and <code>checkOnlineMayCreate</code> are cached to reduce the amount of web traffic, which also increases the performance. The variable <code>pingCacheMaxAge</code> contains the maxiumum amount of seconds before the cache entry will be renewed.
  90.         The cache will be automatically cleared if the function <code>clearPingCache</code> is called, or if the PHP script session terminates.</p>
  91.         <p>The default value is 3600 seconds, which is 1 hour. If you are using the OIDInfo-API in a long-term process (e.g. a daemon or crawler service), you should probably modify the <code>pingCacheMaxAge</code> setting.
  92.         <p>If you want to make sure that the cache is never used, please set <code>pingCacheMaxAge = -1</code>. Please note, that the cache is still maintained (extended and updated).</p>
  93.         <p>If you do not want that the cache entries expire, you can use the <a href="http://php.net/manual/en/math.constants.php">PHP constant</a> INF: <code>pingCacheMaxAge = INF</code>.</p>
  94. <pre class="cmd">public function clearPingCache()</pre>
  95.         <p>This function clears the ping cache. This will also reduce the amount of currently used memory.</p>
  96.  
  97. <h4>Configuration of the verbose ping provider</h4>
  98.  
  99. <p><i>The "Verbose Ping Provider" is a HTTP(S) webservice which tells wheather an OID exists at oid-info.com, and if it may be created.</i></p>
  100.  
  101. <p>The webservice must return following content:</p>
  102.  
  103. <pre>
  104.          First digit of the ping result
  105.          "-" = error
  106.          "0" = OID does not exist
  107.          "1" = OID does exist, but is not approved yet
  108.          "2" = OID does exist and is accessible
  109.  
  110.          Second digit of the ping result
  111.          "-" = error
  112.          "0" = The OID may not be created
  113.          "1" = OID is not an illegal OID, and none of its ascendant is a leaf and its parent OID is not frozen
  114. </pre>
  115.  
  116. <pre class="cmd">$verbosePingProviders = array('https://misc.daniel-marschall.de/oid-repository/ping_oid.php?oid={OID}');</pre>
  117. <p>The URL(s) of the verbose ping provider(s). The string <code>{OID}</code> will be replaced by the OID in dot-notation. Usually, you do not need to edit this configuration.</p>
  118.  
  119. <h3><a name="part2">Part 2: Syntax checking</h3>
  120.  
  121. <pre class="cmd">public static function strictCheckSyntax($oid)</pre>
  122.         <p>Returns <code>true</code>, if the <code>$oid</code> has the correct syntax for usage in the XML files for the OID repository. This means:</p>
  123.         <ul>
  124.                 <li>The syntax is a valid dot-notation</li>
  125.                 <li>The OID does not begin with a dot (this notation can be found in SNMP and OID+ systems)</li>
  126.                 <li>No arc contains a leading zero</li>
  127.         </ul>
  128. <pre class="cmd">public static function trySanitizeOID($oid)</pre>
  129.         <p>Tries to repair <code>$oid</code> to make it comply with <code>strictCheckSyntax</code>. A leading dot as well as leading zeros will be removed. If the OID is still invalid, the function will return <code>false</code>, otherwise the sanitized OID as string.</p>
  130.  
  131. <h3><a name="part3">Part 3: XML file creation</h3>
  132.  
  133. <pre class="cmd">public function softCorrectEMail($email, $params)</pre>
  134.         <p>This function tries to correct an invalid eMail address (probably obfuscated for anti spam purposes), e.g. "john[at]example[dot]com" will be corrected into "john@example.com" .</p>
  135.         <p>If <code>$params['allow_illegal_email']</code> is <code>true</code>, and the email address is still invalid, an empty string will be returned.</p>
  136.         <p>Otherwise, the function will return the email address which was fully, partially or not corrected.</p>
  137.         <p><font class="attention">Attention!</font> You don't need to use this function if you create an XML file using <code>createXMLEntry</code>, since this step will be done automatically.</p>
  138. <pre class="cmd">public function softCorrectPhone($phone, $params)</pre>
  139.         <p>This function tries to corrects a phone number and remove invalid characters, like dashes or brackets.</p>
  140.         <p><font class="attention">Attention!</font> You don't need to use this function if you create an XML file using <code>createXMLEntry</code>, since this step will be done automatically.</p>
  141. <pre class="cmd">public function correctDesc($desc, $params, $ending_dot_policy=OIDInfoAPI::OIDINFO_CORRECT_DESC_OPTIONAL_ENDING_DOT, $enforce_xhtml_light=false)</pre>
  142.         <p>This function tries to change the description to make it comply with the XML file.</p>
  143.         <p>If <code>$params['allow_html']</code> is <code>true</code>, HTML tags will be allowed, otherwise they will be encoded.</p>
  144.         <p>If <code>$params['tolerant_htmlentities']</code> is <code>true</code>, double encoded HTML entities like <code>&amp;amp;amp;</code> will be corrected.</p>
  145.         <p>Also, this function will remove unnecessary phrasings like "OID for " at the beginning or ending of the description.</p>
  146.         <p>Following constants are valid values for <code>$ending_dot_policy</code>:</p>
  147.         <ul>
  148.                 <li><code>OIDInfoAPI::OIDINFO_CORRECT_DESC_OPTIONAL_ENDING_DOT = 0</code></li>
  149.                 <li><code>OIDInfoAPI::OIDINFO_CORRECT_DESC_ENFORCE_ENDING_DOT = 1</code> (A leading dot will be created if it is not available)</li>
  150.                 <li><code>OIDInfoAPI::OIDINFO_CORRECT_DESC_DISALLOW_ENDING_DOT = 2</code> (A leading dot will be removed from the text)</li>
  151.         </ul>
  152.         <p>If <code>$enforce_xhtml_light</code> is set to <code>true</code>, then tags which are not included in the <a href="http://www.oid-info.com/xhtml-light.xsd">XHTML Light specification</a> are removed, except if <code>$params['ignore_xhtml_light']</code> is <code>true</code>.</p>
  153.         <p><font class="attention">Attention!</font> You don't need to use this function if you create an XML file using <code>createXMLEntry</code>, since this step will be done automatically.</p>
  154. <pre class="cmd">public function xmlAddHeader($firstName, $lastName, $email)</pre>
  155.         <p>Outputs the beginning of a XML file which can be created and submitted to oid-info.com</p>
  156. <pre class="cmd">public function xmlAddFooter()</pre>
  157.         <p>Returns the footer of the XML file.</p>
  158. <pre class="cmd">public function createXMLEntry($oid, $elements, $params, $comment='')</pre>
  159.         <p>Returns a <code>&lt;oid&gt;</code> entry for the XML file, with an optional comment <code>$comment</code> above the entry.</p>
  160.         <p>Valid values of <code>$elements</code> and <code>$params</code> will be explained in the following sections.</p>
  161.  
  162. <h4>Valid values for <code>$params</code></h4>
  163. <pre class="cmd">$params['allow_html']</pre>
  164.         <p>Allows HTML in <code>&lt;description&gt;</code> and <code>&lt;information&gt;</code></p>
  165.         <p>Default: <code>false</code></p>
  166. <pre class="cmd">$params['allow_illegal_email']</pre>
  167.         <p>Does not delete email addresses which could not be repaired with <code>softCorrectEMail</code>.</p>
  168.         <p>This should stay enabled, because we don't know if the source used some kind of human-readable anti-spam technique instead of an actual wrong address.</p>
  169.         <p>Default: <code>true</code></p>
  170. <pre class="cmd">$params['soft_correct_behavior']</pre>
  171.         <p>This defines the way ASN.1 identifiers (<code>$elements['synonymous-identifier']</code>) will be corrected in case they are illegal. Following modes are available:</p>
  172.         <ul>
  173.                 <li><code>OIDInfoAPI::SOFT_CORRECT_BEHAVIOR_NONE</code> : The illegal identifier will be deleted.</li>
  174.                 <li><code>OIDInfoAPI::SOFT_CORRECT_BEHAVIOR_LOWERCASE_BEGINNING</code> : The beginning will be enforced to be lowercase.</li>
  175.                 <li><code>OIDInfoAPI::SOFT_CORRECT_BEHAVIOR_ALL_POSSIBLE</code> : All invalid characters will be removed, and the beginning will be enforced to be lowercase.</li>
  176.         </ul>
  177.         <p>Default: <code>OIDInfoAPI::SOFT_CORRECT_BEHAVIOR_NONE</code></p>
  178. <pre class="cmd">$params['do_online_check']</pre>
  179.         <p>Flag to disable this online check (<code>checkOnlineMayCreate($oid)</code>) to save traffic and runtime.</p>
  180.         <p>Default: <code>false</code></p>
  181. <pre class="cmd">$params['do_illegality_check']</pre>
  182.         <p>Checks if the OID is illegal (<code>illegalOID($oid)</code>) before adding it to the XML</p>
  183.         <p>Default: <code>true</code></p>
  184. <pre class="cmd">$params['do_simpleping_check']</pre>
  185.         <p>When a simple ping provider defined, the XML entry will not be added when one of the simple ping providers reports the OID as existing.</p>
  186.         <p>Default: <code>true</code></p>
  187. <pre class="cmd">$params['auto_extract_name']</pre>
  188.         <p>If this is set, the <code>&lt;information&gt;</code> field will end with "Automatically extracted from ..."</p>
  189.         <p>Default: ''</p>
  190. <pre class="cmd">$params['auto_extract_url']</pre>
  191.         <p>If this is set, the <code>&lt;information&gt;</code> field will end with "Automatically extracted from ..."</p>
  192.         <p>Default: ''</p>
  193. <pre class="cmd">$params['always_output_comment']</pre>
  194.         <p>Also output comment if there was an error (e.g. OID already existing)</p>
  195.         <p>Default: <code>false</code></p>
  196. <pre class="cmd">$params['ignore_xhtml_light']</pre>
  197.         <p>If set to <code>true</code>, tags which are not allowed in the <a href="http://www.oid-info.com/xhtml-light.xsd">XHTML Light specification</a> won't be excluded (fields: address, description and information).</p>
  198.  
  199. <h4>Valid values for <code>$elements</code></h4>
  200.  
  201. <pre>
  202. $elements['synonymous-identifier'] = ''; // string or array
  203. $elements['description'] = '';
  204. $elements['information'] = '';
  205.  
  206. $elements['first-registrant']['first-name'] = '';
  207. $elements['first-registrant']['last-name'] = '';
  208. $elements['first-registrant']['address'] = '';
  209. $elements['first-registrant']['email'] = '';
  210. $elements['first-registrant']['phone'] = '';
  211. $elements['first-registrant']['fax'] = '';
  212. $elements['first-registrant']['creation-date'] = '';
  213.  
  214. $elements['current-registrant']['first-name'] = '';
  215. $elements['current-registrant']['last-name'] = '';
  216. $elements['current-registrant']['address'] = '';
  217. $elements['current-registrant']['email'] = '';
  218. $elements['current-registrant']['phone'] = '';
  219. $elements['current-registrant']['fax'] = '';
  220. $elements['current-registrant']['modification-date'] = '';
  221. </pre>
  222.  
  223. <h3><a name="part4">Part 4: Offline check if OIDs are illegal</h3>
  224.  
  225. <p>With these functions, you can query if OIDs are listed in a blacklist, which is stored locally. The download package contains a default
  226. <a href="oid_illegality_rules">illegality rule file</a> which contains known illegal OID arcs.</p>
  227.  
  228. </p>
  229.  
  230. <pre class="cmd">public function clearIllegalityRules()</pre>
  231.         <p>Clears all illegality rules (please see below).</p>
  232. <pre class="cmd">public function loadIllegalityRuleFile($file)</pre>
  233.         <p>Loads a file which contains illegality rules (please see below).</p>
  234. <pre class="cmd">public function addIllegalityRule($rule)</pre>
  235.         <p>Adds an illegality rule (please see below).</p>
  236. <pre class="cmd">public function illegalOID($oid, &$illegal_root='')</pre>
  237.         <p>Returns <code>true</code>, if <code>$oid</code> is marked as illegal OID according to the illegality rules.</p>
  238.         <p><code>$illegal_root</code> will contain the illegal beginning of the OID.</p>
  239.         <p>Example: If 2.999.1 would be marked as illegal, and if <code>$oid</code> is 2.999.1.55, then <code>$illegal_root</code> will be 2.999.1</p>
  240.  
  241. <h4>Illegality rules</h4>
  242.  
  243. <p>Illegality rules define arcs or OIDs which are considered as illegal.</p>
  244.  
  245. <p>An illegality rule file has following syntax:</p>
  246.  
  247. <pre>[1.3.6.1.4.1.37476.3.1.5.1]
  248.  
  249. -- <i>comment</i>
  250. <i>rule</i> --</i>comment</i>
  251. <i>rule</i>
  252. <i>rule</i></pre>
  253.  
  254. <p>where <a href="http://www.viathinksoft.de/documents/oid/oidplus/?action=show_oid&oid=.1.3.6.1.4.1.37476.3.1.5.1">1.3.6.1.4.1.37476.3.1.5.1</a> is the file format definition, and <i>rule</i> is an illegality rule (which can also be manually defined via <code>addIllegalityRule($rule)</code>) with following syntax:
  255.  
  256. <p><code>2.999.(11-).0</code> : the arc values 11 and below are illegal</p>
  257. <p><code>2.999.(11+).0</code> : the arc values 11 and above are illegal</p>
  258. <p><code>2.999.(1-5).0</code> : the arc values 1 to 5 are illegal</p>
  259. <p><code>2.999.*.0</code> : * is equal to (0+)</p>
  260.  
  261. <h3><a name="part5">Part 5: Misc functions</h3>
  262.  
  263. <pre class="cmd">function __construct()</pre>
  264.         <p>When the class is created and a file with the name "oid_illegality_rules" exist, this file will be processed with <code>loadIllegalityRuleFile</code>.</p>
  265. <pre class="cmd">public static function getPublicURL($oid)</pre>
  266.         <p>Returns the public URL to the OID registry, pointing to the information about <code>$oid</code>.</p>
  267. <pre class="cmd">public function oidExisting($oid, $onlineCheck=true, $useSimplePingProvider=true)</pre>
  268.         <p>Returns <code>true</code> if <code>$oid</code> is existing.</p>
  269.         <p>If <code>$useSimplePingProvider</code> is <code>true</code>, the simple ping provider will be checked first.</p>
  270.         <p>If the OID does not exist in the cache, or if no simple ping provider is loaded, or if <code>$useSimplePingProvider</code> is <code>false</code>, then an online check (<code>checkOnlineExists</code>) will be done if <code>$onlineCheck</code> is <code>true</code>.</p>
  271.         <p>An Exception of type <code>OIDInfoException</code> will be thrown, if none of the both checks could be performed (e.g. no simple ping provider is defined and online check disabled).</p>
  272.         <p>An Exception of type <code>OIDInfoException</code> will be thrown in case that <code>$oid</code> cannot be repaired with <code>trySanitizeOID($oid)</code></p>
  273. <pre class="cmd">public function oidMayCreate($oid, $onlineCheck=true, $useSimplePingProvider=true, $illegalityCheck=true)</pre>
  274.         <p>Returns <code>true</code> if <code>$oid</code> may be created.</p>
  275.         <p>If <code>$illegalityCheck</code> is <code>true</code> and <code>illegalOID($oid)</code> results is <code>true</code>, then the function will immediately result in <code>false</code>.</p>
  276.         <p>If <code>$useSimplePingProvider</code> is <code>true</code>, the simple ping provider will be checked first if the OID is already existing (which would result in <code>false</code>).</p>
  277.         <p>If the OID does not exist in the cache, or if no simple ping provider is loaded, or if <code>$useSimplePingProvider</code> is <code>false</code>, then an online check (<code>checkOnlineMayCreate</code>) will be done if <code>$onlineCheck</code> is <code>true</code>.</p>
  278.         <p>An Exception of type <code>OIDInfoException</code> will be thrown, if none of the both checks could be performed (e.g. no simple ping provider defined and online check disabled).</p>
  279.         <p>An Exception of type <code>OIDInfoException</code> will be thrown in case that <code>$oid</code> cannot be repaired with <code>trySanitizeOID($oid)</code></p>
  280.  
  281. <h3><a name="part6">Part 6: Simple Ping Providers</h3>
  282.  
  283. <p><i>Following table shows the differnce between the Simple Ping Providers and the Verbose Ping Providers.</i></p>
  284.  
  285. <table border="1" width="60%" cellpadding="5" cellspacing="5">
  286. <tr>
  287. <td width="50%"><b>Simple Ping Provider (<a href="#part6">Part 6</a>)</b></td>
  288. <td width="50%"><b>Verbose Ping Provider (<a href="#part1">Part 1</a>)</b></td>
  289. </tr>
  290.  
  291. <tr>
  292. <td>Uses Telnet protocol (usually port 49500)</td>
  293. <td>Uses HTTP(s) protocol</td>
  294. </tr>
  295.  
  296. <tr>
  297. <td>Multiple queries per session/connection</td>
  298. <td>Only 1 query per session (HTTP(s) request)</td>
  299. </tr>
  300.  
  301. <tr>
  302. <td>Multiple simple ping providers can be defined and hosted anywhere</td>
  303. <td>Only the official ViaThinkSoft service can be used</td>
  304. </tr>
  305.  
  306. <tr>
  307. <td>Can provide any OID tree (e.g. your own RA's OIDs)</td>
  308. <td>Provides information on all OIDs in oid-info.com</td>
  309. </tr>
  310.  
  311. <tr>
  312. <td>Only provides information if the OID exists at the given local database.</td>
  313. <td>Provides information if the OID exists at oid-info.com, and if it may be created. Additionally, the information provided will make clear if the OID is active (i.e. activated by the verified by the administrator after submitting).</td>
  314. </tr>
  315.  
  316. <tr>
  317. <td>Very fast, especially if the service is located at the local host.</td>
  318. <td>Rather slow</td>
  319. </tr>
  320.  
  321. <tr>
  322. <td>Usual scenario: You have an OID tree of your RA, and want to quickly check if a given OID is in that tree.</td>
  323. <td>Usual scenario: You want to check if you may create an OID at oid-info.com, or if it is available there.</td>
  324. </tr>
  325.  
  326. </table>
  327.  
  328. <pre class="cmd">public function addSimplePingProvider($addr)</pre>
  329.         <p>Adds a simple ping provider.</p>
  330.         <p>Possibility 1 (<code>OIDSimplePingProvider</code>): <code>$addr</code> is a hostname without protocol specification. The port is optional. If no port is specified, the port 49500 will be used. The connection will be only built up while the first query is sent!</p>
  331.         <p>Possibility 2 (<code>CSVSimplePingProvider</code>):: <code>$addr</code> is a filename of a CSV file. A "virtual" simple ping provider will be created. The CSV will be read immediately, and will be re-read in every query, after the modification timestamp had changed.</p>
  332. <pre class="cmd">public function removeSimplePingProvider($addr)</pre>
  333.         <p>Removed a simple ping provider.</p>
  334. <pre class="cmd">public function removeAllSimplePingProviders()</pre>
  335.         <p>Removes all simple ping providers.</p>
  336. <pre class="cmd">public function listSimplePingProviders()</pre>
  337.         <p>List all simple ping providers.</p>
  338. <pre class="cmd">public function simplePingProviderCheckOID($oid)</pre>
  339.         <p>Checks if an OID is existing.</p>
  340.         <p>The result is <code>true</code> when one of the providers returns "1".</p>
  341.         <p>The result is <code>false</code> if all providers returned "0".</p>
  342.         <p>The result is <code>null</code> no providers returned "1", and at least one provider failed to connect or returned something unexpected.</p>
  343.         <p>Throws an Exception of type <code>OIDInfoException</code>, if no providers are in the list.</p>
  344. <pre class="cmd">public function simplePingProviderAvailable()</pre>
  345.         <p>Returns true, if at least one ping provider is added to the list.</p>
  346.  
  347.  
  348.  
  349. <!--
  350. <h3><a name="part6">Part 6: CSV functions</h3>
  351.  
  352. <p>These functions are intended for special cooperations with oid-info.com, and are therefore not documented.</p>
  353.  
  354. <pre class="cmd">public function unloadCSVs()</pre>
  355. <pre class="cmd">public function addCSVDump($file)</pre>
  356. <pre class="cmd">public function defineLearningCSV($file)</pre>
  357. <pre class="cmd">public function undefineLearningCSV($file)</pre>
  358. <pre class="cmd">public function existsInCSV($oid)</pre>
  359. <pre class="cmd">public function useSingleCSV($file, $mayModify=true, $create_cache=true)</pre>
  360. -->
  361.  
  362. </body>
  363.  
  364. </html>
  365.  
  366.