📄 ip_8h.html
字号:
<p>Definition at line <a class="el" href="ip_8c-source.html#l00300">300</a> of file <a class="el" href="ip_8c-source.html">ip.c</a>.<p>References <a class="el" href="arp_8c-source.html#l00639">arp_find()</a>, <a class="el" href="arp_8h-source.html#l00196">ARP_TEMP_IP</a>, <a class="el" href="ip_8h-source.html#l00122">ip_frame::checksum</a>, <a class="el" href="ip_8h-source.html#l00124">ip_frame::dip</a>, <a class="el" href="ip_8h-source.html#l00119">ip_frame::frags</a>, <a class="el" href="arp_8h-source.html#l00175">arp_entry::hwadr</a>, <a class="el" href="ethernet_8h-source.html#l00126">ICMP_BUF</a>, <a class="el" href="ip_8h-source.html#l00118">ip_frame::id</a>, <a class="el" href="ip_8c-source.html#l00417">ip_construct_cs()</a>, <a class="el" href="ip_8h-source.html#l00072">IP_ICMP</a>, <a class="el" href="ip_8c-source.html#l00097">ip_id</a>, <a class="el" href="ip_8h-source.html#l00074">IP_TCP</a>, <a class="el" href="ip_8h-source.html#l00073">IP_UDP</a>, <a class="el" href="arp_8h-source.html#l00074">MAXHWALEN</a>, <a class="el" href="system_8h-source.html#l00306">NETWORK_ADD_DATALINK</a>, <a class="el" href="system_8h-source.html#l00288">NETWORK_COMPLETE_SEND</a>, <a class="el" href="system_8h-source.html#l00296">NETWORK_SEND_INITIALIZE</a>, <a class="el" href="ip_8h-source.html#l00121">ip_frame::protocol</a>, <a class="el" href="ethernet_8h-source.html#l00080">PROTOCOL_IP</a>, <a class="el" href="system_8h-source.html#l00240">SEND_NETWORK_B</a>, <a class="el" href="system_8h-source.html#l00248">SEND_NETWORK_BUF</a>, <a class="el" href="ip_8h-source.html#l00123">ip_frame::sip</a>, <a class="el" href="ethernet_8h-source.html#l00127">TCP_BUF</a>, <a class="el" href="ip_8h-source.html#l00117">ip_frame::tlen</a>, <a class="el" href="ip_8h-source.html#l00116">ip_frame::tos</a>, <a class="el" href="ip_8h-source.html#l00120">ip_frame::ttl</a>, <a class="el" href="ethernet_8h-source.html#l00128">UDP_BUF</a>, and <a class="el" href="ip_8h-source.html#l00115">ip_frame::vihl</a>.<p>Referenced by <a class="el" href="icmp_8c-source.html#l00097">process_icmp_in()</a>, <a class="el" href="tcp_8c-source.html#l02119">process_tcp_out()</a>, and <a class="el" href="udp_8c-source.html#l00395">udp_send()</a>. </td> </tr></table><a name="a20" doxytag="ip.h::ip_check_cs"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> UINT8 ip_check_cs </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">struct <a class="el" href="structip__frame.html">ip_frame</a> * </td> <td class="mdname1" valign="top" nowrap> <em>frame</em> </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><dl compact><dt><b>Author: </b></dt><dd> <ul><li> Jari Lahti </ul></dl><dl compact><dt><b>Date: </b></dt><dd>11.06.2002 </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>frame</em> </td><td>pointer to IP frame to be checked </td></tr></table></dl><dl compact><dt><b>Returns: </b></dt><dd> <ul><li> 0 - checksum corrupted <li> 1 - checksum OK</ul></dl>Checksum of an IP packet is calculated and compared with the received checksum. Error is signaled if there is discrepancy between them. <p>Definition at line <a class="el" href="ip_8c-source.html#l00474">474</a> of file <a class="el" href="ip_8c-source.html">ip.c</a>.<p>References <a class="el" href="ip_8h-source.html#l00122">ip_frame::checksum</a>, <a class="el" href="ip_8h-source.html#l00124">ip_frame::dip</a>, <a class="el" href="ip_8h-source.html#l00119">ip_frame::frags</a>, <a class="el" href="ip_8h-source.html#l00118">ip_frame::id</a>, <a class="el" href="ip_8c-source.html#l00539">ip_checksum()</a>, <a class="el" href="ip_8h-source.html#l00125">ip_frame::opt</a>, <a class="el" href="ip_8h-source.html#l00121">ip_frame::protocol</a>, <a class="el" href="ip_8h-source.html#l00123">ip_frame::sip</a>, <a class="el" href="ip_8h-source.html#l00117">ip_frame::tlen</a>, <a class="el" href="ip_8h-source.html#l00116">ip_frame::tos</a>, <a class="el" href="ip_8h-source.html#l00120">ip_frame::ttl</a>, and <a class="el" href="ip_8h-source.html#l00115">ip_frame::vihl</a>.<p>Referenced by <a class="el" href="ip_8c-source.html#l00115">process_ip_in()</a>. </td> </tr></table><a name="a21" doxytag="ip.h::ip_checksum"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> UINT16 ip_checksum </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">UINT16 </td> <td class="mdname" nowrap> <em>cs</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>UINT8 </td> <td class="mdname" nowrap> <em>dat</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>UINT8 </td> <td class="mdname" nowrap> <em>count</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p><dl compact><dt><b>Author: </b></dt><dd> <ul><li> Jari Lahti </ul></dl><dl compact><dt><b>Date: </b></dt><dd>24.02.2002 </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>cs</em> </td><td>last checksum value </td></tr><tr><td valign=top><em>dat</em> </td><td>byte to be added to checksum </td></tr><tr><td valign=top><em>count</em> </td><td>byte indicating whether dat is MSB or LSB byte </td></tr></table></dl><dl compact><dt><b>Returns: </b></dt><dd>new checksum value</dl>Based on count value, dat byte is added to checksum either as a MSB or a LSB byte and the new checksum value is then returned. <p>Definition at line <a class="el" href="ip_8c-source.html#l00539">539</a> of file <a class="el" href="ip_8c-source.html">ip.c</a>.<p>Referenced by <a class="el" href="ip_8c-source.html#l00474">ip_check_cs()</a>, <a class="el" href="ip_8c-source.html#l00582">ip_checksum_buf()</a>, <a class="el" href="ip_8c-source.html#l00417">ip_construct_cs()</a>, <a class="el" href="icmp_8c-source.html#l00097">process_icmp_in()</a>, <a class="el" href="tcp_8c-source.html#l02119">process_tcp_out()</a>, <a class="el" href="udp_8c-source.html#l00550">process_udp_in()</a>, <a class="el" href="tcp_8c-source.html#l02567">tcp_check_cs()</a>, and <a class="el" href="udp_8c-source.html#l00395">udp_send()</a>. </td> </tr></table><a name="a22" doxytag="ip.h::ip_checksum_buf"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> UINT32 ip_checksum_buf </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">UINT16 </td> <td class="mdname" nowrap> <em>cs</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>UINT8 * </td> <td class="mdname" nowrap> <em>buf</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>UINT16 </td> <td class="mdname" nowrap> <em>len</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p><dl compact><dt><b>Author: </b></dt><dd> <ul><li> Jari Lahti </ul></dl><dl compact><dt><b>Date: </b></dt><dd>03.08.2003 </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>cs</em> </td><td>last checksum value </td></tr><tr><td valign=top><em>buf</em> </td><td>buffer who's checksum we're calculating </td></tr><tr><td valign=top><em>len</em> </td><td>length of data in buffer </td></tr></table></dl><dl compact><dt><b>Returns: </b></dt><dd>new checksum value</dl>Calculates checksum of the data in buffer and returns new checksum value. <p>Definition at line <a class="el" href="ip_8c-source.html#l00582">582</a> of file <a class="el" href="ip_8c-source.html">ip.c</a>.<p>References <a class="el" href="ip_8c-source.html#l00539">ip_checksum()</a>.<p>Referenced by <a class="el" href="icmp_8c-source.html#l00097">process_icmp_in()</a>, <a class="el" href="tcp_8c-source.html#l02119">process_tcp_out()</a>, <a class="el" href="tcp_8c-source.html#l02567">tcp_check_cs()</a>, and <a class="el" href="udp_8c-source.html#l00395">udp_send()</a>. </td> </tr></table><a name="a23" doxytag="ip.h::ip_construct_cs"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> UINT32 ip_construct_cs </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">struct <a class="el" href="structip__frame.html">ip_frame</a> * </td> <td class="mdname1" valign="top" nowrap> <em>frame</em> </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><dl compact><dt><b>Author: </b></dt><dd> <ul><li> Jari Lahti </ul></dl><dl compact><dt><b>Date: </b></dt><dd>08.07.2002 </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>frame</em> </td><td>pointer to <a class="el" href="structip__frame.html">ip_frame</a> structure holding header information based on which checksum is calculated </td></tr></table></dl><dl compact><dt><b>Returns: </b></dt><dd>Calculated checksum</dl>Checksum of the supplied IP datagram is calculated. <p>Definition at line <a class="el" href="ip_8c-source.html#l00417">417</a> of file <a class="el" href="ip_8c-source.html">ip.c</a>.<p>References <a class="el" href="ip_8h-source.html#l00124">ip_frame::dip</a>, <a class="el" href="ip_8h-source.html#l00119">ip_frame::frags</a>, <a class="el" href="ip_8h-source.html#l00118">ip_frame::id</a>, <a class="el" href="ip_8c-source.html#l00539">ip_checksum()</a>, <a class="el" href="ip_8h-source.html#l00125">ip_frame::opt</a>, <a class="el" href="ip_8h-source.html#l00121">ip_frame::protocol</a>, <a class="el" href="ip_8h-source.html#l00123">ip_frame::sip</a>, <a class="el" href="ip_8h-source.html#l00117">ip_frame::tlen</a>, <a class="el" href="ip_8h-source.html#l00116">ip_frame::tos</a>, <a class="el" href="ip_8h-source.html#l00120">ip_frame::ttl</a>, and <a class="el" href="ip_8h-source.html#l00115">ip_frame::vihl</a>.<p>Referenced by <a class="el" href="ip_8c-source.html#l00300">process_ip_out()</a>. </td> </tr></table><hr><address style="align: right;"><small>Generated on Sun Aug 3 20:33:00 2003 for OpenTCP by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.18 </small></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -