📄 a00148.html
字号:
</table></dl><dl compact><dt><b>Examples: </b></dt><dd><a class="el" href="a00048.html#a36">dhcpc.c</a>, <a class="el" href="a00042.html#a65">example-mainloop-with-arp.c</a>, and <a class="el" href="a00043.html#a89">example-mainloop-without-arp.c</a>.</dl><p>Definition at line <a class="el" href="a00202.html#l00840">840</a> of file <a class="el" href="a00202.html">uip.h</a>. </td> </tr></table><a class="anchor" name="g22fa0681cd463191d7a01fe85d86996f"></a><!-- doxytag: member="uip.h::uip_ipaddr1" ref="g22fa0681cd463191d7a01fe85d86996f" args="(addr)" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">#define uip_ipaddr1 </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">addr </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Pick the first octet of an IP address. <p>Picks out the first octet of an IP address.<p>Example: <div class="fragment"><pre class="fragment"> <a class="code" href="a00150.html#g1ef35301f43a5bbb9f89f07b5a36b9a0">uip_ipaddr_t</a> ipaddr; <a class="code" href="a00153.html#g4caecabca98b43919dd11be1c0d4cd8e">u8_t</a> octet; <a class="code" href="a00148.html#g87f0b54ade0d159fba495089128a4932">uip_ipaddr</a>(&ipaddr, 1,2,3,4); octet = <a class="code" href="a00148.html#g22fa0681cd463191d7a01fe85d86996f">uip_ipaddr1</a>(&ipaddr);</pre></div><p>In the example above, the variable "octet" will contain the value 1. <dl compact><dt><b>Examples: </b></dt><dd><a class="el" href="a00048.html#a28">dhcpc.c</a>.</dl><p>Definition at line <a class="el" href="a00202.html#l00995">995</a> of file <a class="el" href="a00202.html">uip.h</a>. </td> </tr></table><a class="anchor" name="gffcd2fbe181e2aaefbf970551c302af5"></a><!-- doxytag: member="uip.h::uip_ipaddr2" ref="gffcd2fbe181e2aaefbf970551c302af5" args="(addr)" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">#define uip_ipaddr2 </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">addr </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Pick the second octet of an IP address. <p>Picks out the second octet of an IP address.<p>Example: <div class="fragment"><pre class="fragment"> <a class="code" href="a00150.html#g1ef35301f43a5bbb9f89f07b5a36b9a0">uip_ipaddr_t</a> ipaddr; <a class="code" href="a00153.html#g4caecabca98b43919dd11be1c0d4cd8e">u8_t</a> octet; <a class="code" href="a00148.html#g87f0b54ade0d159fba495089128a4932">uip_ipaddr</a>(&ipaddr, 1,2,3,4); octet = <a class="code" href="a00148.html#gffcd2fbe181e2aaefbf970551c302af5">uip_ipaddr2</a>(&ipaddr);</pre></div><p>In the example above, the variable "octet" will contain the value 2. <dl compact><dt><b>Examples: </b></dt><dd><a class="el" href="a00048.html#a29">dhcpc.c</a>.</dl><p>Definition at line <a class="el" href="a00202.html#l01015">1015</a> of file <a class="el" href="a00202.html">uip.h</a>. </td> </tr></table><a class="anchor" name="ge23534479ead15af8ff08ace26a47fb5"></a><!-- doxytag: member="uip.h::uip_ipaddr3" ref="ge23534479ead15af8ff08ace26a47fb5" args="(addr)" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">#define uip_ipaddr3 </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">addr </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Pick the third octet of an IP address. <p>Picks out the third octet of an IP address.<p>Example: <div class="fragment"><pre class="fragment"> <a class="code" href="a00150.html#g1ef35301f43a5bbb9f89f07b5a36b9a0">uip_ipaddr_t</a> ipaddr; <a class="code" href="a00153.html#g4caecabca98b43919dd11be1c0d4cd8e">u8_t</a> octet; <a class="code" href="a00148.html#g87f0b54ade0d159fba495089128a4932">uip_ipaddr</a>(&ipaddr, 1,2,3,4); octet = <a class="code" href="a00148.html#ge23534479ead15af8ff08ace26a47fb5">uip_ipaddr3</a>(&ipaddr);</pre></div><p>In the example above, the variable "octet" will contain the value 3. <dl compact><dt><b>Examples: </b></dt><dd><a class="el" href="a00048.html#a30">dhcpc.c</a>.</dl><p>Definition at line <a class="el" href="a00202.html#l01035">1035</a> of file <a class="el" href="a00202.html">uip.h</a>. </td> </tr></table><a class="anchor" name="g165b603ec150e26efec7be199c9c2901"></a><!-- doxytag: member="uip.h::uip_ipaddr4" ref="g165b603ec150e26efec7be199c9c2901" args="(addr)" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">#define uip_ipaddr4 </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">addr </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Pick the fourth octet of an IP address. <p>Picks out the fourth octet of an IP address.<p>Example: <div class="fragment"><pre class="fragment"> <a class="code" href="a00150.html#g1ef35301f43a5bbb9f89f07b5a36b9a0">uip_ipaddr_t</a> ipaddr; <a class="code" href="a00153.html#g4caecabca98b43919dd11be1c0d4cd8e">u8_t</a> octet; <a class="code" href="a00148.html#g87f0b54ade0d159fba495089128a4932">uip_ipaddr</a>(&ipaddr, 1,2,3,4); octet = <a class="code" href="a00148.html#g165b603ec150e26efec7be199c9c2901">uip_ipaddr4</a>(&ipaddr);</pre></div><p>In the example above, the variable "octet" will contain the value 4. <dl compact><dt><b>Examples: </b></dt><dd><a class="el" href="a00048.html#a31">dhcpc.c</a>.</dl><p>Definition at line <a class="el" href="a00202.html#l01055">1055</a> of file <a class="el" href="a00202.html">uip.h</a>. </td> </tr></table><a class="anchor" name="g210e629f7252e4bc8458cbdf260b3318"></a><!-- doxytag: member="uip.h::uip_ipaddr_cmp" ref="g210e629f7252e4bc8458cbdf260b3318" args="(addr1, addr2)" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">#define uip_ipaddr_cmp </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">addr1, <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>addr2 </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Compare two IP addresses. <p>Compares two IP addresses.<p>Example: <div class="fragment"><pre class="fragment"> <a class="code" href="a00150.html#g1ef35301f43a5bbb9f89f07b5a36b9a0">uip_ipaddr_t</a> ipaddr1, ipaddr2; <a class="code" href="a00148.html#g87f0b54ade0d159fba495089128a4932">uip_ipaddr</a>(&ipaddr1, 192,16,1,2); <span class="keywordflow">if</span>(<a class="code" href="a00148.html#g210e629f7252e4bc8458cbdf260b3318">uip_ipaddr_cmp</a>(&ipaddr2, &ipaddr1)) { printf(<span class="stringliteral">"They are the same"</span>); }</pre></div><p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>addr1</em> </td><td>The first IP address. </td></tr> <tr><td valign="top"></td><td valign="top"><em>addr2</em> </td><td>The second IP address. </td></tr> </table></dl>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -