IoTivity-Lite
|
#include "oc_export.h"
#include "oc_helpers.h"
#include "oc_uuid.h"
#include "util/oc_compiler.h"
#include <stdbool.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... | |
typedef enum transport_flags | transport_flags |
transport flags (bit map) 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, const oc_endpoint_t *src) |
copy endpoint More... | |
bool | oc_endpoint_is_empty (const oc_endpoint_t *endpoint) |
check if all fields of the endpoint struct are empty More... | |
int | oc_endpoint_list_copy (oc_endpoint_t **dst, const oc_endpoint_t *src) |
copy list of endpoints More... | |
void | oc_endpoint_list_free (oc_endpoint_t *eps) |
deallocate a linked list of endpoints More... | |
void | oc_endpoint_set_di (oc_endpoint_t *endpoint, const oc_uuid_t *di) |
set device identifier (di) for the endpoint More... | |
void | oc_endpoint_set_local_address (oc_endpoint_t *ep, unsigned interface_index) |
set local address on endpoint from the first device endpoint with matching flags and interface index 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_cstring (const oc_endpoint_t *endpoint, char *buffer, size_t buffer_size) |
convert the endpoint to a human readable string (e.g. More... | |
int | oc_endpoint_to_string (const 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 (const oc_endpoint_t *endpoint) |
is endpoint (ipv6) link local More... | |
oc_endpoint_t * | oc_new_endpoint (void) |
create new endpoint More... | |
int | oc_string_to_endpoint (const oc_string_t *endpoint_str, oc_endpoint_t *endpoint, oc_string_t *uri) |
string to endpoint More... | |
#define oc_make_ipv4_endpoint | ( | __name__, | |
__flags__, | |||
__port__, | |||
... | |||
) |
#define oc_make_ipv6_endpoint | ( | __name__, | |
__flags__, | |||
__port__, | |||
... | |||
) |
typedef struct oc_endpoint_t oc_endpoint_t |
the endpoint information
typedef enum transport_flags transport_flags |
transport flags (bit map)
enum transport_flags |
int oc_endpoint_compare | ( | const oc_endpoint_t * | ep1, |
const oc_endpoint_t * | ep2 | ||
) |
compare endpoint
ep1 | endpoint 1 to compare |
ep2 | endpoint 2 to compare |
int oc_endpoint_compare_address | ( | const oc_endpoint_t * | ep1, |
const oc_endpoint_t * | ep2 | ||
) |
compare address of the endpoint
ep1 | endpoint 1 to compare |
ep2 | endpoint 2 to compare |
void oc_endpoint_copy | ( | oc_endpoint_t * | dst, |
const oc_endpoint_t * | src | ||
) |
copy endpoint
dst | destination endpoint (cannot be NULL) |
src | source endpoint (cannot be NULL) |
bool oc_endpoint_is_empty | ( | const oc_endpoint_t * | endpoint | ) |
check if all fields of the endpoint struct are empty
endpoint | endpoint to check (cannot be NULL) |
int oc_endpoint_list_copy | ( | oc_endpoint_t ** | dst, |
const oc_endpoint_t * | src | ||
) |
copy list of endpoints
dst | destination list of endpoints (cannot be NULL) |
src | source list of endpoints |
void oc_endpoint_list_free | ( | oc_endpoint_t * | eps | ) |
deallocate a linked list of endpoints
eps | linked list to deallocate |
void oc_endpoint_set_di | ( | oc_endpoint_t * | endpoint, |
const oc_uuid_t * | di | ||
) |
set device identifier (di) for the endpoint
endpoint | endpoint (cannot be NULL) |
di | device identifier (cannot be NULL) |
void oc_endpoint_set_local_address | ( | oc_endpoint_t * | ep, |
unsigned | interface_index | ||
) |
set local address on endpoint from the first device endpoint with matching flags and interface index
[in,out] | ep | the endpoint (cannot be NULL) |
interface_index | the interface index |
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
endpoint_str | uri to parse | |
[out] | path | output variable |
int oc_endpoint_to_cstring | ( | const oc_endpoint_t * | endpoint, |
char * | buffer, | ||
size_t | buffer_size | ||
) |
convert the endpoint to a human readable string (e.g.
"coaps://[fe::22]:1234")
endpoint | the endpoint (cannot be NULL) |
buffer | output buffer (cannot be NULL) |
buffer_size | size of output buffer |
int oc_endpoint_to_string | ( | const oc_endpoint_t * | endpoint, |
oc_string_t * | endpoint_str | ||
) |
convert the endpoint to a human readable string (e.g.
"coaps://[fe::22]:1234")
endpoint | the endpoint |
endpoint_str | endpoint as human readable string |
void oc_free_endpoint | ( | oc_endpoint_t * | endpoint | ) |
free endpoint
endpoint | endpoint to be freed |
int oc_ipv6_endpoint_is_link_local | ( | const oc_endpoint_t * | endpoint | ) |
is endpoint (ipv6) link local
endpoint | the endpoint to check |
oc_endpoint_t* oc_new_endpoint | ( | void | ) |
create new endpoint
int oc_string_to_endpoint | ( | const oc_string_t * | endpoint_str, |
oc_endpoint_t * | endpoint, | ||
oc_string_t * | uri | ||
) |
string to endpoint
endpoint_str | the endpoint as string (e.g. "coaps://[fe::22]:/blah") |
endpoint | the address part of the string |
uri | the uri part of the endpoint |