4 #include <sys/socket.h>
8 #include <netinet/in.h>
12 #include <afs/venus.h>
18 #include "afs/prs_fs.h"
19 #include <afs/afsint.h>
21 #include <afs/cellconfig.h>
27 #define MAXINSIZE 1300 /* pioctl complains if data is larger than this */
28 #define VMSGSIZE 128 /* size of msg buf in volume hdr */
30 static char space[MAXSIZE];
31 static char tspace[1024];
32 static struct ubik_client *uclient;
35 extern struct cmd_syndesc *cmd_CreateSyntax();
36 static char pn[] = "fs";
37 static int rxInitDone = 0;
40 struct cmd_syndesc *as; {
42 struct ViceIoctl blob;
47 ti=as->parms[0].items;
49 tmp = atoi (ti->data);
52 rxp.rx_initReceiveWindow = tmp;
53 ti=as->parms[1].items;
55 tmp = atoi (ti->data);
58 rxp.rx_maxReceiveWindow = tmp;
59 ti=as->parms[2].items;
61 tmp = atoi (ti->data);
64 rxp.rx_initSendWindow = tmp;
65 ti=as->parms[3].items;
67 tmp = atoi (ti->data);
70 rxp.rx_maxSendWindow = tmp;
71 ti=as->parms[4].items;
73 tmp = atoi (ti->data);
76 rxp.rxi_nSendFrags = tmp;
77 ti=as->parms[5].items;
79 tmp = atoi (ti->data);
82 rxp.rxi_nRecvFrags = tmp;
83 ti=as->parms[6].items;
85 tmp = atoi (ti->data);
88 rxp.rxi_OrphanFragSize = tmp;
89 ti=as->parms[7].items;
91 tmp = atoi (ti->data);
94 rxp.rx_maxReceiveSize = tmp;
95 ti=as->parms[8].items;
97 tmp = atoi (ti->data);
100 rxp.rx_MyMaxSendSize = tmp;
102 blob.in = (char *)&rxp;
103 blob.out = (char *)&rxp;
104 blob.in_size = sizeof(rxp);
105 blob.out_size = sizeof(rxp);
106 code = pioctl(0, VIOC_TWIDDLE, &blob, 1);
114 #include "AFS_component_version_number.c"
119 register afs_int32 code;
120 register struct cmd_syndesc *ts;
124 * The following signal action for AIX is necessary so that in case of a
125 * crash (i.e. core is generated) we can include the user's data section
126 * in the core dump. Unfortunately, by default, only a partial core is
127 * generated which, in many cases, isn't too useful.
129 struct sigaction nsa;
131 sigemptyset(&nsa.sa_mask);
132 nsa.sa_handler = SIG_DFL;
133 nsa.sa_flags = SA_FULLDUMP;
134 sigaction(SIGSEGV, &nsa, NULL);
136 /* try to find volume location information */
139 ts = cmd_CreateSyntax((char *)0, Twiddle, 0, "adjust rx parms");
140 cmd_AddParm(ts, "-initReceiveWindow ", CMD_SINGLE, CMD_OPTIONAL, "16");
141 cmd_AddParm(ts, "-maxReceiveWindow ", CMD_SINGLE, CMD_OPTIONAL, "16");
142 cmd_AddParm(ts, "-initSendWindow ", CMD_SINGLE, CMD_OPTIONAL, "8");
143 cmd_AddParm(ts, "-maxSendWindow ", CMD_SINGLE, CMD_OPTIONAL, "16");
144 cmd_AddParm(ts, "-nSendFrags ", CMD_SINGLE, CMD_OPTIONAL, "4");
145 cmd_AddParm(ts, "-nRecvFrags ", CMD_SINGLE, CMD_OPTIONAL, "4");
146 cmd_AddParm(ts, "-OrphanFragSize ", CMD_SINGLE, CMD_OPTIONAL, "512");
147 cmd_AddParm(ts, "-maxReceiveSize ", CMD_SINGLE, CMD_OPTIONAL, "");
148 cmd_AddParm(ts, "-MyMaxSendSize ", CMD_SINGLE, CMD_OPTIONAL, "");
150 code = cmd_Dispatch(argc, argv);
151 if (rxInitDone) rx_Finalize();
161 if (errno == EINVAL) {
163 fprintf(stderr,"%s: Invalid argument; it is possible that %s is not in AFS.\n", pn, filename);
164 else fprintf(stderr,"%s: Invalid argument.\n", pn);
166 else if (errno == ENOENT) {
167 if (filename) fprintf(stderr,"%s: File '%s' doesn't exist\n", pn, filename);
168 else fprintf(stderr,"%s: no such file returned\n", pn);
170 else if (errno == EROFS) fprintf(stderr,"%s: You can not change a backup or readonly volume\n", pn);
171 else if (errno == EACCES || errno == EPERM) {
172 if (filename) fprintf(stderr,"%s: You don't have the required access rights on '%s'\n", pn, filename);
173 else fprintf(stderr,"%s: You do not have the required rights to do this operation\n", pn);
176 if (filename) fprintf(stderr,"%s:'%s'", pn, filename);
177 else fprintf(stderr,"%s", pn);
178 fprintf(stderr,": %s\n", error_message(errno));