2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 #include <afsconfig.h>
11 #include <afs/param.h>
17 #include <sys/ioctl.h>
18 #include <sys/socket.h>
22 #include <netinet/in.h>
26 #include <afs/venus.h>
32 #include "afs/prs_fs.h"
33 #include <afs/afsint.h>
35 #include <afs/cellconfig.h>
38 #include <afs/com_err.h>
41 #define MAXINSIZE 1300 /* pioctl complains if data is larger than this */
42 #define VMSGSIZE 128 /* size of msg buf in volume hdr */
44 static char space[MAXSIZE];
45 static char tspace[1024];
46 static struct ubik_client *uclient;
49 extern struct cmd_syndesc *cmd_CreateSyntax();
50 static char pn[] = "fs";
51 static int rxInitDone = 0;
55 struct cmd_syndesc *as;
58 struct ViceIoctl blob;
63 ti = as->parms[0].items;
68 rxp.rx_initReceiveWindow = tmp;
69 ti = as->parms[1].items;
74 rxp.rx_maxReceiveWindow = tmp;
75 ti = as->parms[2].items;
80 rxp.rx_initSendWindow = tmp;
81 ti = as->parms[3].items;
86 rxp.rx_maxSendWindow = tmp;
87 ti = as->parms[4].items;
92 rxp.rxi_nSendFrags = tmp;
93 ti = as->parms[5].items;
98 rxp.rxi_nRecvFrags = tmp;
99 ti = as->parms[6].items;
100 if (ti && ti->data) {
101 tmp = atoi(ti->data);
104 rxp.rxi_OrphanFragSize = tmp;
105 ti = as->parms[7].items;
106 if (ti && ti->data) {
107 tmp = atoi(ti->data);
110 rxp.rx_maxReceiveSize = tmp;
111 ti = as->parms[8].items;
112 if (ti && ti->data) {
113 tmp = atoi(ti->data);
116 rxp.rx_MyMaxSendSize = tmp;
118 blob.in = (char *)&rxp;
119 blob.out = (char *)&rxp;
120 blob.in_size = sizeof(rxp);
121 blob.out_size = sizeof(rxp);
122 code = pioctl(0, VIOC_TWIDDLE, &blob, 1);
130 #include "AFS_component_version_number.c"
136 register afs_int32 code;
137 register struct cmd_syndesc *ts;
141 * The following signal action for AIX is necessary so that in case of a
142 * crash (i.e. core is generated) we can include the user's data section
143 * in the core dump. Unfortunately, by default, only a partial core is
144 * generated which, in many cases, isn't too useful.
146 struct sigaction nsa;
148 sigemptyset(&nsa.sa_mask);
149 nsa.sa_handler = SIG_DFL;
150 nsa.sa_flags = SA_FULLDUMP;
151 sigaction(SIGSEGV, &nsa, NULL);
153 /* try to find volume location information */
156 ts = cmd_CreateSyntax(NULL, Twiddle, 0, "adjust rx parms");
157 cmd_AddParm(ts, "-initReceiveWindow ", CMD_SINGLE, CMD_OPTIONAL, "16");
158 cmd_AddParm(ts, "-maxReceiveWindow ", CMD_SINGLE, CMD_OPTIONAL, "16");
159 cmd_AddParm(ts, "-initSendWindow ", CMD_SINGLE, CMD_OPTIONAL, "8");
160 cmd_AddParm(ts, "-maxSendWindow ", CMD_SINGLE, CMD_OPTIONAL, "16");
161 cmd_AddParm(ts, "-nSendFrags ", CMD_SINGLE, CMD_OPTIONAL, "4");
162 cmd_AddParm(ts, "-nRecvFrags ", CMD_SINGLE, CMD_OPTIONAL, "4");
163 cmd_AddParm(ts, "-OrphanFragSize ", CMD_SINGLE, CMD_OPTIONAL, "512");
164 cmd_AddParm(ts, "-maxReceiveSize ", CMD_SINGLE, CMD_OPTIONAL, "");
165 cmd_AddParm(ts, "-MyMaxSendSize ", CMD_SINGLE, CMD_OPTIONAL, "");
167 code = cmd_Dispatch(argc, argv);
179 if (errno == EINVAL) {
182 "%s: Invalid argument; it is possible that %s is not in AFS.\n",
185 fprintf(stderr, "%s: Invalid argument.\n", pn);
186 } else if (errno == ENOENT) {
188 fprintf(stderr, "%s: File '%s' doesn't exist\n", pn, filename);
190 fprintf(stderr, "%s: no such file returned\n", pn);
191 } else if (errno == EROFS)
193 "%s: You can not change a backup or readonly volume\n", pn);
194 else if (errno == EACCES || errno == EPERM) {
197 "%s: You don't have the required access rights on '%s'\n",
201 "%s: You do not have the required rights to do this operation\n",
205 fprintf(stderr, "%s:'%s'", pn, filename);
207 fprintf(stderr, "%s", pn);
208 fprintf(stderr, ": %s\n", error_message(errno));