RetroArch
Files | Macros | Functions
Architecture specific uIP functions

Files

file  uip_arch.h
 
file  btarch.h
 

Macros

#define UIP_MIN(x, y)   (x)<(y)?(x):(y)
 
#define MEM_ALIGNMENT   4
 
#define MEM_ALIGN(mem)   ((void*)(((u32_t)(mem)+MEM_ALIGNMENT-1)&~(u32_t)(MEM_ALIGNMENT-1)))
 
#define MEM_ALIGN_SIZE(size)   (((size)+MEM_ALIGNMENT-1)&~(u32_t)(MEM_ALIGNMENT-1))
 
#define PACK_STRUCT_STRUCT   __attribute__((packed))
 
#define PACK_STRUCT_FIELD(x)   x
 
#define PACK_STRUCT_BEGIN
 
#define PACK_STRUCT_END
 
#define tcp_tmr_needed   tcpip_tmr_needed
 
#define UIP_MEMCPY   uip_memcpy
 
#define UIP_MEMSET   uip_memset
 
#define MEM_ALIGNMENT   4
 
#define MEM_ALIGN(mem)   ((void*)(((u32_t)(mem)+MEM_ALIGNMENT-1)&~(u32_t)(MEM_ALIGNMENT-1)))
 
#define MEM_ALIGN_SIZE(size)   (((size)+MEM_ALIGNMENT-1)&~(u32_t)(MEM_ALIGNMENT-1))
 
#define le64toh   bswap64
 
#define MEMCPY   memcpy
 
#define MEMSET   memset
 
#define LOG(fmt, ...)
 
#define ERROR(fmt, ...)
 

Functions

u16_t uip_chksum (u16_t *buf, u32_t len)
 
u16_t uip_ipchksum (void *dataptr, u16_t len)
 
u16_t uip_ipchksum_pbuf (struct uip_pbuf *p)
 
u16_t uip_chksum_pseudo (struct uip_pbuf *p, struct uip_ip_addr *src, struct uip_ip_addr *dst, u8_t proto, u16_t proto_len)
 
void tcpip_tmr_needed ()
 
static __inline__ void uip_memcpy (void *dest, const void *src, s32_t len)
 
static __inline__ void uip_memset (void *dest, s32_t c, s32_t len)
 

Detailed Description

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

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.

Macro Definition Documentation

◆ ERROR

#define ERROR (   fmt,
  ... 
)

◆ le64toh

#define le64toh   bswap64

◆ LOG

#define LOG (   fmt,
  ... 
)

◆ MEM_ALIGN [1/2]

#define MEM_ALIGN (   mem)    ((void*)(((u32_t)(mem)+MEM_ALIGNMENT-1)&~(u32_t)(MEM_ALIGNMENT-1)))

◆ MEM_ALIGN [2/2]

#define MEM_ALIGN (   mem)    ((void*)(((u32_t)(mem)+MEM_ALIGNMENT-1)&~(u32_t)(MEM_ALIGNMENT-1)))

◆ MEM_ALIGN_SIZE [1/2]

#define MEM_ALIGN_SIZE (   size)    (((size)+MEM_ALIGNMENT-1)&~(u32_t)(MEM_ALIGNMENT-1))

◆ MEM_ALIGN_SIZE [2/2]

#define MEM_ALIGN_SIZE (   size)    (((size)+MEM_ALIGNMENT-1)&~(u32_t)(MEM_ALIGNMENT-1))

◆ MEM_ALIGNMENT [1/2]

#define MEM_ALIGNMENT   4

◆ MEM_ALIGNMENT [2/2]

#define MEM_ALIGNMENT   4

◆ MEMCPY

#define MEMCPY   memcpy

◆ MEMSET

#define MEMSET   memset

◆ PACK_STRUCT_BEGIN

#define PACK_STRUCT_BEGIN

◆ PACK_STRUCT_END

#define PACK_STRUCT_END

◆ PACK_STRUCT_FIELD

#define PACK_STRUCT_FIELD (   x)    x

◆ PACK_STRUCT_STRUCT

#define PACK_STRUCT_STRUCT   __attribute__((packed))

◆ tcp_tmr_needed

#define tcp_tmr_needed   tcpip_tmr_needed

◆ UIP_MEMCPY

#define UIP_MEMCPY   uip_memcpy

◆ UIP_MEMSET

#define UIP_MEMSET   uip_memset

◆ UIP_MIN

#define UIP_MIN (   x,
  y 
)    (x)<(y)?(x):(y)

Function Documentation

◆ tcpip_tmr_needed()

void tcpip_tmr_needed ( )
Here is the call graph for this function:

◆ uip_chksum()

u16_t uip_chksum ( u16_t buf,
u32_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.

Note
This function is not called in the current version of uIP, but future versions might make use of it.
Parameters
bufA pointer to the buffer over which the checksum is to be computed.
lenThe length of the buffer over which the checksum is to be computed.
Returns
The Internet checksum of the buffer.
Here is the caller graph for this function:

◆ uip_chksum_pseudo()

u16_t uip_chksum_pseudo ( struct uip_pbuf p,
struct uip_ip_addr src,
struct uip_ip_addr dst,
u8_t  proto,
u16_t  proto_len 
)

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.

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.
Returns
The TCP checksum of the TCP segment in uip_buf and pointed to by uip_appdata.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ uip_ipchksum()

u16_t uip_ipchksum ( void dataptr,
u16_t  len 
)

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.

Returns
The IP header checksum of the IP header in the uip_buf buffer.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ uip_ipchksum_pbuf()

u16_t uip_ipchksum_pbuf ( struct uip_pbuf p)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ uip_memcpy()

static __inline__ void uip_memcpy ( void dest,
const void src,
s32_t  len 
)
static

◆ uip_memset()

static __inline__ void uip_memset ( void dest,
s32_t  c,
s32_t  len 
)
static