RetroArch
Classes | Macros | Functions | Variables
uip_ip.h File Reference
#include "uip.h"
Include dependency graph for uip_ip.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  uip_ip_addr
 
struct  uip_ip_addr2
 
struct  uip_ip_hdr
 

Macros

#define UIP_INADDR_NONE   ((u32_t) 0xffffffff) /* 255.255.255.255 */
 
#define UIP_INADDR_LOOPBACK   ((u32_t) 0x7f000001) /* 127.0.0.1 */
 
#define UIP_IPH_V(hdr)   (ntohs((hdr)->_v_hl_tos) >> 12)
 
#define UIP_IPH_HL(hdr)   ((ntohs((hdr)->_v_hl_tos) >> 8) & 0x0f)
 
#define UIP_IPH_TOS(hdr)   (ntohs((hdr)->_v_hl_tos) & 0xff)
 
#define UIP_IPH_LEN(hdr)   ((hdr)->_len)
 
#define UIP_IPH_ID(hdr)   ((hdr)->_id)
 
#define UIP_IPH_OFFSET(hdr)   ((hdr)->_offset)
 
#define UIP_IPH_TTL(hdr)   (ntohs((hdr)->_ttl_proto) >> 8)
 
#define UIP_IPH_PROTO(hdr)   (ntohs((hdr)->_ttl_proto) & 0xff)
 
#define UIP_IPH_CHKSUM(hdr)   ((hdr)->_chksum)
 
#define UIP_IPH_VHLTOS_SET(hdr, v, hl, tos)   (hdr)->_v_hl_tos = (htons(((v) << 12) | ((hl) << 8) | (tos)))
 
#define UIP_IPH_LEN_SET(hdr, len)   (hdr)->_len = (len)
 
#define UIP_IPH_ID_SET(hdr, id)   (hdr)->_id = (id)
 
#define UIP_IPH_OFFSET_SET(hdr, off)   (hdr)->_offset = (off)
 
#define UIP_IPH_TTL_SET(hdr, ttl)   (hdr)->_ttl_proto = (htons(UIP_IPH_PROTO(hdr) | ((ttl) << 8)))
 
#define UIP_IPH_PROTO_SET(hdr, proto)   (hdr)->_ttl_proto = (htons((proto) | (UIP_IPH_TTL(hdr) << 8)))
 
#define UIP_IPH_CHKSUM_SET(hdr, chksum)   (hdr)->_chksum = (chksum)
 
#define UIP_SOF_DEBUG   (u16_t)0x0001U /* turn on debugging info recording */
 
#define UIP_SOF_ACCEPTCONN   (u16_t)0x0002U /* socket has had listen() */
 
#define UIP_SOF_REUSEADDR   (u16_t)0x0004U /* allow local address reuse */
 
#define UIP_SOF_KEEPALIVE   (u16_t)0x0008U /* keep connections alive */
 
#define UIP_SOF_DONTROUTE   (u16_t)0x0010U /* just use interface addresses */
 
#define UIP_SOF_BROADCAST   (u16_t)0x0020U /* permit sending of broadcast msgs */
 
#define UIP_SOF_USELOOPBACK   (u16_t)0x0040U /* bypass hardware when possible */
 
#define UIP_SOF_LINGER   (u16_t)0x0080U /* linger on close if data present */
 
#define UIP_SOF_OOBINLINE   (u16_t)0x0100U /* leave received OOB data in line */
 
#define UIP_SOF_REUSEPORT   (u16_t)0x0200U /* allow local address & port reuse */
 
#define IP4_ADDR(ipaddr, a, b, c, d)
 
#define ip_addr_set(dest, src)
 
#define ip_addr_netcmp(addr1, addr2, mask)
 
#define ip_addr_cmp(addr1, addr2)   ((addr1)->addr == (addr2)->addr)
 
#define ip_addr_isany(addr1)   ((addr1) == NULL || (addr1)->addr == 0)
 
#define ip_addr_isbroadcast   uip_ipaddr_isbroadcast
 
#define ip_addr_ismulticast(addr1)   (((addr1)->addr & ntohl(0xf0000000)) == ntohl(0xe0000000))
 
#define ip4_addr1(ipaddr)   ((u16_t)(ntohl((ipaddr)->addr) >> 24) & 0xff)
 
#define ip4_addr2(ipaddr)   ((u16_t)(ntohl((ipaddr)->addr) >> 16) & 0xff)
 
#define ip4_addr3(ipaddr)   ((u16_t)(ntohl((ipaddr)->addr) >> 8) & 0xff)
 
#define ip4_addr4(ipaddr)   ((u16_t)(ntohl((ipaddr)->addr)) & 0xff)
 
#define UIP_IP_RF   0x8000
 
#define UIP_IP_DF   0x4000
 
#define UIP_IP_MF   0x2000
 
#define UIP_IP_OFFMASK   0x1fff
 
#define UIP_IP_PCB
 

Functions

void uip_ipinit ()
 
u32_t uip_ipaddr (const u8_t *cp)
 
s32_t uip_ipaton (const u8_t *cp, struct in_addr *addr)
 
s8_t uip_ipinput (struct uip_pbuf *p, struct uip_netif *inp)
 
s8_t uip_ipoutput (struct uip_pbuf *p, struct uip_ip_addr *src, struct uip_ip_addr *dst, u8_t ttl, u8_t tos, u8_t proto)
 
s8_t uip_ipoutput_if (struct uip_pbuf *p, struct uip_ip_addr *src, struct uip_ip_addr *dst, u8_t ttl, u8_t tos, u8_t proto, struct uip_netif *netif)
 
struct uip_netifuip_iproute (struct uip_ip_addr *dst)
 
u8_t uip_ipaddr_isbroadcast (struct uip_ip_addr *addr, struct uip_netif *netif)
 

Variables

PACK_STRUCT_BEGIN struct uip_ip_addr PACK_STRUCT_STRUCT
 

Macro Definition Documentation

◆ IP4_ADDR

#define IP4_ADDR (   ipaddr,
  a,
  b,
  c,
 
)
Value:
(ipaddr)->addr = htonl(((u32_t)(a & 0xff) << 24) | ((u32_t)(b & 0xff) << 16) | \
((u32_t)(c & 0xff) << 8) | (u32_t)(d & 0xff))
#define htonl(x)
Definition: inet.h:70
const GLubyte * c
Definition: glext.h:9812
GLboolean GLboolean GLboolean b
Definition: glext.h:6844
GLenum const GLvoid * addr
Definition: glext.h:10528
u32 u32_t
Definition: cc.h:47
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6844

◆ ip4_addr1

#define ip4_addr1 (   ipaddr)    ((u16_t)(ntohl((ipaddr)->addr) >> 24) & 0xff)

◆ ip4_addr2

#define ip4_addr2 (   ipaddr)    ((u16_t)(ntohl((ipaddr)->addr) >> 16) & 0xff)

◆ ip4_addr3

#define ip4_addr3 (   ipaddr)    ((u16_t)(ntohl((ipaddr)->addr) >> 8) & 0xff)

◆ ip4_addr4

#define ip4_addr4 (   ipaddr)    ((u16_t)(ntohl((ipaddr)->addr)) & 0xff)

◆ ip_addr_cmp

#define ip_addr_cmp (   addr1,
  addr2 
)    ((addr1)->addr == (addr2)->addr)

◆ ip_addr_isany

#define ip_addr_isany (   addr1)    ((addr1) == NULL || (addr1)->addr == 0)

◆ ip_addr_isbroadcast

#define ip_addr_isbroadcast   uip_ipaddr_isbroadcast

◆ ip_addr_ismulticast

#define ip_addr_ismulticast (   addr1)    (((addr1)->addr & ntohl(0xf0000000)) == ntohl(0xe0000000))

◆ ip_addr_netcmp

#define ip_addr_netcmp (   addr1,
  addr2,
  mask 
)
Value:
(((addr1)->addr & \
(mask)->addr) == \
((addr2)->addr & \
(mask)->addr))
GLenum const GLvoid * addr
Definition: glext.h:10528
GLenum GLint GLuint mask
Definition: glext.h:6668

Determine if two address are on the same network.

  • addr1 IP address 1
  • addr2 IP address 2
  • mask network identifier mask
    Returns
    !0 if the network identifiers of both address match

◆ ip_addr_set

#define ip_addr_set (   dest,
  src 
)
Value:
(dest)->addr = \
((src) == NULL? 0:\
(src)->addr)
#define NULL
Pointer to 0.
Definition: gctypes.h:65
GLenum const GLvoid * addr
Definition: glext.h:10528
GLenum src
Definition: glext.h:6980

◆ UIP_INADDR_LOOPBACK

#define UIP_INADDR_LOOPBACK   ((u32_t) 0x7f000001) /* 127.0.0.1 */

◆ UIP_INADDR_NONE

#define UIP_INADDR_NONE   ((u32_t) 0xffffffff) /* 255.255.255.255 */

◆ UIP_IP_DF

#define UIP_IP_DF   0x4000

◆ UIP_IP_MF

#define UIP_IP_MF   0x2000

◆ UIP_IP_OFFMASK

#define UIP_IP_OFFMASK   0x1fff

◆ UIP_IP_PCB

#define UIP_IP_PCB
Value:
struct uip_ip_addr local_ip; \
struct uip_ip_addr remote_ip; \
u16_t so_options; \
u8_t tos; \
u8_t ttl
Definition: uip_ip.h:82

◆ UIP_IP_RF

#define UIP_IP_RF   0x8000

◆ UIP_IPH_CHKSUM

#define UIP_IPH_CHKSUM (   hdr)    ((hdr)->_chksum)

◆ UIP_IPH_CHKSUM_SET

#define UIP_IPH_CHKSUM_SET (   hdr,
  chksum 
)    (hdr)->_chksum = (chksum)

◆ UIP_IPH_HL

#define UIP_IPH_HL (   hdr)    ((ntohs((hdr)->_v_hl_tos) >> 8) & 0x0f)

◆ UIP_IPH_ID

#define UIP_IPH_ID (   hdr)    ((hdr)->_id)

◆ UIP_IPH_ID_SET

#define UIP_IPH_ID_SET (   hdr,
  id 
)    (hdr)->_id = (id)

◆ UIP_IPH_LEN

#define UIP_IPH_LEN (   hdr)    ((hdr)->_len)

◆ UIP_IPH_LEN_SET

#define UIP_IPH_LEN_SET (   hdr,
  len 
)    (hdr)->_len = (len)

◆ UIP_IPH_OFFSET

#define UIP_IPH_OFFSET (   hdr)    ((hdr)->_offset)

◆ UIP_IPH_OFFSET_SET

#define UIP_IPH_OFFSET_SET (   hdr,
  off 
)    (hdr)->_offset = (off)

◆ UIP_IPH_PROTO

#define UIP_IPH_PROTO (   hdr)    (ntohs((hdr)->_ttl_proto) & 0xff)

◆ UIP_IPH_PROTO_SET

#define UIP_IPH_PROTO_SET (   hdr,
  proto 
)    (hdr)->_ttl_proto = (htons((proto) | (UIP_IPH_TTL(hdr) << 8)))

◆ UIP_IPH_TOS

#define UIP_IPH_TOS (   hdr)    (ntohs((hdr)->_v_hl_tos) & 0xff)

◆ UIP_IPH_TTL

#define UIP_IPH_TTL (   hdr)    (ntohs((hdr)->_ttl_proto) >> 8)

◆ UIP_IPH_TTL_SET

#define UIP_IPH_TTL_SET (   hdr,
  ttl 
)    (hdr)->_ttl_proto = (htons(UIP_IPH_PROTO(hdr) | ((ttl) << 8)))

◆ UIP_IPH_V

#define UIP_IPH_V (   hdr)    (ntohs((hdr)->_v_hl_tos) >> 12)

◆ UIP_IPH_VHLTOS_SET

#define UIP_IPH_VHLTOS_SET (   hdr,
  v,
  hl,
  tos 
)    (hdr)->_v_hl_tos = (htons(((v) << 12) | ((hl) << 8) | (tos)))

◆ UIP_SOF_ACCEPTCONN

#define UIP_SOF_ACCEPTCONN   (u16_t)0x0002U /* socket has had listen() */

◆ UIP_SOF_BROADCAST

#define UIP_SOF_BROADCAST   (u16_t)0x0020U /* permit sending of broadcast msgs */

◆ UIP_SOF_DEBUG

#define UIP_SOF_DEBUG   (u16_t)0x0001U /* turn on debugging info recording */

◆ UIP_SOF_DONTROUTE

#define UIP_SOF_DONTROUTE   (u16_t)0x0010U /* just use interface addresses */

◆ UIP_SOF_KEEPALIVE

#define UIP_SOF_KEEPALIVE   (u16_t)0x0008U /* keep connections alive */

◆ UIP_SOF_LINGER

#define UIP_SOF_LINGER   (u16_t)0x0080U /* linger on close if data present */

◆ UIP_SOF_OOBINLINE

#define UIP_SOF_OOBINLINE   (u16_t)0x0100U /* leave received OOB data in line */

◆ UIP_SOF_REUSEADDR

#define UIP_SOF_REUSEADDR   (u16_t)0x0004U /* allow local address reuse */

◆ UIP_SOF_REUSEPORT

#define UIP_SOF_REUSEPORT   (u16_t)0x0200U /* allow local address & port reuse */

◆ UIP_SOF_USELOOPBACK

#define UIP_SOF_USELOOPBACK   (u16_t)0x0040U /* bypass hardware when possible */

Function Documentation

◆ uip_ipaddr()

u32_t uip_ipaddr ( const u8_t cp)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ uip_ipaddr_isbroadcast()

u8_t uip_ipaddr_isbroadcast ( struct uip_ip_addr addr,
struct uip_netif netif 
)

◆ uip_ipaton()

s32_t uip_ipaton ( const u8_t cp,
struct in_addr addr 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ uip_ipinit()

void uip_ipinit ( )
Here is the caller graph for this function:

◆ uip_ipinput()

s8_t uip_ipinput ( struct uip_pbuf p,
struct uip_netif inp 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ uip_ipoutput()

s8_t uip_ipoutput ( struct uip_pbuf p,
struct uip_ip_addr src,
struct uip_ip_addr dst,
u8_t  ttl,
u8_t  tos,
u8_t  proto 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ uip_ipoutput_if()

s8_t uip_ipoutput_if ( struct uip_pbuf p,
struct uip_ip_addr src,
struct uip_ip_addr dst,
u8_t  ttl,
u8_t  tos,
u8_t  proto,
struct uip_netif netif 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ uip_iproute()

struct uip_netif* uip_iproute ( struct uip_ip_addr dst)
Here is the caller graph for this function:

Variable Documentation

◆ PACK_STRUCT_STRUCT

PACK_STRUCT_END PACK_STRUCT_BEGIN struct uip_ip_hdr PACK_STRUCT_STRUCT