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

The uIP TCP/IP stack


Files

file  uip.c
 The uIP TCP/IP stack code.

file  uip.h
 Header file for the uIP TCP/IP stack.


Modules

uIP configuration functions
uIP initialization functions
uIP device driver functions
uIP application functions
uIP conversion functions
uIP Address Resolution Protocol
Serial Line IP (SLIP) protocol
uIP hostname resolver functions
Architecture specific uIP functions

Data Structures

struct  uip_conn
 Representation of a uIP TCP connection.
TCP ¿¬°áÀ» ³ªÅ¸³½´Ù. More...

struct  uip_stats
 The structure holding the TCP/IP statistics that are gathered if UIP_STATISTICS is set to 1.
UIP_STATISTICSÀÌ 1·Î ¼³Á¤ µÇ¾î ÀÖ´Ù¸é TCP/IPÀÇ Åë°è ÀڷḦ ´ã´Â ±¸Á¶Ã¼¸¦ ³ªÅ¸³½´Ù. More...

struct  uip_udp_conn
 Representation of a uIP UDP connection.
UDP ¿¬°áÀ» ³ªÅ¸³½´Ù. More...


Functions

void uip_init (void)
 uIP initialization function.
uIP ÃʱâÈ­ ÇÔ¼ö.

uip_udp_connuip_udp_new (u16_t *ripaddr, u16_t rport)
 Set up a new UDP connection.
»õ·Î¿î UDP ¿¬°áÀ» ¼³Á¤.

void uip_unlisten (u16_t port)
 Stop listening to the specified port.
ÁöÁ¤µÈ Æ÷Æ®ÀÇ ¸®½¼(listening)À» ÁßÁö.

void uip_listen (u16_t port)
 Start listening to the specified port.
ÁöÁ¤µÈ Æ÷Æ®ÀÇ ¸®½¼(listening)À» ½ÃÀÛ.

u16_t htons (u16_t val)
 Convert 16-bit quantity from host byte order to network byte order.
16-ºñÆ® µ¥ÀÌÅ͸¦ È£½ºÆ® ¹ÙÀÌÆ® ¼ø¼­¿¡¼­ ³×Æ®¿öÅ© ¹ÙÀÌÆ® ¼ø¼­·Î Àüȯ.


Variables

volatile u8_tuip_appdata
 Pointer to the application data in the packet buffer.
ÆÐŶ ¹öÆÛÀÖ´Â ¾îÇø®ÄÉÀÌ¼Ç µ¥ÀÌÅ͸¦ °¡¸®Å°´Â Æ÷ÀÎÅÍ.

uip_stats uip_stat
 The uIP TCP/IP statistics.
TCP/IP Åë°è ÀÚ·á.

u8_t uip_buf [UIP_BUFSIZE+2]
 The uIP packet buffer.
uIP ÆÐŶ ¹öÆÛ.

volatile u8_t uip_acc32 [4]
 4-byte array used for the 32-bit sequence number calculations.
32-ºñÆ® ¼ö¸¦ °è»êÇϱâ À§ÇØ »ç¿ëµÇ´Â 4-¹ÙÀÌÆ® ¾î·¹ÀÌ


Function Documentation

u16_t htons u16_t  val  ) 
 

Convert 16-bit quantity from host byte order to network byte order.

16-ºñÆ® µ¥ÀÌÅ͸¦ È£½ºÆ® ¹ÙÀÌÆ® ¼ø¼­¿¡¼­ ³×Æ®¿öÅ© ¹ÙÀÌÆ® ¼ø¼­·Î ÀüȯÇÑ´Ù.


This function is primarily used for converting variables from host byte order to network byte order. For converting constants to network byte order, use the HTONS() macro instead.

ÀÌ ÇÔ¼ö´Â º¯¼öµéÀ» È£½ºÆ® ¹ÙÀÌÆ® ¼ø¼­¿¡¼­ ³×Æ®¿öÅ© ¹ÙÀÌÆ® ¼ø¼­·Î ¹Ù²Ù±â À§ÇØ »ç¿ëµÈ´Ù. »ó¼ö¸¦ ³×Æ®¿öÅ© ¹ÙÀÌÆ® ¼ø¼­·Î º¯È¯Çϱâ À§Çؼ­´Â HTONS() ¸ÅÅ©·Î¸¦ »ç¿ëÇÑ´Ù.

void uip_init void   ) 
 

uIP initialization function.

uIP ÃʱâÈ­ ÇÔ¼ö.


This function should be called at boot up to initilize the uIP TCP/IP stack.

ÀÌ ÇÔ¼ö´Â uIP TCP/IP ½ºÅÃÀ» ÃʱâÈ­ ÇϱâÀ§ÇØ ºÎÆÃ½Ã È£Ã⠵ȴÙ.

void uip_listen u16_t  port  ) 
 

Start listening to the specified port.

ÁöÁ¤µÈ Æ÷Æ®ÀÇ ¸®½¼(listening)À» ½ÃÀÛ.


Note:
Since this function expects the port number in network byte order, a conversion using HTONS() or htons() is necessary.

ÀÌ ÇÔ¼ö¿¡¼­ Æ÷Æ® ¹øÈ£´Â ³×Æ®¿öÅ© ¹ÙÀÌÆ® ¼ø¼­·Î µÇ¾î Àֱ⠶§¹®¿¡ HTONS()¶Ç´Â htons()¸¦ ÀÌ¿ëÇÏ¿© º¯È¯ÇÏ´Â °ÍÀÌ ÇÊ¿äÇÏ´Ù.

Parameters:
port A 16-bit port number in network byte order.

³×Æ®¿öÅ© ¹ÙÀÌÆ® ¼ø¼­ÀÇ 16-ºñÆ® Æ÷Æ® ¹øÈ£.

struct uip_udp_conn* uip_udp_new u16_t ripaddr,
u16_t  rport
 

Set up a new UDP connection.

»õ·Î¿î UDP ¿¬°áÀ» ¼³Á¤.


Parameters:
ripaddr A pointer to a 4-byte structure representing the IP address of the remote host.

¿ø°ÝÁö È£½ºÆ®ÀÇ IP ÁÖ¼Ò¸¦ ³ªÅ¸³»´Â 4-¹ÙÀÌÆ®ÀÇ ±¸Á¶Ã¼ Æ÷ÀÎÅÍ.

rport The remote port number in network byte order.

³×Æ®¿öÅ© ¹ÙÀÌÆ® ¼ø¼­ÀÇ ¿ø°ÝÁö Æ÷Æ® ¹øÈ£.
Returns:
The uip_udp_conn structure for the new connection or NULL if no connection could be allocated.

»õ·Î¿î ¿¬°áÀ» À§ÇÑ uip_udp_conn ±¸Á¶Ã¼, ¿¬°áÀÌ ÇÒ´ç µÇÁö ¾ÊÀ¸¸é NULL

void uip_unlisten u16_t  port  ) 
 

Stop listening to the specified port.

ÁöÁ¤µÈ Æ÷Æ®ÀÇ ¸®½¼(listening)À» ÁßÁö


Note:
Since this function expects the port number in network byte order, a conversion using HTONS() or htons() is necessary.

ÀÌ ÇÔ¼ö¿¡¼­ Æ÷Æ® ¹øÈ£´Â ³×Æ®¿öÅ© ¹ÙÀÌÆ® ¼ø¼­·Î µÇ¾î Àֱ⠶§¹®¿¡ HTONS()¶Ç´Â htons()¸¦ ÀÌ¿ëÇÏ¿© º¯È¯ÇÏ´Â °ÍÀÌ ÇÊ¿äÇÏ´Ù.

Parameters:
port A 16-bit port number in network byte order.

³×Æ®¿öÅ© ¹ÙÀÌÆ® ¼ø¼­ÀÇ 16-ºñÆ® Æ÷Æ® ¹øÈ£.


Variable Documentation

volatile u8_t* uip_appdata
 

Pointer to the application data in the packet buffer.

ÆÐŶ ¹öÆÛ¿¡ ÀÖ´Â ¾îÇø®ÄÉÀÌ¼Ç µ¥ÀÌÅ͸¦ °¡¸®Å°´Â Æ÷ÀÎÅÍ.


This pointer points to the application data when the application is called. If the application wishes to send data, the application may use this space to write the data into before calling uip_send().

ÀÌ Æ÷ÀÎÅÍ´Â ¾îÇø®ÄÉÀ̼ÇÀÌ È£ÃâµÉ ¶§ ¾îÇø®ÄÉÀÌ¼Ç µ¥ÀÌÅ͸¦ °¡¸®Å²´Ù. ¾îÇø®ÄÉÀ̼ÇÀÌ µ¥ÀÌÅ͸¦ ¼Û½ÅÇϰíÀÚ ÇÑ´Ù¸é, ¾îÇø®ÄÉÀ̼ÇÀº uip_send()¸¦ È£ÃâÇϱâ Àü¿¡ µ¥ÀÌÅ͸¦ ¾µ À̰ø°£À» »ç¿ëÇÑ´Ù.

u8_t uip_buf[UIP_BUFSIZE+2]
 

The uIP packet buffer.
uIP ÆÐŶ ¹öÆÛ.


The uip_buf array is used to hold incoming and outgoing packets. The device driver should place incoming data into this buffer. When sending data, the device driver should read the link level headers and the TCP/IP headers from this buffer. The size of the link level headers is configured by the UIP_LLH_LEN define.

uip_buf ¾î·¹ÀÌ´Â ÀÔ,Ãâ·Â ÆÐŶÀ» ´ã±âÀ§ÇØ »ç¿ëµÈ´Ù. µð¹ÙÀ̽º µå¶óÀ̹ö´Â ÀÔ·Â µ¥ÀÌÅ͸¦ ÀÌ ¹öÆÛ¿¡ ÀúÀåÇÑ´Ù. µ¥ÀÌÅ͸¦ ¼Û½ÅÇÒ ¶§ µð¹ÙÀ̽º µå¶óÀ̹ö´Â ÀÌ ¹öÆÛ·ÎºÎÅÍ ¸µÅ© ·¹º§ÀÇ Çì´õ¿Í TCP/IP Çì´õ¸¦ Àд´Ù. ¸µÅ©·¹º§ÀÇ Çì´õ »çÀÌÁî´Â UIP_LLH_LEN Á¤ÀÇ¿¡ ÀÇÇØ ¼³Á¤µÈ´Ù.

Note:
The application data need not be placed in this buffer, so the device driver must read it from the place pointed to by the uip_appdata pointer as illustrated by the following example:

ÀÌ ¹öÆÛ¿¡ ¾îÇø®ÄÉÀÌ¼Ç µ¥ÀÌÅ͸¦ ÀúÀåÇÒ ÇÊ¿ä´Â ¾ø´Ù. ±×·¡¼­ µð¹ÙÀ̽º µå¶óÀ̹ö´Â ´ÙÀ½ ¿¹Á¦¿¡¼­¿Í °°ÀÌ uip_appdata Æ÷ÀÎÅÍ¿¡ ÀÇÇØ °¡¸®ÄÑ Áö´Â °÷¿¡¼­ ¾îÇø®ÄÉÀÌ¼Ç µ¥ÀÌÅ͸¦ Àоî¾ß ÇÑ´Ù.
 void
 devicedriver_send(void)
 {
    hwsend(&uip_buf[0], UIP_LLH_LEN);
    hwsend(&uip_buf[UIP_LLH_LEN], 40);
    hwsend(uip_appdata, uip_len - 40 - UIP_LLH_LEN);
 }

struct uip_stats uip_stat
 

The uIP TCP/IP statistics.

TCP/IP Åë°è ÀÚ·á.


This is the variable in which the uIP TCP/IP statistics are gathered.

À̰ÍÀº TCP/IP Åë°èÀÚ·á°¡ ¼öÁýµÇ´Â º¯¼öÀÌ´Ù.


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