Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libdap-chain-net-srv
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
cellframe
libdap-chain-net-srv
Commits
30009ca6
Commit
30009ca6
authored
5 years ago
by
Aleksandr Lysikov
Browse files
Options
Downloads
Patches
Plain Diff
added struct dap_chain_net_srv_abstract_t
parent
467476c7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dap_chain_net_srv.c
+15
-14
15 additions, 14 deletions
dap_chain_net_srv.c
dap_chain_net_srv.h
+47
-14
47 additions, 14 deletions
dap_chain_net_srv.h
with
62 additions
and
28 deletions
dap_chain_net_srv.c
+
15
−
14
View file @
30009ca6
...
...
@@ -8,19 +8,19 @@
This file is part of DAP (Deus Applications Prototypes) the open source project
DAP (Deus Applicaions Prototypes) is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DAP is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with any DAP based project. If not, see <http://www.gnu.org/licenses/>.
*/
DAP (Deus Applicaions Prototypes) is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DAP is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with any DAP based project. If not, see <http://www.gnu.org/licenses/>.
*/
#include
"utlist.h"
...
...
@@ -39,6 +39,7 @@ int dap_chain_net_srv_init()
{
m_uid
=
NULL
;
m_uid_count
=
0
;
return
0
;
}
...
...
@@ -64,7 +65,7 @@ void dap_chain_net_srv_add(dap_chain_net_srv_t * a_srv)
* @param a_uid
* @return
*/
dap_chain_net_srv_t
*
dap_chain_net_srv_get
(
dap_chain_net_srv_uid_t
a_uid
)
dap_chain_net_srv_t
*
dap_chain_net_srv_get
(
dap_chain_net_srv_uid_t
a_uid
)
{
}
...
...
This diff is collapsed.
Click to expand it.
dap_chain_net_srv.h
+
47
−
14
View file @
30009ca6
...
...
@@ -8,24 +8,35 @@
This file is part of DAP (Deus Applications Prototypes) the open source project
DAP (Deus Applicaions Prototypes) is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DAP is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with any DAP based project. If not, see <http://www.gnu.org/licenses/>.
*/
DAP (Deus Applicaions Prototypes) is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DAP is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with any DAP based project. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include
"dap_chain_node_ctl.h"
#include
"dap_chain_net_srv_common.h"
//Classes of services
enum
{
SERV_CLASS_ONCE
=
1
,
// one-time service
SERV_CLASS_PERMANENT
=
2
};
//Types of services
enum
{
SERV_ID_VPN
=
1
,
};
typedef
struct
dap_chain_net_srv
{
dap_chain_node_ctl_t
*
node
;
...
...
@@ -35,11 +46,33 @@ typedef struct dap_chain_net_srv
void
*
_inhertor
;
}
dap_chain_net_srv_t
;
typedef
struct
dap_chain_net_srv_abstract
{
uint64_t
proposal_id
;
// id trade proposal. Must be unique to the node.
uint8_t
class
;
//Class of service
uint8_t
type_id
;
//Type of service
union
{
struct
{
int
bandwith
;
int
abuse_resistant
;
int
limit_bytes
;
}
vpn
;
struct
{
int
value
;
}
other_srv
;
}
proposal_params
;
uint64_t
price
;
// service price, for SERV_CLASS_ONCE ONCE for the whole service, for SERV_CLASS_PERMANENT for one unit.
uint8_t
price_units
;
// Unit of service (seconds, megabytes, etc.) Only for SERV_CLASS_PERMANENT
char
decription
[
128
];
}
DAP_ALIGN_PACKED
dap_chain_net_srv_abstract_t
;
int
dap_chain_net_srv_init
();
void
dap_chain_net_srv_deinit
();
void
dap_chain_net_srv_add
(
dap_chain_net_srv_t
*
a_srv
);
dap_chain_net_srv_t
*
dap_chain_net_srv_get
(
dap_chain_net_srv_uid_t
a_uid
);
dap_chain_net_srv_t
*
dap_chain_net_srv_get
(
dap_chain_net_srv_uid_t
a_uid
);
const
size_t
dap_chain_net_srv_count
();
const
dap_chain_net_srv_uid_t
*
dap_chain_net_srv_list
();
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