Documentation

Documentation

Includes

assert.h

#include <assert.h>
#include 

stdint.h

#include <stdint.h>
#include 

string.h

#include <string.h>
#include 

sys/types.h

#include <sys/types.h>
#include 

libcoap.h

#include "libcoap.h"
#include "libcoap.h"

lwip/ip_addr.h

#include <lwip/ip_addr.h>
#include 

uip.h

#include "uip.h"
#include "uip.h"

Macros

Marco COAP_ADDRESS_H_

#define COAP_ADDRESS_H_


      

Marco _coap_address_equals_impl(A, B)

#define _coap_address_equals_impl(A, B) \
       ((A)->port == (B)->port       \
       && (!!ip_addr_cmp(&(A)->addr,&(B)->addr)))


      

Marco _coap_address_isany_impl(A)

#define _coap_address_isany_impl(A) ip_addr_isany(&(A)->addr)


      

Marco _coap_is_mcast_impl(Address)

#define _coap_is_mcast_impl(Address) ip_addr_ismulticast(&(Address)->addr)


      

Marco _coap_address_equals_impl(A,B)

#define _coap_address_equals_impl(A,B) \
       ((A)->port == (B)->port       \
       && uip_ipaddr_cmp(&((A)->addr),&((B)->addr)))


      

Marco _coap_address_isany_impl(A)

#define _coap_address_isany_impl(A) 0
/** @todo implementation of _coap_address_isany_impl() for Contiki */

Marco _coap_is_mcast_impl(Address)

#define _coap_is_mcast_impl(Address) uip_is_addr_mcast(&((Address)->addr))


      

Marco ip_addr_cmp(addr1, addr2)

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


      

Marco ip_addr_isany(addr1)

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


      

Marco ip_addr_ismulticast(addr1)

#define ip_addr_ismulticast(addr1) (((addr1)->addr & UNI_HTONL(0xf0000000UL)) == UNI_HTONL(0xe0000000UL))


      

Marco _coap_address_equals_impl(A, B)

#define _coap_address_equals_impl(A, B) \
       ((A)->port == (B)->port       \
       && (!!ip_addr_cmp(&(A)->addr,&(B)->addr)))


      

Marco _coap_address_isany_impl(A)

#define _coap_address_isany_impl(A) ip_addr_isany(&(A)->addr)


      

Marco _coap_is_mcast_impl(Address)

#define _coap_is_mcast_impl(Address) ip_addr_ismulticast(&(Address)->addr)

      

Functions

Func coap_address_equals

int coap_address_equals(const coap_address_t *a, const coap_address_t *b);
/**
 * Compares given address objects @p a and @p b. This function returns @c 1 if
 * addresses are equal, @c 0 otherwise. The parameters @p a and @p b must not be
 * @c NULL;
 */

Func memcpy

memcpy( &dst->addr, &src->addr, src->size );


      

Func coap_is_mcast

int coap_is_mcast(const coap_address_t *a);
/**
 * Checks if given address @p a denotes a multicast address. This function
 * returns @c 1 if @p a is multicast, @c 0 otherwise.
 */

Vars

Variable uint16_t

uint16_t port;


      

Variable return

return 0;


      

Variable dst

dst->addr.sin = src->addr.sin;

      

Consts

Types

Typedefs

Typedef coap_address_t;

typedef struct coap_address_t {
 uint16_t port;
 ip_addr_t addr;
} coap_address_t;


      

Typedef coap_address_t;

typedef struct coap_address_t {
 uip_ipaddr_t addr;
 uint16_t port;
} coap_address_t;


      

Typedef addr;

typedef struct coap_address_t {
 struct {
   UNW_IP_ADDR_T addr;
 } addr;


      

Typedef addr;

typedef struct coap_address_t {
 socklen_t size;          /**< size of addr */
 union {
   struct sockaddr        sa;
   struct sockaddr_in     sin;
   struct sockaddr_in6    sin6;
 } addr;
/** multi-purpose address abstraction */