Skip to content
Snippets Groups Projects
Commit c22b0ac9 authored by Dmitriy Gerasimov's avatar Dmitriy Gerasimov
Browse files

[+] av and chat channels

[*] log output renames
[*] lib versions update
parent 04e7224c
No related branches found
No related tags found
No related merge requests found
[submodule "libdap"] [submodule "libdap"]
path = libdap path = libdap
url = https://github.com/demlabsinc/libdap.git url = https://github.com/kelvinblockchain/libdap.git
[submodule "libdap-server"] [submodule "libdap-server"]
path = libdap-server path = libdap-server
url = https://github.com/demlabsinc/libdap-server.git url = https://github.com/kelvinblockchain/libdap-server.git
[submodule "libdap-chain"] [submodule "libdap-chain"]
path = libdap-chain path = libdap-chain
url = https://github.com/demlabsinc/libdap-chain.git url = https://github.com/kelvinblockchain/libdap-chain.git
[submodule "libdap-stream"] [submodule "libdap-stream"]
path = libdap-stream path = libdap-stream
url = https://github.com/demlabsinc/libdap-stream.git url = https://github.com/kelvinblockchain/libdap-stream.git
[submodule "libdap-stream-ch-vpn"] [submodule "libdap-stream-ch-vpn"]
path = libdap-stream-ch-vpn path = libdap-stream-ch-vpn
url = https://github.com/demlabsinc/libdap-stream-ch-vpn.git url = https://github.com/kelvinblockchain/libdap-stream-ch-vpn.git
[submodule "libdap-stream-ch-av"]
path = libdap-stream-ch-av
url = https://github.com/kelvinblockchain/libdap-stream-ch-av
[submodule "libdap-stream-ch-chat"]
path = libdap-stream-ch-chat
url = https://github.com/kelvinblockchain/libdap-stream-ch-chat
Subproject commit d77436785654ce4c10d7b5cdbd22fff3e03665e4 Subproject commit 737931d0cc1080502a564f7a0fe00dfb23f84087
Subproject commit 813167b563e88873dd40bc27b79863586612269f Subproject commit f4d20ce6161fc705abe4b526c7e91b8f6564131f
Subproject commit f8b3d76ac722aeb31c4af3b99217baa9cdfb2486 Subproject commit ef24af6c87d6141ebb919a62f8b1fd461a373f60
Subproject commit f5e9c2928c943ea4abf4e9107c9381366e1255e0
Subproject commit dede25eb4c35c5ba50bddddea237eb1fc2e0ce8e
Subproject commit 61d2654814614f695c8abe2d1d8d2c7b1d7bcb40 Subproject commit c864bcf8a5bfa89ee85237ee9809fdff1adef008
...@@ -26,54 +26,60 @@ ...@@ -26,54 +26,60 @@
#define LOG_TAG "node_manager" #define LOG_TAG "node_manager"
void channel_new(struct stream_ch* ch,void* arg){ void channel_new(struct stream_ch* ch,void* arg)
puts("Channel new"); {
log_it(L_INFO,"Channel new");
} }
void channel_delete(struct stream_ch* ch,void* arg){
puts("Channel delete"); void channel_delete(struct stream_ch* ch,void* arg)
{
log_it(L_INFO,"Channel delete");
} }
void channel_packet_in(struct stream_ch* ch,void* arg){ void channel_packet_in(struct stream_ch* ch,void* arg)
{
stream_ch_pkt_t * ch_pkt = arg; stream_ch_pkt_t * ch_pkt = arg;
char* data = (char*)malloc(ch_pkt->hdr.size); char* data = (char*)malloc(ch_pkt->hdr.size);
memcpy(data,ch_pkt->data,ch_pkt->hdr.size); memcpy(data,ch_pkt->data,ch_pkt->hdr.size);
printf("Income data: %s from %s \n",data,itoa(ch->stream->conn_udp->host_key)); log_it(L_DEBUG,"Income data: %s from %s \n",data,itoa(ch->stream->conn_udp->host_key));
stream_ch_set_ready_to_write(ch,false); stream_ch_set_ready_to_write(ch,false);
stream_ch_pkt_write_f(ch, 1, "ping"); stream_ch_pkt_write_f(ch, 1, "ping");
stream_ch_set_ready_to_write(ch,true); stream_ch_set_ready_to_write(ch,true);
} }
void channel_packet_out(struct stream_ch* ch,void* arg){ void channel_packet_out(struct stream_ch* ch,void* arg)
{
stream_ch_set_ready_to_write(ch,false); stream_ch_set_ready_to_write(ch,false);
} }
void client_new(dap_client_remote_t *client,void * arg){ void client_new(dap_client_remote_t *client,void * arg){
printf("Client connected"); log_it(L_INFO,"Client connected");
} }
void client_read(dap_client_remote_t *client,void * arg){ void client_read(dap_client_remote_t *client,void * arg){
printf("Client read \n"); log_it(L_INFO,"Client read %u",client->buf_in_size);
unsigned char* data = (char*)malloc(client->buf_in_size); unsigned char* data = (char*)malloc(client->buf_in_size);
data[client->buf_in_size] = 0; data[client->buf_in_size] = 0;
if(client->_ready_to_read) if(client->_ready_to_read)
{ {
dap_client_read(client,data,client->buf_in_size); dap_client_read(client,data,client->buf_in_size);
} }
puts(data);
char outbox[] = "ping"; char outbox[] = "ping";
dap_client_write(client,outbox,strlen(outbox)); dap_client_write(client,outbox,strlen(outbox));
dap_udp_client_ready_to_write(client,true); dap_udp_client_ready_to_write(client,true);
free(data); free(data);
} }
void client_write(dap_client_remote_t *client,void * arg){ void client_write(dap_client_remote_t *client,void * arg)
printf("Client write"); {
log_it(L_DEBUG,"Client write");
} }
void client_disconnect(dap_client_remote_t *client,void * arg){ void client_disconnect(dap_client_remote_t *client,void * arg)
printf("Client disconnect"); {
log_it(L_DEBUG,"Client disconnect");
} }
/** /**
...@@ -164,7 +170,7 @@ void node_manager_start(node_manager_t* manager){ ...@@ -164,7 +170,7 @@ void node_manager_start(node_manager_t* manager){
void node_manager_start_stream(){ void node_manager_start_stream(){
dap_server_t* server = dap_server_listen("localhost",56001,DAP_SERVER_TCP); dap_server_t* server = dap_server_listen("localhost",56001,DAP_SERVER_TCP);
dap_http_new(server,"HTTP-serv"); dap_http_new(server,"KelvinNode");
enc_http_add_proc(DAP_HTTP(server),"/handshake"); enc_http_add_proc(DAP_HTTP(server),"/handshake");
dap_server_loop(server); dap_server_loop(server);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment