struct ktime bozo_nextRestartKT, bozo_nextDayKT;
int bozo_newKTs;
+int rxBind = 0;
+
+#define ADDRSPERSITE 16 /* Same global is in rx/rx_user.c */
+afs_uint32 SHostAddrs[ADDRSPERSITE];
+
#ifdef BOS_RESTRICTED_MODE
int bozo_isrestricted = 0;
int bozo_restdisable = 0;
int i;
char namebuf[AFSDIR_PATH_MAX];
int rxMaxMTU = -1;
+ afs_uint32 host = htonl(INADDR_ANY);
#ifndef AFS_NT40_ENV
int nofork = 0;
struct stat sb;
bozo_isrestricted = 1;
}
#endif
+ else if (strcmp(argv[code], "-rxbind") == 0) {
+ rxBind = 1;
+ }
else if (!strcmp(argv[i], "-rxmaxmtu")) {
if ((i + 1) >= argc) {
fprintf(stderr, "missing argument for -rxmaxmtu\n");
#ifndef AFS_NT40_ENV
printf("Usage: bosserver [-noauth] [-log] "
"[-auditlog <log path>] "
- "[-rxmaxmtu <bytes>] "
+ "[-rxmaxmtu <bytes>] [-rxbind] "
"[-syslog[=FACILITY]] "
"[-enable_peer_stats] [-enable_process_stats] "
"[-nofork] " "[-help]\n");
#else
printf("Usage: bosserver [-noauth] [-log] "
"[-auditlog <log path>] "
- "[-rxmaxmtu <bytes>] "
+ "[-rxmaxmtu <bytes>] [-rxbind] "
"[-enable_peer_stats] [-enable_process_stats] "
"[-help]\n");
#endif
rx_SetMaxMTU(rxMaxMTU);
}
- tservice = rx_NewService( /* port */ 0, /* service id */ 1,
+ 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];
+ }
+
+ tservice = rx_NewServiceHost(host, /* port */ 0, /* service id */ 1,
/*service name */ "bozo",
/* security classes */
bozo_rxsc,
rx_SetStackSize(tservice, BOZO_LWP_STACKSIZE); /* so gethostbyname works (in cell stuff) */
tservice =
- rx_NewService(0, RX_STATS_SERVICE_ID, "rpcstats", bozo_rxsc, 3,
- RXSTATS_ExecuteRequest);
+ rx_NewServiceHost(host, 0, RX_STATS_SERVICE_ID, "rpcstats", bozo_rxsc,
+ 3, RXSTATS_ExecuteRequest);
rx_SetMinProcs(tservice, 2);
rx_SetMaxProcs(tservice, 4);
rx_StartServer(1); /* donate this process */
/* debugging control */
int debugging = 0;
+int rxBind = 0;
+
+#define ADDRSPERSITE 16 /* Same global is in rx/rx_user.c */
+afs_uint32 SHostAddrs[ADDRSPERSITE];
+
#if defined(AFS_PTHREAD_ENV)
char *
threadNum(void)
struct afsconf_cell cellinfo;
time_t currentTime;
afs_int32 code = 0;
+ afs_uint32 host = ntohl(INADDR_ANY);
char clones[MAXHOSTSPERCELL];
-
-
struct rx_service *tservice;
struct rx_securityClass *sca[3];
rx_SetRxDeadTime(60); /* 60 seconds inactive before timeout */
+ 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_BUDBPORT));
+ }
+ }
+
code = ubik_ServerInitByInfo (globalConfPtr->myHost,
htons(AFSCONF_BUDBPORT),
&cellinfo,
rx_SetNoJumbo();
tservice =
- rx_NewService(0, BUDB_SERVICE, "BackupDatabase", sca, 3,
+ rx_NewServiceHost(host, 0, BUDB_SERVICE, "BackupDatabase", sca, 3,
BUDB_ExecuteRequest);
if (tservice == (struct rx_service *)0) {
LogError(0, "Could not create backup database rx service\n");
afs_int32 BufferSize; /* Size in B stored for data */
char *centralLogFile;
afs_int32 lastLog; /* Log last pass info */
+int rxBind = 0;
+
+#define ADDRSPERSITE 16 /* Same global is in rx/rx_user.c */
+afs_uint32 SHostAddrs[ADDRSPERSITE];
/* dummy routine for the audit work. It should do nothing since audits */
/* occur at the server level and bos is not a server. */
PROCESS dbWatcherPid;
#endif
time_t t;
+ afs_uint32 host = htonl(INADDR_ANY);
debugLevel = 0;
autoQuery = 0;
localauth = (as->parms[5].items ? 1 : 0);
+ rxBind = (as->parms[8].items ? 1 : 0);
+
+ 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];
+ }
- code = rx_Init(htons(BC_TAPEPORT + portOffset));
+ code = rx_InitHost(host, htons(BC_TAPEPORT + portOffset));
if (code) {
TapeLog(0, 0, code, 0, "rx init failed on port %u\n",
BC_TAPEPORT + portOffset);
}
service =
- rx_NewService(0, 1, "BUTC", securityObjects, 3, TC_ExecuteRequest);
+ rx_NewServiceHost, (host, 0, 1, "BUTC", securityObjects, 3, TC_ExecuteRequest);
if (!service) {
TLog(0, "rx_NewService");
exit(1);
"file to restore to");
cmd_AddParm(ts, "-xbsaforcemultiple", CMD_FLAG, (CMD_OPTIONAL | CMD_HIDE),
"Force multiple XBSA server support");
+ cmd_AddParm(ts, "-rxbind", CMD_FLAG, CMD_OPTIONAL,
+ "bind Rx socket");
/* Initialize dirpaths */
if (!(initAFSDirPath() & AFSDIR_SERVER_PATHS_OK)) {
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"));
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");
service name might be used for probing for
statistics) */
struct rx_service *
-rx_NewService(u_short port, u_short serviceId, char *serviceName,
- struct rx_securityClass **securityObjects, int nSecurityObjects,
- afs_int32(*serviceProc) (struct rx_call * acall))
+rx_NewServiceHost(afs_uint32 host, u_short port, u_short serviceId,
+ char *serviceName, struct rx_securityClass **securityObjects,
+ int nSecurityObjects,
+ afs_int32(*serviceProc) (struct rx_call * acall))
{
osi_socket socket = OSI_NULLSOCKET;
register struct rx_service *tservice;
for (i = 0; i < RX_MAX_SERVICES; i++) {
register struct rx_service *service = rx_services[i];
if (service) {
- if (port == service->servicePort) {
+ if (port == service->servicePort && host == service->serviceHost) {
if (service->serviceId == serviceId) {
/* The identical service has already been
* installed; if the caller was intending to
service = tservice;
service->magic = MAGIC_RXSVC;
service->socket = socket;
+ service->serviceHost = host;
service->servicePort = port;
service->serviceId = serviceId;
service->serviceName = serviceName;
return 0;
}
+struct rx_service *
+rx_NewService(u_short port, u_short serviceId, char *serviceName,
+ struct rx_securityClass **securityObjects, int nSecurityObjects,
+ afs_int32(*serviceProc) (struct rx_call * acall))
+{
+ return rx_NewServiceHost(htonl(INADDR_ANY), port, serviceId, serviceName, securityObjects, nSecurityObjects, serviceProc);
+}
+
/* Generic request processing loop. This routine should be called
* by the implementation dependent rx_ServerProc. If socketp is
* non-null, it will be set to the file descriptor that this thread
struct rx_service {
int magic;
u_short serviceId; /* Service number */
+ afs_uint32 serviceHost; /* IP address for this service */
u_short servicePort; /* UDP port for this service */
char *serviceName; /* Name of the service */
osi_socket socket; /* socket structure or file descriptor */
afs_int32(*serviceProc) (struct
rx_call *
acall));
+extern struct rx_service *rx_NewServiceHost(afs_uint32 host, u_short port,
+ u_short serviceId,
+ char *serviceName,
+ struct rx_securityClass
+ **securityObjects,
+ int nSecurityObjects,
+ afs_int32(*serviceProc) (struct
+ rx_call *
+ acall));
extern void rxi_ServerProc(int threadID, struct rx_call *newcall,
osi_socket * socketp);
extern void rx_WakeupServerProcs(void);
ubik_sc[secIndex] = secClass;
}
}
+ /* for backwards compat this should keep working as it does now
+ and not host bind */
code = rx_Init(myPort);
if (code < 0)
return code;
static int Quit();
+int rxBind = 0;
+
+#define ADDRSPERSITE 16 /* Same global is in rx/rx_user.c */
+afs_uint32 SHostAddrs[ADDRSPERSITE];
+
/* check whether caller is authorized to manage RX statistics */
int
update_rxstat_userok(struct rx_call *call)
{
struct rx_securityClass *securityObjects[3];
struct rx_service *service;
+ afs_uint32 host = htonl(INADDR_ANY);
int a = 0;
rxkad_level level;
for (a = 1; a < argc; a++) {
if (argv[a][0] == '-') { /* parse options */
- char arg[256];
- lcstring(arg, argv[a], sizeof(arg));
- newLevel = rxkad_StringToLevel(&argv[a][1]);
- if (newLevel != -1) {
- level = newLevel; /* set new level */
+ if (strcmp(argv[a], "-rxbind") == 0) {
+ rxBind = 1;
continue;
+ } else {
+ char arg[256];
+ lcstring(arg, argv[a], sizeof(arg));
+ newLevel = rxkad_StringToLevel(&argv[a][1]);
+ if (newLevel != -1) {
+ level = newLevel; /* set new level */
+ continue;
+ }
}
usage:
- Quit("Usage: upserver [<directory>+] [-crypt <directory>+] [-clear <directory>+] [-auth <directory>+] [-help]\n");
+ Quit("Usage: upserver [<directory>+] [-crypt <directory>+] [-clear <directory>+] [-auth <directory>+] [-rxbind] [-help]\n");
} else {
int dirlen;
if (nDirs >= sizeof(dirName) / sizeof(dirName[0]))
exit(1);
}
+ 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];
+ }
+
/* Initialize Rx, telling it port number this server will use for its
* single service */
- if (rx_Init(htons(AFSCONF_UPDATEPORT)) < 0)
+ if (rx_InitHost(host, htons(AFSCONF_UPDATEPORT)) < 0)
Quit("rx_init");
/* Create a single security object, in this case the null security object,
* which is called to decode requests is passed in here
* (UPDATE_ExecuteRequest). */
service =
- rx_NewService(0, UPDATE_SERVICEID, "UPDATE", securityObjects, 3,
- UPDATE_ExecuteRequest);
+ rx_NewServiceHost(host, 0, UPDATE_SERVICEID, "UPDATE", securityObjects,
+ 3, UPDATE_ExecuteRequest);
if (service == (struct rx_service *)0)
Quit("rx_NewService");
rx_SetMaxProcs(service, 2);
int debuglevel = 0;
int printBanner = 0;
int rxJumbograms = 1; /* default is to send and receive jumbograms. */
+int rxBind = 0; /* don't bind */
int rxMaxMTU = -1;
afs_int32 implicitAdminRights = PRSFS_LOOKUP; /* The ADMINISTER right is
* already implied */
strcat(buffer, "[-rxdbg (enable rx debugging)] ");
strcat(buffer, "[-rxdbge (enable rxevent debugging)] ");
strcat(buffer, "[-rxmaxmtu <bytes>] ");
+ strcat(buffer, "[-rxbind (bind the Rx socket to one address)] ");
#ifdef AFS_DEMAND_ATTACH_FS
strcat(buffer, "[-fs-state-dont-save (disable state save during shutdown)] ");
strcat(buffer, "[-fs-state-dont-restore (disable state restore during startup)] ");
#endif
else if (!strcmp(argv[i], "-nojumbo")) {
rxJumbograms = 0;
+ } else if (!strcmp(argv[i], "-rxbind")) {
+ rxBind = 1;
} else if (!strcmp(argv[i], "-rxmaxmtu")) {
if ((i + 1) >= argc) {
fprintf(stderr, "missing argument for -rxmaxmtu\n");
}
afs_int32
+SetupVL()
+{
+ afs_int32 code;
+ extern int rxi_numNetAddrs;
+ extern afs_uint32 rxi_NetAddrs[];
+
+#ifndef AFS_NT40_ENV
+ if (AFSDIR_SERVER_NETRESTRICT_FILEPATH || AFSDIR_SERVER_NETINFO_FILEPATH) {
+ /*
+ * Find addresses we are supposed to register as per the netrestrict
+ * and netinfo files (/usr/afs/local/NetInfo and
+ * /usr/afs/local/NetRestict)
+ */
+ char reason[1024];
+ afs_int32 code = parseNetFiles(FS_HostAddrs, NULL, NULL,
+ ADDRSPERSITE, reason,
+ AFSDIR_SERVER_NETINFO_FILEPATH,
+ AFSDIR_SERVER_NETRESTRICT_FILEPATH);
+ if (code < 0) {
+ ViceLog(0, ("Can't register any valid addresses: %s\n", reason));
+ exit(1);
+ }
+ FS_HostAddr_cnt = (afs_uint32) code;
+ } else
+#endif
+ {
+ FS_HostAddr_cnt = rx_getAllAddr(FS_HostAddrs, ADDRSPERSITE);
+ }
+
+ if (FS_HostAddr_cnt == 1 && rxBind == 1)
+ code = FS_HostAddrs[0];
+ else
+ code = htonl(INADDR_ANY);
+ return code;
+}
+
+afs_int32
InitVL()
{
afs_int32 code;
/* A good sysid file exists; inform the vlserver. If any conflicts,
* we always use the latest interface available as the real truth.
*/
-#ifndef AFS_NT40_ENV
- if (AFSDIR_SERVER_NETRESTRICT_FILEPATH || AFSDIR_SERVER_NETINFO_FILEPATH) {
- /*
- * Find addresses we are supposed to register as per the netrestrict
- * and netinfo files (/usr/afs/local/NetInfo and
- * /usr/afs/local/NetRestict)
- */
- char reason[1024];
- afs_int32 code = parseNetFiles(FS_HostAddrs, NULL, NULL,
- ADDRSPERSITE, reason,
- AFSDIR_SERVER_NETINFO_FILEPATH,
- AFSDIR_SERVER_NETRESTRICT_FILEPATH);
- if (code < 0) {
- ViceLog(0, ("Can't register any valid addresses: %s\n", reason));
- exit(1);
- }
- FS_HostAddr_cnt = (afs_uint32) code;
- } else
-#endif
- {
- FS_HostAddr_cnt = rx_getAllAddr(FS_HostAddrs, ADDRSPERSITE);
- }
- FS_registered = 1;
code = Do_VLRegisterRPC();
return code;
}
#endif
int curLimit;
time_t t;
+ afs_uint32 rx_bindhost;
#ifdef AFS_AIX32_ENV
struct sigaction nsa;
#endif
if (udpBufSize)
rx_SetUdpBufSize(udpBufSize); /* set the UDP buffer size for receive */
- if (rx_Init((int)htons(7000)) < 0) {
+ rx_bindhost = SetupVL();
+
+ if (rx_InitHost(rx_bindhost, (int)htons(7000)) < 0) {
ViceLog(0, ("Cannot initialize RX\n"));
exit(1);
}
sc[1] = 0; /* rxvab_NewServerSecurityObject(key1, 0) */
sc[2] = rxkad_NewServerSecurityObject(rxkad_clear, NULL, get_key, NULL);
sc[3] = rxkad_NewServerSecurityObject(rxkad_crypt, NULL, get_key, NULL);
- tservice = rx_NewService( /* port */ 0, /* service id */ 1, /*service name */
- "AFS",
- /* security classes */ sc,
- /* numb sec classes */
- 4, RXAFS_ExecuteRequest);
+ tservice = rx_NewServiceHost(rx_bindhost, /* port */ 0, /* service id */
+ 1, /*service name */
+ "AFS",
+ /* security classes */ sc,
+ /* numb sec classes */
+ 4, RXAFS_ExecuteRequest);
if (!tservice) {
ViceLog(0,
("Failed to initialize RX, probably two servers running.\n"));
int smallMem = 0;
int rxJumbograms = 1; /* default is to send and receive jumbo grams */
int rxMaxMTU = -1;
+afs_int32 rxBind = 0;
+
+#define ADDRSPERSITE 16 /* Same global is in rx/rx_user.c */
+afs_uint32 SHostAddrs[ADDRSPERSITE];
static void
CheckSignal_Signal()
extern int rx_extraPackets;
char commandLine[150];
char clones[MAXHOSTSPERCELL];
+ afs_uint32 host = ntohl(INADDR_ANY);
#ifdef AFS_AIX32_ENV
/*
} else if (strcmp(argv[index], "-nojumbo") == 0) {
rxJumbograms = 0;
+ } else if (strcmp(argv[index], "-rxbind") == 0) {
+ rxBind = 1;
+
} else if (!strcmp(argv[index], "-rxmaxmtu")) {
if ((index + 1) >= argc) {
fprintf(stderr, "missing argument for -rxmaxmtu\n");
/* support help flag */
#ifndef AFS_NT40_ENV
printf("Usage: vlserver [-p <number of processes>] [-nojumbo] "
- "[-rxmaxmtu <bytes>] "
+ "[-rxmaxmtu <bytes>] [-rxbind] "
"[-auditlog <log path>] "
"[-syslog[=FACILITY]] "
"[-enable_peer_stats] [-enable_process_stats] "
"[-help]\n");
#else
printf("Usage: vlserver [-p <number of processes>] [-nojumbo] "
- "[-rxmaxmtu <bytes>] "
+ "[-rxmaxmtu <bytes>] [-rxbind] "
"[-auditlog <log path>] "
"[-enable_peer_stats] [-enable_process_stats] "
"[-help]\n");
if (noAuth)
afsconf_SetNoAuthFlag(tdir, 1);
+ 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_VLDBPORT));
+ }
+ }
+
ubik_nBuffers = 512;
ubik_CRXSecurityProc = afsconf_ClientAuth;
ubik_CRXSecurityRock = (char *)tdir;
sc[0] = rxnull_NewServerSecurityObject();
sc[1] = (struct rx_securityClass *)0;
sc[2] = rxkad_NewServerSecurityObject(0, tdir, afsconf_GetKey, NULL);
+
tservice =
- rx_NewService(0, USER_SERVICE_ID, "Vldb server", sc, 3,
+ rx_NewServiceHost(host, 0, USER_SERVICE_ID, "Vldb server", sc, 3,
VL_ExecuteRequest);
if (tservice == (struct rx_service *)0) {
printf("vlserver: Could not create VLDB_SERVICE 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) {
printf("vlserver: Could not create rpc stats rx service\n");
int udpBufSize = 0; /* UDP buffer size for receive */
int Testing = 0; /* for ListViceInodes */
+int rxBind = 0;
+
+#define ADDRSPERSITE 16 /* Same global is in rx/rx_user.c */
+afs_uint32 SHostAddrs[ADDRSPERSITE];
#define VS_EXIT(code) { \
osi_audit(VS_ExitEvent, code, AUD_END); \
int rxJumbograms = 1; /* default is to send and receive jumbograms. */
int rxMaxMTU = -1;
int bufSize = 0; /* temp variable to read in udp socket buf size */
+ afs_uint32 host = ntohl(INADDR_ANY);
#ifdef AFS_AIX32_ENV
/*
DoLogging = 1;
} else if (strcmp(argv[code], "-help") == 0) {
goto usage;
+ } else if (strcmp(argv[code], "-rxbind") == 0) {
+ rxBind = 1;
} else if (strcmp(argv[code], "-p") == 0) {
lwps = atoi(argv[++code]);
if (lwps > MAXLWP) {
#ifndef AFS_NT40_ENV
printf("Usage: volserver [-log] [-p <number of processes>] "
"[-auditlog <log path>] "
- "[-nojumbo] [-rxmaxmtu <bytes>] "
+ "[-nojumbo] [-rxmaxmtu <bytes>] [-rxbind] "
"[-udpsize <size of socket buffer in bytes>] "
"[-syslog[=FACILITY]] "
"[-enable_peer_stats] [-enable_process_stats] "
#else
printf("Usage: volserver [-log] [-p <number of processes>] "
"[-auditlog <log path>] "
- "[-nojumbo] [-rxmaxmtu <bytes>] "
+ "[-nojumbo] [-rxmaxmtu <bytes>] [-rxbind] "
"[-udpsize <size of socket buffer in bytes>] "
"[-enable_peer_stats] [-enable_process_stats] "
"[-help]\n");
rx_nPackets = rxpackets; /* set the max number of packets */
if (udpBufSize)
rx_SetUdpBufSize(udpBufSize); /* set the UDP buffer size for receive */
- code = rx_Init((int)htons(AFSCONF_VOLUMEPORT));
+ 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];
+ }
+
+ code = rx_InitHost(host, (int)htons(AFSCONF_VOLUMEPORT));
if (code) {
fprintf(stderr, "rx init failed on socket AFSCONF_VOLUMEPORT %u\n",
AFSCONF_VOLUMEPORT);
if (securityObjects[0] == (struct rx_securityClass *)0)
Abort("rxnull_NewServerSecurityObject");
service =
- rx_NewService(0, VOLSERVICE_ID, "VOLSER", securityObjects, 3,
+ rx_NewServiceHost(host, 0, VOLSERVICE_ID, "VOLSER", securityObjects, 3,
AFSVolExecuteRequest);
if (service == (struct rx_service *)0)
Abort("rx_NewService");