52 lines
1.2 KiB
C
52 lines
1.2 KiB
C
/* SPDX-License-Identifier: GPL-3.0-only */
|
|
/* Authenticated HTTPS administration foundation. */
|
|
|
|
#pragma once
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
#include "esp_err.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef struct {
|
|
uint64_t starts;
|
|
uint64_t start_failures;
|
|
uint64_t stops;
|
|
uint64_t requests;
|
|
uint64_t authenticated_requests;
|
|
uint64_t authentication_failures;
|
|
uint64_t root_requests;
|
|
uint64_t status_requests;
|
|
uint64_t ticket_requests;
|
|
uint64_t asset_requests;
|
|
uint64_t response_errors;
|
|
} web_server_counters_t;
|
|
|
|
typedef struct {
|
|
bool initialized;
|
|
bool running;
|
|
bool transitioning;
|
|
uint16_t port;
|
|
esp_err_t last_error;
|
|
esp_err_t serial_transport_error;
|
|
web_server_counters_t counters;
|
|
} web_server_snapshot_t;
|
|
|
|
/* Initialize runtime state without requiring valid certificate material. */
|
|
esp_err_t web_server_init(void);
|
|
|
|
/* Start one TLS-only server on all active network interfaces. */
|
|
esp_err_t web_server_start(void);
|
|
esp_err_t web_server_stop(void);
|
|
|
|
esp_err_t web_server_get_snapshot(web_server_snapshot_t *snapshot);
|
|
esp_err_t web_server_clear_counters(void);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|