Added reset command to mbout

This commit is contained in:
Michiel Broek 2002-03-17 12:14:40 +00:00
parent e84d4ba7e4
commit 026882c2af
4 changed files with 43 additions and 10 deletions

View File

@ -4695,6 +4695,10 @@ v0.33.20 10-Feb-2002
mbout:
The status display has now 9 digits for the outbound size.
New command, mbout reset <node>, unconditionally resets the
nodes "try" counter, ie. make an undiable node try to call
again.
The status command displays the call attempts.
mbsebbs:
On some systems the download taglists contained garbage after

View File

@ -48,6 +48,7 @@ int do_poll = FALSE; /* Poll a node */
int do_req = FALSE; /* Request files from a node */
int do_stat = FALSE; /* Show outbound status */
int do_stop = FALSE; /* Stop polling a node */
int do_reset = FALSE; /* Reset node's try counter */
int e_pid = 0; /* Pid of child */
extern int show_log; /* Show logging */
time_t t_start; /* Start time */
@ -132,7 +133,8 @@ void Help()
printf(" a att <node> <flavor> <file> Attach a file to a node\n");
printf(" n node <node> Show nodelist information\n");
printf(" p poll <node> [node..node] Poll node(s) (always crash)\n");
printf(" r req <node> <file> [file..file] Request file(s) from node\n");
printf(" req req <node> <file> [file..file] Request file(s) from node\n");
printf(" res reset <node> Reset node(s) \"try\" counter\n");
printf(" sta stat Show outbound status\n");
printf(" sto stop <node> [node..node] Stop polling node(s)\n");
printf("\n");
@ -207,8 +209,10 @@ int main(int argc, char *argv[])
do_node = TRUE;
if (!strncasecmp(argv[1], "p", 1))
do_poll = TRUE;
if (!strncasecmp(argv[1], "r", 1))
if (!strncasecmp(argv[1], "req", 3))
do_req = TRUE;
if (!strncasecmp(argv[1], "res", 3))
do_reset = TRUE;
if (!strncasecmp(argv[1], "sta", 3))
do_stat = TRUE;
if (!strncasecmp(argv[1], "sto", 3))
@ -247,12 +251,12 @@ int main(int argc, char *argv[])
/*
* Get node number from commandline
*/
if (do_attach || do_node || do_poll || do_stop || do_req) {
if (do_attach || do_node || do_poll || do_stop || do_req || do_reset) {
if (argc < 3)
Fatal((char *)"Not enough parameters");
}
if (do_attach || do_node || do_req) {
if (do_attach || do_node || do_req || do_reset) {
if ((addr = parsefaddr(argv[2])) == NULL)
Fatal((char *)"Unrecognizable address");
}
@ -281,6 +285,14 @@ int main(int argc, char *argv[])
die(rc);
}
if (do_reset) {
rc = reset(addr);
tidy_faddr(addr);
if (rc)
rc += 100;
die(rc);
}
if (do_attach) {
if (argc < 5)
Fatal((char *)"Not enough parameters");

View File

@ -71,6 +71,7 @@ int outstat()
char flstr[6];
time_t age;
char temp[81];
callstat *cst;
if ((rc = scanout(each))) {
WriteError("Error scanning outbound, aborting");
@ -79,11 +80,11 @@ int outstat()
if (!do_quiet) {
colour(10, 0);
printf("flavor size age address\n");
printf("flavor try size age address\n");
colour(3, 0);
}
Syslog('+', "Flavor Size Age Address");
Syslog('+', "Flavor Try Size Age Address");
for (tmp = alist; tmp; tmp = tmp->next) {
if ((tmp->flavors & F_FREQ) || (tmp->size) || 1) {
strcpy(flstr,"......");
@ -94,9 +95,11 @@ int outstat()
if ((tmp->flavors) & F_FREQ ) flstr[4]='R';
if ((tmp->flavors) & F_POLL ) flstr[5]='P';
cst = getstatus(&(tmp->addr));
age = time(NULL);
age -= tmp->time;
sprintf(temp, "%s %9lu %s %s", flstr, (long)tmp->size, str_time(age), ascfnode(&(tmp->addr), 0x1f));
sprintf(temp, "%s %3d %9lu %s %s", flstr, cst->tryno, (long)tmp->size,
str_time(age), ascfnode(&(tmp->addr), 0x1f));
if (!do_quiet)
printf("%s\n", temp);
@ -321,6 +324,19 @@ int poll(faddr *addr, int stop)
int reset(faddr *addr)
{
if (addr == NULL)
return 0;
putstatus(addr, 0, 0);
CreateSema((char *)"scanout");
return 0;
}
int freq(faddr *addr, char *fname)
{
char *req;

View File

@ -5,6 +5,7 @@
int each(faddr *, char, int, char *);
int outstat(void);
int poll(faddr *, int);
int reset(faddr *);
int freq(faddr *, char *);