Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for windows platform #78

Merged
merged 103 commits into from
Jul 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
2d6f526
src/net.c: bugfix: remove observer on cancel before invoking resource…
obgm Feb 26, 2016
efa6415
prng.c: move platform-specific PRNG invocation into separate files
obgm Feb 24, 2016
ff74ebe
coap_io.c: Moved to platform/posix/
obgm Feb 24, 2016
d1e3ecd
net.[hc]: allow multiple endpoints in single context
obgm Feb 25, 2016
fb1054d
run.[hc]: Add new functions for main loop
obgm Feb 26, 2016
237c60a
configure.ac: Test for sys/select.h
obgm Feb 26, 2016
5ffe22c
examples/*.c: Use coap_run*() in examples
obgm Feb 26, 2016
ab24b37
Updated tinydtls
obgm Mar 8, 2016
6be0340
uri.[hc]: improved support for 'coaps' URI scheme
obgm Mar 8, 2016
6521a5d
pdu.h: added coaps default port
obgm Mar 8, 2016
5825e63
net.h: added missing prototypes
obgm Mar 8, 2016
ef9ce64
address.h: added missing includes for POSIX
obgm Mar 8, 2016
0320739
coap_io.h: define flag to indicate that data is available
obgm Mar 8, 2016
c2e4660
coap_io.c: make socket non-blocking for platform posix
obgm Mar 8, 2016
1c99d22
dtls: added initial boilerplate for dtls support
obgm Mar 8, 2016
4eef597
dtls: create DTLS session for outgoing NON messages
obgm Mar 8, 2016
66cf06a
dtls: Added basic keystore implementation
obgm Mar 16, 2016
452407c
net.[hc]: Changed interface for coap_handle_message()
obgm Mar 16, 2016
6adf25f
coap_dtls.[hc]: improved session handling
obgm Mar 16, 2016
4672846
coap_event.[hc]: pass library events to application
obgm Mar 16, 2016
2c8da35
net.c: bugfix: call coap_read_endpoint() only when data available
obgm Mar 17, 2016
69f3d97
coap_dtls.c: bugfix: set correct error code for wrong credentials
obgm Mar 22, 2016
ec89b06
client.c: added command line options for DTLS credentials
obgm Mar 22, 2016
42aa0d7
coap-server.c: DTLS server with default credentials for PSK
obgm Mar 22, 2016
2633479
net.c: moved DTLS-specific code to coap_send_impl()
obgm Mar 29, 2016
3427bb2
libcoap-1.{map,sym}: updated map files
obgm Mar 29, 2016
ae8a68c
ext/tinydtls: updated to HEAD of branch develop
obgm Mar 29, 2016
0909d1d
coap_keystore.h: bugfix: do not expose coap_config.h in public API
obgm Mar 30, 2016
ecadf05
configure.ac: bugfix: removed empty AC_SEARCH_LIBS
obgm Mar 30, 2016
b223d9f
coap_dtls.c: Discard DTLS session on fatal error
obgm Mar 31, 2016
ca0f3f3
plaform/posix/{coap_io,run}.c: fixed LWS in source
obgm Apr 5, 2016
45349d5
Makefile.am: bugfix: replaced makefile variable by m4-expanded symbol
obgm Apr 8, 2016
96d572d
prng.c: move platform-specific PRNG invocation into separate files
obgm Feb 24, 2016
cfdfd03
coap_io.c: Moved to platform/posix/
obgm Feb 24, 2016
3d3eb02
net.[hc]: allow multiple endpoints in single context
obgm Feb 25, 2016
63f5141
run.[hc]: Add new functions for main loop
obgm Feb 26, 2016
cadfe3d
configure.ac: Test for sys/select.h
obgm Feb 26, 2016
d42aa27
examples/*.c: Use coap_run*() in examples
obgm Feb 26, 2016
5180ae3
Updated tinydtls
obgm Mar 8, 2016
3a127a3
uri.[hc]: improved support for 'coaps' URI scheme
obgm Mar 8, 2016
9a538f4
pdu.h: added coaps default port
obgm Mar 8, 2016
c031e99
net.h: added missing prototypes
obgm Mar 8, 2016
3d7c0d2
address.h: added missing includes for POSIX
obgm Mar 8, 2016
73aa574
coap_io.h: define flag to indicate that data is available
obgm Mar 8, 2016
009934e
coap_io.c: make socket non-blocking for platform posix
obgm Mar 8, 2016
39698f7
dtls: added initial boilerplate for dtls support
obgm Mar 8, 2016
e3b8275
dtls: create DTLS session for outgoing NON messages
obgm Mar 8, 2016
90fb5fd
dtls: Added basic keystore implementation
obgm Mar 16, 2016
655e84c
net.[hc]: Changed interface for coap_handle_message()
obgm Mar 16, 2016
578b38d
coap_dtls.[hc]: improved session handling
obgm Mar 16, 2016
b734208
coap_event.[hc]: pass library events to application
obgm Mar 16, 2016
a3059ab
net.c: bugfix: call coap_read_endpoint() only when data available
obgm Mar 17, 2016
205efae
coap_dtls.c: bugfix: set correct error code for wrong credentials
obgm Mar 22, 2016
094f733
client.c: added command line options for DTLS credentials
obgm Mar 22, 2016
022238d
coap-server.c: DTLS server with default credentials for PSK
obgm Mar 22, 2016
999a46d
net.c: moved DTLS-specific code to coap_send_impl()
obgm Mar 29, 2016
f6472f8
libcoap-1.{map,sym}: updated map files
obgm Mar 29, 2016
4e75cc0
ext/tinydtls: updated to HEAD of branch develop
obgm Mar 29, 2016
b34e56c
coap_keystore.h: bugfix: do not expose coap_config.h in public API
obgm Mar 30, 2016
4b9b38c
configure.ac: bugfix: removed empty AC_SEARCH_LIBS
obgm Mar 30, 2016
5ebd003
coap_dtls.c: Discard DTLS session on fatal error
obgm Mar 31, 2016
c217ff6
plaform/posix/{coap_io,run}.c: fixed LWS in source
obgm Apr 5, 2016
89bf457
Makefile.am: bugfix: replaced makefile variable by m4-expanded symbol
obgm Apr 8, 2016
b911b3e
Merge branch 'dtls' of github.com:obgm/libcoap into dtls
obgm Apr 8, 2016
d77b4b0
coap_dtls.[hc]: Encapsulate DTLS log level manipulation
obgm Apr 15, 2016
5f9579b
client.c: Pass coap log level to DTLS library
obgm Apr 15, 2016
d3d48a9
libcoap-1.{map,sym}: Updated map file
obgm Apr 15, 2016
a692789
net.[hc]: Added storage for application-specific data to coap_context_t
obgm Apr 26, 2016
0494efc
Updated .gitignore to ignore the *.o *.lo files in the subfolders of …
malinengineer Jun 15, 2016
c96d47d
updated the .gitignore file to ignore 'tags' files generated by ctags…
malinengineer Jun 15, 2016
3038c7c
Updated .gitmodules to ignore untracked files in the 'tinydtls' submo…
malinengineer Jun 15, 2016
f64e72b
Merge pull request #34 from malinengineer/dtls
obgm Jun 15, 2016
48e694f
Merge branch 'dtls' of github.com:obgm/libcoap into dtls
obgm Jun 15, 2016
5381706
coap_dtls.c: Fixed dummy functions for --disable-dtls build
obgm Jul 18, 2016
dc91eb9
client.c: allow user name and key to be empty
obgm Apr 12, 2017
b5ffd36
Updated tinydtls to version 0.8.6
obgm Apr 12, 2017
1ba4fd0
Cross compilation issue (#31)
invalid-email-address Apr 22, 2016
2586304
tinydtls: updated to latest version with cross-compilation fixes
obgm Apr 18, 2017
9b647d5
Add visual studio 2015 solution and project files for building libcoa…
jcmichelou May 5, 2017
f25f962
Add win32 binaries for the CUnit library (as a DLL because of LGPL) s…
jcmichelou May 5, 2017
3ee4552
Merge fix to coap_config.h.contiki from PR #47.
jcmichelou May 5, 2017
9b3cf89
Use crypto secure version of rand to generate the message ids on wind…
jcmichelou May 5, 2017
9e8a693
Fix typo on ipv6 notation for the multicast group address for coap.
jcmichelou May 5, 2017
3042a28
Fix a problem with the use of control structures in sendmsg / recvmsg…
jcmichelou May 6, 2017
e2c2dc5
Make LIBCOAP_PACKAGE_XXX macros usables in code
jcmichelou May 6, 2017
95d8e2c
Use C-style prototypes for coap_statup and coap_cleanup
jcmichelou May 6, 2017
ba68ba8
Do not make exported symbols different between release and debug buil…
jcmichelou May 7, 2017
68c0dba
Add Debug DLL and Release DLL configurations in visual studio solutio…
jcmichelou May 7, 2017
53eb564
Change name of debug dll to -1d suffix under windows.
jcmichelou May 7, 2017
78ed10b
Add explicit platform-independent support for dual-stacked sockets (i…
jcmichelou May 8, 2017
df86b74
Add configurations for x64 platform. Note that testdriver won't build…
jcmichelou May 12, 2017
3102646
Rename project files for coap-rd to coap-rd instead of coap-rp.
jcmichelou May 12, 2017
ab958ca
Activate dual-stacked code first only on windows since on linux it is…
jcmichelou May 12, 2017
fb21450
Added x64 build of CUnit.
jcmichelou May 17, 2017
85ca4aa
Fix size_t downcast to unsigned long warning.
jcmichelou May 17, 2017
ae04e00
Remove CUnit headers and prebuilt shared libraries. The testdriver pr…
jcmichelou Jun 3, 2017
78148d0
Merge develop into win32
jcmichelou Jun 10, 2017
60dced7
Modify include path in visual studio project files to match changes i…
jcmichelou Jun 10, 2017
8d0223f
Merge branch 'win32' of https://github.com/spinetix/libcoap into win32
jcmichelou Jun 10, 2017
fdf3dab
Activate dual-stacked BSD socket logic on linux after validation.
jcmichelou Jun 10, 2017
1c79a4b
Merge remote-tracking branch 'remotes/obgm/dtls' into dtls-dev with t…
jcmichelou Jun 12, 2017
b2ab881
Fix the result of dtls branch merge so that all the examples work (DT…
jcmichelou Jun 13, 2017
5b1a8f6
Implement coap_session_t concept for POSIX.
jcmichelou Jun 15, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ stamp-h1
.libs/
libcoap*.la
libcoap*.pc
src/.deps/
src/.dirstamp
src/.libs/
src/*.o
src/*.lo
src/**/.deps/
src/**/.dirstamp
src/**/.libs/
src/**/*.o
src/**/*.lo

# the doc/ folder
doc/Doxyfile
Expand Down Expand Up @@ -62,3 +62,7 @@ include/coap/coap.h
tests/.deps
tests/testdriver
tests/*.o

# ctags - Sublime plugin
tags
.tags*
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "ext/tinydtls"]
path = ext/tinydtls
url = https://git.eclipse.org/r/tinydtls/org.eclipse.tinydtls
ignore = dirty
8 changes: 6 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Makefile.am for libcoap
#
# Copyright (C) 2010-2015 Olaf Bergmann <[email protected]>
# Copyright (C) 2010-2016 Olaf Bergmann <[email protected]>
# (C) 2015-2016 Carsten Schoenert <[email protected]>
#
# This file is part of the CoAP C library libcoap. Please see README and
Expand Down Expand Up @@ -29,7 +29,7 @@ EXTRA_DIST = \

AM_CFLAGS = -I$(top_builddir)/include/coap -I$(top_srcdir)/include/coap $(WARNING_CFLAGS) -std=c99

SUBDIRS = . $(DOC_DIR) tests examples
SUBDIRS = $(subdirs) . $(DOC_DIR) tests examples

## Define a libtool archive target "libcoap-@[email protected]", with
## @LIBCOAP_API_VERSION@ substituted into the generated Makefile at configure
Expand All @@ -52,6 +52,8 @@ libcoap_@LIBCOAP_API_VERSION@_la_SOURCES = \
src/async.c \
src/block.c \
src/coap_io.c \
src/coap_dtls.c \
src/coap_event.c \
src/coap_time.c \
src/debug.c \
src/encode.c \
Expand All @@ -77,6 +79,8 @@ libcoap_include_HEADERS = \
$(top_srcdir)/include/coap/block.h \
$(top_builddir)/include/coap/coap.h \
$(top_srcdir)/include/coap/coap_io.h \
$(top_srcdir)/include/coap/coap_dtls.h \
$(top_srcdir)/include/coap/coap_event.h \
$(top_srcdir)/include/coap/coap_time.h \
$(top_srcdir)/include/coap/debug.h \
$(top_srcdir)/include/coap/encode.h \
Expand Down
3 changes: 2 additions & 1 deletion coap_config.h.contiki
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@

#define HAVE_STRNLEN 1
#define HAVE_SNPRINTF 1
#define HAVE_STRINGS_H 1

/* there is no file-oriented output */
#define COAP_DEBUG_FD NULL
Expand Down Expand Up @@ -120,7 +121,7 @@ typedef void FILE;
# endif /* UIP_CONF_BYTE_ORDER */
#endif /* BYTE_ORDER */

/* Define assert() as emtpy directive unless HAVE_ASSERT_H is given. */
/* Define assert() as empty directive unless HAVE_ASSERT_H is given. */
#ifndef HAVE_ASSERT_H
# define assert(x)
#endif
Expand Down
111 changes: 111 additions & 0 deletions coap_config.h.windows
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
#ifndef _COAP_CONFIG_H_
#define _COAP_CONFIG_H_

#if defined(_WIN32)

/* Define to 1 if you have <ws2tcpip.h> header file. */
#define HAVE_WS2TCPIP_H 1

/* Define to 1 if you have <winsock2.h> header file. */
#define HAVE_WINSOCK2_H 1

/* Define to 1 if you have the <assert.h> header file. */
#define HAVE_ASSERT_H 1

/* Define to 1 if you have the `getaddrinfo' function. */
#define HAVE_GETADDRINFO 1

/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1

/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1

/* Define to 1 if you have the `malloc' function. */
#define HAVE_MALLOC 1

/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1

/* Define to 1 if you have the `memset' function. */
#define HAVE_MEMSET 1

/* Define to 1 if you have the `select' function. */
#define HAVE_SELECT 1

/* Define to 1 if you have the `socket' function. */
#define HAVE_SOCKET 1

/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1

/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1

/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1

/* Define to 1 if you have the `strnlen' function. */
#define HAVE_STRNLEN 1

/* Define to 1 if you have the `strrchr' function. */
#define HAVE_STRRCHR 1

/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1

/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1

/* Define to 1 if you have the <time.h> header file. */
#define HAVE_TIME_H 1

#if defined(_MSC_VER) && (_MSC_VER < 1900) && !defined(snprintf)
#define snprintf _snprintf
#endif

/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "[email protected]"

/* Define to the full name of this package. */
#define PACKAGE_NAME "libcoap"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "libcoap 4.1.2"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "libcoap"

/* Define to the home page for this package. */
#define PACKAGE_URL "https://libcoap.net/"

/* Define to the version of this package. */
#define PACKAGE_VERSION "4.1.2"

/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1

/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
# define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
/* # undef WORDS_BIGENDIAN */
# endif
#endif

/* Define this to 1 for ancillary data on MacOS */
/* #undef __APPLE_USE_RFC_3542 */

/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */

/* Define to `int' if <sys/types.h> does not define. */
/* #undef ssize_t */

#endif

#endif /* _COAP_CONFIG_H_ */
35 changes: 30 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,14 @@ if test "x$build_examples" = "xyes" -a "x$build_documentation" = "xyes"; then
fi
AM_CONDITIONAL(BUILD_EXAMPLES, [test "x$build_examples" = "xyes"])

# __dtls__
AC_ARG_ENABLE([dtls],
[AC_HELP_STRING([--enable-dtls],
[Enable DTLS provided by tinydtls (default=yes)])],
[build_dtls="$enableval"],
[build_dtls="yes"])
AM_CONDITIONAL(BUILD_DTLS, [test "x$build_dtls" = "xyes"])

# end configure options
#######################

Expand Down Expand Up @@ -333,6 +341,18 @@ AC_SEARCH_LIBS([inet_ntop], [nsl])
# Check if clock_gettime() requires librt, when available
AC_SEARCH_LIBS([clock_gettime], [rt])

# Add tinydtls to build flags if selected
if test "x$build_dtls" = "xyes" ; then
if test -d "$srcdir/ext/tinydtls"; then
AC_CONFIG_SUBDIRS([ext/tinydtls])
AC_DEFINE(HAVE_LIBTINYDTLS, [1], [Define if the system has libtinydtls])
CPPFLAGS="$CPPFLAGS -I \$(top_srcdir)/ext/tinydtls"
LDFLAGS="$LDFLAGS -L\$(top_srcdir)/ext/tinydtls -ltinydtls"
else
build_dtls="no"
fi
fi

AC_MSG_CHECKING([operating system])

# Set up here some extra platform depended defines and variables.
Expand All @@ -341,7 +361,7 @@ AC_MSG_CHECKING([operating system])
case $host in
*-linux* | *-uclinux*)
AC_MSG_RESULT([Linux])
ADDITIONAL_CFLAGS="-D_GNU_SOURCE -DWITH_POSIX"
ADDITIONAL_CFLAGS="-D_GNU_SOURCE"

# Not yet needed but if some code definitions have to depend on the platform.
#AC_DEFINE(OS_LINUX, 1, [Linux backend])
Expand All @@ -353,12 +373,12 @@ case $host in
# set _XOPEN_SOURCE and _XOPEN_SOURCE_EXTENDED to enable XPG4v2 (POSIX 2004)
# set __EXTENSION__ to shut up feature test macros that restrict -std=c99
# to only C99 (and nothing newer)
ADDITIONAL_CFLAGS="-D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=600 -D__EXTENSIONS__=1 -DWITH_POSIX"
ADDITIONAL_CFLAGS="-D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=600 -D__EXTENSIONS__=1"
;;

*-darwin*)
AC_MSG_RESULT([Darwin])
ADDITIONAL_CFLAGS="-D_GNU_SOURCE -DWITH_POSIX"
ADDITIONAL_CFLAGS="-D_GNU_SOURCE"

AC_DEFINE(__APPLE_USE_RFC_3542, 1, [Define this to 1 for ancillary data on MacOS])

Expand All @@ -369,12 +389,12 @@ case $host in

*-freebsd1*)
AC_MSG_RESULT([FreeBSD-1x])
ADDITIONAL_CFLAGS="-D_GNU_SOURCE -DWITH_POSIX"
ADDITIONAL_CFLAGS="-D_GNU_SOURCE"
;;

*kfreebsd*)
AC_MSG_RESULT([kFreeBSD])
ADDITIONAL_CFLAGS="-D_GNU_SOURCE -DWITH_POSIX"
ADDITIONAL_CFLAGS="-D_GNU_SOURCE"
;;

*)
Expand Down Expand Up @@ -444,3 +464,8 @@ if test "x$build_examples" = "xyes"; then
else
AC_MSG_RESULT([ build examples : "no"])
fi
if test "x$build_dtls" = "xyes"; then
AC_MSG_RESULT([ build with DTLS support : "yes"])
else
AC_MSG_RESULT([ build with DTLS support : "no"])
fi
Loading