afs_int32 myHost = 0;
afs_int32 verbose_track = 1;
afs_int32 krb4_cross = 0;
+afs_int32 rxBind = 0;
+
+#define ADDRSPERSITE 16 /* Same global is in rx/rx_user.c */
+afs_uint32 SHostAddrs[ADDRSPERSITE];
struct afsconf_dir *KA_conf; /* for getting cell info */
int level; /* security level for Ubik */
afs_int32 i;
char clones[MAXHOSTSPERCELL];
+ afs_uint32 host = ntohl(INADDR_ANY);
struct rx_service *tservice;
struct rx_securityClass *sca[1];
if (argc == 0) {
usage:
printf("Usage: kaserver [-noAuth] [-fastKeys] [-database <dbpath>] "
- "[-auditlog <log path>] "
+ "[-auditlog <log path>] [-rxbind] "
"[-localfiles <lclpath>] [-minhours <n>] [-servers <serverlist>] "
"[-crossrealm]"
/*" [-enable_peer_stats] [-enable_process_stats] " */
verbose_track = 0;
else if (IsArg("-crossrealm"))
krb4_cross = 1;
+ else if (IsArg("-rxbind"))
+ rxBind = 1;
else if (IsArg("-minhours")) {
MinHours = atoi(argv[++a]);
} else if (IsArg("-enable_peer_stats")) {
ubik_CheckRXSecurityRock = (char *)KA_conf;
ubik_nBuffers = 80;
+
+ if (rxBind) {
+ afs_int32 ccode;
+ if (AFSDIR_SERVER_NETRESTRICT_FILEPATH ||
+ AFSDIR_SERVER_NETINFO_FILEPATH) {
+ char reason[1024];
+ ccode = parseNetFiles(SHostAddrs, NULL, NULL,
+ ADDRSPERSITE, reason,
+ AFSDIR_SERVER_NETINFO_FILEPATH,
+ AFSDIR_SERVER_NETRESTRICT_FILEPATH);
+ } else {
+ ccode = rx_getAllAddr(SHostAddrs, ADDRSPERSITE);
+ }
+ if (ccode == 1) {
+ host = SHostAddrs[0];
+ rx_InitHost(host, htons(AFSCONF_KAUTHPORT));
+ }
+ }
+
if (servers)
code =
ubik_ServerInit(myHost, htons(AFSCONF_KAUTHPORT), serverList,
rx_SetNoJumbo();
tservice =
- rx_NewService(0, KA_AUTHENTICATION_SERVICE, "AuthenticationService",
- sca, 1, KAA_ExecuteRequest);
+ rx_NewServiceHost(host, 0, KA_AUTHENTICATION_SERVICE,
+ "AuthenticationService", sca, 1, KAA_ExecuteRequest);
if (tservice == (struct rx_service *)0) {
ViceLog(0, ("Could not create Authentication rx service\n"));
exit(3);
rx_SetMinProcs(tservice, 1);
rx_SetMaxProcs(tservice, 1);
+
tservice =
- rx_NewService(0, KA_TICKET_GRANTING_SERVICE, "TicketGrantingService",
+ rx_NewServiceHost(host, 0, KA_TICKET_GRANTING_SERVICE, "TicketGrantingService",
sca, 1, KAT_ExecuteRequest);
if (tservice == (struct rx_service *)0) {
ViceLog(0, ("Could not create Ticket Granting rx service\n"));
scm[RX_SCINDEX_KAD] =
rxkad_NewServerSecurityObject(rxkad_crypt, 0, kvno_admin_key, 0);
tservice =
- rx_NewService(0, KA_MAINTENANCE_SERVICE, "Maintenance", scm, 3,
+ rx_NewServiceHost(host, 0, KA_MAINTENANCE_SERVICE, "Maintenance", scm, 3,
KAM_ExecuteRequest);
if (tservice == (struct rx_service *)0) {
ViceLog(0, ("Could not create Maintenance rx service\n"));
rx_SetStackSize(tservice, 10000);
tservice =
- rx_NewService(0, RX_STATS_SERVICE_ID, "rpcstats", scm, 3,
+ rx_NewServiceHost(host, 0, RX_STATS_SERVICE_ID, "rpcstats", scm, 3,
RXSTATS_ExecuteRequest);
if (tservice == (struct rx_service *)0) {
ViceLog(0, ("Could not create rpc stats rx service\n"));