Files
FTL/src/api/api.h
T
DL6ER 60c09602ac Remove /api/settings/web
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-01-02 20:58:33 +01:00

80 lines
2.4 KiB
C

/* Pi-hole: A black hole for Internet advertisements
* (c) 2017 Pi-hole, LLC (https://pi-hole.net)
* Network-wide ad blocking via your own hardware.
*
* FTL Engine
* API route prototypes
*
* This file is copyright under the latest version of the EUPL.
* Please see LICENSE file for your rights under this license. */
#ifndef ROUTES_H
#define ROUTES_H
// struct mg_connection
#include "../civetweb/civetweb.h"
// type cJSON
#include "../cJSON/cJSON.h"
#include "../webserver/http-common.h"
// API router
int api_handler(struct mg_connection *conn, void *ignored);
// Statistic methods
int api_stats_summary(struct ftl_conn *api);
int api_stats_query_types(struct ftl_conn *api);
int api_stats_upstreams(struct ftl_conn *api);
int api_stats_top_domains(struct ftl_conn *api);
int api_stats_top_clients(struct ftl_conn *api);
int api_stats_recentblocked(struct ftl_conn *api);
// History methods
int api_history(struct ftl_conn *api);
int api_history_clients(struct ftl_conn *api);
// Query methods
int api_queries(struct ftl_conn *api);
int api_queries_suggestions(struct ftl_conn *api);
// Statistics methods (database)
int api_stats_database_overTime_history(struct ftl_conn *api);
int api_stats_database_top_items(struct ftl_conn *api);
int api_stats_database_summary(struct ftl_conn *api);
int api_stats_database_overTime_clients(struct ftl_conn *api);
int api_stats_database_query_types(struct ftl_conn *api);
int api_stats_database_upstreams(struct ftl_conn *api);
// FTL methods
int api_ftl_client(struct ftl_conn *api);
int api_ftl_logs_dns(struct ftl_conn *api);
int api_ftl_dbinfo(struct ftl_conn *api);
int api_ftl_sysinfo(struct ftl_conn *api);
int get_ftl_obj(struct ftl_conn *api, cJSON *ftl, const bool is_locked);
int get_system_obj(struct ftl_conn *api, cJSON *system);
int api_config(struct ftl_conn *api);
// Network methods
int api_network_gateway(struct ftl_conn *api);
int api_network_interfaces(struct ftl_conn *api);
int api_network_devices(struct ftl_conn *api);
// DNS methods
int api_dns_blocking(struct ftl_conn *api);
int api_dns_cache(struct ftl_conn *api);
int api_dns_port(struct ftl_conn *api);
// List methods
int api_list(struct ftl_conn *api);
int api_group(struct ftl_conn *api);
// Version method
int api_version(struct ftl_conn *api);
// Auth method
int check_client_auth(struct ftl_conn *api);
int api_auth(struct ftl_conn *api);
// Documentation methods
int api_docs(struct ftl_conn *api);
#endif // ROUTES_H