#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header$");
+RCSID
+ ("$Header$");
#include <rx/xdr.h>
#include <sys/ioctl.h>
#define MAXSIZE 2048
-#define MAXINSIZE 1300 /* pioctl complains if data is larger than this */
-#define VMSGSIZE 128 /* size of msg buf in volume hdr */
+#define MAXINSIZE 1300 /* pioctl complains if data is larger than this */
+#define VMSGSIZE 128 /* size of msg buf in volume hdr */
static char space[MAXSIZE];
static char tspace[1024];
static char pn[] = "fs";
static int rxInitDone = 0;
-static Twiddle(as)
-struct cmd_syndesc *as; {
+static
+Twiddle(as)
+ struct cmd_syndesc *as;
+{
afs_int32 code;
struct ViceIoctl blob;
struct cmd_item *ti;
struct rxparams rxp;
int tmp;
-
- ti=as->parms[0].items;
+
+ ti = as->parms[0].items;
if (ti && ti->data) {
- tmp = atoi (ti->data);
- }
- else tmp = 0;
+ tmp = atoi(ti->data);
+ } else
+ tmp = 0;
rxp.rx_initReceiveWindow = tmp;
- ti=as->parms[1].items;
+ ti = as->parms[1].items;
if (ti && ti->data) {
- tmp = atoi (ti->data);
- }
- else tmp = 0;
+ tmp = atoi(ti->data);
+ } else
+ tmp = 0;
rxp.rx_maxReceiveWindow = tmp;
- ti=as->parms[2].items;
+ ti = as->parms[2].items;
if (ti && ti->data) {
- tmp = atoi (ti->data);
- }
- else tmp = 0;
+ tmp = atoi(ti->data);
+ } else
+ tmp = 0;
rxp.rx_initSendWindow = tmp;
- ti=as->parms[3].items;
+ ti = as->parms[3].items;
if (ti && ti->data) {
- tmp = atoi (ti->data);
- }
- else tmp = 0;
+ tmp = atoi(ti->data);
+ } else
+ tmp = 0;
rxp.rx_maxSendWindow = tmp;
- ti=as->parms[4].items;
+ ti = as->parms[4].items;
if (ti && ti->data) {
- tmp = atoi (ti->data);
- }
- else tmp = 0;
+ tmp = atoi(ti->data);
+ } else
+ tmp = 0;
rxp.rxi_nSendFrags = tmp;
- ti=as->parms[5].items;
+ ti = as->parms[5].items;
if (ti && ti->data) {
- tmp = atoi (ti->data);
- }
- else tmp = 0;
+ tmp = atoi(ti->data);
+ } else
+ tmp = 0;
rxp.rxi_nRecvFrags = tmp;
- ti=as->parms[6].items;
+ ti = as->parms[6].items;
if (ti && ti->data) {
- tmp = atoi (ti->data);
- }
- else tmp = 0;
+ tmp = atoi(ti->data);
+ } else
+ tmp = 0;
rxp.rxi_OrphanFragSize = tmp;
- ti=as->parms[7].items;
+ ti = as->parms[7].items;
if (ti && ti->data) {
- tmp = atoi (ti->data);
- }
- else tmp = 0;
+ tmp = atoi(ti->data);
+ } else
+ tmp = 0;
rxp.rx_maxReceiveSize = tmp;
- ti=as->parms[8].items;
+ ti = as->parms[8].items;
if (ti && ti->data) {
- tmp = atoi (ti->data);
- }
- else tmp = 0;
+ tmp = atoi(ti->data);
+ } else
+ tmp = 0;
rxp.rx_MyMaxSendSize = tmp;
blob.in = (char *)&rxp;
#include "AFS_component_version_number.c"
main(argc, argv)
-int argc;
-char **argv; {
+ int argc;
+ char **argv;
+{
register afs_int32 code;
register struct cmd_syndesc *ts;
-
+
#ifdef AFS_AIX32_ENV
/*
* The following signal action for AIX is necessary so that in case of a
* generated which, in many cases, isn't too useful.
*/
struct sigaction nsa;
-
+
sigemptyset(&nsa.sa_mask);
nsa.sa_handler = SIG_DFL;
nsa.sa_flags = SA_FULLDUMP;
sigaction(SIGSEGV, &nsa, NULL);
#endif
/* try to find volume location information */
-
+
ts = cmd_CreateSyntax(NULL, Twiddle, 0, "adjust rx parms");
cmd_AddParm(ts, "-initReceiveWindow ", CMD_SINGLE, CMD_OPTIONAL, "16");
cmd_AddParm(ts, "-MyMaxSendSize ", CMD_SINGLE, CMD_OPTIONAL, "");
code = cmd_Dispatch(argc, argv);
- if (rxInitDone) rx_Finalize();
-
+ if (rxInitDone)
+ rx_Finalize();
+
exit(code);
}
Die(code, filename)
- int code;
- char *filename;
-{ /*Die*/
+ int code;
+ char *filename;
+{ /*Die */
if (errno == EINVAL) {
if (filename)
- fprintf(stderr,"%s: Invalid argument; it is possible that %s is not in AFS.\n", pn, filename);
- else fprintf(stderr,"%s: Invalid argument.\n", pn);
- }
- else if (errno == ENOENT) {
- if (filename) fprintf(stderr,"%s: File '%s' doesn't exist\n", pn, filename);
- else fprintf(stderr,"%s: no such file returned\n", pn);
- }
- else if (errno == EROFS) fprintf(stderr,"%s: You can not change a backup or readonly volume\n", pn);
+ fprintf(stderr,
+ "%s: Invalid argument; it is possible that %s is not in AFS.\n",
+ pn, filename);
+ else
+ fprintf(stderr, "%s: Invalid argument.\n", pn);
+ } else if (errno == ENOENT) {
+ if (filename)
+ fprintf(stderr, "%s: File '%s' doesn't exist\n", pn, filename);
+ else
+ fprintf(stderr, "%s: no such file returned\n", pn);
+ } else if (errno == EROFS)
+ fprintf(stderr,
+ "%s: You can not change a backup or readonly volume\n", pn);
else if (errno == EACCES || errno == EPERM) {
- if (filename) fprintf(stderr,"%s: You don't have the required access rights on '%s'\n", pn, filename);
- else fprintf(stderr,"%s: You do not have the required rights to do this operation\n", pn);
- }
- else {
- if (filename) fprintf(stderr,"%s:'%s'", pn, filename);
- else fprintf(stderr,"%s", pn);
- fprintf(stderr,": %s\n", error_message(errno));
+ if (filename)
+ fprintf(stderr,
+ "%s: You don't have the required access rights on '%s'\n",
+ pn, filename);
+ else
+ fprintf(stderr,
+ "%s: You do not have the required rights to do this operation\n",
+ pn);
+ } else {
+ if (filename)
+ fprintf(stderr, "%s:'%s'", pn, filename);
+ else
+ fprintf(stderr, "%s", pn);
+ fprintf(stderr, ": %s\n", error_message(errno));
}
-} /*Die*/
-
-
-
-
-
-
-
-
+} /*Die */