Merge "Implement functionality to set PSK credentials for DTLS in OC stack."
authorsudarshan prasad <sudarshan.prasad@intel.com>
Fri, 5 Dec 2014 01:59:58 +0000 (17:59 -0800)
committerGerrit Code Review <gerrit@oicreview.vlan14.01.org>
Fri, 5 Dec 2014 01:59:58 +0000 (17:59 -0800)
1  2 
resource/csdk/libcoap-4.1.1/makefile
resource/csdk/libcoap-4.1.1/sec/netdtls.c
resource/csdk/makefile
resource/csdk/stack/samples/linux/secure/common.cpp
resource/csdk/stack/samples/linux/secure/ocserverbasicops.cpp
resource/csdk/stack/samples/linux/secure/ocserverbasicops.h
resource/csdk/stack/src/ocstack.c

@@@ -43,10 -43,8 +43,10 @@@ LOGGER_DIR    = $(ROOT_DIR)/logge
  RANDOM_DIR    = $(ROOT_DIR)/ocrandom
  STACK_DIR     = $(ROOT_DIR)/stack
  OCMALLOC_DIR  = $(ROOT_DIR)/ocmalloc
 +EXTLIBS_DIR   = $(ROOT_DIR)/../../extlibs
 +TINYDTLS_DIR  = $(EXTLIBS_DIR)/tinydtls
  INC_DIRS      = -I$(OCSOCK_DIR)/include/ -I$(LOGGER_DIR)/include -I$(RANDOM_DIR)/include \
-                 -I$(OCMALLOC_DIR)/include -I$(OC_LOG_DIR)/include 
+                 -I$(OCMALLOC_DIR)/include -I$(OC_LOG_DIR)/include -I$(STACK_DIR)/include
  
  # Note for Arduino: The CC flag is set to the C++ compiler since Arduino build 
  # includes Time.h header file which has C++ style definitions.
@@@ -133,8 -133,8 +133,9 @@@ OCTBSTACK_SOURCES  := $(OCTBSTACK_SRC)/o
  OCTBSTACK_SOURCES     += $(OCTBSTACK_SRC)/occlientcb.c
  OCTBSTACK_SOURCES     += $(OCTBSTACK_SRC)/ocresource.c
  OCTBSTACK_SOURCES     += $(OCTBSTACK_SRC)/ocobserve.c
 +OCTBSTACK_SOURCES     += $(OCTBSTACK_SRC)/ocserverrequest.c
  OCTBSTACK_SOURCES     += $(OCTBSTACK_SRC)/occollection.c
+ OCTBSTACK_SOURCES     += $(OCTBSTACK_SRC)/ocsecurity.c
  
  SOURCES                       := $(CJSON_SOURCES)
  SOURCES                       += $(OCCOAP_SOURCES)
@@@ -54,19 -54,10 +54,16 @@@ char* constructJsonResponse (OCEntityHa
  /* Following methods process the PUT, GET, POST
   * requests
   */
 -void ProcessGetRequest (OCEntityHandlerRequest *ehRequest);
 -void ProcessPutRequest (OCEntityHandlerRequest *ehRequest);
 -void ProcessPostRequest (OCEntityHandlerRequest *ehRequest);
 +OCEntityHandlerResult ProcessGetRequest (OCEntityHandlerRequest *ehRequest,
 +                                         char *payload,
 +                                         size_t maxPayloadSize);
 +OCEntityHandlerResult ProcessPutRequest (OCEntityHandlerRequest *ehRequest,
 +                                         char *payload,
 +                                         size_t maxPayloadSize);
 +OCEntityHandlerResult ProcessPostRequest (OCEntityHandlerRequest *ehRequest,
 +                                          char *payload,
 +                                          size_t maxPayloadSize);
  
- /* call getResult in common.cpp to get the result in string format. */
- const char *getResult(OCStackResult result);
  //-----------------------------------------------------------------------------
  // Callback functions
  //-----------------------------------------------------------------------------
@@@ -69,9 -68,12 +69,14 @@@ OCDeviceEntityHandler defaultDeviceHand
  #define VERIFY_NON_NULL(arg, logLevel, retVal) { if (!(arg)) { OC_LOG((logLevel), \
               TAG, PCF(#arg " is NULL")); return (retVal); } }
  
 +//TODO: we should allow the server to define this
 +#define MAX_OBSERVE_AGE (0x2FFFFUL)
  //-----------------------------------------------------------------------------
+ // Externs
+ //-----------------------------------------------------------------------------
+ extern void DeinitOCSecurityInfo();
+ //-----------------------------------------------------------------------------
  // Internal API function
  //-----------------------------------------------------------------------------