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

Go to the source code of this file.

Classes

struct  ip_addr
 
struct  ip_addr2
 
struct  in_addr
 

Macros

#define HAVE_IN_ADDR
 
#define IP_ADDR_ANY   ((struct ip_addr *)&ip_addr_any)
 
#define IP_ADDR_BROADCAST   ((struct ip_addr *)&ip_addr_broadcast)
 
#define INADDR_NONE   ((u32_t) 0xffffffff) /* 255.255.255.255 */
 
#define INADDR_LOOPBACK   ((u32_t) 0x7f000001) /* 127.0.0.1 */
 
#define IN_CLASSA(a)   ((((u32_t)(a)) & 0x80000000) == 0)
 
#define IN_CLASSA_NET   0xff000000
 
#define IN_CLASSA_NSHIFT   24
 
#define IN_CLASSA_HOST   (0xffffffff & ~IN_CLASSA_NET)
 
#define IN_CLASSA_MAX   128
 
#define IN_CLASSB(a)   ((((u32_t)(a)) & 0xc0000000) == 0x80000000)
 
#define IN_CLASSB_NET   0xffff0000
 
#define IN_CLASSB_NSHIFT   16
 
#define IN_CLASSB_HOST   (0xffffffff & ~IN_CLASSB_NET)
 
#define IN_CLASSB_MAX   65536
 
#define IN_CLASSC(a)   ((((u32_t)(a)) & 0xe0000000) == 0xc0000000)
 
#define IN_CLASSC_NET   0xffffff00
 
#define IN_CLASSC_NSHIFT   8
 
#define IN_CLASSC_HOST   (0xffffffff & ~IN_CLASSC_NET)
 
#define IN_CLASSD(a)   (((u32_t)(a) & 0xf0000000) == 0xe0000000)
 
#define IN_CLASSD_NET   0xf0000000 /* These ones aren't really */
 
#define IN_CLASSD_NSHIFT   28 /* net and host fields, but */
 
#define IN_CLASSD_HOST   0x0fffffff /* routing needn't know. */
 
#define IN_MULTICAST(a)   IN_CLASSD(a)
 
#define IN_EXPERIMENTAL(a)   (((u32_t)(a) & 0xf0000000) == 0xf0000000)
 
#define IN_BADCLASS(a)   (((u32_t)(a) & 0xf0000000) == 0xf0000000)
 
#define IN_LOOPBACKNET   127 /* official! */
 
#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_ismulticast(addr1)   (((addr1)->addr & ntohl(0xf0000000)) == ntohl(0xe0000000))
 
#define ip_addr_debug_print(debug, ipaddr)
 
#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)
 

Functions

u8_t ip_addr_isbroadcast (struct ip_addr *, struct netif *)
 

Variables

PACK_STRUCT_BEGIN struct ip_addr PACK_STRUCT_STRUCT
 
const struct ip_addr ip_addr_any
 
const struct ip_addr ip_addr_broadcast
 

Macro Definition Documentation

◆ HAVE_IN_ADDR

#define HAVE_IN_ADDR

◆ IN_BADCLASS

#define IN_BADCLASS (   a)    (((u32_t)(a) & 0xf0000000) == 0xf0000000)

◆ IN_CLASSA

#define IN_CLASSA (   a)    ((((u32_t)(a)) & 0x80000000) == 0)

◆ IN_CLASSA_HOST

#define IN_CLASSA_HOST   (0xffffffff & ~IN_CLASSA_NET)

◆ IN_CLASSA_MAX

#define IN_CLASSA_MAX   128

◆ IN_CLASSA_NET

#define IN_CLASSA_NET   0xff000000

◆ IN_CLASSA_NSHIFT

#define IN_CLASSA_NSHIFT   24

◆ IN_CLASSB

#define IN_CLASSB (   a)    ((((u32_t)(a)) & 0xc0000000) == 0x80000000)

◆ IN_CLASSB_HOST

#define IN_CLASSB_HOST   (0xffffffff & ~IN_CLASSB_NET)

◆ IN_CLASSB_MAX

#define IN_CLASSB_MAX   65536

◆ IN_CLASSB_NET

#define IN_CLASSB_NET   0xffff0000

◆ IN_CLASSB_NSHIFT

#define IN_CLASSB_NSHIFT   16

◆ IN_CLASSC

#define IN_CLASSC (   a)    ((((u32_t)(a)) & 0xe0000000) == 0xc0000000)

◆ IN_CLASSC_HOST

#define IN_CLASSC_HOST   (0xffffffff & ~IN_CLASSC_NET)

◆ IN_CLASSC_NET

#define IN_CLASSC_NET   0xffffff00

◆ IN_CLASSC_NSHIFT

#define IN_CLASSC_NSHIFT   8

◆ IN_CLASSD

#define IN_CLASSD (   a)    (((u32_t)(a) & 0xf0000000) == 0xe0000000)

◆ IN_CLASSD_HOST

#define IN_CLASSD_HOST   0x0fffffff /* routing needn't know. */

◆ IN_CLASSD_NET

#define IN_CLASSD_NET   0xf0000000 /* These ones aren't really */

◆ IN_CLASSD_NSHIFT

#define IN_CLASSD_NSHIFT   28 /* net and host fields, but */

◆ IN_EXPERIMENTAL

#define IN_EXPERIMENTAL (   a)    (((u32_t)(a) & 0xf0000000) == 0xf0000000)

◆ IN_LOOPBACKNET

#define IN_LOOPBACKNET   127 /* official! */

◆ IN_MULTICAST

#define IN_MULTICAST (   a)    IN_CLASSD(a)

◆ INADDR_LOOPBACK

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

◆ INADDR_NONE

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

◆ 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_ANY

#define IP_ADDR_ANY   ((struct ip_addr *)&ip_addr_any)

IP_ADDR_ can be used as a fixed IP address for the wildcard and the broadcast address

◆ IP_ADDR_BROADCAST

#define IP_ADDR_BROADCAST   ((struct ip_addr *)&ip_addr_broadcast)

◆ ip_addr_cmp

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

◆ ip_addr_debug_print

#define ip_addr_debug_print (   debug,
  ipaddr 
)
Value:
LWIP_DEBUGF(debug, ("%"U16_F".%"U16_F".%"U16_F".%"U16_F, \
ipaddr?(u16_t)(ntohl((ipaddr)->addr) >> 24) & 0xff:0, \
ipaddr?(u16_t)(ntohl((ipaddr)->addr) >> 16) & 0xff:0, \
ipaddr?(u16_t)(ntohl((ipaddr)->addr) >> 8) & 0xff:0, \
ipaddr?(u16_t)ntohl((ipaddr)->addr) & 0xff:0U))
GLenum const GLvoid * addr
Definition: glext.h:10528
#define U16_F
Definition: cc.h:65
#define ntohl(x)
Definition: inet.h:71
#define LWIP_DEBUGF(debug, x)
Definition: debug.h:80
u16 u16_t
Definition: cc.h:45

◆ ip_addr_isany

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

◆ 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

Function Documentation

◆ ip_addr_isbroadcast()

u8_t ip_addr_isbroadcast ( struct ip_addr ,
struct netif  
)

Variable Documentation

◆ ip_addr_any

const struct ip_addr ip_addr_any

◆ ip_addr_broadcast

const struct ip_addr ip_addr_broadcast

◆ PACK_STRUCT_STRUCT

PACK_STRUCT_END PACK_STRUCT_BEGIN struct ip_addr2 PACK_STRUCT_STRUCT