mirror of
https://git.openafs.org/openafs.git
synced 2025-02-01 05:57:43 +00:00
STABLE14-rxbind-for-servers-20060612
FIXES 32308 support -rxbind switch for servers (cherry picked from commit 592d97f9472abcf77496cef07261fa8766f60b9f)
This commit is contained in:
parent
24f40413fb
commit
72a0ca838d
@ -71,6 +71,11 @@ static afs_int32 nextDay;
|
|||||||
|
|
||||||
struct ktime bozo_nextRestartKT, bozo_nextDayKT;
|
struct ktime bozo_nextRestartKT, bozo_nextDayKT;
|
||||||
int bozo_newKTs;
|
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
|
#ifdef BOS_RESTRICTED_MODE
|
||||||
int bozo_isrestricted = 0;
|
int bozo_isrestricted = 0;
|
||||||
int bozo_restdisable = 0;
|
int bozo_restdisable = 0;
|
||||||
@ -719,6 +724,7 @@ main(int argc, char **argv, char **envp)
|
|||||||
int i;
|
int i;
|
||||||
char namebuf[AFSDIR_PATH_MAX];
|
char namebuf[AFSDIR_PATH_MAX];
|
||||||
int rxMaxMTU = -1;
|
int rxMaxMTU = -1;
|
||||||
|
afs_uint32 host = htonl(INADDR_ANY);
|
||||||
#ifndef AFS_NT40_ENV
|
#ifndef AFS_NT40_ENV
|
||||||
int nofork = 0;
|
int nofork = 0;
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
@ -813,6 +819,9 @@ main(int argc, char **argv, char **envp)
|
|||||||
bozo_isrestricted = 1;
|
bozo_isrestricted = 1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
else if (strcmp(argv[code], "-rxbind") == 0) {
|
||||||
|
rxBind = 1;
|
||||||
|
}
|
||||||
else if (!strcmp(argv[i], "-rxmaxmtu")) {
|
else if (!strcmp(argv[i], "-rxmaxmtu")) {
|
||||||
if ((i + 1) >= argc) {
|
if ((i + 1) >= argc) {
|
||||||
fprintf(stderr, "missing argument for -rxmaxmtu\n");
|
fprintf(stderr, "missing argument for -rxmaxmtu\n");
|
||||||
@ -864,14 +873,14 @@ main(int argc, char **argv, char **envp)
|
|||||||
#ifndef AFS_NT40_ENV
|
#ifndef AFS_NT40_ENV
|
||||||
printf("Usage: bosserver [-noauth] [-log] "
|
printf("Usage: bosserver [-noauth] [-log] "
|
||||||
"[-auditlog <log path>] "
|
"[-auditlog <log path>] "
|
||||||
"[-rxmaxmtu <bytes>] "
|
"[-rxmaxmtu <bytes>] [-rxbind] "
|
||||||
"[-syslog[=FACILITY]] "
|
"[-syslog[=FACILITY]] "
|
||||||
"[-enable_peer_stats] [-enable_process_stats] "
|
"[-enable_peer_stats] [-enable_process_stats] "
|
||||||
"[-nofork] " "[-help]\n");
|
"[-nofork] " "[-help]\n");
|
||||||
#else
|
#else
|
||||||
printf("Usage: bosserver [-noauth] [-log] "
|
printf("Usage: bosserver [-noauth] [-log] "
|
||||||
"[-auditlog <log path>] "
|
"[-auditlog <log path>] "
|
||||||
"[-rxmaxmtu <bytes>] "
|
"[-rxmaxmtu <bytes>] [-rxbind] "
|
||||||
"[-enable_peer_stats] [-enable_process_stats] "
|
"[-enable_peer_stats] [-enable_process_stats] "
|
||||||
"[-help]\n");
|
"[-help]\n");
|
||||||
#endif
|
#endif
|
||||||
@ -1027,7 +1036,23 @@ main(int argc, char **argv, char **envp)
|
|||||||
rx_SetMaxMTU(rxMaxMTU);
|
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",
|
/*service name */ "bozo",
|
||||||
/* security classes */
|
/* security classes */
|
||||||
bozo_rxsc,
|
bozo_rxsc,
|
||||||
@ -1037,8 +1062,8 @@ main(int argc, char **argv, char **envp)
|
|||||||
rx_SetStackSize(tservice, BOZO_LWP_STACKSIZE); /* so gethostbyname works (in cell stuff) */
|
rx_SetStackSize(tservice, BOZO_LWP_STACKSIZE); /* so gethostbyname works (in cell stuff) */
|
||||||
|
|
||||||
tservice =
|
tservice =
|
||||||
rx_NewService(0, RX_STATS_SERVICE_ID, "rpcstats", bozo_rxsc, 3,
|
rx_NewServiceHost(host, 0, RX_STATS_SERVICE_ID, "rpcstats", bozo_rxsc,
|
||||||
RXSTATS_ExecuteRequest);
|
3, RXSTATS_ExecuteRequest);
|
||||||
rx_SetMinProcs(tservice, 2);
|
rx_SetMinProcs(tservice, 2);
|
||||||
rx_SetMaxProcs(tservice, 4);
|
rx_SetMaxProcs(tservice, 4);
|
||||||
rx_StartServer(1); /* donate this process */
|
rx_StartServer(1); /* donate this process */
|
||||||
|
@ -76,6 +76,11 @@ char dbDir[AFSDIR_PATH_MAX], cellConfDir[AFSDIR_PATH_MAX];
|
|||||||
/* debugging control */
|
/* debugging control */
|
||||||
int debugging = 0;
|
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)
|
#if defined(AFS_PTHREAD_ENV)
|
||||||
char *
|
char *
|
||||||
threadNum(void)
|
threadNum(void)
|
||||||
@ -357,11 +362,10 @@ main(argc, argv)
|
|||||||
struct afsconf_cell cellinfo;
|
struct afsconf_cell cellinfo;
|
||||||
time_t currentTime;
|
time_t currentTime;
|
||||||
afs_int32 code = 0;
|
afs_int32 code = 0;
|
||||||
|
afs_uint32 host = ntohl(INADDR_ANY);
|
||||||
|
|
||||||
char clones[MAXHOSTSPERCELL];
|
char clones[MAXHOSTSPERCELL];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct rx_service *tservice;
|
struct rx_service *tservice;
|
||||||
struct rx_securityClass *sca[3];
|
struct rx_securityClass *sca[3];
|
||||||
|
|
||||||
@ -517,6 +521,24 @@ main(argc, argv)
|
|||||||
|
|
||||||
rx_SetRxDeadTime(60); /* 60 seconds inactive before timeout */
|
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,
|
code = ubik_ServerInitByInfo (globalConfPtr->myHost,
|
||||||
htons(AFSCONF_BUDBPORT),
|
htons(AFSCONF_BUDBPORT),
|
||||||
&cellinfo,
|
&cellinfo,
|
||||||
@ -540,7 +562,7 @@ main(argc, argv)
|
|||||||
rx_SetNoJumbo();
|
rx_SetNoJumbo();
|
||||||
|
|
||||||
tservice =
|
tservice =
|
||||||
rx_NewService(0, BUDB_SERVICE, "BackupDatabase", sca, 3,
|
rx_NewServiceHost(host, 0, BUDB_SERVICE, "BackupDatabase", sca, 3,
|
||||||
BUDB_ExecuteRequest);
|
BUDB_ExecuteRequest);
|
||||||
if (tservice == (struct rx_service *)0) {
|
if (tservice == (struct rx_service *)0) {
|
||||||
LogError(0, "Could not create backup database rx service\n");
|
LogError(0, "Could not create backup database rx service\n");
|
||||||
|
@ -106,6 +106,10 @@ afs_int32 statusSize;
|
|||||||
afs_int32 BufferSize; /* Size in B stored for data */
|
afs_int32 BufferSize; /* Size in B stored for data */
|
||||||
char *centralLogFile;
|
char *centralLogFile;
|
||||||
afs_int32 lastLog; /* Log last pass info */
|
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 */
|
/* dummy routine for the audit work. It should do nothing since audits */
|
||||||
/* occur at the server level and bos is not a server. */
|
/* occur at the server level and bos is not a server. */
|
||||||
@ -857,6 +861,7 @@ WorkerBee(as, arock)
|
|||||||
PROCESS dbWatcherPid;
|
PROCESS dbWatcherPid;
|
||||||
#endif
|
#endif
|
||||||
time_t t;
|
time_t t;
|
||||||
|
afs_uint32 host = htonl(INADDR_ANY);
|
||||||
|
|
||||||
debugLevel = 0;
|
debugLevel = 0;
|
||||||
|
|
||||||
@ -1039,8 +1044,25 @@ WorkerBee(as, arock)
|
|||||||
autoQuery = 0;
|
autoQuery = 0;
|
||||||
|
|
||||||
localauth = (as->parms[5].items ? 1 : 0);
|
localauth = (as->parms[5].items ? 1 : 0);
|
||||||
|
rxBind = (as->parms[8].items ? 1 : 0);
|
||||||
|
|
||||||
code = rx_Init(htons(BC_TAPEPORT + portOffset));
|
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, htons(BC_TAPEPORT + portOffset));
|
||||||
if (code) {
|
if (code) {
|
||||||
TapeLog(0, 0, code, 0, "rx init failed on port %u\n",
|
TapeLog(0, 0, code, 0, "rx init failed on port %u\n",
|
||||||
BC_TAPEPORT + portOffset);
|
BC_TAPEPORT + portOffset);
|
||||||
@ -1080,7 +1102,7 @@ WorkerBee(as, arock)
|
|||||||
}
|
}
|
||||||
|
|
||||||
service =
|
service =
|
||||||
rx_NewService(0, 1, "BUTC", securityObjects, 3, TC_ExecuteRequest);
|
rx_NewServiceHost, (host, 0, 1, "BUTC", securityObjects, 3, TC_ExecuteRequest);
|
||||||
if (!service) {
|
if (!service) {
|
||||||
TLog(0, "rx_NewService");
|
TLog(0, "rx_NewService");
|
||||||
exit(1);
|
exit(1);
|
||||||
@ -1183,6 +1205,8 @@ main(argc, argv)
|
|||||||
"file to restore to");
|
"file to restore to");
|
||||||
cmd_AddParm(ts, "-xbsaforcemultiple", CMD_FLAG, (CMD_OPTIONAL | CMD_HIDE),
|
cmd_AddParm(ts, "-xbsaforcemultiple", CMD_FLAG, (CMD_OPTIONAL | CMD_HIDE),
|
||||||
"Force multiple XBSA server support");
|
"Force multiple XBSA server support");
|
||||||
|
cmd_AddParm(ts, "-rxbind", CMD_FLAG, CMD_OPTIONAL,
|
||||||
|
"bind Rx socket");
|
||||||
|
|
||||||
/* Initialize dirpaths */
|
/* Initialize dirpaths */
|
||||||
if (!(initAFSDirPath() & AFSDIR_SERVER_PATHS_OK)) {
|
if (!(initAFSDirPath() & AFSDIR_SERVER_PATHS_OK)) {
|
||||||
|
@ -59,6 +59,10 @@ struct ubik_dbase *KA_dbase;
|
|||||||
afs_int32 myHost = 0;
|
afs_int32 myHost = 0;
|
||||||
afs_int32 verbose_track = 1;
|
afs_int32 verbose_track = 1;
|
||||||
afs_int32 krb4_cross = 0;
|
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 */
|
struct afsconf_dir *KA_conf; /* for getting cell info */
|
||||||
|
|
||||||
@ -168,6 +172,7 @@ main(argc, argv)
|
|||||||
int level; /* security level for Ubik */
|
int level; /* security level for Ubik */
|
||||||
afs_int32 i;
|
afs_int32 i;
|
||||||
char clones[MAXHOSTSPERCELL];
|
char clones[MAXHOSTSPERCELL];
|
||||||
|
afs_uint32 host = ntohl(INADDR_ANY);
|
||||||
|
|
||||||
struct rx_service *tservice;
|
struct rx_service *tservice;
|
||||||
struct rx_securityClass *sca[1];
|
struct rx_securityClass *sca[1];
|
||||||
@ -203,7 +208,7 @@ main(argc, argv)
|
|||||||
if (argc == 0) {
|
if (argc == 0) {
|
||||||
usage:
|
usage:
|
||||||
printf("Usage: kaserver [-noAuth] [-fastKeys] [-database <dbpath>] "
|
printf("Usage: kaserver [-noAuth] [-fastKeys] [-database <dbpath>] "
|
||||||
"[-auditlog <log path>] "
|
"[-auditlog <log path>] [-rxbind] "
|
||||||
"[-localfiles <lclpath>] [-minhours <n>] [-servers <serverlist>] "
|
"[-localfiles <lclpath>] [-minhours <n>] [-servers <serverlist>] "
|
||||||
"[-crossrealm]"
|
"[-crossrealm]"
|
||||||
/*" [-enable_peer_stats] [-enable_process_stats] " */
|
/*" [-enable_peer_stats] [-enable_process_stats] " */
|
||||||
@ -305,6 +310,8 @@ main(argc, argv)
|
|||||||
verbose_track = 0;
|
verbose_track = 0;
|
||||||
else if (IsArg("-crossrealm"))
|
else if (IsArg("-crossrealm"))
|
||||||
krb4_cross = 1;
|
krb4_cross = 1;
|
||||||
|
else if (IsArg("-rxbind"))
|
||||||
|
rxBind = 1;
|
||||||
else if (IsArg("-minhours")) {
|
else if (IsArg("-minhours")) {
|
||||||
MinHours = atoi(argv[++a]);
|
MinHours = atoi(argv[++a]);
|
||||||
} else if (IsArg("-enable_peer_stats")) {
|
} else if (IsArg("-enable_peer_stats")) {
|
||||||
@ -377,6 +384,25 @@ main(argc, argv)
|
|||||||
ubik_CheckRXSecurityRock = (char *)KA_conf;
|
ubik_CheckRXSecurityRock = (char *)KA_conf;
|
||||||
|
|
||||||
ubik_nBuffers = 80;
|
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)
|
if (servers)
|
||||||
code =
|
code =
|
||||||
ubik_ServerInit(myHost, htons(AFSCONF_KAUTHPORT), serverList,
|
ubik_ServerInit(myHost, htons(AFSCONF_KAUTHPORT), serverList,
|
||||||
@ -397,8 +423,8 @@ main(argc, argv)
|
|||||||
rx_SetNoJumbo();
|
rx_SetNoJumbo();
|
||||||
|
|
||||||
tservice =
|
tservice =
|
||||||
rx_NewService(0, KA_AUTHENTICATION_SERVICE, "AuthenticationService",
|
rx_NewServiceHost(host, 0, KA_AUTHENTICATION_SERVICE,
|
||||||
sca, 1, KAA_ExecuteRequest);
|
"AuthenticationService", sca, 1, KAA_ExecuteRequest);
|
||||||
if (tservice == (struct rx_service *)0) {
|
if (tservice == (struct rx_service *)0) {
|
||||||
ViceLog(0, ("Could not create Authentication rx service\n"));
|
ViceLog(0, ("Could not create Authentication rx service\n"));
|
||||||
exit(3);
|
exit(3);
|
||||||
@ -406,8 +432,9 @@ main(argc, argv)
|
|||||||
rx_SetMinProcs(tservice, 1);
|
rx_SetMinProcs(tservice, 1);
|
||||||
rx_SetMaxProcs(tservice, 1);
|
rx_SetMaxProcs(tservice, 1);
|
||||||
|
|
||||||
|
|
||||||
tservice =
|
tservice =
|
||||||
rx_NewService(0, KA_TICKET_GRANTING_SERVICE, "TicketGrantingService",
|
rx_NewServiceHost(host, 0, KA_TICKET_GRANTING_SERVICE, "TicketGrantingService",
|
||||||
sca, 1, KAT_ExecuteRequest);
|
sca, 1, KAT_ExecuteRequest);
|
||||||
if (tservice == (struct rx_service *)0) {
|
if (tservice == (struct rx_service *)0) {
|
||||||
ViceLog(0, ("Could not create Ticket Granting rx service\n"));
|
ViceLog(0, ("Could not create Ticket Granting rx service\n"));
|
||||||
@ -421,7 +448,7 @@ main(argc, argv)
|
|||||||
scm[RX_SCINDEX_KAD] =
|
scm[RX_SCINDEX_KAD] =
|
||||||
rxkad_NewServerSecurityObject(rxkad_crypt, 0, kvno_admin_key, 0);
|
rxkad_NewServerSecurityObject(rxkad_crypt, 0, kvno_admin_key, 0);
|
||||||
tservice =
|
tservice =
|
||||||
rx_NewService(0, KA_MAINTENANCE_SERVICE, "Maintenance", scm, 3,
|
rx_NewServiceHost(host, 0, KA_MAINTENANCE_SERVICE, "Maintenance", scm, 3,
|
||||||
KAM_ExecuteRequest);
|
KAM_ExecuteRequest);
|
||||||
if (tservice == (struct rx_service *)0) {
|
if (tservice == (struct rx_service *)0) {
|
||||||
ViceLog(0, ("Could not create Maintenance rx service\n"));
|
ViceLog(0, ("Could not create Maintenance rx service\n"));
|
||||||
@ -432,7 +459,7 @@ main(argc, argv)
|
|||||||
rx_SetStackSize(tservice, 10000);
|
rx_SetStackSize(tservice, 10000);
|
||||||
|
|
||||||
tservice =
|
tservice =
|
||||||
rx_NewService(0, RX_STATS_SERVICE_ID, "rpcstats", scm, 3,
|
rx_NewServiceHost(host, 0, RX_STATS_SERVICE_ID, "rpcstats", scm, 3,
|
||||||
RXSTATS_ExecuteRequest);
|
RXSTATS_ExecuteRequest);
|
||||||
if (tservice == (struct rx_service *)0) {
|
if (tservice == (struct rx_service *)0) {
|
||||||
ViceLog(0, ("Could not create rpc stats rx service\n"));
|
ViceLog(0, ("Could not create rpc stats rx service\n"));
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2000, International Business Machines Corporation and others.
|
* Copyright 2000, International Business Machines Corporation and others.
|
||||||
* All Rights Reserved.
|
* All Rights Reserved.
|
||||||
@ -167,6 +168,10 @@ char *pr_realmName;
|
|||||||
|
|
||||||
int restricted = 0;
|
int restricted = 0;
|
||||||
int rxMaxMTU = -1;
|
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;
|
static struct afsconf_cell info;
|
||||||
|
|
||||||
@ -222,6 +227,7 @@ main(int argc, char **argv)
|
|||||||
int kerberosKeys; /* set if found some keys */
|
int kerberosKeys; /* set if found some keys */
|
||||||
int lwps = 3;
|
int lwps = 3;
|
||||||
char clones[MAXHOSTSPERCELL];
|
char clones[MAXHOSTSPERCELL];
|
||||||
|
afs_uint32 host = htonl(INADDR_ANY);
|
||||||
|
|
||||||
const char *pr_dbaseName;
|
const char *pr_dbaseName;
|
||||||
char *whoami = "ptserver";
|
char *whoami = "ptserver";
|
||||||
@ -305,6 +311,9 @@ main(int argc, char **argv)
|
|||||||
else if (strncmp(arg, "-restricted", alen) == 0) {
|
else if (strncmp(arg, "-restricted", alen) == 0) {
|
||||||
restricted = 1;
|
restricted = 1;
|
||||||
}
|
}
|
||||||
|
else if (strncmp(arg, "-rxbind", alen) == 0) {
|
||||||
|
rxBind = 1;
|
||||||
|
}
|
||||||
else if (strncmp(arg, "-enable_peer_stats", alen) == 0) {
|
else if (strncmp(arg, "-enable_peer_stats", alen) == 0) {
|
||||||
rx_enablePeerRPCStats();
|
rx_enablePeerRPCStats();
|
||||||
} else if (strncmp(arg, "-enable_process_stats", alen) == 0) {
|
} else if (strncmp(arg, "-enable_process_stats", alen) == 0) {
|
||||||
@ -374,16 +383,16 @@ main(int argc, char **argv)
|
|||||||
"[-syslog[=FACILITY]] "
|
"[-syslog[=FACILITY]] "
|
||||||
"[-p <number of processes>] [-rebuild] "
|
"[-p <number of processes>] [-rebuild] "
|
||||||
"[-groupdepth <depth>] "
|
"[-groupdepth <depth>] "
|
||||||
"[-restricted] [-rxmaxmtu <bytes>]"
|
"[-restricted] [-rxmaxmtu <bytes>] [-rxbind] "
|
||||||
"[-enable_peer_stats] [-enable_process_stats] "
|
"[-enable_peer_stats] [-enable_process_stats] "
|
||||||
"[-default_access default_user_access default_group_access] "
|
"[-default_access default_user_access default_group_access] "
|
||||||
"[-help]\n");
|
"[-help]\n");
|
||||||
#else /* AFS_NT40_ENV */
|
#else /* AFS_NT40_ENV */
|
||||||
printf("Usage: ptserver [-database <db path>] "
|
printf("Usage: ptserver [-database <db path>] "
|
||||||
"[-auditlog <log path>] "
|
"[-auditlog <log path>] "
|
||||||
"[-p <number of processes>] [-rebuild] "
|
"[-p <number of processes>] [-rebuild] [-rxbind] "
|
||||||
"[-default_access default_user_access default_group_access] "
|
"[-default_access default_user_access default_group_access] "
|
||||||
"[-restricted] [-rxmaxmtu <bytes>]"
|
"[-restricted] [-rxmaxmtu <bytes>] [-rxbind] "
|
||||||
"[-groupdepth <depth>] " "[-help]\n");
|
"[-groupdepth <depth>] " "[-help]\n");
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
@ -394,13 +403,13 @@ main(int argc, char **argv)
|
|||||||
"[-p <number of processes>] [-rebuild] "
|
"[-p <number of processes>] [-rebuild] "
|
||||||
"[-enable_peer_stats] [-enable_process_stats] "
|
"[-enable_peer_stats] [-enable_process_stats] "
|
||||||
"[-default_access default_user_access default_group_access] "
|
"[-default_access default_user_access default_group_access] "
|
||||||
"[-restricted] [-rxmaxmtu <bytes>]"
|
"[-restricted] [-rxmaxmtu <bytes>] [-rxbind] "
|
||||||
"[-help]\n");
|
"[-help]\n");
|
||||||
#else /* AFS_NT40_ENV */
|
#else /* AFS_NT40_ENV */
|
||||||
printf("Usage: ptserver [-database <db path>] "
|
printf("Usage: ptserver [-database <db path>] "
|
||||||
"[-auditlog <log path>] "
|
"[-auditlog <log path>] "
|
||||||
"[-default_access default_user_access default_group_access] "
|
"[-default_access default_user_access default_group_access] "
|
||||||
"[-restricted] [-rxmaxmtu <bytes>]"
|
"[-restricted] [-rxmaxmtu <bytes>] [-rxbind] "
|
||||||
"[-p <number of processes>] [-rebuild] " "[-help]\n");
|
"[-p <number of processes>] [-rebuild] " "[-help]\n");
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@ -493,6 +502,25 @@ main(int argc, char **argv)
|
|||||||
* and the header are in separate Ubik buffers then 120 buffers may be
|
* and the header are in separate Ubik buffers then 120 buffers may be
|
||||||
* required. */
|
* required. */
|
||||||
ubik_nBuffers = 120 + /*fudge */ 40;
|
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 =
|
code =
|
||||||
ubik_ServerInitByInfo(myHost, htons(AFSCONF_PROTPORT), &info, &clones,
|
ubik_ServerInitByInfo(myHost, htons(AFSCONF_PROTPORT), &info, &clones,
|
||||||
pr_dbaseName, &dbase);
|
pr_dbaseName, &dbase);
|
||||||
@ -519,7 +547,7 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
tservice =
|
tservice =
|
||||||
rx_NewService(0, PRSRV, "Protection Server", sc, 3,
|
rx_NewServiceHost(host, 0, PRSRV, "Protection Server", sc, 3,
|
||||||
PR_ExecuteRequest);
|
PR_ExecuteRequest);
|
||||||
if (tservice == (struct rx_service *)0) {
|
if (tservice == (struct rx_service *)0) {
|
||||||
fprintf(stderr, "ptserver: Could not create new rx service.\n");
|
fprintf(stderr, "ptserver: Could not create new rx service.\n");
|
||||||
@ -529,7 +557,7 @@ main(int argc, char **argv)
|
|||||||
rx_SetMaxProcs(tservice, lwps);
|
rx_SetMaxProcs(tservice, lwps);
|
||||||
|
|
||||||
tservice =
|
tservice =
|
||||||
rx_NewService(0, RX_STATS_SERVICE_ID, "rpcstats", sc, 3,
|
rx_NewServiceHost(host, 0, RX_STATS_SERVICE_ID, "rpcstats", sc, 3,
|
||||||
RXSTATS_ExecuteRequest);
|
RXSTATS_ExecuteRequest);
|
||||||
if (tservice == (struct rx_service *)0) {
|
if (tservice == (struct rx_service *)0) {
|
||||||
fprintf(stderr, "ptserver: Could not create new rx service.\n");
|
fprintf(stderr, "ptserver: Could not create new rx service.\n");
|
||||||
|
20
src/rx/rx.c
20
src/rx/rx.c
@ -1255,9 +1255,10 @@ rxi_SetCallNumberVector(register struct rx_connection *aconn,
|
|||||||
service name might be used for probing for
|
service name might be used for probing for
|
||||||
statistics) */
|
statistics) */
|
||||||
struct rx_service *
|
struct rx_service *
|
||||||
rx_NewService(u_short port, u_short serviceId, char *serviceName,
|
rx_NewServiceHost(afs_uint32 host, u_short port, u_short serviceId,
|
||||||
struct rx_securityClass **securityObjects, int nSecurityObjects,
|
char *serviceName, struct rx_securityClass **securityObjects,
|
||||||
afs_int32(*serviceProc) (struct rx_call * acall))
|
int nSecurityObjects,
|
||||||
|
afs_int32(*serviceProc) (struct rx_call * acall))
|
||||||
{
|
{
|
||||||
osi_socket socket = OSI_NULLSOCKET;
|
osi_socket socket = OSI_NULLSOCKET;
|
||||||
register struct rx_service *tservice;
|
register struct rx_service *tservice;
|
||||||
@ -1288,7 +1289,7 @@ rx_NewService(u_short port, u_short serviceId, char *serviceName,
|
|||||||
for (i = 0; i < RX_MAX_SERVICES; i++) {
|
for (i = 0; i < RX_MAX_SERVICES; i++) {
|
||||||
register struct rx_service *service = rx_services[i];
|
register struct rx_service *service = rx_services[i];
|
||||||
if (service) {
|
if (service) {
|
||||||
if (port == service->servicePort) {
|
if (port == service->servicePort && host == service->serviceHost) {
|
||||||
if (service->serviceId == serviceId) {
|
if (service->serviceId == serviceId) {
|
||||||
/* The identical service has already been
|
/* The identical service has already been
|
||||||
* installed; if the caller was intending to
|
* installed; if the caller was intending to
|
||||||
@ -1309,7 +1310,7 @@ rx_NewService(u_short port, u_short serviceId, char *serviceName,
|
|||||||
if (socket == OSI_NULLSOCKET) {
|
if (socket == OSI_NULLSOCKET) {
|
||||||
/* If we don't already have a socket (from another
|
/* If we don't already have a socket (from another
|
||||||
* service on same port) get a new one */
|
* service on same port) get a new one */
|
||||||
socket = rxi_GetHostUDPSocket(htonl(INADDR_ANY), port);
|
socket = rxi_GetHostUDPSocket(host, port);
|
||||||
if (socket == OSI_NULLSOCKET) {
|
if (socket == OSI_NULLSOCKET) {
|
||||||
USERPRI;
|
USERPRI;
|
||||||
rxi_FreeService(tservice);
|
rxi_FreeService(tservice);
|
||||||
@ -1318,6 +1319,7 @@ rx_NewService(u_short port, u_short serviceId, char *serviceName,
|
|||||||
}
|
}
|
||||||
service = tservice;
|
service = tservice;
|
||||||
service->socket = socket;
|
service->socket = socket;
|
||||||
|
service->serviceHost = host;
|
||||||
service->servicePort = port;
|
service->servicePort = port;
|
||||||
service->serviceId = serviceId;
|
service->serviceId = serviceId;
|
||||||
service->serviceName = serviceName;
|
service->serviceName = serviceName;
|
||||||
@ -1341,6 +1343,14 @@ rx_NewService(u_short port, u_short serviceId, char *serviceName,
|
|||||||
return 0;
|
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
|
/* Generic request processing loop. This routine should be called
|
||||||
* by the implementation dependent rx_ServerProc. If socketp is
|
* by the implementation dependent rx_ServerProc. If socketp is
|
||||||
* non-null, it will be set to the file descriptor that this thread
|
* non-null, it will be set to the file descriptor that this thread
|
||||||
|
@ -295,6 +295,7 @@ struct rx_connection {
|
|||||||
|
|
||||||
struct rx_service {
|
struct rx_service {
|
||||||
u_short serviceId; /* Service number */
|
u_short serviceId; /* Service number */
|
||||||
|
afs_uint32 serviceHost; /* IP address for this service */
|
||||||
u_short servicePort; /* UDP port for this service */
|
u_short servicePort; /* UDP port for this service */
|
||||||
char *serviceName; /* Name of the service */
|
char *serviceName; /* Name of the service */
|
||||||
osi_socket socket; /* socket structure or file descriptor */
|
osi_socket socket; /* socket structure or file descriptor */
|
||||||
|
@ -43,6 +43,15 @@ extern struct rx_service *rx_NewService(u_short port, u_short serviceId,
|
|||||||
afs_int32(*serviceProc) (struct
|
afs_int32(*serviceProc) (struct
|
||||||
rx_call *
|
rx_call *
|
||||||
acall));
|
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,
|
extern void rxi_ServerProc(int threadID, struct rx_call *newcall,
|
||||||
osi_socket * socketp);
|
osi_socket * socketp);
|
||||||
extern void rx_WakeupServerProcs(void);
|
extern void rx_WakeupServerProcs(void);
|
||||||
|
@ -240,6 +240,8 @@ ubik_ServerInitCommon(afs_int32 myHost, short myPort,
|
|||||||
ubik_sc[secIndex] = secClass;
|
ubik_sc[secIndex] = secClass;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* for backwards compat this should keep working as it does now
|
||||||
|
and not host bind */
|
||||||
code = rx_Init(myPort);
|
code = rx_Init(myPort);
|
||||||
if (code < 0)
|
if (code < 0)
|
||||||
return code;
|
return code;
|
||||||
|
@ -69,6 +69,11 @@ char *whoami;
|
|||||||
|
|
||||||
static int Quit();
|
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 */
|
/* check whether caller is authorized to manage RX statistics */
|
||||||
int
|
int
|
||||||
update_rxstat_userok(struct rx_call *call)
|
update_rxstat_userok(struct rx_call *call)
|
||||||
@ -183,6 +188,7 @@ main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
struct rx_securityClass *securityObjects[3];
|
struct rx_securityClass *securityObjects[3];
|
||||||
struct rx_service *service;
|
struct rx_service *service;
|
||||||
|
afs_uint32 host = htonl(INADDR_ANY);
|
||||||
|
|
||||||
int a = 0;
|
int a = 0;
|
||||||
rxkad_level level;
|
rxkad_level level;
|
||||||
@ -234,15 +240,20 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
for (a = 1; a < argc; a++) {
|
for (a = 1; a < argc; a++) {
|
||||||
if (argv[a][0] == '-') { /* parse options */
|
if (argv[a][0] == '-') { /* parse options */
|
||||||
char arg[256];
|
if (strcmp(argv[a], "-rxbind") == 0) {
|
||||||
lcstring(arg, argv[a], sizeof(arg));
|
rxBind = 1;
|
||||||
newLevel = rxkad_StringToLevel(&argv[a][1]);
|
|
||||||
if (newLevel != -1) {
|
|
||||||
level = newLevel; /* set new level */
|
|
||||||
continue;
|
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:
|
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 {
|
} else {
|
||||||
int dirlen;
|
int dirlen;
|
||||||
if (nDirs >= sizeof(dirName) / sizeof(dirName[0]))
|
if (nDirs >= sizeof(dirName) / sizeof(dirName[0]))
|
||||||
@ -270,9 +281,25 @@ main(int argc, char *argv[])
|
|||||||
exit(1);
|
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
|
/* Initialize Rx, telling it port number this server will use for its
|
||||||
* single service */
|
* single service */
|
||||||
if (rx_Init(htons(AFSCONF_UPDATEPORT)) < 0)
|
if (rx_InitHost(host, htons(AFSCONF_UPDATEPORT)) < 0)
|
||||||
Quit("rx_init");
|
Quit("rx_init");
|
||||||
|
|
||||||
/* Create a single security object, in this case the null security object,
|
/* Create a single security object, in this case the null security object,
|
||||||
@ -296,8 +323,8 @@ main(int argc, char *argv[])
|
|||||||
* which is called to decode requests is passed in here
|
* which is called to decode requests is passed in here
|
||||||
* (UPDATE_ExecuteRequest). */
|
* (UPDATE_ExecuteRequest). */
|
||||||
service =
|
service =
|
||||||
rx_NewService(0, UPDATE_SERVICEID, "UPDATE", securityObjects, 3,
|
rx_NewServiceHost(host, 0, UPDATE_SERVICEID, "UPDATE", securityObjects,
|
||||||
UPDATE_ExecuteRequest);
|
3, UPDATE_ExecuteRequest);
|
||||||
if (service == (struct rx_service *)0)
|
if (service == (struct rx_service *)0)
|
||||||
Quit("rx_NewService");
|
Quit("rx_NewService");
|
||||||
rx_SetMaxProcs(service, 2);
|
rx_SetMaxProcs(service, 2);
|
||||||
|
@ -167,6 +167,7 @@ int SawPctSpare;
|
|||||||
int debuglevel = 0;
|
int debuglevel = 0;
|
||||||
int printBanner = 0;
|
int printBanner = 0;
|
||||||
int rxJumbograms = 1; /* default is to send and receive jumbograms. */
|
int rxJumbograms = 1; /* default is to send and receive jumbograms. */
|
||||||
|
int rxBind = 0; /* don't bind */
|
||||||
int rxMaxMTU = -1;
|
int rxMaxMTU = -1;
|
||||||
afs_int32 implicitAdminRights = PRSFS_LOOKUP; /* The ADMINISTER right is
|
afs_int32 implicitAdminRights = PRSFS_LOOKUP; /* The ADMINISTER right is
|
||||||
* already implied */
|
* already implied */
|
||||||
@ -738,6 +739,7 @@ FlagMsg()
|
|||||||
strcat(buffer, "[-rxdbg (enable rx debugging)] ");
|
strcat(buffer, "[-rxdbg (enable rx debugging)] ");
|
||||||
strcat(buffer, "[-rxdbge (enable rxevent debugging)] ");
|
strcat(buffer, "[-rxdbge (enable rxevent debugging)] ");
|
||||||
strcat(buffer, "[-rxmaxmtu <bytes>] ");
|
strcat(buffer, "[-rxmaxmtu <bytes>] ");
|
||||||
|
strcat(buffer, "[-rxbind (bind the Rx socket to one address)] ");
|
||||||
#if AFS_PTHREAD_ENV
|
#if AFS_PTHREAD_ENV
|
||||||
strcat(buffer, "[-vattachpar <number of volume attach threads>] ");
|
strcat(buffer, "[-vattachpar <number of volume attach threads>] ");
|
||||||
#endif
|
#endif
|
||||||
@ -1054,6 +1056,8 @@ ParseArgs(int argc, char *argv[])
|
|||||||
#endif
|
#endif
|
||||||
else if (!strcmp(argv[i], "-nojumbo")) {
|
else if (!strcmp(argv[i], "-nojumbo")) {
|
||||||
rxJumbograms = 0;
|
rxJumbograms = 0;
|
||||||
|
} else if (!strcmp(argv[i], "-rxbind")) {
|
||||||
|
rxBind = 1;
|
||||||
} else if (!strcmp(argv[i], "-rxmaxmtu")) {
|
} else if (!strcmp(argv[i], "-rxmaxmtu")) {
|
||||||
if ((i + 1) >= argc) {
|
if ((i + 1) >= argc) {
|
||||||
fprintf(stderr, "missing argument for -rxmaxmtu\n");
|
fprintf(stderr, "missing argument for -rxmaxmtu\n");
|
||||||
@ -1554,6 +1558,43 @@ Do_VLRegisterRPC()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
afs_int32
|
||||||
InitVL()
|
InitVL()
|
||||||
{
|
{
|
||||||
@ -1587,30 +1628,7 @@ InitVL()
|
|||||||
/* A good sysid file exists; inform the vlserver. If any conflicts,
|
/* A good sysid file exists; inform the vlserver. If any conflicts,
|
||||||
* we always use the latest interface available as the real truth.
|
* 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();
|
code = Do_VLRegisterRPC();
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
@ -1635,6 +1653,7 @@ main(int argc, char *argv[])
|
|||||||
#endif
|
#endif
|
||||||
int curLimit;
|
int curLimit;
|
||||||
time_t t;
|
time_t t;
|
||||||
|
afs_uint32 rx_bindhost;
|
||||||
|
|
||||||
#ifdef AFS_AIX32_ENV
|
#ifdef AFS_AIX32_ENV
|
||||||
struct sigaction nsa;
|
struct sigaction nsa;
|
||||||
@ -1800,7 +1819,9 @@ main(int argc, char *argv[])
|
|||||||
#endif
|
#endif
|
||||||
if (udpBufSize)
|
if (udpBufSize)
|
||||||
rx_SetUdpBufSize(udpBufSize); /* set the UDP buffer size for receive */
|
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"));
|
ViceLog(0, ("Cannot initialize RX\n"));
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@ -1817,11 +1838,12 @@ main(int argc, char *argv[])
|
|||||||
sc[1] = 0; /* rxvab_NewServerSecurityObject(key1, 0) */
|
sc[1] = 0; /* rxvab_NewServerSecurityObject(key1, 0) */
|
||||||
sc[2] = rxkad_NewServerSecurityObject(rxkad_clear, NULL, get_key, NULL);
|
sc[2] = rxkad_NewServerSecurityObject(rxkad_clear, NULL, get_key, NULL);
|
||||||
sc[3] = rxkad_NewServerSecurityObject(rxkad_crypt, NULL, get_key, NULL);
|
sc[3] = rxkad_NewServerSecurityObject(rxkad_crypt, NULL, get_key, NULL);
|
||||||
tservice = rx_NewService( /* port */ 0, /* service id */ 1, /*service name */
|
tservice = rx_NewServiceHost(rx_bindhost, /* port */ 0, /* service id */
|
||||||
"AFS",
|
1, /*service name */
|
||||||
/* security classes */ sc,
|
"AFS",
|
||||||
/* numb sec classes */
|
/* security classes */ sc,
|
||||||
4, RXAFS_ExecuteRequest);
|
/* numb sec classes */
|
||||||
|
4, RXAFS_ExecuteRequest);
|
||||||
if (!tservice) {
|
if (!tservice) {
|
||||||
ViceLog(0,
|
ViceLog(0,
|
||||||
("Failed to initialize RX, probably two servers running.\n"));
|
("Failed to initialize RX, probably two servers running.\n"));
|
||||||
|
@ -72,6 +72,10 @@ int LogLevel = 0;
|
|||||||
int smallMem = 0;
|
int smallMem = 0;
|
||||||
int rxJumbograms = 1; /* default is to send and receive jumbo grams */
|
int rxJumbograms = 1; /* default is to send and receive jumbo grams */
|
||||||
int rxMaxMTU = -1;
|
int rxMaxMTU = -1;
|
||||||
|
afs_int32 rxBind = 0;
|
||||||
|
|
||||||
|
#define ADDRSPERSITE 16 /* Same global is in rx/rx_user.c */
|
||||||
|
afs_uint32 SHostAddrs[ADDRSPERSITE];
|
||||||
|
|
||||||
static void
|
static void
|
||||||
CheckSignal_Signal()
|
CheckSignal_Signal()
|
||||||
@ -144,6 +148,7 @@ main(argc, argv)
|
|||||||
extern int rx_extraPackets;
|
extern int rx_extraPackets;
|
||||||
char commandLine[150];
|
char commandLine[150];
|
||||||
char clones[MAXHOSTSPERCELL];
|
char clones[MAXHOSTSPERCELL];
|
||||||
|
afs_uint32 host = ntohl(INADDR_ANY);
|
||||||
|
|
||||||
#ifdef AFS_AIX32_ENV
|
#ifdef AFS_AIX32_ENV
|
||||||
/*
|
/*
|
||||||
@ -179,6 +184,9 @@ main(argc, argv)
|
|||||||
} else if (strcmp(argv[index], "-nojumbo") == 0) {
|
} else if (strcmp(argv[index], "-nojumbo") == 0) {
|
||||||
rxJumbograms = 0;
|
rxJumbograms = 0;
|
||||||
|
|
||||||
|
} else if (strcmp(argv[index], "-rxbind") == 0) {
|
||||||
|
rxBind = 1;
|
||||||
|
|
||||||
} else if (!strcmp(argv[index], "-rxmaxmtu")) {
|
} else if (!strcmp(argv[index], "-rxmaxmtu")) {
|
||||||
if ((index + 1) >= argc) {
|
if ((index + 1) >= argc) {
|
||||||
fprintf(stderr, "missing argument for -rxmaxmtu\n");
|
fprintf(stderr, "missing argument for -rxmaxmtu\n");
|
||||||
@ -245,14 +253,14 @@ main(argc, argv)
|
|||||||
/* support help flag */
|
/* support help flag */
|
||||||
#ifndef AFS_NT40_ENV
|
#ifndef AFS_NT40_ENV
|
||||||
printf("Usage: vlserver [-p <number of processes>] [-nojumbo] "
|
printf("Usage: vlserver [-p <number of processes>] [-nojumbo] "
|
||||||
"[-rxmaxmtu <bytes>] "
|
"[-rxmaxmtu <bytes>] [-rxbind] "
|
||||||
"[-auditlog <log path>] "
|
"[-auditlog <log path>] "
|
||||||
"[-syslog[=FACILITY]] "
|
"[-syslog[=FACILITY]] "
|
||||||
"[-enable_peer_stats] [-enable_process_stats] "
|
"[-enable_peer_stats] [-enable_process_stats] "
|
||||||
"[-help]\n");
|
"[-help]\n");
|
||||||
#else
|
#else
|
||||||
printf("Usage: vlserver [-p <number of processes>] [-nojumbo] "
|
printf("Usage: vlserver [-p <number of processes>] [-nojumbo] "
|
||||||
"[-rxmaxmtu <bytes>] "
|
"[-rxmaxmtu <bytes>] [-rxbind] "
|
||||||
"[-auditlog <log path>] "
|
"[-auditlog <log path>] "
|
||||||
"[-enable_peer_stats] [-enable_process_stats] "
|
"[-enable_peer_stats] [-enable_process_stats] "
|
||||||
"[-help]\n");
|
"[-help]\n");
|
||||||
@ -323,6 +331,24 @@ main(argc, argv)
|
|||||||
if (noAuth)
|
if (noAuth)
|
||||||
afsconf_SetNoAuthFlag(tdir, 1);
|
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_nBuffers = 512;
|
||||||
ubik_CRXSecurityProc = afsconf_ClientAuth;
|
ubik_CRXSecurityProc = afsconf_ClientAuth;
|
||||||
ubik_CRXSecurityRock = (char *)tdir;
|
ubik_CRXSecurityRock = (char *)tdir;
|
||||||
@ -351,8 +377,9 @@ main(argc, argv)
|
|||||||
sc[0] = rxnull_NewServerSecurityObject();
|
sc[0] = rxnull_NewServerSecurityObject();
|
||||||
sc[1] = (struct rx_securityClass *)0;
|
sc[1] = (struct rx_securityClass *)0;
|
||||||
sc[2] = rxkad_NewServerSecurityObject(0, tdir, afsconf_GetKey, NULL);
|
sc[2] = rxkad_NewServerSecurityObject(0, tdir, afsconf_GetKey, NULL);
|
||||||
|
|
||||||
tservice =
|
tservice =
|
||||||
rx_NewService(0, USER_SERVICE_ID, "Vldb server", sc, 3,
|
rx_NewServiceHost(host, 0, USER_SERVICE_ID, "Vldb server", sc, 3,
|
||||||
VL_ExecuteRequest);
|
VL_ExecuteRequest);
|
||||||
if (tservice == (struct rx_service *)0) {
|
if (tservice == (struct rx_service *)0) {
|
||||||
printf("vlserver: Could not create VLDB_SERVICE rx service\n");
|
printf("vlserver: Could not create VLDB_SERVICE rx service\n");
|
||||||
@ -364,7 +391,7 @@ main(argc, argv)
|
|||||||
rx_SetMaxProcs(tservice, lwps);
|
rx_SetMaxProcs(tservice, lwps);
|
||||||
|
|
||||||
tservice =
|
tservice =
|
||||||
rx_NewService(0, RX_STATS_SERVICE_ID, "rpcstats", sc, 3,
|
rx_NewServiceHost(host, 0, RX_STATS_SERVICE_ID, "rpcstats", sc, 3,
|
||||||
RXSTATS_ExecuteRequest);
|
RXSTATS_ExecuteRequest);
|
||||||
if (tservice == (struct rx_service *)0) {
|
if (tservice == (struct rx_service *)0) {
|
||||||
printf("vlserver: Could not create rpc stats rx service\n");
|
printf("vlserver: Could not create rpc stats rx service\n");
|
||||||
|
@ -95,6 +95,10 @@ int lwps = 9;
|
|||||||
int udpBufSize = 0; /* UDP buffer size for receive */
|
int udpBufSize = 0; /* UDP buffer size for receive */
|
||||||
|
|
||||||
int Testing = 0; /* for ListViceInodes */
|
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) { \
|
#define VS_EXIT(code) { \
|
||||||
osi_audit(VS_ExitEvent, code, AUD_END); \
|
osi_audit(VS_ExitEvent, code, AUD_END); \
|
||||||
@ -244,6 +248,7 @@ main(int argc, char **argv)
|
|||||||
int rxJumbograms = 1; /* default is to send and receive jumbograms. */
|
int rxJumbograms = 1; /* default is to send and receive jumbograms. */
|
||||||
int rxMaxMTU = -1;
|
int rxMaxMTU = -1;
|
||||||
int bufSize = 0; /* temp variable to read in udp socket buf size */
|
int bufSize = 0; /* temp variable to read in udp socket buf size */
|
||||||
|
afs_uint32 host = ntohl(INADDR_ANY);
|
||||||
|
|
||||||
#ifdef AFS_AIX32_ENV
|
#ifdef AFS_AIX32_ENV
|
||||||
/*
|
/*
|
||||||
@ -288,6 +293,8 @@ main(int argc, char **argv)
|
|||||||
DoLogging = 1;
|
DoLogging = 1;
|
||||||
} else if (strcmp(argv[code], "-help") == 0) {
|
} else if (strcmp(argv[code], "-help") == 0) {
|
||||||
goto usage;
|
goto usage;
|
||||||
|
} else if (strcmp(argv[code], "-rxbind") == 0) {
|
||||||
|
rxBind = 1;
|
||||||
} else if (strcmp(argv[code], "-p") == 0) {
|
} else if (strcmp(argv[code], "-p") == 0) {
|
||||||
lwps = atoi(argv[++code]);
|
lwps = atoi(argv[++code]);
|
||||||
if (lwps > MAXLWP) {
|
if (lwps > MAXLWP) {
|
||||||
@ -379,7 +386,7 @@ main(int argc, char **argv)
|
|||||||
#ifndef AFS_NT40_ENV
|
#ifndef AFS_NT40_ENV
|
||||||
printf("Usage: volserver [-log] [-p <number of processes>] "
|
printf("Usage: volserver [-log] [-p <number of processes>] "
|
||||||
"[-auditlog <log path>] "
|
"[-auditlog <log path>] "
|
||||||
"[-nojumbo] [-rxmaxmtu <bytes>] "
|
"[-nojumbo] [-rxmaxmtu <bytes>] [-rxbind] "
|
||||||
"[-udpsize <size of socket buffer in bytes>] "
|
"[-udpsize <size of socket buffer in bytes>] "
|
||||||
"[-syslog[=FACILITY]] "
|
"[-syslog[=FACILITY]] "
|
||||||
"[-enable_peer_stats] [-enable_process_stats] "
|
"[-enable_peer_stats] [-enable_process_stats] "
|
||||||
@ -387,7 +394,7 @@ main(int argc, char **argv)
|
|||||||
#else
|
#else
|
||||||
printf("Usage: volserver [-log] [-p <number of processes>] "
|
printf("Usage: volserver [-log] [-p <number of processes>] "
|
||||||
"[-auditlog <log path>] "
|
"[-auditlog <log path>] "
|
||||||
"[-nojumbo] [-rxmaxmtu <bytes>] "
|
"[-nojumbo] [-rxmaxmtu <bytes>] [-rxbind] "
|
||||||
"[-udpsize <size of socket buffer in bytes>] "
|
"[-udpsize <size of socket buffer in bytes>] "
|
||||||
"[-enable_peer_stats] [-enable_process_stats] "
|
"[-enable_peer_stats] [-enable_process_stats] "
|
||||||
"[-help]\n");
|
"[-help]\n");
|
||||||
@ -426,7 +433,23 @@ main(int argc, char **argv)
|
|||||||
rx_nPackets = rxpackets; /* set the max number of packets */
|
rx_nPackets = rxpackets; /* set the max number of packets */
|
||||||
if (udpBufSize)
|
if (udpBufSize)
|
||||||
rx_SetUdpBufSize(udpBufSize); /* set the UDP buffer size for receive */
|
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) {
|
if (code) {
|
||||||
fprintf(stderr, "rx init failed on socket AFSCONF_VOLUMEPORT %u\n",
|
fprintf(stderr, "rx init failed on socket AFSCONF_VOLUMEPORT %u\n",
|
||||||
AFSCONF_VOLUMEPORT);
|
AFSCONF_VOLUMEPORT);
|
||||||
@ -478,7 +501,7 @@ main(int argc, char **argv)
|
|||||||
if (securityObjects[0] == (struct rx_securityClass *)0)
|
if (securityObjects[0] == (struct rx_securityClass *)0)
|
||||||
Abort("rxnull_NewServerSecurityObject");
|
Abort("rxnull_NewServerSecurityObject");
|
||||||
service =
|
service =
|
||||||
rx_NewService(0, VOLSERVICE_ID, "VOLSER", securityObjects, 3,
|
rx_NewServiceHost(host, 0, VOLSERVICE_ID, "VOLSER", securityObjects, 3,
|
||||||
AFSVolExecuteRequest);
|
AFSVolExecuteRequest);
|
||||||
if (service == (struct rx_service *)0)
|
if (service == (struct rx_service *)0)
|
||||||
Abort("rx_NewService");
|
Abort("rx_NewService");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user