⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hostlib.html

📁 vxworks相关论文
💻 HTML
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/hostLib.html - generated by refgen from hostLib.c --> <title> hostLib </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.html"><i>VxWorks Reference Manual :  Libraries</i></a></p></blockquote><h1>hostLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>hostLib</strong> - host table subroutine library </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./hostLib.html#hostTblInit">hostTblInit</a></i>(&nbsp;)</b>  -  initialize the network host table<br><b><i><a href="./hostLib.html#hostAdd">hostAdd</a></i>(&nbsp;)</b>  -  add a host to the host table<br><b><i><a href="./hostLib.html#hostDelete">hostDelete</a></i>(&nbsp;)</b>  -  delete a host from the host table<br><b><i><a href="./hostLib.html#hostGetByName">hostGetByName</a></i>(&nbsp;)</b>  -  look up a host in the host table by its name<br><b><i><a href="./hostLib.html#hostGetByAddr">hostGetByAddr</a></i>(&nbsp;)</b>  -  look up a host in the host table by its Internet address<br><b><i><a href="./hostLib.html#sethostname">sethostname</a></i>(&nbsp;)</b>  -  set the symbolic name of this machine<br><b><i><a href="./hostLib.html#gethostname">gethostname</a></i>(&nbsp;)</b>  -  get the symbolic name of this machine<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library provides routines to store and access the network host database.The host table contains information regarding the known hosts on thelocal network.  The host table (displayed with <b><i><a href="./netShow.html#hostShow">hostShow</a></i>(&nbsp;)</b>) containsthe Internet address, the official host name, and aliases.<p>By convention, network addresses are specified in dotted (".") decimal notation.  The library <b><a href="./inetLib.html#top">inetLib</a></b> contains Internet address manipulation routines.  Host names and aliases may contain any printable character.<p>Before any of the routines in this module can be used, the library must beinitialized by <b><i><a href="./hostLib.html#hostTblInit">hostTblInit</a></i>(&nbsp;)</b>.  This is done automatically if theconfiguration macro <b>INCLUDE_NET_INIT</b> is defined.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>hostLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./hostLib.html#top">hostLib</a></b>, <b><a href="./inetLib.html#top">inetLib</a></b>,  <i>VxWorks Programmer's Guide: Network</i><hr><a name="hostTblInit"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>hostTblInit</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>hostTblInit</i>(&nbsp;)</strong> - initialize the network host table</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void hostTblInit (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine initializes the host list data structure used by routinesthroughout this module.  It should be called before any other routines inthis module.  This is done automatically if the configuration macro<b>INCLUDE_NET_INIT</b> is defined.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./hostLib.html#top">hostLib</a></b>, usrConfig<hr><a name="hostAdd"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>hostAdd</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>hostAdd</i>(&nbsp;)</strong> - add a host to the host table</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS hostAdd    (    char * hostName, /* host name */    char * hostAddr  /* host addr in standard Internet format */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine adds a host name to the local host table.This must be called before sockets on the remote host are opened,or before files on the remote host are accessed via <b><a href="./netDrv.html#top">netDrv</a></b> or nfsDrv.<p>The host table has one entry per Internet address.More than one name may be used for an address.Additional host names are added as aliases.<p></blockquote><h4>EXAMPLE</h4><blockquote><p><pre>   -&gt; hostAdd "wrs", "90.2"   -&gt; hostShow   hostname         inet address       aliases   --------         ------------       -------   localhost        127.0.0.1   yuba             90.0.0.3   wrs              90.0.0.2   value = 12288 = 0x3000 = _bzero + 0x18</pre></blockquote><h4>RETURNS</h4><blockquote><p><p>OK, or ERROR if the host table is full, the host name/inet address pairis already entered, the Internet address is invalid, or memory is insufficient.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./hostLib.html#top">hostLib</a></b>, <b><a href="./netDrv.html#top">netDrv</a></b>, <b><a href="./nfsDrv.html#top">nfsDrv</a></b><hr><a name="hostDelete"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>hostDelete</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>hostDelete</i>(&nbsp;)</strong> - delete a host from the host table</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS hostDelete    (    char * name, /* host name or alias */    char * addr  /* host addr in standard Internet format */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine deletes a host name from the local host table.  If <i>name</i> isa host name, the host entry is deleted.  If <i>name</i> is a host name alias,the alias is deleted.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the parameters are invalid or the host is unknown.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./hostLib.html#top">hostLib</a></b><hr><a name="hostGetByName"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>hostGetByName</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>hostGetByName</i>(&nbsp;)</strong> - look up a host in the host table by its name</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int hostGetByName    (    char * name /* name of host */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine returns the Internet address of a host that hasbeen added to the host table by <b><i><a href="./hostLib.html#hostAdd">hostAdd</a></i>(&nbsp;)</b>.  If the DNS resolver library<b><a href="./resolvLib.html#top">resolvLib</a></b> has been configured in the vxWorks image, a query for the hostIP address is sent to the DNS server, if the name was not found in the localhost table.<p></blockquote><h4>RETURNS</h4><blockquote><p>The Internet address (as an integer in network byte order), or ERROR if thehost is unknown.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./hostLib.html#top">hostLib</a></b><hr><a name="hostGetByAddr"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>hostGetByAddr</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>hostGetByAddr</i>(&nbsp;)</strong> - look up a host in the host table by its Internet address</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS hostGetByAddr    (    int    addr, /* inet address of host */    char * name  /* buffer to hold name */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine finds the host name by its Internet address and copies it to<i>name</i>.  The buffer <i>name</i> should be preallocated with (MAXHOSTNAMELEN + 1)bytes of memory and is NULL-terminated unless insufficient space isprovided.  If the DNS resolver library <b><a href="./resolvLib.html#top">resolvLib</a></b> has been configured in thevxWorks image, a query for the host name is sent to the DNS server, if thename was not found in the local host table.<p></blockquote><h4>WARNING</h4><blockquote><p>This routine does not look for aliases.  Host names are limited toMAXHOSTNAMELEN (from <b>hostLib.h</b>) characters.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if buffer is invalid or the host is unknown.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./hostLib.html#top">hostLib</a></b>, <b><i><a href="./hostLib.html#hostGetByName">hostGetByName</a></i>(&nbsp;)</b><hr><a name="sethostname"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>sethostname</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>sethostname</i>(&nbsp;)</strong> - set the symbolic name of this machine</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int sethostname    (    char * name,   /* machine name */    int    nameLen /* length of name */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine sets the target machine's symbolic name, which can be usedfor identification.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./hostLib.html#top">hostLib</a></b><hr><a name="gethostname"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>gethostname</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>gethostname</i>(&nbsp;)</strong> - get the symbolic name of this machine</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int gethostname    (    char * name,   /* machine name */    int    nameLen /* length of name */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine gets the target machine's symbolic name, which can be usedfor identification.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./hostLib.html#top">hostLib</a></b></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -