Skip to content

Commit 329e991

Browse files
Roytakmichalvasko
authored andcommitted
server config UPDATE tree walk config
Rewrite server configuration. Adds robustness. Rollback support. Readability and scalability improved by utilizing YANG tree structure.
1 parent 82cf01c commit 329e991

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+20906
-6031
lines changed

CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,7 @@ if(ENABLE_SSH_TLS)
123123
src/server_config_util_ssh.c
124124
src/session_client_tls.c
125125
src/session_server_tls.c
126-
src/server_config_util_tls.c
127-
src/server_config_ks.c
128-
src/server_config_ts.c)
126+
src/server_config_util_tls.c)
129127
set(SSH_TLS_MACRO "#ifndef NC_ENABLED_SSH_TLS\n#define NC_ENABLED_SSH_TLS\n#endif")
130128
endif()
131129

examples/config.json

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@
88
"name": "ssh-password-auth-endpt",
99
"ssh": {
1010
"tcp-server-parameters": {
11-
"local-address": "127.0.0.1",
12-
"local-port": 10000
11+
"local-bind": [
12+
{
13+
"local-address": "127.0.0.1",
14+
"local-port": 10000
15+
}
16+
]
1317
},
1418
"ssh-server-parameters": {
1519
"server-identity": {
@@ -32,7 +36,9 @@
3236
"user": [
3337
{
3438
"name": "admin",
35-
"password": "$0$admin"
39+
"password": {
40+
"hashed-password": "$0$admin"
41+
}
3642
}
3743
]
3844
}
@@ -44,8 +50,12 @@
4450
"name": "ssh-pubkey-auth-endpt",
4551
"ssh": {
4652
"tcp-server-parameters": {
47-
"local-address": "127.0.0.1",
48-
"local-port": 10001
53+
"local-bind": [
54+
{
55+
"local-address": "127.0.0.1",
56+
"local-port": 10001
57+
}
58+
]
4959
},
5060
"ssh-server-parameters": {
5161
"server-identity": {

examples/server.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,13 @@ init(const char *unix_socket_path, struct ly_ctx **context, struct nc_pollsessio
244244
}
245245
}
246246

247+
/* since nc_server_config_setup_data() requires all implicit nodes to be present and the example
248+
* configuration data does not contain all of them, we need to add them */
249+
rc = lyd_new_implicit_tree(config, LYD_IMPLICIT_NO_STATE, NULL);
250+
if (rc) {
251+
ERR_MSG_CLEANUP("Adding implicit nodes to the example configuration data failed.\n");
252+
}
253+
247254
/* apply the example configuration data to the server */
248255
rc = nc_server_config_setup_data(config);
249256
if (rc) {

0 commit comments

Comments
 (0)