jcs
/subtext
/amendments
/407
binkp: Use FTN terminology
jcs made amendment 407 about 1 year ago
--- binkp.c Mon Mar 13 22:33:09 2023
+++ binkp.c Tue Mar 14 08:56:55 2023
@@ -1,5 +1,5 @@
/*
- * FidoNet Binkp
+ * FTN Binkp
* https://www.ritlabs.com/binkp/
*
* Copyright (c) 2023 joshua stein <jcs@jcs.org>
@@ -37,7 +37,7 @@ static bool binkp_temp_fail = false;
struct uthread *binkp_thread = NULL;
void binkp_mkdir(Str255 *dir_str, char *suffix);
-void binkp_sync_with_hub(void);
+void binkp_poll(void);
bool binkp_connect(void);
void binkp_free(void);
size_t binkp_send_frame(short command, char *data, size_t data_size);
@@ -56,10 +56,10 @@ binkp_process(struct uthread *uthread, void *arg)
{
short newdirid, error;
- if (!fidopkt_parse_address(db->config.fidonet_node_addr,
+ if (!fidopkt_parse_address(db->config.ftn_node_addr,
&binkp_our_address)) {
- logger_printf("[binkp] failed parsing local FidoNet node address "
- "\"%s\", fix in settings", db->config.fidonet_node_addr);
+ logger_printf("[binkp] failed parsing local FTN node address "
+ "\"%s\", fix in settings", db->config.ftn_node_addr);
return;
}
@@ -75,7 +75,7 @@ binkp_process(struct uthread *uthread, void *arg)
for (;;) {
if (db->config.binkp_hostname[0] != '\0' &&
db->config.binkp_port != 0)
- binkp_sync_with_hub();
+ binkp_poll();
binkp_deliver_inbox();
@@ -117,7 +117,7 @@ binkp_atexit(void)
}
void
-binkp_sync_with_hub(void)
+binkp_poll(void)
{
char filename[16];
size_t n, pkt_buf_size;
@@ -144,7 +144,7 @@ binkp_sync_with_hub(void)
false);
elapsed = Time - started;
- logger_printf("[binkp] done transferring in %ld sec%s", elapsed,
+ logger_printf("[binkp] done polling after %ld sec%s", elapsed,
elapsed == 1 ? "" : "s");
done:
@@ -603,7 +603,7 @@ binkp_login(void)
return false;
if (!binkp_send_frame(BINKP_COMMAND_M_ADR,
- db->config.fidonet_node_addr, strlen(db->config.fidonet_node_addr)))
+ db->config.ftn_node_addr, strlen(db->config.ftn_node_addr)))
return false;
if (!binkp_send_frame(BINKP_COMMAND_M_PWD, db->config.binkp_password,
@@ -621,14 +621,14 @@ binkp_login(void)
if (binkpc->cur_frame.command_id == BINKP_COMMAND_M_ERR) {
logger_printf("[binkp] login as %s failed, disconnecting",
- db->config.fidonet_node_addr);
+ db->config.ftn_node_addr);
binkp_free();
return false;
}
if (binkpc->cur_frame.command_id == BINKP_COMMAND_M_OK) {
logger_printf("[binkp] logged in successfully as %s",
- db->config.fidonet_node_addr);
+ db->config.ftn_node_addr);
return true;
}
}
@@ -789,8 +789,8 @@ binkp_fidopkt_processor(char *filename, unsigned char
if (msg->area[0]) {
for (n = 0; n < db->nboards; n++) {
- if (db->boards[n].fidonet_area[0] &&
- strcasecmp(msg->area, db->boards[n].fidonet_area) == 0) {
+ if (db->boards[n].ftn_area[0] &&
+ strcasecmp(msg->area, db->boards[n].ftn_area) == 0) {
board = &db->boards[n];
break;
}
@@ -805,9 +805,9 @@ binkp_fidopkt_processor(char *filename, unsigned char
goto next_message;
}
- ret = board_ingest_fidopkt_message(board, msg);
+ ret = board_toss_ftn_message(board, msg);
} else
- ret = mail_ingest_fidopkt_message(msg);
+ ret = mail_toss_ftn_message(msg);
if (ret == -1) {
binkp_temp_fail = true;
@@ -1002,7 +1002,7 @@ done:
}
bool
-binkp_store_outbound_message(struct fidopkt_message *msg)
+binkp_scan_message(struct fidopkt_message *msg)
{
Str255 path;
char filename[32];
@@ -1012,7 +1012,7 @@ binkp_store_outbound_message(struct fidopkt_message *m
bool ret = false;
size = fidopkt_encode_message(msg, &buf,
- db->config.fidonet_pkt_password, db->config.timezone_utcoff);
+ db->config.ftn_hub_pkt_password, db->config.timezone_utcoff);
if (size == 0)
return false;
@@ -1025,7 +1025,7 @@ binkp_store_outbound_message(struct fidopkt_message *m
CtoPstr(binkp_outbox_dir);
CtoPstr(path);
- error = Create(path, 0, SUBTEXT_CREATOR, FIDONET_SPOOL_PACKET_TYPE);
+ error = Create(path, 0, SUBTEXT_CREATOR, FTN_SPOOL_PACKET_TYPE);
if (error == dupFNErr) {
warn("binkp: collision saving packet to %s", PtoCstr(path));
goto done;
--- binkp.h Mon Mar 13 10:18:07 2023
+++ binkp.h Mon Mar 13 23:47:04 2023
@@ -71,6 +71,6 @@ struct binkp_connection {
extern struct uthread *binkp_thread;
void binkp_process(struct uthread *uthread, void *arg);
void binkp_atexit(void);
-bool binkp_store_outbound_message(struct fidopkt_message *msg);
+bool binkp_scan_message(struct fidopkt_message *msg);
#endif