1. 27 Nov, 2018 1 commit
  2. 26 Nov, 2018 1 commit
  3. 13 Sep, 2018 1 commit
  4. 13 Aug, 2018 2 commits
  5. 17 Jul, 2018 1 commit
  6. 06 Jul, 2018 1 commit
  7. 26 Jun, 2018 1 commit
  8. 13 Jun, 2018 1 commit
  9. 12 Jun, 2018 1 commit
    • Kishen Maloor's avatar
      oc_endpoint_t: Add local address, interface index · e1a56f5c
      Kishen Maloor authored
      This patch brings in 4 related changes:
      1) Add addr_local attribute to oc_endpoint_t:
      This is an important change that extends the oc_endpoint_t
      structure to include a record of the local, receiving address
      of a message, in addition to the destination address. This
      information is vital because on multi-homed devices, or
      devices with network interfaces carrying multiple
      addresses, sendto() over UDP sockets bound to ANY_ADDR
      would be handled with the source address of the UDP packet
      set by the underlying network stack.
      This can lead to ambiguities in other layers that rely on
      remote endpoint consistency to track sessions or other resources.
      To counter this problem, this change modifies the receive
      flow to extract the destination address of an incoming packet
      and store it in the addr_local attribute of the endpoint.
      Likewise, on the send side, the address from the addr_local
      attribute is set explicitly as the source address of the
      outgoing UDP packet.
      The above logic has been fully implemented on the Linux and
      Windows ports with the aid of the sendmsg()/recvmsg() APIs that
      allow us to read/write anciliary data from/to the UDP packet.
      Ports for constrained devices can choose to employ this
      behavior in appropriate scenarios, though a basic case of having
      a single network interface would not require this handling.
      2) Store interface index of the network interface that receives a
      UDP/TCP packet in oc_endpoint_t. The interface index is also
      obtained from the anciliary data in the UDP packet and stored.
      This information is echoed back in the outgoing UDP packet for
      a response.
      But it also serves the purpose of restricting the list of
      endpoints returned by the oic/res handler to a requestor.
      For e.g. if an oic/res request had arrived through interface x,
      it can be assumed that there certianly exists a route to the
      remote endpoint through interface x. Consequently, the oic/res
      handler includes ONLY addresses from interface x in its response,
      and exclude addresses from all other active network interfaces
      on its system.
      3) While constructing a list of endpoints, a change now returns
      utmost one IPv6 address and one IPv4 address for any network interface.
      Further, the Linux and Windows ports now have logic to return only
      the highest-scope IPv6 address (if one exists) on an interface.
      For e.g. if an interface contains link-local and one/more
      Global IPv6 addresses (say one private, one ISP-assigned), it will
      pick the highest-scoped, non-temporary (DNS eligible) address.
      The internal oc_connectivity_get_endpoints() API will return
      this pared down list of addresses, which are then reflected the oic/res
      4) All the ports have been modified to store the list of endpoints
      on the machine, and not re-compute for each call to
      For the Linux and Windows ports, separate lists are maintained per
      logical device. Further, these lists are refreshed automatically upon any
      detected network interface change.
      Change-Id: I4bfa25a5c2b491d36726e3bb8bfad64d81effb04
      Signed-off-by: Kishen Maloor's avatarKishen Maloor <kishen.maloor@intel.com>
      Reviewed-on: https://gerrit.iotivity.org/gerrit/25773Tested-by: default avatarIoTivity Jenkins <jenkins-daemon@iotivity.org>
  10. 08 Jun, 2018 1 commit
    • Kishen Maloor's avatar
      Make network up/down and session events optional · b54fa762
      Kishen Maloor authored
      This change makes the internal logic to propagate
      network interface up/down and session connected/disconnected
      events a compile-time option. Both these features require
      ports to implement the logic for obtaining network interface
      events from the network stack, as well as the add/remove/handle
      interfaces for recording and invoking callbacks to the
      By making it optional, ports/apps that don’t require these
      events can choose to exclude the internal framework logic
      As a result of this change, apps must now #define
      OC_NETWORK_MONITOR for enabling network interface
      events, and OC_SESSION_EVENTS for session connect/disconnect
      events in config.h.
      Note: In the case of session events, the internal logic that
      removes observers and other resources at the close of a TCP/TLS
      session is still included and executed irrespective.
      The #define OC_SESSION_EVENTS is required only to
      invoke the handle_* interfaces for processing application
      callbacks to notify events.
      Change-Id: I6ca3287c5d66c2fb821f73a2999c259ac8ac5749
      Signed-off-by: Kishen Maloor's avatarKishen Maloor <kishen.maloor@intel.com>
      Reviewed-on: https://gerrit.iotivity.org/gerrit/25747Tested-by: default avatarIoTivity Jenkins <jenkins-daemon@iotivity.org>
  11. 01 Jun, 2018 1 commit
  12. 30 May, 2018 2 commits
  13. 16 May, 2018 1 commit
  14. 10 May, 2018 1 commit
  15. 07 May, 2018 1 commit
  16. 30 Apr, 2018 1 commit
  17. 27 Apr, 2018 1 commit
    • Kishen Maloor's avatar
      Update Linux TCP adapter · abad3691
      Kishen Maloor authored
      * Refactored few internal functions and modified the
      TCP session cleanup procedure.
      * Dispatch a CONNECTED event for plain TCP sessions and
      a DISCONNECTED event for all other cases when the session
      object is freed.
      * Added a per logical device mutex to synchronize between
      send/receive/end_session calls to avoid a race between the
      stack’s worker thread and the network thread.
      * Implemented oc_connectivity_end_session() interface in the
      IP adapter.
      Change-Id: Icc875bc63d3ffb90e6ab971835e77f41798dbd32
      Signed-off-by: Kishen Maloor's avatarKishen Maloor <kishen.maloor@intel.com>
      Reviewed-on: https://gerrit.iotivity.org/gerrit/24947
  18. 26 Apr, 2018 1 commit
    • Kishen Maloor's avatar
      Handle session (dis)connect, close_session() API · 23f9ebfc
      Kishen Maloor authored
      This patch adds a mechanism for cleaning up any
      internal session state upon termination of TCP, TLS,
      or DTLS sessions. Two new APIs: oc_session_start_event()
      and oc_session_end_event() may be invoked from the
      (separate) network thread in the connectivity implementation,
      upon initiating new sessions or detecting a session close
      via the network stack. This applies only to TCP and TLS
      This will not apply to DTLS sessions which receive no such
      indication via the network stack, but internal state
      is nonetheless cleared upon receipt of an explicit
      DTLS CLOSE_NOTIFY message.
      In addition, applications will now have the ability to
      (optionally) set a callback to be invoked upon session
      establishment and disconnections, supplying the specific
      oc_endpoint_t of the remote device along with an
      applies to DTLS, TLS and plain TCP sessions.
      Lastly, clients will have an oc_close_session() API they can
      call to tear down any open DTLS, TLS and TCP sessions.
      Change-Id: Icee7f3d6006d779b173ffaa9dd508dbbbdc327d2
      Signed-off-by: Kishen Maloor's avatarKishen Maloor <kishen.maloor@intel.com>
      Reviewed-on: https://gerrit.iotivity.org/gerrit/24943
  19. 13 Apr, 2018 1 commit
  20. 09 Apr, 2018 2 commits
  21. 15 Mar, 2018 1 commit
  22. 02 Feb, 2018 1 commit
  23. 15 Dec, 2017 1 commit
  24. 08 Oct, 2017 1 commit
  25. 22 Sep, 2017 1 commit
  26. 18 Sep, 2017 1 commit
  27. 26 Jul, 2017 1 commit
    • Kishen Maloor's avatar
      OCF 1.0 discovery, endpoints, multi-device support · 45d912ef
      Kishen Maloor authored
      This commit brings in many significant changes to the
      handling and processing of discovery requests and
      responses, and also aligns the resource architecture and
      core representations to the OCF 1.0 specification.
      It adds support for OCF 1.0 endpoints to interpret the
      the coap and coaps schemes over IPv4/v6 with platform
      neutral functions to convert IPv4/v6 addresses to/from
      strings and the ability to construct and maintain lists of
      endpoint descriptions for a remote entity by allocating
      from a pool of endpoint structures in both the
      server/client roles.
      In keeping with OCF resource model concepts of a platform
      with logical devices, this commit adds support for the
      definition of multiple virtual servers with an
      application that reside on a single platform.
      Virtual servers are bound to different ports and behave
      as independent entities, separately handling requests.
      All virtual servers expose the required set of core OCF
      resources (oic/res, oic/d, oic/con, security resources, etc.),
      but share a single oic/p resource corresponding to the underlying
      platform. Virtual servers would each have to be independently
      onboarded and provisioned in the security context in order
      for their resources to be accessed. Application resources
      are instantiated and bound to a specific logical device
      in the application, and resource handlers are made aware of
      their hosting device. This design is usually employed in
      a bridging scenario with OCF.
      The new multi_device_server/multi_device_client samples
      for Linux illustrate these concepts in action.
      Logical devices are defined using the oc_add_device() API
      and are identified by their zero based index in the order
      of oc_add_device() calls.
      Internal APIs now take the device index as the parameter.
      The interfaces to initialize and teardown
      connectivity also take device index as a parameter. The
      expectation is that implementations that wish to support
      multiple logical devices would allocate the required
      set of resources to hold multiple sets of handles, port
      numbers, addresses etc., one set for each logical device.
      A new interface to obtain the set of endpoints hosting
      a logical device must be realized in connectivity
      implementations, and is invoked in the discovery resource
      handler to populate the "eps" parameter.
      The Linux IP adapter incorporates full support for
      defining multiple logical devices by implementing the new
      interfaces, where each logical device maintains
      secured/unsecured ports over IPv6, and optionally over
      IPv4. The IP adapters for constrained OSes have been updated
      to return the list of endpoints, but continue to handle
      only a single logical device, as would be expected for
      constrained platforms.
      The build with security is NOT functional at the moment
      and has yet to be updated for OCF 1.0 security.
      However, the above changes were successfully tested for
      interoperability with IoTivity 1.3 (master) using the
      OCF 1.0 scheme and by running the simpleclient/simpleserver
      Additional notes:
      -Clients are now upon successful discovery handed a
      linked list of oc_endpoint_t structures that they may use to
      reach a server. This eliminates the oc_server_handle_t
      structure and all client APIs instead accept an oc_endpoin_t
      handle. These oc_endpoint_t structures are allocated from
      a pool, and the oc_free_server_endpoints() API may be used
      to free all server endpoints back to the poool when the client
      has no more interest to contact the server.
      -The handler for collections has been updated to include the
      “eps” property containing the list of endpoints to reach
      a referenced resource in a link.
      -The oic/d handler now returns the pid property containing
      a UUID.
      -The default OC_MAX_APP_DATA_SIZE for dynamic builds has been
      raised to 8192 bytes.
      -oc_connectivity_init() for each logical device is invoked
      through every oc_add_device() call.
      -Elimination of duplicate requests now happens by checking
      both the message id and logical device index.
      -Interfaces into the security implementation have been updated
      to mesh with the above changes, but the implementation itself
      is NOT currently functional.
      Change-Id: Iccf9e174b7d41d81eba89c010b8dbef9b090fc4e
      Signed-off-by: Kishen Maloor's avatarKishen Maloor <kishen.maloor@intel.com>
      Reviewed-on: https://gerrit.iotivity.org/gerrit/21607
  28. 20 Mar, 2017 1 commit
    • Kishen Maloor's avatar
      Add optional support for dynamic memory allocation · 4e36b13b
      Kishen Maloor authored
      * This feature allows IoTivity-Constrained to dynamically
        allocate memory from the heap on rich environments that
        provide a full C library and an allocator (Linux, Windows,
        iOS, etc.)
      * When enabled, the core framework internally invokes functions
        from the C standard library (malloc(), free(), etc.) while
        ignoring all constraints that were set in config.h.
      * This is an optional feature, and is enabled by setting
        #define OC_DYNAMIC_ALLOCATION in config.h. In addition,
        port/linux/Makefile now takes a new command-line option
        DYNAMIC=1 to include it.
        When OC_DYNAMIC_ALLOCATION is not set, the resulting build
        statically allocates all memory under the set constraints,
        as before.
      * This feature is completely transparent to both
        IoTivity-Constrained applications and port implementations.
        However, the application now has the added ability to set
        two parameters via new APIs at runtime: prescriptive
        MTU size, and maximum application data size.
        The MTU size is used to compute a maximum supported block
        size (16 - 1024 bytes), and the application data size is
        used to allocate internal buffers of that size to hold the
        entire application payload for block-wise transfers, separate
        responses and resource observations.
      * Modified server_block_linux and client_block_linux to
        demonstrate the use of these APIs: oc_set_mtu_size()
        and oc_set_max_app_data_size().
      * Cleaned up some parts of the internal flow to fix up
        previously hidden issues (when all memory was statically
      Change-Id: I50fba434ea2073371b27c260569ed147d22e2804
      Signed-off-by: Kishen Maloor's avatarKishen Maloor <kishen.maloor@intel.com>
      Reviewed-on: https://gerrit.iotivity.org/gerrit/17877Reviewed-by: default avatarFlavio Ceolin <flavio.ceolin@intel.com>
      Tested-by: default avatarFlavio Ceolin <flavio.ceolin@intel.com>
  29. 14 Mar, 2017 2 commits
  30. 07 Mar, 2017 1 commit
  31. 01 Mar, 2017 2 commits
  32. 27 Feb, 2017 1 commit
    • Kishen Maloor's avatar
      Update Linux IP adapter · aaa67bba
      Kishen Maloor authored
      * On the server-side, enable OCF discovery over the IPv6
        realm-local and site-local scopes, in addition to the
        link-local scope.
      * Declare IPv6/v4 multicast addresses in binary form instead
        of a string. This eliminates the need to use inet_pton()
        to do the translation.
      * Add error check from sendto() in oc_send_buffer().
      * Close IPv4 sockets in oc_connectivity_shutdown().
      Change-Id: I6d1cb7dae4494aa3cef7251f6000ea12346d0a74
      Signed-off-by: Kishen Maloor's avatarKishen Maloor <kishen.maloor@intel.com>
      Reviewed-on: https://gerrit.iotivity.org/gerrit/17357
  33. 19 Feb, 2017 1 commit
  34. 17 Feb, 2017 1 commit
  35. 27 Jan, 2017 1 commit
    • Kishen Maloor's avatar
      Update the connectivity interface · 093da610
      Kishen Maloor authored
      * Added new transport flag for IPV4 (and renamed IP to IPV6).
      * Renamed transport flag MULTICAST to DISCOVERY.
      * Removed transport flag IPSP (since it would simply talk through an IP
      * Renamed oc_send_multicast_message() to oc_send_discovery_request().
        This is more general and aligned to its purpose.
      * Updated all connectivity implementations and other impacted modules.
      Change-Id: Ic5c659bf5e0aeb27327a6bf44203de386d388928
      Signed-off-by: Kishen Maloor's avatarKishen Maloor <kishen.maloor@intel.com>
      Reviewed-on: https://gerrit.iotivity.org/gerrit/16849