Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/example.conf
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,7 @@ features
# "HIS_TRACE" = "TRUE";
# "HIS_STATS_a" = "TRUE";
# "HIS_STATS_c" = "TRUE";
# "HIS_STATS_C" = "TRUE";
# "HIS_STATS_d" = "TRUE";
# "HIS_STATS_e" = "TRUE";
# "HIS_STATS_f" = "TRUE";
Expand Down
1 change: 1 addition & 0 deletions include/handlers.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ struct Client;
extern int m_admin(struct Client*, struct Client*, int, char*[]);
extern int m_away(struct Client*, struct Client*, int, char*[]);
extern int m_cap(struct Client*, struct Client*, int, char*[]);
extern int ms_config(struct Client*, struct Client*, int, char*[]);
extern int m_cnotice(struct Client*, struct Client*, int, char*[]);
extern int m_cprivmsg(struct Client*, struct Client*, int, char*[]);
extern int m_gline(struct Client*, struct Client*, int, char*[]);
Expand Down
5 changes: 3 additions & 2 deletions include/ircd_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ enum Feature {
FEAT_HIS_TRACE,
FEAT_HIS_STATS_a,
FEAT_HIS_STATS_c,
FEAT_HIS_STATS_C,
FEAT_HIS_STATS_d,
FEAT_HIS_STATS_e,
FEAT_HIS_STATS_f,
Expand All @@ -132,13 +133,13 @@ enum Feature {
FEAT_HIS_STATS_k,
FEAT_HIS_STATS_l,
FEAT_HIS_STATS_L,
FEAT_HIS_STATS_M,
FEAT_HIS_STATS_m,
FEAT_HIS_STATS_M,
FEAT_HIS_STATS_o,
FEAT_HIS_STATS_p,
FEAT_HIS_STATS_q,
FEAT_HIS_STATS_R,
FEAT_HIS_STATS_r,
FEAT_HIS_STATS_R,
FEAT_HIS_STATS_t,
FEAT_HIS_STATS_T,
FEAT_HIS_STATS_u,
Expand Down
75 changes: 75 additions & 0 deletions include/ircd_netconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
* IRC - Internet Relay Chat, include/ircd_netconf.h
* Copyright (C) 2025 MrIron <mriron@undernet.org>
*
* See file AUTHORS in IRC package for additional names of
* the programmers.
*
* This program 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 1, or (at your option)
* any later version.
*
* This program 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 this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#ifndef INCLUDED_ircd_netconf_h
#define INCLUDED_ircd_netconf_h

#include <time.h>

struct Client;
struct StatDesc;

/** Configuration set return values */
#define CONFIG_REJECTED -1 /**< Rejected - older timestamp */
#define CONFIG_CREATED 0 /**< New entry created */
#define CONFIG_TIMESTAMP 1 /**< Timestamp updated, same value */
#define CONFIG_CHANGED 2 /**< Value actually changed */

/** Configuration entry structure */
struct ConfigEntry {
char *key; /**< Configuration option key */
char *value; /**< Configuration option value */
time_t timestamp; /**< Timestamp when this config was set */
struct ConfigEntry *next; /**< Next configuration entry */
};

/** Configuration change callback function type */
typedef void (*config_callback_f)(const char *key, const char *old_value, const char *new_value);

/** Configuration callback structure */
struct ConfigCallback {
char *key_prefix; /**< Key prefix to match (e.g., "sasl.") */
config_callback_f callback; /**< Callback function */
struct ConfigCallback *next; /**< Next callback */
};

/** Network configuration options */
enum NetConf {
/* To be included. This is the implementation only. */
NETCONF_LAST_NC
};

/*
* Prototypes
*/

extern int config_set(const char *key, const char *value, time_t timestamp);
extern const char *config_get(const char *key);
extern void config_register_callback(const char *key_prefix, config_callback_f callback);
extern void config_unregister_callback(const char *key_prefix);
extern void config_burst(struct Client *cptr);
extern void config_stats(struct Client *sptr, const struct StatDesc *sd, char *param);
extern int netconf_int(enum NetConf key);
extern int netconf_bool(enum NetConf key);
extern const char *netconf_str(enum NetConf key);

#endif /* INCLUDED_ircd_netconf_h */
4 changes: 4 additions & 0 deletions include/msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,10 @@ struct Client;
#define TOK_CHGHOST "CHGHOST"
#define CMD_CHGHOST MSG_CHGHOST, TOK_CHGHOST

#define MSG_CONFIG "CONFIG"
#define TOK_CONFIG "CF"
#define CMD_CONFIG MSG_CONFIG, TOK_CONFIG

/*
* Constants
*/
Expand Down
1,189 changes: 622 additions & 567 deletions ircd/Makefile.in

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions ircd/ircd_features.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ static struct FeatureDesc {
F_B(HIS_TRACE, 0, 1, 0),
F_B(HIS_STATS_a, 0, 1, 0),
F_B(HIS_STATS_c, 0, 1, 0),
F_B(HIS_STATS_C, 0, 1, 0),
F_B(HIS_STATS_d, 0, 1, 0),
F_B(HIS_STATS_e, 0, 1, 0),
F_B(HIS_STATS_f, 0, 1, 0),
Expand All @@ -397,13 +398,13 @@ static struct FeatureDesc {
F_B(HIS_STATS_k, 0, 1, 0),
F_B(HIS_STATS_l, 0, 1, 0),
F_B(HIS_STATS_L, 0, 1, 0),
F_B(HIS_STATS_M, 0, 1, 0),
F_B(HIS_STATS_m, 0, 1, 0),
F_B(HIS_STATS_M, 0, 1, 0),
F_B(HIS_STATS_o, 0, 1, 0),
F_B(HIS_STATS_p, 0, 1, 0),
F_B(HIS_STATS_q, 0, 1, 0),
F_B(HIS_STATS_R, 0, 1, 0),
F_B(HIS_STATS_r, 0, 1, 0),
F_B(HIS_STATS_R, 0, 1, 0),
F_B(HIS_STATS_t, 0, 1, 0),
F_B(HIS_STATS_T, 0, 1, 0),
F_B(HIS_STATS_u, 0, 0, 0),
Expand Down
Loading