fprintf(stderr, " [port] Terminal Server port to match\n");
fprintf(stderr, " [user] Login account to match\n");
exit(1);
-}
+}
/*
/* Process the options. */
while ((argval = getopt(argc, argv, "d:p:r:")) != EOF) {
-
+
switch(argval) {
-
+
case 'd':
if (radius_dir) free(radius_dir);
radius_dir = strdup(optarg);
case 'p':
acct_port = atoi(optarg);
break;
-
+
case 'r':
if ((radiusip = ip_getaddr(optarg)) == INADDR_NONE) {
fprintf(stderr, "%s: %s: radius server unknown\n",
exit(1);
}
break;
-
+
default:
usage();
exit(1);
exit(1);
}
}
- if (nas != NULL)
+ if (nas != NULL)
ip = nas->ipaddr;
/*
printf("%s: zapping termserver %s, port %u",
progname, ip_hostname(buf, sizeof(buf), ip), nas_port);
- if (user != NULL)
+ if (user != NULL)
printf(", user %s", user);
printf("\n");
req->id = getpid() & 0xFF;
req->code = PW_ACCOUNTING_REQUEST;
req->dst_port = acct_port;
- if(req->dst_port == 0)
+ if(req->dst_port == 0)
req->dst_port = getport("radacct");
- if(req->dst_port == 0)
+ if(req->dst_port == 0)
req->dst_port = PW_ACCT_UDP_PORT;
if (radiusip == INADDR_NONE) {
req->dst_ipaddr = ip_getaddr("localhost");
else {
req->dst_ipaddr = radiusip;
}
- if(!req->dst_ipaddr)
+ if(!req->dst_ipaddr)
req->dst_ipaddr = 0x7f000001;
req->vps = NULL;
secret = getsecret(req->dst_ipaddr);