int restricted = 0;
int rxMaxMTU = -1;
+int rxBind = 0;
+
+#define ADDRSPERSITE 16 /* Same global is in rx/rx_user.c */
+afs_uint32 SHostAddrs[ADDRSPERSITE];
static struct afsconf_cell info;
int kerberosKeys; /* set if found some keys */
int lwps = 3;
char clones[MAXHOSTSPERCELL];
+ afs_uint32 host = htonl(INADDR_ANY);
const char *pr_dbaseName;
char *whoami = "ptserver";
else if (strncmp(arg, "-restricted", alen) == 0) {
restricted = 1;
}
+ else if (strncmp(arg, "-rxbind", alen) == 0) {
+ rxBind = 1;
+ }
else if (strncmp(arg, "-enable_peer_stats", alen) == 0) {
rx_enablePeerRPCStats();
} else if (strncmp(arg, "-enable_process_stats", alen) == 0) {
"[-syslog[=FACILITY]] "
"[-p <number of processes>] [-rebuild] "
"[-groupdepth <depth>] "
- "[-restricted] [-rxmaxmtu <bytes>]"
+ "[-restricted] [-rxmaxmtu <bytes>] [-rxbind] "
"[-enable_peer_stats] [-enable_process_stats] "
"[-default_access default_user_access default_group_access] "
"[-help]\n");
#else /* AFS_NT40_ENV */
printf("Usage: ptserver [-database <db path>] "
"[-auditlog <log path>] "
- "[-p <number of processes>] [-rebuild] "
+ "[-p <number of processes>] [-rebuild] [-rxbind] "
"[-default_access default_user_access default_group_access] "
- "[-restricted] [-rxmaxmtu <bytes>]"
+ "[-restricted] [-rxmaxmtu <bytes>] [-rxbind] "
"[-groupdepth <depth>] " "[-help]\n");
#endif
#else
"[-p <number of processes>] [-rebuild] "
"[-enable_peer_stats] [-enable_process_stats] "
"[-default_access default_user_access default_group_access] "
- "[-restricted] [-rxmaxmtu <bytes>]"
+ "[-restricted] [-rxmaxmtu <bytes>] [-rxbind] "
"[-help]\n");
#else /* AFS_NT40_ENV */
printf("Usage: ptserver [-database <db path>] "
"[-auditlog <log path>] "
"[-default_access default_user_access default_group_access] "
- "[-restricted] [-rxmaxmtu <bytes>]"
+ "[-restricted] [-rxmaxmtu <bytes>] [-rxbind] "
"[-p <number of processes>] [-rebuild] " "[-help]\n");
#endif
#endif
* and the header are in separate Ubik buffers then 120 buffers may be
* required. */
ubik_nBuffers = 120 + /*fudge */ 40;
+
+ 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_PROTPORT));
+ }
+ }
+
code =
ubik_ServerInitByInfo(myHost, htons(AFSCONF_PROTPORT), &info, &clones,
pr_dbaseName, &dbase);
}
tservice =
- rx_NewService(0, PRSRV, "Protection Server", sc, 3,
+ rx_NewServiceHost(host, 0, PRSRV, "Protection Server", sc, 3,
PR_ExecuteRequest);
if (tservice == (struct rx_service *)0) {
fprintf(stderr, "ptserver: Could not create new rx service.\n");
rx_SetMaxProcs(tservice, lwps);
tservice =
- rx_NewService(0, RX_STATS_SERVICE_ID, "rpcstats", sc, 3,
+ rx_NewServiceHost(host, 0, RX_STATS_SERVICE_ID, "rpcstats", sc, 3,
RXSTATS_ExecuteRequest);
if (tservice == (struct rx_service *)0) {
fprintf(stderr, "ptserver: Could not create new rx service.\n");