+static void
+setlog(const char *val, int dummy __unused, int s,
+ const struct afswtch *afp)
+{
+ char *cp;
+
+ errno = 0;
+ strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
+
+ ifr.ifr_log.ifl_level = strtold(val, &cp);
+ if (val == cp || errno != 0) {
+ warn("Invalid value '%s'", val);
+ return;
+ }
+ ifr.ifr_log.ifl_flags = (IFRLOGF_DLIL|IFRLOGF_FAMILY|IFRLOGF_DRIVER|
+ IFRLOGF_FIRMWARE);
+
+ if (ioctl(s, SIOCSIFLOG, &ifr) < 0)
+ warn("ioctl (set logging parameters)");
+}
+
+void
+setcl2k(const char *vname, int value, int s, const struct afswtch *afp)
+{
+ strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
+ ifr.ifr_ifru.ifru_2kcl = value;
+
+ if (ioctl(s, SIOCSIF2KCL, (caddr_t)&ifr) < 0)
+ Perror(vname);
+}
+
+void
+setexpensive(const char *vname, int value, int s, const struct afswtch *afp)
+{
+ strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
+ ifr.ifr_ifru.ifru_expensive = value;
+
+ if (ioctl(s, SIOCSIFEXPENSIVE, (caddr_t)&ifr) < 0)
+ Perror(vname);
+}
+
+
+void
+setecnmode(const char *val, int dummy __unused, int s,
+ const struct afswtch *afp)
+{
+ char *cp;
+
+ if (strcmp(val, "default") == 0)
+ ifr.ifr_ifru.ifru_ecn_mode = IFRTYPE_ECN_DEFAULT;
+ else if (strcmp(val, "enable") == 0)
+ ifr.ifr_ifru.ifru_ecn_mode = IFRTYPE_ECN_ENABLE;
+ else if (strcmp(val, "disable") == 0)
+ ifr.ifr_ifru.ifru_ecn_mode = IFRTYPE_ECN_DISABLE;
+ else {
+ ifr.ifr_ifru.ifru_ecn_mode = strtold(val, &cp);
+ if (val == cp || errno != 0) {
+ warn("Invalid ECN mode value '%s'", val);
+ return;
+ }
+ }
+
+ strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
+
+ if (ioctl(s, SIOCSECNMODE, (caddr_t)&ifr) < 0)
+ Perror("ioctl(SIOCSECNMODE)");
+}
+
+