📄 inetlib.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/inetLib.html - generated by refgen from inetLib.c --> <title> inetLib </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>inetLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>inetLib</strong> - Internet address manipulation routines </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./inetLib.html#inet_addr">inet_addr</a></i>( )</b> - convert a dot notation Internet address to a long integer<br><b><i><a href="./inetLib.html#inet_lnaof">inet_lnaof</a></i>( )</b> - get the local address (host number) from the Internet address<br><b><i><a href="./inetLib.html#inet_makeaddr_b">inet_makeaddr_b</a></i>( )</b> - form an Internet address from network and host numbers<br><b><i><a href="./inetLib.html#inet_makeaddr">inet_makeaddr</a></i>( )</b> - form an Internet address from network and host numbers<br><b><i><a href="./inetLib.html#inet_netof">inet_netof</a></i>( )</b> - return the network number from an Internet address<br><b><i><a href="./inetLib.html#inet_netof_string">inet_netof_string</a></i>( )</b> - extract the network address in dot notation<br><b><i><a href="./inetLib.html#inet_network">inet_network</a></i>( )</b> - convert an Internet network number from string to address<br><b><i><a href="./inetLib.html#inet_ntoa_b">inet_ntoa_b</a></i>( )</b> - convert an network address to dot notation, store it in a buffer<br><b><i><a href="./inetLib.html#inet_ntoa">inet_ntoa</a></i>( )</b> - convert a network address to dotted decimal notation<br><b><i><a href="./inetLib.html#inet_aton">inet_aton</a></i>( )</b> - convert a network address from dot notation, store in a structure<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library provides routines for manipulating Internet addresses,including the UNIX BSD 4.3 <b>inet_</b> routines. It includes routines forconverting between character addresses in Internet standard dotted decimal notation and integer addresses, routines for extracting the network and host portions out of an Internet address, and routines for constructing Internet addresses given the network and host address parts.<p>All Internet addresses are returned in network order (bytes ordered fromleft to right). All network numbers and local address parts are returnedas machine format integer values.<p></blockquote><h4>INTERNET ADDRESSES</h4><blockquote><p>Internet addresses are typically specified in dotted decimal notation or as a 4-byte number. Values specified using the dotted decimal notation take one of the following forms:<pre> a.b.c.d a.b.c a.b a</pre>If four parts are specified, each is interpreted as a byte of data andassigned, from left to right, to the four bytes of an Internet address.Note that when an Internet address is viewed as a 32-bit integer quantityon any MC68000 family machine, the bytes referred to above appear as"<b>a.b.c</b>.d" and are ordered from left to right.<p>If a three-part address is specified, the last part is interpreted as a16-bit quantity and placed in the right-most two bytes of the networkaddress. This makes the three-part address format convenient forspecifying Class B network addresses as "128.net.host".<p>If a two-part address is supplied, the last part is interpreted as a24-bit quantity and placed in the right-most three bytes of the networkaddress. This makes the two-part address format convenient for specifyingClass A network addresses as "net.host".<p>If only one part is given, the value is stored directly in the networkaddress without any byte rearrangement.<p>Although dotted decimal notation is the default, it is possible to use the dot notation with hexadecimal or octal numbers. The base is indicatedusing the same prefixes as are used in C. That is, a leading 0x or 0X indicates a hexadecimal number. A leading 0 indicates anoctal number. If there is no prefix, the number is interpreted as decimal.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><p><b>inetLib.h</b>, <b>inet.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./inetLib.html#top">inetLib</a></b>, UNIX BSD 4.3 manual entry for inet(3N), <i>VxWorks Programmer's Guide: Network</i><hr><a name="inet_addr"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>inet_addr</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>inet_addr</i>( )</strong> - convert a dot notation Internet address to a long integer</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>u_long inet_addr ( char * inetString /* string inet address */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine interprets an Internet address. All the network libraryroutines call this routine to interpret entries in the data baseswhich are expected to be an address. The value returned is in network order.<p></blockquote><h4>EXAMPLE</h4><blockquote><p>The following example returns 0x5a000002:<pre> inet_addr ("90.0.0.2");</pre></blockquote><h4>RETURNS</h4><blockquote><p>The Internet address, or ERROR.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./inetLib.html#top">inetLib</a></b><hr><a name="inet_lnaof"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>inet_lnaof</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>inet_lnaof</i>( )</strong> - get the local address (host number) from the Internet address</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int inet_lnaof ( int inetAddress /* inet addr from which to extract local portion */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine returns the local network address portion of an Internet address.The routine handles class A, B, and C network number formats.<p></blockquote><h4>EXAMPLE</h4><blockquote><p>The following example returns 2:<pre> inet_lnaof (0x5a000002);</pre></blockquote><h4>RETURNS</h4><blockquote><p>The local address portion of <i>inetAddress</i>.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./inetLib.html#top">inetLib</a></b><hr><a name="inet_makeaddr_b"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>inet_makeaddr_b</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>inet_makeaddr_b</i>( )</strong> - form an Internet address from network and host numbers</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void inet_makeaddr_b ( int netAddr, /* network part of the inet address */ int hostAddr, /* host part of the inet address */ struct in_addr * pInetAddr /* where to return the inet address */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine constructs the Internet address from the network number andlocal host address. This routine is identical to the UNIX <b><i><a href="./inetLib.html#inet_makeaddr">inet_makeaddr</a></i>( )</b>routine except that you must provide a buffer for the resulting value.<p></blockquote><h4>EXAMPLE</h4><blockquote><p>The following copies the address 0x5a000002 to the location pointed to by <i>pInetAddr</i>:<pre> inet_makeaddr_b (0x5a, 2, pInetAddr);</pre></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./inetLib.html#top">inetLib</a></b><hr><a name="inet_makeaddr"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>inet_makeaddr</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>inet_makeaddr</i>( )</strong> - form an Internet address from network and host numbers</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>struct in_addr inet_makeaddr ( int netAddr, /* network part of the address */ int hostAddr /* host part of the address */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine constructs the Internet address from the network number andlocal host address.<p></blockquote><h4>WARNING</h4><blockquote><p>This routine is supplied for UNIX compatibility only. Each time thisroutine is called, four bytes are allocated from memory. Use<b><i><a href="./inetLib.html#inet_makeaddr_b">inet_makeaddr_b</a></i>( )</b> instead.<p></blockquote><h4>EXAMPLE</h4><blockquote><p>The following example returns the address 0x5a000002 to the structure <b>in_addr</b>:<pre> inet_makeaddr (0x5a, 2);</pre></blockquote><h4>RETURNS</h4><blockquote><p>The network address in an <b>in_addr</b> structure.<p></blockquote><h4>SEE ALSO</h4><blockquote><p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -