Commit Graph
30 Commits
Author SHA1 Message Date
Jon Shallow c237b15b16 Correct Disable TCP for TLS and Windows
Makefile.am:

include coap_tcp_internal.h in EXTRA_DIST

libcoap-2.map
libcoap-2.sym:

Don't expose previously static coap_socket_format_errno().

src/coap_gnutls.c:
src/coap_openssl.c:
src/coap_tinydtls.c:

Correct ENABLE_TCP (never defined) to !COAP_DISABLE_TCP.
Conditionally compile in TLS code as appropriate.

src/coap_io.c:

Correct #endif description.

src/coap_session.c:

Conditionally compile in TLS code as appropriate.

src/coap_tcp.c

Merge in appropriate parts of https://github.com/obgm/libcoap/pull/396 and
https://github.com/obgm/libcoap/pull/345 fixes.

include/coap2/coap_tcp.h:
include/coap2/coap_tcp_internal.h:

Rename include/coap2/coap_tcp.h to include/coap2/coap_tcp_internal.h and
remove reference to coap_tcp_is_supported().

include/coap2/coap.h.in:

Remove reference to coap_tcp.h.

coap_config.h.windows:

Include #define COAP_DISABLE_TCP 0.

include/coap2/coap.h.windows:

Reorder #includes

include/coap2/coap_internal.h:

Add #include coap_tcp_internal.h

include/coap2/coap_io.h:

Add in definition of coap_tcp_is_supported().

win32/libcoap.vcxproj:
win32/libcoap.vcxproj.filters:

Include src/coap_tcp.c and include/coap2/coap_tcp_internal.h.
2020-01-16 15:17:10 +00:00
Jon Shallow d7055d16d8 Update win32 builds
win32/libcoap.vcxproj:
win32/libcoap.vcxproj.filters:

Include coap_mbedtls.c in the files
2020-01-16 09:38:43 +00:00
Jon Shallow 4dec5225c0 Update Windows projects to VS independent.
win32/coap-client/coap-client.vcxproj:
win32/coap-rd/coap-rd.vcxproj:
win32/coap-server/coap-server.vcxproj:
win32/install/install.vcxproj:
win32/libcoap.vcxproj:
win32/testdriver/testdriver.vcxproj:

Update WindowsTargetPlatformVersion to $(LatestTargetPlatformVersion)
and PlatformToolset to $(DefaultPlatformToolset).
2019-09-23 10:21:32 +01:00
Jon Shallow c5ab99369f Fix Windows builds
coap_config.h.windows:

Windows has struct cmsghdr so use it.
Update libcoap versions.

include/coap2/coap.h.windows:

Update libcoap versions.
Bring in line with build include/coap2/coap.h.

include/coap2/coap_session.h:

Include coap_forward_decls.h so things build correctly.

win32/libcoap.vcxproj:
win32/libcoap.vcxproj.filters:

Add in missing include files.
2019-09-12 11:49:26 +01:00
Jon Shallow 2900f72a64 Make coap_subscription_t and coap_endpoint_t opaque to applications
include/coap2/coap_subscribe_internal.h and
include/coap2/coap_session_internal.h contain the information not exposed
to applications.

This internal information was moved out of the respective
include/coap2/subscribe.h and include/coap2/coap_session.h files comprising of
the coap_subscription_t and coap_endpoint_t definitions.

To ease inter .h file dependencies, a new file
include/coap2/coap_forward_decls.h is added to include forward declarations
for both libcoap and applications.

Makefile.am:

Include include/coap2/coap_*internal.h as files for distribution, but not
installed for applications to use.
Include include/coap2/coap_forward_decls.h, so it is installed for
applications.

include/coap2/coap.h.in:

Include "coap_forward_decls.h"

include/coap2/coap_forward_decls.h: (New)

Forward declare structures and typedef the structures defined in
coap_internal.h.

include/coap2/coap_internal.h: (New)

Includes all the required #include files that libcoap internally needs.

include/coap2/coap_session_internal.h: (New)

Include the coap_endpoint_t information taken from
include/coap2/coap_session.h.

include/coap2/coap_session.h:

Remove coap_endpoint_t definition.

include/coap2/lwippools.h:

Add in coap_forward_decls.h and coap_internal.h to handle the LwIP memory
allocations.

include/coap2/resource.h:

Add in "block.h" to allow things to build.

include/coap2/coap_subscribe_internal.h: (New)

Include the coap_subscription_t information taken from
include/coap2/subscribe.h.

include/coap2/subscribe.h:

Remove coap_subscription_t definition.

libcoap-2.map:
libcoap-2.sym:

Updated, removing coap_subscription_init().

src/address.c:
src/asyn.c:
src/block.c:
src/coap_debug.c:
src/coap_event.c:
src/coap_gnutls.c:
src/coap_hashkey.c:
src/coap_io.c:
src/coap_io_lwip.c:
src/coap_notls.c:
src/coap_openssl.c:
src/coap_session.c:
src/coap_time.c:
src/coap_tinydtls.c:
src/encode.c:
src/mem.c:
src/net.c:
src/option.c:
src/pdu.c:
src/resource.c:
src/str.c:
src/subscribe.c:
src/uri.c:

Add in '#include "coap_internal.h"' to the source files.
Remove other libcoap #include files.

win32/libcoap.vcxproj:
win32/libcoap.vcxproj.filters:

Update for Windows build (not tested).

examples/contiki/server.c:
src/coap_io.c:

Remove knowledge of endpoint from the server and update Contiki's
version of coap_run_once() to do the work instead.

====
Other structures (plus some internal required #defines) will follow as
separate PRs.
2019-09-03 11:59:07 +01:00
Jean-Claude Michelou e66b963744 win32/libcoap.props: use standard layout for OpenSSL headers 2019-03-02 22:11:13 +01:00
Olaf Bergmann 0388bb9e38 Renamed debug.[hc] to coap_debug.[hc]
Prefixing the file name with "coap_" helps avoiding a name clash
when libcoap is included as package in RIOT [1].

[1] https://github.com/RIOT-OS/RIOT
2019-01-07 00:51:10 +01:00
jcmichelou 40144769f4 Windows: repair build before release 4.2
Add coap_hashkey.c to the project.
Fix the include path option for libcoap.
Move the include files back to the "Header Files" filter after the rename.
2018-10-08 17:55:20 +02:00
Carsten Schoenert f605e1f77e Windows: \include\coap -> \include\coap2 header change 2018-10-04 12:36:26 +02:00
Jon Shallow fb72bde960 win32/coap-client/coap-client.vcxproj*: Remove references to examples/coap_list.[ch] 2018-05-17 18:58:16 +01:00
jcmichelou d27790ffa5 win32: Use libcoap-2.sym and retarget to Windows SDK version 10.0.17134. 2018-05-15 17:01:41 +02:00
jcmichelou 8f5e3beab6 win32: Change DLL version number to 2-openssl 2018-05-15 16:50:52 +02:00
jcmichelou 2c9fd4cceb win32: Do not use $(IntDir) as it confuses msbuild. 2018-05-15 16:50:51 +02:00
jcmichelou eb86b6fd4e win32: PDB file for libcoap DLL duplicated by install.
It should be installed only once, next to the DLL in bin.
2018-05-15 16:50:50 +02:00
jcmichelou a794fbd983 win32: Add configuration variables and install project for VS2017
Upgrade to VS2017. Added a property sheet with user variables to configure the
target installation directory and location of openssl library from within the
Visual Studio GUI and in a manner compatible with msbuild. This method is
inspired by the GTK project. It supports out of tree builds, and separate or
common directories for debug and release builds. The new install project copies
the library files to the selected target directory. It has all other projects
in dependency, so to build the library and utilities, you just build the
"install" target and it will take care of building the library, executable,
then copy to a tree with a unix-like structure (bin, lib, include).
Also fixes missing files in the testdriver project.
2018-05-15 16:50:49 +02:00
Jon Shallow 59d0d36b1d libcoap.vcxproj libcoap.vcxproj.filters: Stop building obsoleted hash libraries 2018-04-04 16:19:37 +01:00
jcmichelou bcfd7a0753 pdu: add support for TCP-style headers
Make coap_pdu-t independent of the header style.
Use C99 sized types when applicable.
Use transaction ids in host byte order in the library.
Make coap_pdu_t payload storage grow on demand.
Add parsing and encoding of PDUs with UDP or TCP style headers.
Adapt examples and unit tests to the new PDU format.
2017-10-21 16:11:11 +02:00
jcmichelou 9490a0c8ab Fix bug in setting the OpenSSL log level make its use consistent with tinydtls
Rename session.c and session.h to coap_session.c and coap_session.h
Use length to PSK hint and identity
Improve packet loss testing
2017-06-22 16:02:03 +02:00
jcmichelou 8353417afb Added session management with simpler DTLS lib API.
Added DTLS support with OpenSSL.
2017-06-18 20:09:47 +02:00
jcmichelou b2ab881ad4 Fix the result of dtls branch merge so that all the examples work (DTLS support not enabled yet) 2017-06-13 14:38:30 +02:00
jcmichelou 8d0223f21f Merge branch 'win32' of https://github.com/spinetix/libcoap into win32 2017-06-10 16:22:12 +02:00
jcmichelou 60dced7dfc Modify include path in visual studio project files to match changes in develop. 2017-06-10 16:20:13 +02:00
jcmichelou ae04e001aa Remove CUnit headers and prebuilt shared libraries. The testdriver project is no longer by default as part of the solution. 2017-06-03 16:07:29 +02:00
jcmichelou fb2145094f Added x64 build of CUnit. 2017-05-17 19:31:56 +02:00
jcmichelou 31026462cf Rename project files for coap-rd to coap-rd instead of coap-rp. 2017-05-12 19:54:22 +02:00
jcmichelou df86b746d6 Add configurations for x64 platform. Note that testdriver won't build unless you also have an x64 version of the CUnit library. 2017-05-12 19:50:08 +02:00
jcmichelou 53eb5640e0 Change name of debug dll to -1d suffix under windows. 2017-05-07 18:36:57 +02:00
jcmichelou 68c0dba2da Add Debug DLL and Release DLL configurations in visual studio solution to build the library as a dll for windows. 2017-05-07 18:19:46 +02:00
jcmichelou f25f962427 Add win32 binaries for the CUnit library (as a DLL because of LGPL) so the regression tests can be run on windows. 2017-05-05 20:31:57 +02:00
jcmichelou 9b647d5d05 Add visual studio 2015 solution and project files for building libcoap on windows.
Merge changes from PR #47 related to windows platform support.
Add full windows platform support including correct error checking and working regression tests and examples.
Remove need to build applications using libcoap with -DWITH_POSIX and to include coap_config.h. This applies to the examples as well.
2017-05-05 20:29:10 +02:00