Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
celllframe-node
Manage
Activity
Members
Labels
Plan
Issues
5
Issue boards
Milestones
Code
Merge requests
24
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cellframe
celllframe-node
Commits
f82a3c7d
Commit
f82a3c7d
authored
4 years ago
by
cellframe
Browse files
Options
Downloads
Patches
Plain Diff
[+] Builtin DNS server support
parent
df67987e
No related branches found
No related tags found
1 merge request
!89
features-3330
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dist/share/configs/cellframe-node.cfg.tpl
+1
-0
1 addition, 0 deletions
dist/share/configs/cellframe-node.cfg.tpl
sources/main.c
+20
-8
20 additions, 8 deletions
sources/main.c
with
21 additions
and
8 deletions
dist/share/configs/cellframe-node.cfg.tpl
100644 → 100755
+
1
−
0
View file @
f82a3c7d
...
...
@@ -17,6 +17,7 @@ node_addr_type=auto
enabled=
{
SERVER_ENABLED
}
listen_address=
{
SERVER_ADDR
}
listen_port_tcp=
{
SERVER_PORT
}
builtin_dns_enabled=true #
{
BUILTIN_DNS_ENABLED
}
# Mempool
[mempool]
...
...
This diff is collapsed.
Click to expand it.
sources/main.c
+
20
−
8
View file @
f82a3c7d
/*
* Authors:
* Dmitriy A. Ge
a
rasimov <kahovski@gmail.com>
* Dmitriy A. Gerasimov <kahovski@gmail.com>
* DeM Labs Inc. https://demlabs.net
* DeM Labs Open source community https://github.com/demlabsinc
* Copyright (c) 2017-2019
...
...
@@ -58,6 +58,7 @@
#include
"dap_server.h"
#include
"dap_http.h"
#include
"dap_http_folder.h"
#include
"dap_dns_server.h"
#include
"dap_events.h"
...
...
@@ -221,6 +222,13 @@ int main( int argc, const char **argv )
return
-
4
;
}
// New event loop init
dap_events_init
(
0
,
0
);
dap_events_t
*
l_events
=
dap_events_new
(
);
dap_events_start
(
l_events
);
dap_client_init
();
if
(
dap_http_init
()
!=
0
)
{
log_it
(
L_CRITICAL
,
"Can't init http server module"
);
return
-
5
;
...
...
@@ -235,13 +243,13 @@ int main( int argc, const char **argv )
log_it
(
L_CRITICAL
,
"Can't init encryption module"
);
return
-
56
;
}
if
(
dap_chain_global_db_init
(
g_config
)
)
{
log_it
(
L_CRITICAL
,
"Can't init global db module"
);
return
-
58
;
}
dap_client_init
();
//dap_http_client_simple_init( );
...
...
@@ -412,6 +420,14 @@ int main( int argc, const char **argv )
log_it
(
L_INFO
,
"No enabled server, working in client mode only"
);
// DNS server start
bool
bBuiltinDNSEnabled
=
dap_config_get_item_bool_default
(
g_config
,
"server"
,
"builtin_dns_enabled"
,
false
);
log_it
(
L_DEBUG
,
"config server->builtin_dns_enabled =
\"
%u
\"
"
,
bBuiltinDNSEnabled
);
dap_server_t
*
dns
=
NULL
;
if
(
bBuiltinDNSEnabled
)
{
dns
=
dap_dns_server_start
();
}
// Chain Network init
dap_stream_ch_chain_init
(
);
...
...
@@ -419,11 +435,6 @@ int main( int argc, const char **argv )
dap_stream_ch_chain_net_srv_init
();
// New event loop init
dap_events_init
(
0
,
0
);
dap_events_t
*
l_events
=
dap_events_new
(
);
dap_events_start
(
l_events
);
/// if (dap_config_get_item_bool_default(g_config,"vpn","enabled",false))
/// dap_stream_ch_vpn_deinit();
...
...
@@ -462,6 +473,7 @@ failure:
#ifdef DAP_SUPPORT_PYTHON_PLUGINS
dap_chain_plugins_deinit
();
#endif
dap_dns_server_stop
(
dns
);
dap_stream_deinit
();
dap_stream_ctl_deinit
();
dap_http_folder_deinit
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment