| 1 |
/* SPDX-License-Identifier: GPL-3.0-or-later */
|
| 2 |
/*
|
| 3 |
* common
|
| 4 |
* - common definitions
|
| 5 |
*
|
| 6 |
* Copyright (C) 2004-2025 by Leaflet <leaflet@leafok.com>
|
| 7 |
*/
|
| 8 |
|
| 9 |
#include "common.h"
|
| 10 |
|
| 11 |
// File loader
|
| 12 |
const char *data_files_load_startup[] = {
|
| 13 |
DATA_WELCOME,
|
| 14 |
DATA_REGISTER,
|
| 15 |
DATA_GOODBYE,
|
| 16 |
DATA_LICENSE,
|
| 17 |
DATA_COPYRIGHT,
|
| 18 |
DATA_VERSION,
|
| 19 |
DATA_LOGIN_ERROR,
|
| 20 |
DATA_ACTIVE_BOARD,
|
| 21 |
DATA_READ_HELP,
|
| 22 |
DATA_EDITOR_HELP,
|
| 23 |
VAR_BBS_TOP};
|
| 24 |
|
| 25 |
const int data_files_load_startup_count = sizeof(data_files_load_startup) / sizeof(const char *);
|
| 26 |
|
| 27 |
// Global declaration for sockets
|
| 28 |
int socket_server[2];
|
| 29 |
int socket_client;
|
| 30 |
char hostaddr_client[IP_ADDR_LEN];
|
| 31 |
int port_client;
|
| 32 |
|
| 33 |
// SSHv2
|
| 34 |
int SSH_v2 = 0;
|
| 35 |
ssh_bind sshbind;
|
| 36 |
ssh_session SSH_session;
|
| 37 |
ssh_channel SSH_channel;
|
| 38 |
|
| 39 |
// Global declaration for system
|
| 40 |
volatile int SYS_server_exit = 0;
|
| 41 |
volatile int SYS_child_process_count = 0;
|
| 42 |
volatile int SYS_child_exit = 0;
|
| 43 |
volatile int SYS_conf_reload = 0;
|
| 44 |
|
| 45 |
// Common function
|
| 46 |
void sig_hup_handler(int i)
|
| 47 |
{
|
| 48 |
SYS_conf_reload = 1;
|
| 49 |
}
|
| 50 |
|
| 51 |
void sig_term_handler(int i)
|
| 52 |
{
|
| 53 |
SYS_server_exit = 1;
|
| 54 |
}
|
| 55 |
|
| 56 |
void sig_chld_handler(int i)
|
| 57 |
{
|
| 58 |
SYS_child_exit = 1;
|
| 59 |
}
|