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

uIP application functions
[The uIP TCP/IP stack]


Detailed Description

Functions used by an application running of top of uIP.

uIP 상위에서 동작하는 어플리케이션에의 사용되는 함수.



Defines

#define uip_send(data, len)
 Send data on the current connection.
데이터를 현재 연결에 송신.

#define uip_datalen()
 The length of any incoming data that is currently avaliable (if avaliable) in the uip_appdata buffer.
uip_appdata 버퍼에서 현재 유효한 입력데이터의 길이.

#define uip_urgdatalen()
 The length of any out-of-band data (urgent data) that has arrived on the connection.
수신된 데이터중 밴드를 벗어난 데이터의 길이.

#define uip_close()
 Close the current connection.
현재 연결을 닫음.

#define uip_abort()
 Abort the current connection.
현재 연결을 중지.

#define uip_stop()
 Tell the sending host to stop sending data.
송신 호스트에게 데이터 송신을 중지함을 알림.

#define uip_stopped(conn)
 Find out if the current connection has been previously stopped with uip_stop().
현재 연결이 uip_stop()으로 전에 정지 되었는지를 검사.

#define uip_restart()
 Restart the current connection, if is has previously been stopped with uip_stop().
uip_stop()으로 전에 정지 되었다면 현재 연결을 재 시작.

#define uip_newdata()
 Is new incoming data available?
새로 입력된 데이터가 유효한가?

#define uip_acked()
 Has previously sent data been acknowledged?
ack를 받은 데이터를 이전에 송신 했는가?.

#define uip_connected()
 Has the connection just been connected?
접속이 연결 되었는가?

#define uip_closed()
 Has the connection been closed by the other end?
연결이 다른 노드에 의해 닫혔는가?

#define uip_aborted()
 Has the connection been aborted by the other end?
연결이 다른 노드에 의해 중지 되었는가?

#define uip_timedout()
 Has the connection timed out?
연결이 타임 아웃 되었는가?

#define uip_rexmit()
 Do we need to retransmit previously data?
전 데이터를 재전송 할 필요가 있는가?

#define uip_poll()
 Is the connection being polled by uIP?
연결이 uIP에 의해 폴링되고 있는가?

#define uip_initialmss()
 Get the initial maxium segment size (MSS) of the current connection.
현재 연결에서 초기 최대 세그먼트 사이즈(MSS)를 얻음.

#define uip_mss()
 Get the current maxium segment size that can be sent on the current connection.
현재 연결에서 송신될 수 있는 최대 세그먼트 사이즈를 얻음.

#define uip_udp_remove(conn)
 Removed a UDP connection.
UDP 연결을 제거.

#define uip_udp_send(len)
 Send a UDP datagram of length len on the current connection.
현재 연결에서 len길이 만큼의 UDP 데이터그램을 송신.


Functions

void uip_listen (u16_t port)
 Start listening to the specified port.
지정된 포트에서 리슨(listening)을 시작.

void uip_unlisten (u16_t port)
 Stop listening to the specified port.
지정된 포트에서 리슨(listening)을 중지.

uip_conn * uip_connect (u16_t *ripaddr, u16_t port)
 Connect to a remote host using TCP.
TCP를 사용하는 원격지 호스트와 연결.

uip_udp_conn * uip_udp_new (u16_t *ripaddr, u16_t rport)
 Set up a new UDP connection.
새로운 UDP 연결을 설정.


Define Documentation

#define uip_abort (   ) 
 

Abort the current connection.

현재 연결을 중지.


This function will abort (reset) the current connection, and is usually used when an error has occured that prevents using the uip_close() function.

이 함수는 현재 연결을 중지하고 uip_close()함수를 사용하지 못하는 에러가 발생했을 때 사용된다.

#define uip_aborted (   ) 
 

Has the connection been aborted by the other end?

연결이 다른 노드에 의해 중지 되었는가?


Non-zero if the current connection has been aborted (reset) by the remote host.

현재 연결이 원격지 호스트에의해 중지 되었으면 0이 아닌값.

#define uip_acked (   ) 
 

Has previously sent data been acknowledged?

ack를 받은 데이터를 이전에 송신 했는가?


Will reduce to non-zero if the previously sent data has been acknowledged by the remote host. This means that the application can send new data.

전에 송신한 데이터에 대해 원격지 호스트에서 ack가 오면 0이 아닌 값을 리턴. 이것은 어플리케이션이 새로운 데이터를 송신할 수 있다는 것을 의미한다.

#define uip_close (   ) 
 

Close the current connection.

현재 연결을 닫음.


This function will close the current connection in a nice way.

이 함수는 현재 연결을 닫는다.

#define uip_closed (   ) 
 

Has the connection been closed by the other end?

연결이 다른 노드에 의해 닫혔는가?


Is non-zero if the connection has been closed by the remote host. The application may then do the necessary clean-ups.

연결이 원격지 호스트에의해 닫혔다면 0이아닌 값을 리턴, 어플리케이션이 필요한 제거를 해야 한다.

#define uip_connected (   ) 
 

Has the connection just been connected?

접속이 연결 되었는가?


Reduces to non-zero if the current connection has been connected to a remote host. This will happen both if the connection has been actively opened (with uip_connect()) or passively opened (with uip_listen()).

현재 접속이 원격지 호스트에 연결되었으면 0이아닌 값을 리턴. 이것은 연결이 uip_connect()을 이용하여 열리거나 uip_listen()으로 열리면 일어난다.

#define uip_datalen (   ) 
 

The length of any incoming data that is currently avaliable (if avaliable) in the uip_appdata buffer.

uip_appdata 버퍼에서 현재 유효한 입력데이터의 길이.


The test function uip_data() must first be used to check if there is any data available at all.

테스트 함수 uip_data()는 유효한 데이터가 있는 지 없는지 검사하는 데 사용되어야 한다.

#define uip_mss (   ) 
 

Get the current maxium segment size that can be sent on the current connection.

현재 연결에서 송신될 수 있는 최대 세그먼트 사이즈를 얻음.


The current maxiumum segment size that can be sent on the connection is computed from the receiver's window and the MSS of the connection (which also is available by calling uip_initialmss()).

연결상태에서 송신되어질 현재 최대 세그먼트 사이즈는 수신 윈도우와 연결 MSS로부터 계산된다.

#define uip_newdata (   ) 
 

Is new incoming data available?

새로 입력된 데이터가 유효한가?


Will reduce to non-zero if there is new data for the application present at the uip_appdata pointer. The size of the data is avaliable through the uip_len variable.

uip_appdata 포인터가 가리키고있는 곳에 어플리케이션을 위한 새로운 데이터가 있으 면 0이 아닌 값을 리턴한다. 데이터 사이즈는 uip_len 변수를 통해 유효하다.

#define uip_poll (   ) 
 

Is the connection being polled by uIP?

연결이 uIP에 의해 폴링되고 있는가?


Is non-zero if the reason the application is invoked is that the current connection has been idle for a while and should be polled.

The polling event can be used for sending data without having to wait for the remote host to send data.

어플리케이션이 호출된 이유가 현재 연결이 잠시 아이들 상태였다면 0이아닌 값을 리 턴한다. 폴링 이벤트는 데이터를 송신할 원격지 호스트를 기다릴 필요 없이 송신데이터를 위해 사용될 수 있다.

#define uip_restart (   ) 
 

Restart the current connection, if is has previously been stopped with uip_stop().

uip_stop()으로 전에 정지 되었다면 현재 연결을 재 시작


This function will open the receiver's window again so that we start receiving data for the current connection.

이 함수는 수신 윈도우를 다시 오픈하고 데이터를 수신 할 것이다.

#define uip_rexmit (   ) 
 

Do we need to retransmit previously data?

전 데이터를 재전송 할 필요가 있는가?


Reduces to non-zero if the previously sent data has been lost in the network, and the application should retransmit it. The application should send the exact same data as it did the last time, using the uip_send() function.

이전에 송신한 데이터가 네트워크에서 손실되어서 어플리케이션이 재전송을 하면 0이아닌 값을 리턴한다. 어플리케이션은 uip_send()를 사용해서 마지막으로 송신했던 것 처럼 똑같이 송신한다.

#define uip_send (  data,
len   ) 
 

Send data on the current connection.

데이터를 현재 연결에 송신.


This function is used to send out a single segment of TCP data. Only applications that have been invoked by uIP for event processing can send data.

이 함수는 TCP 데이터의 단일 세그먼트를 송신하는 데 사용된다. 이벤트 처리에 대해 uIP에 의해 호출된 어플리케이션은 데이터를 송신할 수 있다.


The amount of data that actually is sent out after a call to this funcion is determined by the maximum amount of data TCP allows. uIP will automatically crop the data so that only the appropriate amount of data is sent. The function uip_mss() can be used to query uIP for the amount of data that actually will be sent.

이 함수를 호출한 후 자동으로 송신된 데이터의 양은 TCP가 허용하는 최대 데이터 양에 의해 결정된다. uIP는 자동으로 데이터를 잘라서 적당한 데이터의 양이 송신된다. 함수uip_mss()는 실제로 송신된 데이터의 양을 uIP에 물을 때 사용된다.


Note:
This function does not guarantee that the sent data will arrive at the destination. If the data is lost in the network, the application will be invoked with the uip_rexmit() event being set. The application will then have to resend the data using this function.

이 함수는 송신된 데이터가 목적지에 도착했는지에 대해 보장하지는 않는다. 데이터가 네트워크상에서 손실되었다면, 어플리케이션은 설정된 이벤트 함수인 uip_rexmit()로 호출될 것이다. 그런다음 어플리케이션은 이 함수를 이용해서 데이터를 재전송을 해야 한다.
Parameters:
data A pointer to the data which is to be sent.
송신될 데이터의 포인터.
len The maximum amount of data bytes to be sent.
송신될 데이터의 최대 바이트.

#define uip_stop (   ) 
 

Tell the sending host to stop sending data.

송신 호스트에게 데이터 송신을 중지함을 알림.


This function will close our receiver's window so that we stop receiving data for the current connection.

이 함수는 수신 윈도우를 닫아서 현재 연결에서 데이터 수신하는 것을 중지한다.

#define uip_timedout (   ) 
 

Has the connection timed out?

연결이 타임 아웃 되었는가?


Non-zero if the current connection has been aborted due to too many retransmissions.

너무 많은 재전송 때문에 연결이 정지됐다면 0이 아닌 값 리턴.

#define uip_udp_remove (  conn   ) 
 

Removed a UDP connection.

UDP 연결을 제거.


Parameters:
conn A pointer to the uip_udp_conn structure for the connection.
연결 구조체 uip_udp_conn의 포인터.

#define uip_udp_send (  len   ) 
 

Send a UDP datagram of length len on the current connection.

현재 연결에서 len길이 만큼의 UDP 데이터그램을 송신.


This function can only be called in response to a UDP event (poll or newdata). The data must be present in the uip_buf buffer, at the place pointed to by the uip_appdata pointer.

이 함수는 UDP 이벤트 응답으로 호출된다. 데이터는 uip_appdata 포인터가 가리키는 uip_buffer에 존재 해야 한다.


Parameters:
len The length of the data in the uip_buf buffer.
버퍼 uip_buf에 데이터 길이.

#define uip_urgdatalen (   ) 
 

The length of any out-of-band data (urgent data) that has arrived on the connection.

수신된 데이터중 밴드를 벗어난 데이터의 길이.


Note:
The configuration parameter UIP_URGDATA must be set for this function to be enabled.

구성 파라메터인 UIP_URGDATA는 이 함수가 활성화 될 때 설정되어야 한다.


Function Documentation

struct uip_conn* uip_connect (  u16_t *  ripaddr,
u16_t  port
) 
 

Connect to a remote host using TCP.

TCP를 사용해서 원격지 호스트와 연결.


This function is used to start a new connection to the specified port on the specied host. It allocates a new connection identifier, sets the connection to the SYN_SENT state and sets the retransmission timer to 0. This will cause a TCP SYN segment to be sent out the next time this connection is periodically processed, which usually is done within 0.5 seconds after the call to uip_connect().

이 함수는 지정된 호스트의 지정된 포트에 새로운 연결을 시작하는 데 사용된다. 새로운 연결 id를 할당하고 연결을 SYN_SENT 상태로 설정하고 재전송 타이머를 0으로 설정한다. 이것은 TCP SYN 세그먼트가 다음 번에 송신되도록 할것이고 이연결은 주기적으로 처리된다. uip_connect()가 호출되고 보통 0.5초 이내 처리된다.


Note:
This function is avaliable only if support for active open has been configured by defining UIP_ACTIVE_OPEN to 1 in uipopt.h.

이 함수는 액티브 오픈 지원이 UIP_ACTIVE_OPEN을 1로 설정하면 유효하다.


Since this function requires the port number to be in network byte order, a convertion using HTONS() or htons() is necessary.

이함수는 네트워크 바이트 순서로된 포트 번호를 요구하기 때문에 HTONS()나 htons()를 사용해서 변환하는 것이 필요하다.

 u16_t ipaddr[2];

 uip_ipaddr(ipaddr, 192,168,1,2);
 uip_connect(ipaddr, HTONS(80)); 

Parameters:
ripaddr A pointer to a 4-byte array representing the IP address of the remote hot.
원격지 호스트의 IP주소를 나타내는 4-바이트 배열 포인터.
port A 16-bit port number in network byte order.
네트워크 바이트 순서의 16비트 포트 번호
Returns:
A pointer to the uIP connection identifier for the new connection, or NULL if no connection could be allocated.

새로운 연결을 위한 uIP 연결 id 포인터, 연결이 할당 되지 않으면 NULL

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.

지정된 포트의 리슨(listen)을 중지.


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-비트 포트번호


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