upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/tollgate_core/include/tollgate_core.h
diff options
context:
space:
mode:
Diffstat (limited to 'tollgate_core/include/tollgate_core.h')
-rw-r--r--tollgate_core/include/tollgate_core.h90
1 files changed, 0 insertions, 90 deletions
diff --git a/tollgate_core/include/tollgate_core.h b/tollgate_core/include/tollgate_core.h
deleted file mode 100644
index bbae7cf..0000000
--- a/tollgate_core/include/tollgate_core.h
+++ /dev/null
@@ -1,90 +0,0 @@
1#ifndef TOLLGATE_CORE_H
2#define TOLLGATE_CORE_H
3
4#include "tollgate_platform.h"
5#include <stdbool.h>
6#include <stdint.h>
7
8int tollgate_core_init(const tollgate_platform_t *platform, uint32_t ap_ip);
9void tollgate_core_tick(void);
10
11int tollgate_core_dns_start(uint32_t upstream_dns);
12void tollgate_core_dns_stop(void);
13
14int tollgate_core_process_payment(uint32_t client_ip, const char *token_str);
15int tollgate_core_process_share(uint32_t client_ip, const char *job_id,
16 const char *nonce, const char *ntime, const char *version);
17
18void tollgate_core_client_connected(const uint8_t *mac, uint32_t client_ip);
19void tollgate_core_client_disconnected(const uint8_t *mac);
20
21bool tollgate_core_is_client_allowed(uint32_t client_ip);
22bool tollgate_core_is_dns_running(void);
23
24char *tollgate_core_get_status_json(void);
25char *tollgate_core_get_config_json(void);
26
27int tollgate_core_active_session_count(void);
28int tollgate_core_allowed_client_count(void);
29int tollgate_core_firewall_revoke_all(void);
30void tollgate_core_firewall_set_mining_port(uint16_t port);
31void tollgate_core_firewall_set_sandbox_mint_access(bool enable);
32
33bool tollgate_core_is_owner(uint32_t client_ip);
34bool tollgate_core_is_owner_connected(void);
35
36double tollgate_core_get_hashprice(void);
37void tollgate_core_set_nbits(uint32_t nbits);
38const void *tollgate_core_get_current_job(void);
39void tollgate_core_set_job(const void *job);
40
41int tollgate_core_stratum_client_start(void);
42void tollgate_core_stratum_client_stop(void);
43
44int tollgate_core_stratum_proxy_init(uint16_t port);
45void tollgate_core_stratum_proxy_get_stats(void *out);
46
47void tollgate_core_mining_init(void);
48
49void tollgate_core_beacon_start(void);
50
51void tollgate_core_market_init(void);
52void tollgate_core_market_on_scan_result(const void *ie_data, int ie_len,
53 const uint8_t *bssid, int rssi);
54
55const void *tollgate_core_get_sessions_array(void);
56int tollgate_core_get_sessions_array_size(void);
57void *tollgate_core_find_session_by_ip(uint32_t ip);
58void *tollgate_core_find_session_by_mac(const char *mac);
59void *tollgate_core_session_create(uint32_t client_ip, uint64_t allotment_ms);
60void *tollgate_core_session_create_bytes(uint32_t client_ip, uint64_t allotment_bytes);
61void tollgate_core_session_extend(void *session, uint64_t additional_ms);
62void tollgate_core_session_revoke(void *session);
63int tollgate_core_session_add_bytes(uint32_t client_ip, uint64_t bytes);
64bool tollgate_core_session_is_expired(const void *session);
65
66void tollgate_core_firewall_grant(uint32_t client_ip);
67void tollgate_core_firewall_revoke(uint32_t client_ip);
68int tollgate_core_firewall_get_mac_for_ip(uint32_t client_ip, char *mac_out, int mac_out_size);
69
70int tollgate_core_cashu_decode(const char *token_str, void *out);
71int tollgate_core_cashu_check_states(const char *mint_url, const void *token,
72 void *states, int *state_count);
73uint64_t tollgate_core_cashu_allotment(uint64_t amount, uint64_t price, uint64_t step_size);
74bool tollgate_core_cashu_is_mint_accepted(const char *mint_url);
75const char *tollgate_core_cashu_token_mint(const void *token);
76uint64_t tollgate_core_cashu_token_amount(const void *token);
77
78void tollgate_core_mining_update_hashrate(uint32_t client_ip, bool accepted);
79const void *tollgate_core_mining_get_client_stats(uint32_t client_ip);
80double tollgate_core_mining_get_hashprice(void);
81uint64_t tollgate_core_mining_shares_to_allotment_ms(double hashrate, double hashprice,
82 int price, int step_ms);
83uint64_t tollgate_core_mining_shares_to_allotment_bytes(double hashrate, double hashprice,
84 int price, int step_bytes);
85void tollgate_core_mining_set_nbits(uint32_t nbits);
86
87const tollgate_platform_t *tollgate_core_get_platform(void);
88uint32_t tollgate_core_get_ap_ip(void);
89
90#endif