![]() |
EVE 1.0
|
![]() |
Files | |
file | uip.c |
file | uip.h |
Data Structures | |
union | uip_ip4addr_t |
struct | uip_802154_shortaddr |
16 bit 802.15.4 address More... | |
struct | uip_802154_longaddr |
64 bit 802.15.4 address More... | |
struct | uip_80211_addr |
802.11 address More... | |
struct | uip_eth_addr |
802.3 address More... | |
struct | uip_conn |
struct | uip_udp_conn |
struct | uip_stats |
Macros | |
#define | PRINTD(FORMAT, args...) do {} while (0) |
#define | UIP_STAT(s) |
#define | UIP_APPDATA_SIZE |
Typedefs | |
typedef union uip_ip4addr_t | uip_ip4addr_t |
typedef struct uip_802154_shortaddr | uip_802154_shortaddr |
16 bit 802.15.4 address | |
typedef struct uip_802154_longaddr | uip_802154_longaddr |
64 bit 802.15.4 address | |
typedef struct uip_80211_addr | uip_80211_addr |
802.11 address | |
typedef struct uip_eth_addr | uip_eth_addr |
802.3 address | |
typedef uip_eth_addr | uip_lladdr_t |
Ethernet address. | |
Functions | |
void | uip_setipid (uint16_t id) |
void | uip_add32 (uint8_t *op32, uint16_t op16) |
uint16_t | uip_chksum (uint16_t *data, uint16_t len) |
uint16_t | uip_ipchksum (void) |
uint16_t | uip_tcpchksum (void) |
void | uip_init (void) |
void | uip_unlisten (uint16_t port) |
void | uip_listen (uint16_t port) |
void | uip_process (uint8_t flag) |
process the options within a hop by hop or destination option header More... | |
uint16_t | uip_htons (uint16_t val) |
void | uip_send (const void *data, int len) |
uint16_t | uip_udpchksum (void) |
uint16_t | uip_icmp6chksum (void) |
Variables | |
void * | uip_appdata |
uint16_t | uip_len |
struct uip_conn * | uip_conn |
uint8_t | uip_acc32 [4] |
CCIF void * | uip_appdata |
CCIF struct uip_conn * | uip_conn |
struct uip_udp_conn * | uip_udp_conn |
#define PRINTD | ( | FORMAT, | |
args... | |||
) | do {} while (0) |
The macro provides debug print functionality
Definition at line 100 of file uip.c.
Referenced by uip_process(), and uip_send().
#define UIP_STAT | ( | s | ) |
The uIP TCP/IP statistics.
This is the variable in which the uIP TCP/IP statistics are gathered.
Definition at line 1450 of file uip.h.
Referenced by uip_process().
#define UIP_APPDATA_SIZE |
The buffer size available for user data in the uip_buf buffer.
This macro holds the available size for user data in the uip_buf buffer. The macro is intended to be used for checking bounds of available user data.
Example:
typedef union uip_ip4addr_t uip_ip4addr_t |
Representation of an IP address.
void uip_setipid | ( | uint16_t | id | ) |
void uip_add32 | ( | uint8_t * | op32, |
uint16_t | op16 | ||
) |
Carry out a 32-bit addition.
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.
op32 | A pointer to a 4-byte array representing a 32-bit integer in network byte order (big endian). |
op16 | A 16-bit integer in host byte order. |
Definition at line 266 of file uip.c.
References data, and uip_acc32.
Referenced by uip_listen(), and uip_process().
uint16_t uip_chksum | ( | uint16_t * | buf, |
uint16_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.
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. |
Definition at line 328 of file uip.c.
References uip_htons().
Referenced by uip_fw_init(), and uip_process().
uint16_t uip_ipchksum | ( | void | ) |
Calculate the IP header checksum of the packet header in uip_buf.
The IP header checksum is the Internet checksum of the 20 bytes of the IP header.
Definition at line 335 of file uip.c.
References uip_htons(), uip_icmp6chksum(), and UIP_LLH_LEN.
Referenced by uip_fw_init(), uip_listen(), and uip_process().
uint16_t uip_tcpchksum | ( | void | ) |
Calculate the TCP checksum of the packet in uip_buf and uip_appdata.
The TCP checksum is the Internet checksum of data contents of the TCP segment, and a pseudo-header as defined in RFC793.
Definition at line 381 of file uip.c.
References uip_udpchksum().
Referenced by uip_process().
void uip_init | ( | void | ) |
uIP initialization function.
This function should be called at boot up to initilize the uIP TCP/IP stack.
Definition at line 396 of file uip.c.
References uip_conn::arpid, uip_udp_conn::arpid, backlog, dlist_init(), uip_conn::initialmss, uip_conn::len, uip_conn::lport, uip_udp_conn::lport, uip_conn::mss, uip_conn::nrtx, uip_conn::ripaddr, uip_udp_conn::ripaddr, uip_conn::rport, uip_udp_conn::rport, uip_conn::rto, uip_conn::sa, uip_conn::snd_nxt, uip_conn::sv, uip_conn::tcpstateflags, uip_conn::timer, uip_udp_conn::ttl, uip_connect(), UIP_CONNS, UIP_HTONS, uip_htons(), uip_ipaddr_copy, UIP_LISTENPORTS, UIP_RTO, UIP_TCP_MSS, UIP_TTL, UIP_UDP_CONNS, uip_udp_new(), and uip_conn::window.
Referenced by tcpip_input().
void uip_unlisten | ( | uint16_t | port | ) |
Stop listening to the specified port.
port | A 16-bit port number in network byte order. |
Definition at line 542 of file uip.c.
References UIP_LISTENPORTS.
Referenced by tcpip_output().
void uip_listen | ( | uint16_t | port | ) |
Start listening to the specified port.
port | A 16-bit port number in network byte order. |
Definition at line 553 of file uip.c.
References uip_conn::rcv_nxt, uip_acc32, uip_add32(), uip_ipchksum(), UIP_LISTENPORTS, and UIP_REASS_MAXAGE.
Referenced by tcpip_output().
void uip_process | ( | uint8_t | flag | ) |
process the options within a hop by hop or destination option header
0 | nothing to send, |
1 | drop pkt |
2 | ICMP error message to send |
Definition at line 706 of file uip.c.
References uip_conn::arpid, uip_udp_conn::arpid, uip_conn::backlog, uip_conn::initialmss, uip_conn::len, uip_conn::lport, uip_udp_conn::lport, uip_conn::mss, uip_conn::nrtx, PRINTD, uip_conn::rcv_nxt, uip_conn::ripaddr, uip_udp_conn::ripaddr, uip_conn::rport, uip_udp_conn::rport, uip_conn::rto, uip_conn::sa, send(), uip_conn::snd_nxt, uip_conn::sv, uip_conn::tcpstateflags, uip_conn::timer, uip_udp_conn::ttl, uip_acc32, uip_add32(), UIP_APPCALL, uip_appdata, uip_chksum(), UIP_CONF_IPV6, uip_conn, UIP_CONNS, UIP_HTONS, uip_icmp6chksum(), uip_ipaddr_copy, uip_ipchksum(), uip_len, UIP_LISTENPORTS, UIP_LLH_LEN, UIP_MAXRTX, UIP_MAXSYNRTX, UIP_RECEIVE_WINDOW, UIP_RTO, UIP_STAT, UIP_TCP_MSS, uip_tcpchksum(), UIP_TIME_WAIT_TIMEOUT, UIP_TTL, uip_udp_conn, UIP_UDP_CONNS, uip_udpchksum(), and uip_conn::window.
uint16_t uip_htons | ( | uint16_t | val | ) |
Convert a 16-bit quantity from host byte order to network byte order.
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 UIP_HTONS() macro instead.
Definition at line 2076 of file uip.c.
References UIP_HTONS.
Referenced by uip_chksum(), uip_init(), and uip_ipchksum().
void uip_send | ( | const void * | data, |
int | 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.
The amount of data that actually is sent out after a call to this function 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.
data | A pointer to the data which is to be sent. |
len | The maximum amount of data bytes to be sent. |
Definition at line 2088 of file uip.c.
References uip_conn::len, uip_conn::mss, PRINTD, uip_conn::ripaddr, uip_udp_conn::ripaddr, UIP_BUFSIZE, UIP_LLH_LEN, and uip_conn::window.
uint16_t uip_udpchksum | ( | void | ) |
Calculate the UDP checksum of the packet in uip_buf and uip_appdata.
The UDP checksum is the Internet checksum of data contents of the UDP segment, and a pseudo-header as defined in RFC768.
Referenced by uip_process(), and uip_tcpchksum().
uint16_t uip_icmp6chksum | ( | void | ) |
Calculate the ICMP checksum of the packet in uip_buf.
Referenced by uip_ipchksum(), and uip_process().
void* 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().
Definition at line 154 of file uip.c.
Referenced by simple_udp_deregister(), slipdev_send(), uip_arp_out(), uip_fw_forward(), and uip_process().
uint16_t uip_len |
The length of the packet in the uip_buf buffer.
The global variable uip_len holds the length of the packet in the uip_buf buffer.
When the network device driver calls the uIP input function, uip_len should be set to the length of the packet in the uip_buf buffer.
When sending packets, the device driver should use the contents of the uip_len variable to determine the length of the outgoing packet.
Definition at line 166 of file uip.c.
Referenced by slipdev_send(), tcpip_input(), tcpip_output(), uip_arp_arpin(), uip_arp_out(), uip_arp_timer(), uip_fw_forward(), uip_fw_init(), uip_fw_output(), and uip_process().
Pointer to the current TCP connection.
The uip_conn pointer can be used to access the current TCP connection.
Definition at line 174 of file uip.c.
Referenced by uip_process().
uint8_t uip_acc32[4] |
4-byte array used for the 32-bit sequence number calculations.
Definition at line 206 of file uip.c.
Referenced by uip_add32(), uip_listen(), and uip_process().
CCIF void* 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().
Definition at line 154 of file uip.c.
Referenced by simple_udp_deregister(), slipdev_send(), uip_arp_out(), uip_fw_forward(), and uip_process().
Pointer to the current TCP connection.
The uip_conn pointer can be used to access the current TCP connection.
Definition at line 174 of file uip.c.
Referenced by uip_process().
struct uip_udp_conn* uip_udp_conn |
The current UDP connection.
Referenced by uip_process().