diff options
| -rw-r--r-- | README.md (renamed from readme.md) | 99 |
1 files changed, 40 insertions, 59 deletions
@@ -1,7 +1,6 @@ # BobinkCOpcUa -A small C project that demonstrates OPC UA server discovery using the -[open62541](https://www.open62541.org/) library. Three programs work together: +A small C project that demonstrates OPC UA server discovery using the [open62541](https://www.open62541.org/) library. Three programs work together: - **bobink_opcua_discovery_server** — Local Discovery Server that other servers register with - **bobink_opcua_server** — a server that periodically registers itself with the LDS @@ -25,15 +24,9 @@ cd BobinkCOpcUa ### Certificates -Test certificates are pre-generated and committed under each test directory -(e.g. `tests/secure_anonymous/certs/`). Each secure test has per-identity -subdirectories (`ServerLDS/`, `ServerRegister/`, `ServerRegisterClient/`, -`Client/`) containing `cert.der` and `key.der`, plus a shared `trust/` -directory with all certificates. +Test certificates are pre-generated and committed under each test directory (e.g. `tests/secure_anonymous/certs/`). Each secure test has per-identity subdirectories (`ServerLDS/`, `ServerRegister/`, `ServerRegisterClient/`, `Client/`) containing `cert.der` and `key.der`, plus a shared `trust/` directory with all certificates. -Programs can also run without certificates (SecurityPolicy#None only) by -omitting the `certificate`, `privateKey`, and `trustStore` keys from their -config files. +Programs can also run without certificates (SecurityPolicy#None only) by omitting the `certificate`, `privateKey`, and `trustStore` keys from their config files. To generate new certificates, use `tools/generate_certificate.sh <output_dir> <name> [uri]`. @@ -44,14 +37,11 @@ cmake -B build cmake --build build --parallel ``` -open62541 is fetched from the submodule and built automatically — the first -build takes a bit longer. +open62541 is fetched from the submodule and built automatically — the first build takes a bit longer. ## Running -Start the programs in order, each in its own terminal, from the project root. -Configuration files live in `tests/` (one directory per test scenario — see -[Tests](#tests) below). The examples below use `tests/secure_user/`: +Start the programs in order, each in its own terminal, from the project root. Configuration files live in `tests/` (one directory per test scenario — see [Tests](#tests) below). The examples below use `tests/secure_user/`: ```sh # 1. Local Discovery Server @@ -75,20 +65,19 @@ build/bobink_opcua_client tests/secure_user/client.conf read-time opc.tcp://loca build/bobink_opcua_client tests/secure_user/client.conf download-cert opc.tcp://localhost:14841 server.der ``` -All three programs accept an optional log level as the last argument -(`trace`, `debug`, `info`, `warning`, `error`, `fatal`). The default is `info`. +All three programs accept an optional log level as the last argument (`trace`, `debug`, `info`, `warning`, `error`, `fatal`). The default is `info`. ## Tests Integration tests exercise four combinations of security and authentication: -| Test | Security | Auth | -|------|----------|------| -| `unsecure_anonymous` | None / None | anonymous | -| `secure_anonymous` | SignAndEncrypt / Aes256_Sha256_RsaPss | anonymous | -| `secure_user` | SignAndEncrypt / Aes256_Sha256_RsaPss | user/password | -| `secure_cert` | SignAndEncrypt / Aes256_Sha256_RsaPss | X509 certificate | -| `download_cert` | SignAndEncrypt / Aes256_Sha256_RsaPss | anonymous (download-cert) | +| Test | Security | Auth | +|----------------------|---------------------------------------|---------------------------| +| `unsecure_anonymous` | None / None | anonymous | +| `secure_anonymous` | SignAndEncrypt / Aes256_Sha256_RsaPss | anonymous | +| `secure_user` | SignAndEncrypt / Aes256_Sha256_RsaPss | user/password | +| `secure_cert` | SignAndEncrypt / Aes256_Sha256_RsaPss | X509 certificate | +| `download_cert` | SignAndEncrypt / Aes256_Sha256_RsaPss | anonymous (download-cert) | Run all tests: @@ -116,8 +105,7 @@ cmake --build build --parallel ## Configuration -Programs are configured through plain text files (`key = value`, one per line). -See the `tests/` directories for working examples. +Programs are configured through plain text files (`key = value`, one per line). See the `tests/` directories for working examples. Three authentication modes are supported via the `authMode` key: @@ -127,18 +115,13 @@ Three authentication modes are supported via the `authMode` key: ## Nodes Configuration -`bobink_opcua_server` accepts an optional nodes config file that populates -the server's address space with variable nodes. Pass it as the fourth -positional argument (before the optional log level): +`bobink_opcua_server` accepts an optional nodes config file that populates the server's address space with variable nodes. Pass it as the fourth positional argument (before the optional log level): ```sh build/bobink_opcua_server server.conf client.conf opc.tcp://localhost:14840 nodes.conf ``` -The config file only declares the node structure (name, type, access level). -Values are not specified in the config — the server assigns random values at -startup and updates them every five seconds. This is intended for testing OPC UA -monitoring and subscriptions. +The config file only declares the node structure (name, type, access level). Values are not specified in the config — the server assigns random values at startup and updates them every five seconds. This is intended for testing OPC UA monitoring and subscriptions. The file uses the same `key = value` format with dot-indexed keys: @@ -158,37 +141,35 @@ node.2.type = double[] node.2.accessLevel = read ``` -Each node gets a string NodeId in namespace 1 (`ns=1;s=<name>`). The `name` -field is also used as the display name and browse name. Array nodes are -created with 5 elements. +Each node gets a string NodeId in namespace 1 (`ns=1;s=<name>`). The `name` field is also used as the display name and browse name. Array nodes are created with 5 elements. ### Fields -| Field | Required | Description | -|-------|----------|-------------| -| `name` | yes | Display name, browse name, and string NodeId | -| `description` | no | Human-readable description | -| `type` | yes | Data type (see table below); append `[]` for a 1D array | -| `accessLevel` | yes | `read` or `readwrite` | +| Field | Required | Description | +|---------------|----------|---------------------------------------------------------| +| `name` | yes | Display name, browse name, and string NodeId | +| `description` | no | Human-readable description | +| `type` | yes | Data type (see table below); append `[]` for a 1D array | +| `accessLevel` | yes | `read` or `readwrite` | ### Supported Types -| Type name | OPC UA type | -|-----------|-------------| -| `bool` | Boolean | -| `int16` | Int16 | -| `uint16` | UInt16 | -| `int32` | Int32 | -| `uint32` | UInt32 | -| `int64` | Int64 | -| `uint64` | UInt64 | -| `float` | Float | -| `double` | Double | -| `string` | String | -| `sbyte` | SByte | -| `byte` | Byte | -| `datetime` | DateTime | -| `guid` | Guid | -| `bytestring` | ByteString | +| Type name | OPC UA type | +|--------------|-------------| +| `bool` | Boolean | +| `int16` | Int16 | +| `uint16` | UInt16 | +| `int32` | Int32 | +| `uint32` | UInt32 | +| `int64` | Int64 | +| `uint64` | UInt64 | +| `float` | Float | +| `double` | Double | +| `string` | String | +| `sbyte` | SByte | +| `byte` | Byte | +| `datetime` | DateTime | +| `guid` | Guid | +| `bytestring` | ByteString | Append `[]` to any type name for a 1D array (e.g. `double[]`, `string[]`). |
