You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

hostinfo.html 3.8 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <!--
  2. Licensed to the Apache Software Foundation (ASF) under one or more
  3. contributor license agreements. See the NOTICE file distributed with
  4. this work for additional information regarding copyright ownership.
  5. The ASF licenses this file to You under the Apache License, Version 2.0
  6. (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. -->
  15. <html>
  16. <head>
  17. <meta http-equiv="Content-Language" content="en-us">
  18. <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
  19. <title>HostInfo Task</title>
  20. </head>
  21. <body>
  22. <h2><a name="hostinfo">HostInfo</a></h2>
  23. <h3>Description</h3>
  24. <p>Sets the <code>NAME</code>, <code>DOMAIN</code>, <code>ADDR4</code>, and <code>ADDR6</code>
  25. properties in the current project.</p>
  26. <p>
  27. The <code>NAME</code> contains the host part of the canonical name of the host.<br/>
  28. If the host is not found, the host will contain the name as provided to the task,
  29. or <code>localhost</code> if no host was provided, and no name for the local
  30. host was found.<br/>
  31. The <code>DOMAIN</code> contains the domain part of the canonical name of the host.<br/>
  32. If the host is not found, the domain will contain the domain as provided to the task,
  33. or <code>localdomain</code> if no host / domain was provided.<br/>
  34. The <code>ADDR4</code> contains the IPv4 address of the host with the widest meaning.<br/>
  35. If no IPv4 address is found and a host has been provided the address <code>0.0.0.0</code>
  36. is returned, when no host was provided the address <code>127.0.0.1</code> is returned.<br/>
  37. The <code>ADDR6</code> contains the IPv6 address of the host with the widest meaning.<br/>
  38. If no IPv6 address is found and a host has been provided the address <code>::</code>
  39. is returned, when no host was provided the address <code>::1</code> is returned.<br/>
  40. </p>
  41. <p>These properties can be used in the build-file, for instance, to create
  42. host-stamped filenames, or used to replace placeholder tags inside documents
  43. to indicate, for example, the host where the build was performed on.
  44. The best place for this task is probably in an initialization target.</p>
  45. <h3>Parameters</h3>
  46. <table border="1" cellpadding="2" cellspacing="0">
  47. <tr>
  48. <td valign="top"><b>Attribute</b></td>
  49. <td valign="top"><b>Description</b></td>
  50. <td align="center" valign="top"><b>Required</b></td>
  51. </tr>
  52. <tr>
  53. <td valign="top">prefix</td>
  54. <td valign="top">Prefix used for all properties set. The default is no prefix.</td>
  55. <td align="center" valign="top">No</td>
  56. </tr>
  57. <tr>
  58. <td valign="top">host</td>
  59. <td valign="top">
  60. The host to retrieve the information for, default is to retrieve
  61. information for the host the task is running on.
  62. </td>
  63. <td align="center" valign="top">No</td>
  64. </tr>
  65. </table>
  66. <h3>Examples</h3>
  67. <pre>
  68. &lt;hostinfo/&gt;
  69. </pre>
  70. <p>
  71. Sets the <code>NAME</code>, <code>DOMAIN</code>, <code>ADDR4</code>, and
  72. <code>ADDR6</code> for the local host, using the most &quot;global&quot; address
  73. available.</p>
  74. <pre>
  75. &lt;hostinfo prefix=&quot;remotehost&quot; host=&quot;www.apache.org&quot;/&gt;
  76. </pre>
  77. <p>
  78. Sets the properties <code>remotehost.NAME</code> to <code>eos</code>,
  79. <code>remotehost.DOMAIN</code> to <code>apache.org</code>,
  80. <code>remotehost.ADDR4</code> to <code>140.211.11.130</code> and
  81. <code>remotehost.ADDR6</code> to <code>::</code>
  82. for the host with the name www.apache.org (provided the canonical name and ip
  83. addresses do not change).
  84. </p>
  85. </body>
  86. </html>