#include <assert.h>
-static int retries = 10;
-static float timeout = 3;
+static int success = 0;
+static int retries = 3;
+static float timeout = 5;
static const char *secret = NULL;
static int do_output = 1;
static int totalapp = 0;
radclient->reply->data_len);
vp_printlist(stdout, radclient->reply->vps);
}
- if (radclient->reply->code != PW_AUTHENTICATION_REJECT) {
+
+ if ((radclient->reply->code == PW_AUTHENTICATION_ACK) ||
+ (radclient->reply->code == PW_ACCOUNTING_RESPONSE) ||
+ (radclient->reply->code == PW_COA_ACK) ||
+ (radclient->reply->code == PW_DISCONNECT_ACK)) {
+ success = 1; /* have a good response */
totalapp++;
} else {
totaldeny++;
printf("\t Total lost auths: %d\n", totallost);
}
- return 0;
+ if (success) return 0;
+
+ return 1;
}