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

uIP device driver functions
[The uIP TCP/IP stack]


Detailed Description

These functions are used by a network device driver for interacting with uIP.

다음 함수들은 uIP와 통신하기 위하여 네트워크 디바이스 드라이버에 의해 사용된다.


Defines

#define uip_input()
 Process an incoming packet.
수신된 패킷 처리

#define uip_periodic(conn)
 Periodic processing for a connection identified by its number.
번호를 통해 확인할 수 있는 접속에 대한 주기적 처리.

#define uip_periodic_conn(conn)
 Periodic processing for a connection identified by a pointer to its structure.
구조체에 대한 포인터를 통해 확인할 수 있는 접속에 대한 주기적 처리.

#define uip_udp_periodic(conn)
 Periodic processing for a UDP connection identified by its number.
번호를 통해 확인할 수 있는 UDP 접속에 대한 주기적 처리.

#define uip_udp_periodic_conn(conn)
 Periodic processing for a UDP connection identified by a pointer to its structure.
구조체에 대한 포인터를 통해 확인할 수 있는 UDP 접속에 대한 주기적 처리.


Variables

u8_t uip_buf [UIP_BUFSIZE+2]
 The uIP packet buffer.
uIP 패킷 버퍼.


Define Documentation

#define uip_input (   ) 
 

Process an incoming packet.
수신된 패킷 처리.

This function should be called when the device driver has received a packet from the network. The packet from the device driver must be present in the uip_buf buffer, and the length of the packet should be placed in the uip_len variable.

이 함수는 디바이스 드라이버가 네트워크로부터 패킷을 수신했을 경우 호출되어야 한다. 디바이스 드라이버로부터 온 패킷은 uip_buf 버퍼에 있어야 하며, 패킷의 길이는 uip_len 변수에 저장되어야 한다.


When the function returns, there may be an outbound packet placed in the uip_buf packet buffer. If so, the uip_len variable is set to the length of the packet. If no packet is to be sent out, the uip_len variable is set to 0.

함수가 종료될 때, uip_buf 패킷 버퍼에 외부로 나갈 패킷이 있는 경우가 있다. 그럴 경우에 uip_len 변수에는 해당 패킷의 길이가 저장된다. 만약, 내보낼 패킷이 없다면, uip_len 변수는 0 값을 가진다.


The usual way of calling the function is presented by the source code below.

함수를 사용하는 일반적인 방법은 아래 소스 코드와 같다.

  uip_len = devicedriver_poll();
  if(uip_len > 0) {
    uip_input();
    if(uip_len > 0) {
      devicedriver_send();
    }
  }

Note:
If you are writing a uIP device driver that needs ARP (Address Resolution Protocol), e.g., when running uIP over Ethernet, you will need to call the uIP ARP code before calling this function:

만약 ARP가 필요한 uIP 디바이스 드라이버를 작성하고 있다면, 예를 들어 Ethernet상에서 uIP를 실행시킨다면, 이 함수를 호출하기 전에 uIP ARP 코드를 먼저 호출해야 한다.


  #define BUF ((struct uip_eth_hdr *)&uip_buf[0])
  uip_len = ethernet_devicedrver_poll();
  if(uip_len > 0) {
    if(BUF->type == HTONS(UIP_ETHTYPE_IP)) {
      uip_arp_ipin();
      uip_input();
      if(uip_len > 0) {
        uip_arp_out();
        ethernet_devicedriver_send();
      }
    } else if(BUF->type == HTONS(UIP_ETHTYPE_ARP)) {
      uip_arp_arpin();
      if(uip_len > 0) {
        ethernet_devicedriver_send();
      }
    }

#define uip_periodic (  conn   ) 
 

Periodic processing for a connection identified by its number.

번호를 통해 확인할 수 있는 접속에 대한 주기적 처리

This function does the necessary periodic processing (timers, polling) for a uIP TCP conneciton, and should be called when the periodic uIP timer goes off. It should be called for every connection, regardless of whether they are open of closed.

이 함수는 uIP TCP 연결을 위해 필요한 주기적인 사항들(타이머, 폴링)을 수행하며, 주기적 uIP 타이머가 꺼졌을 경우 반드시 호출되어야 한다. 이 함수는 접속이 열려 있던, 닫혀 있던 상관없이 모든 접속에 대하여 호출되어야 한다.


When the function returns, it may have an outbound packet waiting for service in the uIP packet buffer, and if so the uip_len variable is set to a value larger than zero. The device driver should be called to send out the packet.

함수가 종료될 때, uIP 패킷 버퍼에 외부로 나갈 패킷이 있는 경우가 있있는데, 그런 경우에는 uip_len 변수는 0보다 큰 값을 가진다. 이 패킷을 송신하기 위해서는 디바이스 드라이버가 반드시 호출되어야 한다.


The ususal way of calling the function is through a for() loop like this:

이 함수를 호출하는 일반적인 방법은 아래와 같이 for() 루프를 이용하는 것이다.

  for(i = 0; i < UIP_CONNS; ++i) {
    uip_periodic(i);
    if(uip_len > 0) {
      devicedriver_send();
    }
  }

Note:
If you are writing a uIP device driver that needs ARP (Address Resolution Protocol), e.g., when running uIP over Ethernet, you will need to call the uip_arp_out() function before calling the device driver:

만약 ARP가 필요한 uIP 디바이스 드라이버를 작성하고 있다면, 예를 들어 Ethernet상에서 uIP를 실행시킨다면, 이 함수를 호출하기 전에 uip_arp_out() 함수를 먼저 호출해야 한다.

  for(i = 0; i < UIP_CONNS; ++i) {
    uip_periodic(i);
    if(uip_len > 0) {
      uip_arp_out();
      ethernet_devicedriver_send();
    }
  }
Parameters:
conn The number of the connection which is to be periodically polled.

주기적으로 폴링해야 할 접속의 번호

#define uip_periodic_conn (  conn   ) 
 

Periodic processing for a connection identified by a pointer to its structure.

구조체에 대한 포인터를 통해 확인할 수 있는 접속에 대한 주기적 처리


Same as uip_periodic() but takes a pointer to the actual uip_conn struct instead of an integer as its argument. This function can be used to force periodic processing of a specific connection.

uip_periodic() 함수와 같지만 인자로 정수값 대신 실제 uip_conn 구조체에 대한 포인터를 받는다. 이 함수는 특정 접속에 대한 강제적인 주기적 처리를 하는데 사용할 수 있다.

Parameters:
conn A pointer to the uip_conn struct for the connection to be processed.

처리해야 할 접속에 대한 uip_conn 구조체의 포인터.

#define uip_udp_periodic (  conn   ) 
 

Periodic processing for a UDP connection identified by its number.

번호를 통해 확인할 수 있는 UDP 접속에 대한 주기적 처리


This function is essentially the same as uip_prerioic(), but for UDP connections. It is called in a similar fashion as the uip_periodic() function:

이 함수는 원칙적으로 uip_periodic()함수와 동일하지만, UPD 접속을 위한 것이다. uip_periodic() 함수와 유사한 방법으로 호출한다.

  for(i = 0; i < UIP_UDP_CONNS; i++) {
    uip_udp_periodic(i);
    if(uip_len > 0) {
      devicedriver_send();
    }
  }   

Note:
As for the uip_periodic() function, special care has to be taken when using uIP together with ARP and Ethernet:

uip_periodic() 함수와 같이, uIP를 ARP와 Ethernet과 같이 사용하기 위해서는 특별히 주의해야 한다.
  for(i = 0; i < UIP_UDP_CONNS; i++) {
    uip_udp_periodic(i);
    if(uip_len > 0) {
      uip_arp_out();
      ethernet_devicedriver_send();
    }
  }   
Parameters:
conn The number of the UDP connection to be processed.

처리해야 할 UDP 접속의 번호

#define uip_udp_periodic_conn (  conn   ) 
 

Periodic processing for a UDP connection identified by a pointer to its structure.

구조체에 대한 포인터를 통해 확인할 수 있는 UDP 접속에 대한 주기적 처리


Same as uip_udp_periodic() but takes a pointer to the actual uip_conn struct instead of an integer as its argument. This function can be used to force periodic processing of a specific connection.

uip_udp_periodic() 함수와 동일하지만, 인자로 정수값 대신 실제 uip_conn 구조체에 대한 포인터를 받는다. 이 함수는 특정 접속을 강제적으로 주기적으로 처리할 때 쓸 수 있다.


Parameters:
conn A pointer to the uip_udp_conn struct for the connection to be processed.

처리해야 할 uip_udp_conn 구조체에 대한 포인터.


Variable Documentation

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);
 }


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