Sfoglia il codice sorgente

Merge branch '0.2' of https://github.com/open62541/open62541 into 0.2

ichrispa 8 anni fa
parent
commit
9fcce200cb

+ 26 - 0
doc/building.rst

@@ -87,6 +87,32 @@ Building on OS X
 
 Follow Ubuntu instructions without the ``apt-get`` commands as these are taken care of by the above packages.
 
+Building on OpenBSD
+-------------------
+The procedure below works on OpenBSD 5.8 with gcc version 4.8.4, cmake version 3.2.3 and Python version 2.7.10.
+
+- Install a recent gcc, python and cmake:
+
+.. code-block:: bash
+   
+   pkg_add gcc python cmake
+
+- Tell the system to actually use the recent gcc (it gets installed as egcc on OpenBSD): 
+
+.. code-block:: bash
+   
+   export CC=egcc CXX=eg++
+
+- Now procede as described for Ubuntu/Debian:
+
+.. code-block:: bash
+
+   cd open62541
+   mkdir build
+   cd build
+   cmake ..
+   make
+
 Build Options
 -------------
 

+ 1 - 1
doc/introduction.rst

@@ -54,7 +54,7 @@ Getting Help
 For discussion and help besides this documentation, you can reach the open62541 community via
 
 - the `mailing list <https://groups.google.com/d/forum/open62541>`_
-- our `IRC channe <http://webchat.freenode.net/?channels=%23open62541>`_
+- our `IRC channel <http://webchat.freenode.net/?channels=%23open62541>`_
 - the `bugtracker <https://github.com/open62541/open62541/issues>`_
 
 Contributing

File diff suppressed because it is too large
+ 6 - 6
doc/tutorial_noderelations.rst


+ 1 - 1
doc/tutorial_server_firstSteps.rst

@@ -6,7 +6,7 @@ compiling the examples, you need a compiler (MS Visual Studio 2015 or newer,
 GCC, Clang and MinGW32 are all known to be working). The compilation
 instructions are given for GCC but should be straightforward to adapt.
 
-It will also be very helpfull to install an OPC UA Client with a graphical
+It will also be very helpful to install an OPC UA Client with a graphical
 frontend, such as UAExpert by Unified Automation. That will enable you to
 examine the information model of any OPC UA server.
 

+ 19 - 19
include/ua_connection.h

@@ -120,28 +120,28 @@ void UA_EXPORT UA_Connection_deleteMembers(UA_Connection *connection);
 
 /**
  * EndpointURL Helper
- * ^^^^^^^^^^^^^^^^^^
- */
-
-/**
- * Split the given endpoint url into hostname and port
+ * ^^^^^^^^^^^^^^^^^^ */
+/* Split the given endpoint url into hostname and port
  * @param endpointUrl The endpoint URL to split up
- * @param hostname the target array for hostname. Has to be at least 256 size. If an IPv6 address is given, hostname contains e.g. '[2001:0db8:85a3::8a2e:0370:7334]'
+ * @param hostname the target array for hostname. Has to be at least 256 size.
+ *        If an IPv6 address is given, hostname contains e.g.
+ *        '[2001:0db8:85a3::8a2e:0370:7334]'
  * @param port set to the port of the url or 0
- * @param path pointing to the end of given endpointUrl or to NULL if no path given. The starting '/' is NOT included in path
- * @return UA_STATUSCODE_BADOUTOFRANGE if url too long, UA_STATUSCODE_BADATTRIBUTEIDINVALID if url not starting with 'opc.tcp://', UA_STATUSCODE_GOOD on success
- */
-UA_StatusCode UA_EXPORT UA_EndpointUrl_split(const char *endpointUrl, char *hostname, UA_UInt16 * port, const char ** path);
-
-/**
- * Convert given byte string to a number. Returns the number of valid digits.
- * Stops if a non-digit char is found and returns the number of digits up to that point.
- * @param buf
- * @param buflen
- * @param number
- * @return
+ * @param path pointing to the end of given endpointUrl or to NULL if no
+ *        path given. The starting '/' is NOT included in path
+ * @return UA_STATUSCODE_BADOUTOFRANGE if url too long,
+ *         UA_STATUSCODE_BADATTRIBUTEIDINVALID if url not starting with
+ *         'opc.tcp://', UA_STATUSCODE_GOOD on success
  */
-size_t UA_EXPORT UA_readNumber(UA_Byte *buf, size_t buflen, UA_UInt32 *number);
+UA_StatusCode UA_EXPORT
+UA_EndpointUrl_split(const char *endpointUrl, char *hostname,
+                     UA_UInt16 * port, const char ** path);
+
+/* Convert given byte string to a positive number. Returns the number of valid
+ * digits. Stops if a non-digit char is found and returns the number of digits
+ * up to that point. */
+size_t UA_EXPORT
+UA_readNumber(UA_Byte *buf, size_t buflen, UA_UInt32 *number);
 
 #ifdef __cplusplus
 } // extern "C"

+ 4 - 1
plugins/ua_network_tcp.c

@@ -42,13 +42,16 @@
 # ifdef __QNX__
 #  include <sys/socket.h>
 # endif
+# ifdef __OpenBSD__
+#  include <sys/socket.h>
+# endif
 # ifndef __CYGWIN__
 #  include <netinet/tcp.h>
 # endif
 #endif
 
 /* unsigned int for windows and workaround to a glibc bug */
-#if defined(_WIN32) || (defined(__GNU_LIBRARY__) && (__GNU_LIBRARY__ <= 6) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ < 16))
+#if defined(_WIN32) || defined(__OpenBSD__) || (defined(__GNU_LIBRARY__) && (__GNU_LIBRARY__ <= 6) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ < 16))
 # define UA_fd_set(fd, fds) FD_SET((unsigned int)fd, fds)
 # define UA_fd_isset(fd, fds) FD_ISSET((unsigned int)fd, fds)
 #else

+ 3 - 0
plugins/ua_network_udp.c

@@ -24,6 +24,9 @@
 #ifdef __QNX__
 #include <sys/socket.h>
 #endif
+#ifdef __OpenBSD__
+#include <sys/socket.h>
+#endif 
 # define CLOSESOCKET(S) close(S)
 
 #define MAXBACKLOG 100

+ 1 - 1
src/ua_connection.c

@@ -113,7 +113,7 @@ UA_Connection_completeMessages(UA_Connection *connection, UA_ByteString * UA_RES
         retval = UA_ByteString_allocBuffer(&connection->incompleteMessage, incomplete_length);
         if(retval != UA_STATUSCODE_GOOD)
             goto cleanup;
-        memcpy(&connection->incompleteMessage.data, &message->data[complete_until], incomplete_length);
+        memcpy(connection->incompleteMessage.data, &message->data[complete_until], incomplete_length);
         message->length = complete_until;
     }