AmendHub

Download:

jcs

/

subtext

/

amendments

/

312

db: Add binkp fields


jcs made amendment 312 about 1 year ago
--- db.c Sun Feb 5 10:26:09 2023 +++ db.c Wed Feb 22 20:47:37 2023 @@ -88,6 +88,22 @@ struct struct_field config_fields[] = { { "Session Log History Days", CONFIG_TYPE_SHORT, offsetof(struct config, session_log_days), 1, USHRT_MAX }, + + { "FidoNet Binkp Host", CONFIG_TYPE_STRING, + offsetof(struct config, binkp_hostname), + 0, member_size(struct config, binkp_hostname) }, + { "FidoNet Binkp Port", CONFIG_TYPE_SHORT, + offsetof(struct config, binkp_port), + 0, 65535 }, + { "FidoNet Binkp Node Address", CONFIG_TYPE_STRING, + offsetof(struct config, binkp_node_addr), + 0, member_size(struct config, binkp_node_addr) }, + { "FidoNet Binkp Password", CONFIG_TYPE_STRING, + offsetof(struct config, binkp_password), + 0, member_size(struct config, binkp_password) }, + { "FidoNet Binkp Fetch Seconds", CONFIG_TYPE_LONG, + offsetof(struct config, binkp_interval_seconds), + 1, ULONG_MAX } }; size_t nconfig_fields = nitems(config_fields); @@ -519,6 +535,23 @@ db_migrate(struct db *tdb, short is_new) sizeof(new_config)); sprintf(new_config.modem_parity, "8N1"); + + bile_write(tdb->bile, DB_CONFIG_RTYPE, 1, &new_config, + sizeof(new_config)); + break; + } + case 12: { + /* 12->13, added binkp fields */ + struct config new_config = { 0 }; + + bile_read(tdb->bile, DB_CONFIG_RTYPE, 1, (char *)&new_config, + sizeof(new_config)); + + new_config.binkp_hostname[0] = '\0'; + new_config.binkp_port = 24554; + new_config.binkp_node_addr[0] = '\0'; + new_config.binkp_password[0] = '\0'; + new_config.binkp_interval_seconds = (60 * 60 * 3); bile_write(tdb->bile, DB_CONFIG_RTYPE, 1, &new_config, sizeof(new_config)); --- db.h Wed Nov 30 13:28:52 2022 +++ db.h Wed Feb 22 17:54:51 2023 @@ -23,7 +23,7 @@ #define DB_TYPE 'STDB' -#define DB_CUR_VERS 12 +#define DB_CUR_VERS 13 #define DB_TRUE 0x100 #define DB_FALSE 0x000 @@ -84,6 +84,11 @@ struct config { unsigned short trusted_proxy_udp_port; short session_log_days; char modem_parity[4]; + char binkp_hostname[64]; + char binkp_node_addr[32]; + unsigned short binkp_port; + char binkp_password[32]; + unsigned long binkp_interval_seconds; }; extern struct struct_field config_fields[];