libcoap  4.1.1
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
Data Structures | Macros | Functions | Variables
etsi_iot_01.c File Reference
#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 "uthash.h"
#include "coap.h"

Go to the source code of this file.

Data Structures

struct  coap_payload_t
 
struct  coap_dynamic_uri_t
 This structure is used to store URIs for dynamically allocated resources, usually by POST or PUT. More...
 

Macros

#define COAP_RESOURCE_CHECK_TIME_SEC   1
 
#define min(a, b)   ((a) < (b) ? (a) : (b))
 
#define COAP_OPT_BLOCK_SZX_MAX   6
 allowed maximum for block szx value More...
 
#define REQUIRE_ETAG   0x01 /* flag for coap_payload_t: require ETag option */
 
#define INDEX
 
#define BUFSIZE   20
 

Functions

void handle_sigint (int signum)
 
coap_payload_tcoap_new_payload (size_t size)
 
static coap_payload_tcoap_find_payload (const coap_key_t key)
 
static void coap_add_payload (const coap_key_t key, coap_payload_t *payload, coap_dynamic_uri_t *uri)
 
static void coap_delete_payload (coap_payload_t *payload)
 
void hnd_get_index (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_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_post_test (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_test (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_test (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_query (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_separate (coap_context_t *ctx, struct coap_resource_t *resource, coap_address_t *peer, coap_pdu_t *request, str *token, coap_pdu_t *response)
 
void check_async (coap_context_t *ctx, coap_tick_t now)
 
coap_payload_tmake_large (char *filename)
 
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 main (int argc, char **argv)
 

Variables

static int quit = 0
 
coap_payload_ttest_resources = NULL
 
coap_dynamic_uri_ttest_dynamic_uris = NULL
 
static coap_async_state_tasync = NULL
 

Macro Definition Documentation

#define BUFSIZE   20
#define COAP_OPT_BLOCK_SZX_MAX   6

allowed maximum for block szx value

Definition at line 38 of file etsi_iot_01.c.

#define COAP_RESOURCE_CHECK_TIME_SEC   1

Definition at line 29 of file etsi_iot_01.c.

#define INDEX
Value:
"libcoap server for ETSI CoAP Plugtest, March 2012, Paris\n" \
"Copyright (C) 2012 Olaf Bergmann <bergmann@tzi.org>\n\n"

Definition at line 76 of file etsi_iot_01.c.

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

Definition at line 32 of file etsi_iot_01.c.

#define REQUIRE_ETAG   0x01 /* flag for coap_payload_t: require ETag option */

Definition at line 40 of file etsi_iot_01.c.

Function Documentation

void check_async ( coap_context_t ctx,
coap_tick_t  now 
)

Definition at line 455 of file etsi_iot_01.c.

static void coap_add_payload ( const coap_key_t  key,
coap_payload_t payload,
coap_dynamic_uri_t uri 
)
inlinestatic

Definition at line 99 of file etsi_iot_01.c.

static void coap_delete_payload ( coap_payload_t payload)
inlinestatic

Definition at line 113 of file etsi_iot_01.c.

static coap_payload_t* coap_find_payload ( const coap_key_t  key)
inlinestatic

Definition at line 92 of file etsi_iot_01.c.

coap_payload_t* coap_new_payload ( size_t  size)

Definition at line 80 of file etsi_iot_01.c.

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

Definition at line 631 of file etsi_iot_01.c.

void handle_sigint ( int  signum)

Definition at line 72 of file etsi_iot_01.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 223 of file etsi_iot_01.c.

void hnd_delete_test ( 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 356 of file etsi_iot_01.c.

void hnd_get_index ( 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 129 of file etsi_iot_01.c.

void hnd_get_query ( 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 372 of file etsi_iot_01.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 147 of file etsi_iot_01.c.

void hnd_get_separate ( 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 410 of file etsi_iot_01.c.

void hnd_post_test ( 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 239 of file etsi_iot_01.c.

void hnd_put_test ( 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 305 of file etsi_iot_01.c.

void init_resources ( coap_context_t ctx)

Definition at line 533 of file etsi_iot_01.c.

int main ( int  argc,
char **  argv 
)

Definition at line 673 of file etsi_iot_01.c.

coap_payload_t* make_large ( char *  filename)

Definition at line 499 of file etsi_iot_01.c.

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

Definition at line 614 of file etsi_iot_01.c.

Variable Documentation

coap_async_state_t* async = NULL
static

Definition at line 68 of file etsi_iot_01.c.

int quit = 0
static

Definition at line 36 of file etsi_iot_01.c.

coap_dynamic_uri_t* test_dynamic_uris = NULL

Definition at line 64 of file etsi_iot_01.c.

coap_payload_t* test_resources = NULL

Definition at line 51 of file etsi_iot_01.c.