IoTivity-Lite
oc_endpoint.h File Reference
#include "oc_helpers.h"
#include "oc_uuid.h"

Data Structures

struct  oc_endpoint_t
 the endpoint information More...
 
struct  oc_ipv4_addr_t
 ipv4 data structure More...
 
struct  oc_ipv6_addr_t
 ipv6 data structure More...
 
struct  oc_le_addr_t
 ble address data structure More...
 

Macros

#define oc_make_ipv4_endpoint(__name__, __flags__, __port__, ...)
 
#define oc_make_ipv6_endpoint(__name__, __flags__, __port__, ...)
 

Typedefs

typedef struct oc_endpoint_t oc_endpoint_t
 the endpoint information More...
 

Enumerations

enum  ocf_version_t { OCF_VER_1_0_0 = 2048 , OIC_VER_1_1_0 = 2112 }
 
enum  transport_flags {
  DISCOVERY = 1 << 0 , SECURED = 1 << 1 , IPV4 = 1 << 2 , IPV6 = 1 << 3 ,
  TCP = 1 << 4 , GATT = 1 << 5 , MULTICAST = 1 << 6 , ACCEPTED = 1 << 7
}
 transport flags (bit map) More...
 

Functions

int oc_endpoint_compare (const oc_endpoint_t *ep1, const oc_endpoint_t *ep2)
 compare endpoint More...
 
int oc_endpoint_compare_address (const oc_endpoint_t *ep1, const oc_endpoint_t *ep2)
 compare address of the endpoint More...
 
void oc_endpoint_copy (oc_endpoint_t *dst, oc_endpoint_t *src)
 copy endpoint More...
 
void oc_endpoint_list_copy (oc_endpoint_t **dst, oc_endpoint_t *src)
 copy list of endpoint More...
 
void oc_endpoint_set_di (oc_endpoint_t *endpoint, oc_uuid_t *di)
 set device identifier (di) for the endpoint More...
 
void oc_endpoint_set_local_address (oc_endpoint_t *ep, int interface_index)
 set interface index on the endpoint More...
 
int oc_endpoint_string_parse_path (const oc_string_t *endpoint_str, oc_string_t *path)
 parse path component (ie. More...
 
int oc_endpoint_to_string (oc_endpoint_t *endpoint, oc_string_t *endpoint_str)
 convert the endpoint to a human readable string (e.g. More...
 
void oc_free_endpoint (oc_endpoint_t *endpoint)
 free endpoint More...
 
int oc_ipv6_endpoint_is_link_local (oc_endpoint_t *endpoint)
 is endpoint (ipv6) link local More...
 
oc_endpoint_toc_new_endpoint (void)
 create new endpoint More...
 
int oc_string_to_endpoint (oc_string_t *endpoint_str, oc_endpoint_t *endpoint, oc_string_t *uri)
 string to endpoint More...
 

Macro Definition Documentation

◆ oc_make_ipv4_endpoint

#define oc_make_ipv4_endpoint (   __name__,
  __flags__,
  __port__,
  ... 
)
Value:
oc_endpoint_t __name__ = { .flags = __flags__, \
.addr.ipv4 = { .port = __port__, \
.address = { __VA_ARGS__ } } }
the endpoint information
Definition: oc_endpoint.h:85
enum transport_flags flags
the transport flags
Definition: oc_endpoint.h:88

◆ oc_make_ipv6_endpoint

#define oc_make_ipv6_endpoint (   __name__,
  __flags__,
  __port__,
  ... 
)
Value:
oc_endpoint_t __name__ = { .flags = __flags__, \
.addr.ipv6 = { .port = __port__, \
.address = { __VA_ARGS__ } } }

Typedef Documentation

◆ oc_endpoint_t

typedef struct oc_endpoint_t oc_endpoint_t

the endpoint information

Enumeration Type Documentation

◆ transport_flags

transport flags (bit map)

Enumerator
DISCOVERY 

used for discovery

SECURED 

secure communication

IPV4 

ipv4 communication

IPV6 

ipv6 communication

TCP 

tcp communication

GATT 

BLE GATT communication.

MULTICAST 

multicast enabled

ACCEPTED 

accepted

Function Documentation

◆ oc_endpoint_compare()

int oc_endpoint_compare ( const oc_endpoint_t ep1,
const oc_endpoint_t ep2 
)

compare endpoint

Parameters
ep1endpoint 1 to compare
ep2endpoint 2 to compare
Returns
int 0 = equal

◆ oc_endpoint_compare_address()

int oc_endpoint_compare_address ( const oc_endpoint_t ep1,
const oc_endpoint_t ep2 
)

compare address of the endpoint

Parameters
ep1endpoint 1 to compare
ep2endpoint 2 to compare
Returns
int 0 = equal

◆ oc_endpoint_copy()

void oc_endpoint_copy ( oc_endpoint_t dst,
oc_endpoint_t src 
)

copy endpoint

Parameters
dstdesination endpoint
srcsource endpoint

◆ oc_endpoint_list_copy()

void oc_endpoint_list_copy ( oc_endpoint_t **  dst,
oc_endpoint_t src 
)

copy list of endpoint

Parameters
dstdestination list of endpoints
srcsource list of endpoints

◆ oc_endpoint_set_di()

void oc_endpoint_set_di ( oc_endpoint_t endpoint,
oc_uuid_t *  di 
)

set device identifier (di) for the endpoint

Parameters
endpointend point
didevice identifier

◆ oc_endpoint_set_local_address()

void oc_endpoint_set_local_address ( oc_endpoint_t ep,
int  interface_index 
)

set interface index on the endpoint

Parameters
epthe endpoing
interface_indexthe interface index

◆ oc_endpoint_string_parse_path()

int oc_endpoint_string_parse_path ( const oc_string_t *  endpoint_str,
oc_string_t *  path 
)

parse path component (ie.

the part after the first '/') of a uri

Parameters
[in]endpoint_struri to parse
[out]pathoutput variable
Returns
0 on success
-1 on failure

◆ oc_endpoint_to_string()

int oc_endpoint_to_string ( oc_endpoint_t endpoint,
oc_string_t *  endpoint_str 
)

convert the endpoint to a human readable string (e.g.

"coaps://[fe::22]:/")

Parameters
endpointthe endpoint
endpoint_strendpoint as human readable string
Returns
int 0 success

◆ oc_free_endpoint()

void oc_free_endpoint ( oc_endpoint_t endpoint)

free endpoint

Parameters
endpointendpoint to be freed

◆ oc_ipv6_endpoint_is_link_local()

int oc_ipv6_endpoint_is_link_local ( oc_endpoint_t endpoint)

is endpoint (ipv6) link local

Parameters
endpointthe endpoint to check
Returns
int 0 = endpoint is link local

◆ oc_new_endpoint()

oc_endpoint_t* oc_new_endpoint ( void  )

create new endpoint

Returns
oc_endpoint_t* created new endpoint

◆ oc_string_to_endpoint()

int oc_string_to_endpoint ( oc_string_t *  endpoint_str,
oc_endpoint_t endpoint,
oc_string_t *  uri 
)

string to endpoint

Parameters
endpoint_strthe endpoint as string (e.g. "coaps://[fe::22]:/blah")
endpointthe address part of the string
urithe uri part of the endpoint
Returns
int 0 success