Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals

Architecture specific uIP functions
[The uIP TCP/IP stack]


Detailed Description

The functions in the architecture specific module implement the IP check sum and 32-bit additions.

¾ÆÅ°ÅØÃÄ¿¡ ÀÇÁ¸ÀûÀÎ ¸ðµâÀÇ ÇÔ¼öµéÀº IP üũ¼¶À» Çϰí 32-bit¸¦ Ãß°¡ÇÑ´Ù.


The IP checksum calculation is the most computationally expensive operation in the TCP/IP stack and it therefore pays off to implement this in efficient assembler. The purpose of the uip-arch module is to let the checksum functions to be implemented in architecture specific assembler.

IP üũ¼¶ °è»êÀº TCP/IP¿¡¼­ ´ëºÎºÐ ºñ¿ëÀÌ ¸¹ÀÌ µå´Â ¿¬»êÀÌ´Ù. ±×·¡¼­ ¾î¼Àºí·¯·Î ±¸ÇöÇÑ´Ù. uip-arch ¸ðµâÀÇ ¸ñÀûÀº üũ¼¶À» ¾ÆÅ°ÅØÃÄ ÀÇÁ¸ÀûÀÎ ¾î¼Àºí·¯·Î ±¸ÇöÇÏ´Â °ÍÀÌ´Ù.



Files

file  uip_arch.h
 Declarations of architecture specific functions.
¾ÆÅ°ÅØÃ³ ÀÇÁ¸ÀûÀÎ ÇÔ¼ö ¼±¾ð.


Functions

void uip_add32 (u8_t *op32, u16_t op16)
 Carry out a 32-bit addition.
32-bit Ãß°¡.

u16_t uip_chksum (u16_t *buf, u16_t len)
 Calculate the Internet checksum over a buffer.
ÀÎÅÍ³Ý Ã¼Å©¼¶ °è»ê.

u16_t uip_ipchksum (void)
 Calculate the IP header checksum of the packet header in uip_buf.
uip_buf¿¡ ÀÖ´Â ÆÐŶ Çì´õÀÇ IPÇì´õ üũ¼¶ °è»ê.

u16_t uip_tcpchksum (void)
 Calculate the TCP checksum of the packet in uip_buf and uip_appdata.
uip_buf¿Í uip_apdata¿¡ ÀÖ´Â ÆÐŶÀÇ TCP üũ¼¶ °è»ê.


Variables

volatile u8_t uip_acc32 [4]
 4-byte array used for the 32-bit sequence number calculations.
32-ºñÆ® ½ÃÄö½º ¹øÈ£ °è»êÀ» À§ÇØ »ç¿ëµÇ´Â 4-¹ÙÀÌÆ® ¹è¿­.


Function Documentation

void uip_add32 u8_t op32,
u16_t  op16
 

Carry out a 32-bit addition.

32-ºñÆ® Ãß°¡.


Because not all architectures for which uIP is intended has native 32-bit arithmetic, uIP uses an external C function for doing the required 32-bit additions in the TCP protocol processing. This function should add the two arguments and place the result in the global variable uip_acc32.

uIPÀÇ ¸ðµç ¾ÆÅ°ÅØÃ³°¡ 32-ºñÆ®°¡ ¾Æ´Ï±â ¶§¹®¿¡, uIP´Â TCP ÇÁ·ÎÅäÄÝ Ã³¸®¿¡¼­ ÇÊ¿äÇÑ 32-ºñÆ® Ãß°¡¸¦ Çϱâ À§ÇØ È®Àå CÇÔ¼ö¸¦ »ç¿ëÇÑ´Ù. ÀÌ ÇÔ¼ö´Â µÎ°³ÀÇ ÀÎÀÚ¸¦ Ãß°¡Çϰí Àü¿ª º¯¼öÀÎ uip_acc32¿¡ °á°ú¸¦ ÀúÀåÇÑ´Ù.


Note:
The 32-bit integer pointed to by the op32 parameter and the result in the uip_acc32 variable are in network byte order (big endian).

Op32 ÆÄ¶ó¸ÞÅÍ¿Í uip_acc32º¯¼ö °á°ú¿¡ ÀÇÇØ Æ÷ÀÎÆÃµÇ´Â 32-ºñÆ® Á¤¼ö´Â ³×Æ®¿÷ ¹ÙÀÌÆ® ¼ø¼­(big endian)ÀÌ´Ù.
Parameters:
op32 A pointer to a 4-byte array representing a 32-bit integer in network byte order (big endian).
³×Æ®¿÷ ¹ÙÀÌÆ® ¼ø¼­ÀÇ 32-ºñÆ® Á¤¼ö¸¦ ³ªÅ¸³»´Â 4-¹ÙÀÌÆ® ¹è¿­ Æ÷ÀÎÅÍ.
op16 A 16-bit integer in host byte order.
È£½ºÆ® ¹ÙÀÌÆ® ¼ø¼­ÀÇ 16-ºñÆ® Á¤¼ö.

u16_t uip_chksum u16_t buf,
u16_t  len
 

Calculate the Internet checksum over a buffer.

ÀÎÅÍ³Ý Ã¼Å©¼¶ °è»ê.


The Internet checksum is the one's complement of the one's complement sum of all 16-bit words in the buffer.

See RFC1071.

RFC1071 Âü°í.


Note:
This function is not called in the current version of uIP, but future versions might make use of it.

ÀÌ ÇÔ¼ö´Â ÇöÀç uIP¹öÀü¿¡¼­´Â È£ÃâµÇÁö ¾Ê°í »óÀ§ ¹öÀü¿¡¼­ »ç¿ëµÉ °ÍÀÌ´Ù.
Parameters:
buf A pointer to the buffer over which the checksum is to be computed.
üũ¼¶ÀÌ °è»êµÉ ¹öÆÛ Æ÷ÀÎÅÍ.
len The length of the buffer over which the checksum is to be computed.
üũ¼¶ÀÌ °è»êµÉ ¹öÆÛ ±æÀÌ.
Returns:
The Internet checksum of the buffer.
¹öÆÛÀÇ ÀÎÅÍ³Ý Ã¼Å©¼¶.

u16_t uip_ipchksum void   ) 
 

Calculate the IP header checksum of the packet header in uip_buf.

uip_buf¿¡ ÀÖ´Â ÆÐŶ Çì´õÀÇ IPÇì´õ üũ¼¶ °è»ê.


The IP header checksum is the Internet checksum of the 20 bytes of the IP header.

IP Çì´õ üũ¼¶Àº IPÇì´õÀÇ 20¹ÙÀÌÆ® ÀÎÅÍ³Ý Ã¼Å©¼¶ÀÌ´Ù.


Returns:
The IP header checksum of the IP header in the uip_buf buffer.
uip_buf¿¡ ÀÖ´Â ÆÐŶ Çì´õÀÇ IPÇì´õ üũ¼¶.

u16_t uip_tcpchksum void   ) 
 

Calculate the TCP checksum of the packet in uip_buf and uip_appdata.

uip_buf¿Í uip_apdata¿¡ ÀÖ´Â ÆÐŶÀÇ TCP üũ¼¶ °è»ê


The TCP checksum is the Internet checksum of data contents of the TCP segment, and a pseudo-header as defined in RFC793.

TCP üũ¼¶Àº TCP¼¼±×¸ÕÆ®ÀÇ »ó¼ö µ¥ÀÌÅÍÀÇ ÀÎÅÍ³Ý Ã¼Å©¼¶ÀÌ´Ù.


Note:
The uip_appdata pointer that points to the packet data may point anywhere in memory, so it is not possible to simply calculate the Internet checksum of the contents of the uip_buf buffer.

ÆÐŶ µ¥ÀÌÅ͸¦ °¡¸®Å°´Â uip_appdata Æ÷ÀÎÅÍ´Â ¸Þ¸ð¸® ¾î¶²°÷ÀÌµç °¡¸®Å²´Ù. ±×·¡¼­ uip_buf ¹öÆÛÀÇ ÀÎÅÍ³Ý Ã¼Å©¼¶À» °£´ÜÈ÷ °è»êÇÏ´Â °ÍÀº °¡´ÉÇÏÁö ¾Ê´Ù.
Returns:
The TCP checksum of the TCP segment in uip_buf and pointed to by uip_appdata.

uip_buf¿¡ TCP¼¼±×¸ÕÆ®ÀÇ TCPüũ¼¶.


Generated on Tue Oct 7 15:51:44 2003 for uIP 0.9 by doxygen 1.3.3