libcoap  4.1.1
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
Data Structures | Macros | Typedefs | Functions | Variables
rd.c File Reference

CoRE resource directory. More...

#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <ctype.h>
#include <sys/select.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <sys/stat.h>
#include <dirent.h>
#include <errno.h>
#include <signal.h>
#include "config.h"
#include "utlist.h"
#include "resource.h"
#include "coap.h"

Go to the source code of this file.

Data Structures

struct  rd_t
 

Macros

#define COAP_RESOURCE_CHECK_TIME   2
 
#define RD_ROOT_STR   ((unsigned char *)"rd")
 
#define RD_ROOT_SIZE   2
 
#define min(a, b)   ((a) < (b) ? (a) : (b))
 
#define BUFSIZE   64
 
#define LOCSIZE   68
 

Typedefs

typedef struct rd_t rd_t
 

Functions

rd_trd_new ()
 
void rd_delete (rd_t *rd)
 
void handle_sigint (int signum)
 
void hnd_get_resource (coap_context_t *ctx, struct coap_resource_t *resource, coap_address_t *peer, coap_pdu_t *request, str *token, coap_pdu_t *response)
 
void hnd_put_resource (coap_context_t *ctx, struct coap_resource_t *resource, coap_address_t *peer, coap_pdu_t *request, str *token, coap_pdu_t *response)
 
void hnd_delete_resource (coap_context_t *ctx, struct coap_resource_t *resource, coap_address_t *peer, coap_pdu_t *request, str *token, coap_pdu_t *response)
 
void hnd_get_rd (coap_context_t *ctx, struct coap_resource_t *resource, coap_address_t *peer, coap_pdu_t *request, str *token, coap_pdu_t *response)
 
int parse_param (unsigned char *search, size_t search_len, unsigned char *data, size_t data_len, str *result)
 
void add_source_address (struct coap_resource_t *resource, coap_address_t *peer)
 
rd_tmake_rd (coap_address_t *peer, coap_pdu_t *pdu)
 
void hnd_post_rd (coap_context_t *ctx, struct coap_resource_t *resource, coap_address_t *peer, coap_pdu_t *request, str *token, coap_pdu_t *response)
 
void init_resources (coap_context_t *ctx)
 
void usage (const char *program, const char *version)
 
coap_context_tget_context (const char *node, const char *port)
 
int join (coap_context_t *ctx, char *group_name)
 
int main (int argc, char **argv)
 

Variables

rd_tresources = NULL
 
static int quit = 0
 

Detailed Description

CoRE resource directory.

See Also
http://tools.ietf.org/id/draft-shelby-core-resource-directory

Definition in file rd.c.

Macro Definition Documentation

#define BUFSIZE   64
#define COAP_RESOURCE_CHECK_TIME   2

Definition at line 39 of file rd.c.

#define LOCSIZE   68
#define min (   a,
 
)    ((a) < (b) ? (a) : (b))

Definition at line 45 of file rd.c.

#define RD_ROOT_SIZE   2

Definition at line 42 of file rd.c.

#define RD_ROOT_STR   ((unsigned char *)"rd")

Definition at line 41 of file rd.c.

Typedef Documentation

typedef struct rd_t rd_t

Function Documentation

void add_source_address ( struct coap_resource_t resource,
coap_address_t *  peer 
)

Definition at line 260 of file rd.c.

coap_context_t* get_context ( const char *  node,
const char *  port 
)

Definition at line 517 of file rd.c.

void handle_sigint ( int  signum)

Definition at line 83 of file rd.c.

void hnd_delete_resource ( coap_context_t ctx,
struct coap_resource_t resource,
coap_address_t *  peer,
coap_pdu_t request,
str token,
coap_pdu_t response 
)

Definition at line 183 of file rd.c.

void hnd_get_rd ( coap_context_t ctx,
struct coap_resource_t resource,
coap_address_t *  peer,
coap_pdu_t request,
str token,
coap_pdu_t response 
)

Definition at line 201 of file rd.c.

void hnd_get_resource ( coap_context_t ctx,
struct coap_resource_t resource,
coap_address_t *  peer,
coap_pdu_t request,
str token,
coap_pdu_t response 
)

Definition at line 88 of file rd.c.

void hnd_post_rd ( coap_context_t ctx,
struct coap_resource_t resource,
coap_address_t *  peer,
coap_pdu_t request,
str token,
coap_pdu_t response 
)

Definition at line 349 of file rd.c.

void hnd_put_resource ( coap_context_t ctx,
struct coap_resource_t resource,
coap_address_t *  peer,
coap_pdu_t request,
str token,
coap_pdu_t response 
)

Definition at line 109 of file rd.c.

void init_resources ( coap_context_t ctx)

Definition at line 484 of file rd.c.

int join ( coap_context_t ctx,
char *  group_name 
)

Definition at line 559 of file rd.c.

int main ( int  argc,
char **  argv 
)

Definition at line 617 of file rd.c.

rd_t* make_rd ( coap_address_t *  peer,
coap_pdu_t pdu 
)

Definition at line 316 of file rd.c.

int parse_param ( unsigned char *  search,
size_t  search_len,
unsigned char *  data,
size_t  data_len,
str result 
)

Definition at line 216 of file rd.c.

void rd_delete ( rd_t rd)
inline

Definition at line 71 of file rd.c.

rd_t* rd_new ( )
inline

Definition at line 61 of file rd.c.

void usage ( const char *  program,
const char *  version 
)

Definition at line 500 of file rd.c.

Variable Documentation

int quit = 0
static

Definition at line 79 of file rd.c.

rd_t* resources = NULL

Definition at line 58 of file rd.c.