summaryrefslogtreecommitdiffstats
path: root/ktalkd
diff options
context:
space:
mode:
Diffstat (limited to 'ktalkd')
-rw-r--r--ktalkd/ktalkd/defs.h14
-rw-r--r--ktalkd/ktalkd/machines/answmach.cpp8
-rw-r--r--ktalkd/ktalkd/process.cpp32
-rw-r--r--ktalkd/ktalkd/talkd.cpp6
4 files changed, 30 insertions, 30 deletions
diff --git a/ktalkd/ktalkd/defs.h b/ktalkd/ktalkd/defs.h
index 31e58b32..ffd1b5d4 100644
--- a/ktalkd/ktalkd/defs.h
+++ b/ktalkd/ktalkd/defs.h
@@ -72,15 +72,15 @@ Please leave a message and quit normally when finished.\n"
#define NEU_BANNER3 "or leave a message which will be sent to the system administrator."
/* return value from process_request : */
-#define PROC_RETQ_OK 0
-#define PROC_RETQ_ERR 1
-#define PROC_RETQ_FORWMACH 2
-#define PROC_RETQ_ANSWMACH 3
-#define PROC_RETQ_ANSWMACH_NOT_LOGGED 4
-#define PROC_RETQ_ANSWMACH_NOT_HERE 5
+#define PROC_REQ_OK 0
+#define PROC_REQ_ERR 1
+#define PROC_REQ_FORWMACH 2
+#define PROC_REQ_ANSWMACH 3
+#define PROC_REQ_ANSWMACH_NOT_LOGGED 4
+#define PROC_REQ_ANSWMACH_NOT_HERE 5
/* Min value to launch answer machine : */
-#define PROC_RETQ_MIN_A 3
+#define PROC_REQ_MIN_A 3
#include "options.h"
diff --git a/ktalkd/ktalkd/machines/answmach.cpp b/ktalkd/ktalkd/machines/answmach.cpp
index 8119a1dd..7a2bf052 100644
--- a/ktalkd/ktalkd/machines/answmach.cpp
+++ b/ktalkd/ktalkd/machines/answmach.cpp
@@ -77,7 +77,7 @@ AnswMachine::AnswMachine(struct in_addr r_addr,
l_name, /* the caller (remote) */
local_user,
ntalkProtocol); /* the callee (local) */
- if (mode==PROC_RETQ_ANSWMACH_NOT_HERE)
+ if (mode==PROC_REQ_ANSWMACH_NOT_HERE)
{
/* The caller is trying to talk to somebody this system doesn't know.
We can display a NEU banner (non-existent user) and take a message
@@ -113,7 +113,7 @@ void AnswMachine::start()
If NEU/not logged, start quickly. (Wait just a little for the
LEAVE_INVITE to come.) */
- sleep( (mode==PROC_RETQ_ANSWMACH) ? Options.time_before_answmach : 1 );
+ sleep( (mode==PROC_REQ_ANSWMACH) ? Options.time_before_answmach : 1 );
usercfg = init_user_config(local_user);
@@ -216,7 +216,7 @@ void AnswMachine::talk()
{ /* => Display Options.invitelines */
talkconn->write_banner(Options.invitelines);
}
- else if (mode==PROC_RETQ_ANSWMACH_NOT_HERE)
+ else if (mode==PROC_REQ_ANSWMACH_NOT_HERE)
{ /* => Display Options.NEUBanner* */
talkconn->write_banner(Options.NEUBanner1);
talkconn->write_banner(Options.NEUBanner2);
@@ -313,7 +313,7 @@ void AnswMachine::write_headers(FILE * fd, struct hostent * hp, char *
strcpy(messg_tmpl,"Message left in the answering machine, by %s@%s");
snprintf(messg,S_MESSG,messg_tmpl,r_user,hp->h_name);
- if (mode==PROC_RETQ_ANSWMACH_NOT_HERE)
+ if (mode==PROC_REQ_ANSWMACH_NOT_HERE)
{
char tmp[ NEW_NAME_SIZE + 10 ];
snprintf(tmp, NEW_NAME_SIZE + 9, " => '%s'", NEUperson);
diff --git a/ktalkd/ktalkd/process.cpp b/ktalkd/ktalkd/process.cpp
index 436c9dba..2f8ba27b 100644
--- a/ktalkd/ktalkd/process.cpp
+++ b/ktalkd/ktalkd/process.cpp
@@ -102,14 +102,14 @@ int process_request(NEW_CTL_MSG *mp, NEW_CTL_RESPONSE *rp, const char* theirhos
print_request("process_request", mp);
if (!prepare_response(mp, rp))
- return PROC_RETQ_ERR;
+ return PROC_REQ_ERR;
/* Ensure null-termination */
mp->l_name[sizeof(mp->l_name)-1] = 0;
mp->r_name[sizeof(mp->r_name)-1] = 0;
mp->r_tty[sizeof(mp->r_tty)-1] = 0;
- ret = PROC_RETQ_OK;
+ ret = PROC_REQ_OK;
switch (mp->type) {
@@ -121,8 +121,8 @@ int process_request(NEW_CTL_MSG *mp, NEW_CTL_RESPONSE *rp, const char* theirhos
/* Store in table if normal announce or answmach replacing it.
Not if re-announce, nor if error, nor for forwarding machine */
- if ((ret == PROC_RETQ_OK) || (ret == PROC_RETQ_ANSWMACH_NOT_LOGGED)
- || (ret == PROC_RETQ_ANSWMACH_NOT_HERE))
+ if ((ret == PROC_REQ_OK) || (ret == PROC_REQ_ANSWMACH_NOT_LOGGED)
+ || (ret == PROC_REQ_ANSWMACH_NOT_HERE))
ktable->insert_table(mp, rp, 0L);
case LEAVE_INVITE:
@@ -143,7 +143,7 @@ int process_request(NEW_CTL_MSG *mp, NEW_CTL_RESPONSE *rp, const char* theirhos
rp->answer = SUCCESS;
} else {
if (ForwMachine::forwMachProcessLookup(ktable->getTable(), mp)) {
- ret = PROC_RETQ_FORWMACH; // Don't send any response, forwmach will do it
+ ret = PROC_REQ_FORWMACH; // Don't send any response, forwmach will do it
} else
rp->answer = NOT_HERE;
}
@@ -157,7 +157,7 @@ int process_request(NEW_CTL_MSG *mp, NEW_CTL_RESPONSE *rp, const char* theirhos
rp->answer = UNKNOWN_REQUEST;
break;
}
- if (ret != PROC_RETQ_FORWMACH)
+ if (ret != PROC_REQ_FORWMACH)
print_response("=> response", rp);
if (mp->vers == 0) { // it's kotalkd talking to us.
// Let's prepare an OTALK response, shifting the first 2 fields
@@ -187,7 +187,7 @@ int do_announce(NEW_CTL_MSG *mp, NEW_CTL_RESPONSE *rp, const char* theirhost, in
ktalk_debug("dupannounce %d", mp->id_num);
rp->id_num = htonl(ptr->id_num);
rp->answer = SUCCESS;
- return PROC_RETQ_ERR;
+ return PROC_REQ_ERR;
} else {
if (ptr == (NEW_CTL_MSG *) 0) { /* Not already in the table */
@@ -202,7 +202,7 @@ int do_announce(NEW_CTL_MSG *mp, NEW_CTL_RESPONSE *rp, const char* theirhost, in
(FWR & FWT) : we'll receive the LOOK_UP */
ktable->insert_table(mp, 0L, fwm);
fwm->start(mp->id_num);
- return PROC_RETQ_FORWMACH;
+ return PROC_REQ_FORWMACH;
}
}
@@ -223,7 +223,7 @@ int do_announce(NEW_CTL_MSG *mp, NEW_CTL_RESPONSE *rp, const char* theirhost, in
ktalk_debug("Not logged.");
rp->answer = SUCCESS;
endpwent();
- return PROC_RETQ_ANSWMACH_NOT_LOGGED; /* answer machine. */
+ return PROC_REQ_ANSWMACH_NOT_LOGGED; /* answer machine. */
} else
{ /* Non-existent user ... */
endpwent();
@@ -236,11 +236,11 @@ int do_announce(NEW_CTL_MSG *mp, NEW_CTL_RESPONSE *rp, const char* theirhost, in
case 2: /* Paranoid setting. Do nothing. */
ktalk_debug("Paranoid setting. Do nothing.");
rp->answer = NOT_HERE;
- return PROC_RETQ_ERR;
+ return PROC_REQ_ERR;
case 0: /* Launch answering machine. */
ktalk_debug("Not here.");
rp->answer = SUCCESS;
- return PROC_RETQ_ANSWMACH_NOT_HERE;
+ return PROC_REQ_ANSWMACH_NOT_HERE;
case 1: /* NEU_user will take the talk. */
ktalk_debug("Not here. I ll take the talk.");
fwm = new ForwMachine(mp, Options.NEU_user,
@@ -248,14 +248,14 @@ int do_announce(NEW_CTL_MSG *mp, NEW_CTL_RESPONSE *rp, const char* theirhost, in
/* store in table, because we'll receive the LOOK_UP */
ktable->insert_table(mp, 0L, fwm);
fwm->start(mp->id_num);
- return PROC_RETQ_FORWMACH;
+ return PROC_REQ_FORWMACH;
} /* switch */
} /* getpwnam */
} /* result */
else {
ktalk_debug("not SUCCESS, nor NOT_HERE");
rp->answer = result; /* not SUCCESS, nor NOT_HERE*/
- return PROC_RETQ_ERR;
+ return PROC_REQ_ERR;
}
}
@@ -266,9 +266,9 @@ int do_announce(NEW_CTL_MSG *mp, NEW_CTL_RESPONSE *rp, const char* theirhost, in
if (ptr == (NEW_CTL_MSG *) 0) { /* Not already in the table => announce */
rp->answer = announce(mp, theirhost, disp, usercfg, callee);
- if (rp->answer == PERMISSION_DENIED) return PROC_RETQ_ERR;
+ if (rp->answer == PERMISSION_DENIED) return PROC_REQ_ERR;
ktalk_debug("Announce done.");
- return PROC_RETQ_OK;
+ return PROC_REQ_OK;
} else {
/* This is an explicit re-announce, so update the id_num
* field to avoid duplicates and re-announce the talk. */
@@ -279,7 +279,7 @@ int do_announce(NEW_CTL_MSG *mp, NEW_CTL_RESPONSE *rp, const char* theirhost, in
ptr->id_num = new_id_num; /* update in the table */
rp->id_num = htonl(ptr->id_num);
rp->answer = announce(mp, theirhost, disp, usercfg, callee);
- return PROC_RETQ_ANSWMACH;
+ return PROC_REQ_ANSWMACH;
}
}
}
diff --git a/ktalkd/ktalkd/talkd.cpp b/ktalkd/ktalkd/talkd.cpp
index feb11f28..cef384d2 100644
--- a/ktalkd/ktalkd/talkd.cpp
+++ b/ktalkd/ktalkd/talkd.cpp
@@ -184,7 +184,7 @@ do_one_packet(void)
struct sockaddr_in sn;
int cc, i, ok;
socklen_t addrlen;
- int ret_value = PROC_RETQ_OK; /* return value from process_request */
+ int ret_value = PROC_REQ_OK; /* return value from process_request */
addrlen = sizeof(sn);
cc = recvfrom(0, inbuf, sizeof(inbuf), 0,
@@ -326,13 +326,13 @@ do_one_packet(void)
ret_value = process_request(mp, &response, theirhost);
- if (ret_value != PROC_RETQ_FORWMACH)
+ if (ret_value != PROC_REQ_FORWMACH)
{
/* can block here, is this what I want? */
send_packet(&response, &sn, quirk);
}
- if (Options.answmach && (ret_value>=PROC_RETQ_MIN_A))
+ if (Options.answmach && (ret_value>=PROC_REQ_MIN_A))
{
ktalk_debug("Launch answer machine, mode %d.", ret_value);
AnswMachine::launchAnswMach(*mp, ret_value);