15 #ifndef _COAP_ADDRESS_H_ 16 #define _COAP_ADDRESS_H_ 21 #include <sys/types.h> 25 #include <lwip/ip_addr.h> 32 #define _coap_address_equals_impl(A, B) (!!ip_addr_cmp(&(A)->addr,&(B)->addr)) 34 #define _coap_address_isany_impl(A) ip_addr_isany(&(A)->addr) 36 #define _coap_is_mcast_impl(Address) ip_addr_ismulticast(&(Address)->addr) 47 #define _coap_address_equals_impl(A,B) \ 48 ((A)->port == (B)->port \ 49 && uip_ipaddr_cmp(&((A)->addr),&((B)->addr))) 52 #define _coap_address_isany_impl(A) 0 54 #define _coap_is_mcast_impl(Address) uip_is_addr_mcast(&((Address)->addr)) 63 struct sockaddr_storage
st;
64 struct sockaddr_in
sin;
79 switch (a->
addr.
sa.sa_family) {
81 return a->
addr.
sin.sin_addr.s_addr == INADDR_ANY;
83 return memcmp(&in6addr_any,
85 sizeof(in6addr_any)) == 0;
120 return _coap_address_equals_impl(a, b);
148 return a && _coap_is_mcast_impl(a);
int coap_address_equals(const coap_address_t *a, const coap_address_t *b)
Compares given address objects a and b.
multi-purpose address abstraction
struct coap_address_t coap_address_t
multi-purpose address abstraction
static int _coap_address_isany_impl(const coap_address_t *a)
struct sockaddr_storage st
static int coap_address_isany(const coap_address_t *a)
Checks if given address object a denotes the wildcard address.
static void coap_address_init(coap_address_t *addr)
Resets the given coap_address_t object addr to its default values.
union coap_address_t::@0 addr
socklen_t size
size of addr
int coap_is_mcast(const coap_address_t *a)
Checks if given address a denotes a multicast address.