Lines Matching defs:mib

373 	int mib[CTL_MAXNAME];
389 mib[0] = indx;
405 mib[1] = indx;
408 switch (mib[0]) {
411 switch (mib[1]) {
413 mib[2] = GPROF_STATE;
414 mib[3] = 0; /* Assume CPU ID 0 is always valid. */
416 if (sysctl(mib, 4, &state, &size, NULL, 0) == -1) {
429 sysctl_forkstat(string, &bufp, mib, flags, &type);
432 len = sysctl_tty(string, &bufp, mib, flags, &type);
437 sysctl_nchstats(string, &bufp, mib, flags, &type);
440 len = sysctl_malloc(string, &bufp, mib, flags, &type);
443 if (mib[2] == KERN_MALLOC_BUCKET)
445 if (mib[2] == KERN_MALLOC_KMEMSTATS)
479 len = sysctl_seminfo(string, &bufp, mib, flags, &type);
484 len = sysctl_shminfo(string, &bufp, mib, flags, &type);
495 len = sysctl_watchdog(string, &bufp, mib, flags,
501 len = sysctl_tc(string, &bufp, mib, flags,
520 len = sysctl_audio(string, &bufp, mib, flags, &type);
525 len = sysctl_video(string, &bufp, mib, flags, &type);
530 len = sysctl_witness(string, &bufp, mib, flags, &type);
546 switch (mib[1]) {
558 len = sysctl_sensors(string, &bufp, mib, flags, &type);
563 len = sysctl_battery(string, &bufp, mib, flags, &type);
578 if (mib[1] == VM_LOADAVG) {
587 } else if (mib[1] == VM_PSSTRINGS) {
591 if (sysctl(mib, 2, &_ps, &size, NULL, 0) == -1) {
603 } else if (mib[1] == VM_SWAPENCRYPT) {
604 len = sysctl_swpenc(string, &bufp, mib, flags, &type);
609 } else if (mib[1] == VM_NKMEMPAGES ||
610 mib[1] == VM_ANONMIN ||
611 mib[1] == VM_VTEXTMIN ||
612 mib[1] == VM_VNODEMIN ||
613 mib[1] == VM_MALLOC_CONF) {
624 if (mib[1] == PF_INET) {
625 len = sysctl_inet(string, &bufp, mib, flags, &type);
629 if ((mib[2] == IPPROTO_IP && mib[3] == IPCTL_MRTSTATS) ||
630 (mib[2] == IPPROTO_IP && mib[3] == IPCTL_STATS) ||
631 (mib[2] == IPPROTO_IP && mib[3] == IPCTL_MRTMFC) ||
632 (mib[2] == IPPROTO_IP && mib[3] == IPCTL_MRTVIF) ||
633 (mib[2] == IPPROTO_TCP && mib[3] == TCPCTL_STATS) ||
634 (mib[2] == IPPROTO_UDP && mib[3] == UDPCTL_STATS) ||
635 (mib[2] == IPPROTO_ESP && mib[3] == ESPCTL_STATS) ||
636 (mib[2] == IPPROTO_AH && mib[3] == AHCTL_STATS) ||
637 (mib[2] == IPPROTO_IGMP && mib[3] == IGMPCTL_STATS) ||
638 (mib[2] == IPPROTO_ETHERIP && mib[3] == ETHERIPCTL_STATS) ||
639 (mib[2] == IPPROTO_IPIP && mib[3] == IPIPCTL_STATS) ||
640 (mib[2] == IPPROTO_IPCOMP && mib[3] == IPCOMPCTL_STATS) ||
641 (mib[2] == IPPROTO_ICMP && mib[3] == ICMPCTL_STATS) ||
642 (mib[2] == IPPROTO_CARP && mib[3] == CARPCTL_STATS) ||
643 (mib[2] == IPPROTO_PFSYNC && mib[3] == PFSYNCCTL_STATS) ||
644 (mib[2] == IPPROTO_DIVERT && mib[3] == DIVERTCTL_STATS)) {
650 } else if ((mib[2] == IPPROTO_TCP &&
651 (mib[3] == TCPCTL_BADDYNAMIC ||
652 mib[3] == TCPCTL_ROOTONLY)) ||
653 (mib[2] == IPPROTO_UDP &&
654 (mib[3] == UDPCTL_BADDYNAMIC ||
655 mib[3] == UDPCTL_ROOTONLY))) {
660 parse_baddynamic(mib, len, string,
665 if (mib[1] == PF_INET6) {
666 len = sysctl_inet6(string, &bufp, mib, flags, &type);
670 if (mib[2] == IPPROTO_IPV6 &&
671 mib[3] == IPV6CTL_SOIIKEY)
674 if ((mib[2] == IPPROTO_IPV6 && mib[3] == IPV6CTL_MRTMFC) ||
675 (mib[2] == IPPROTO_IPV6 && mib[3] == IPV6CTL_MRTMIF) ||
676 (mib[2] == IPPROTO_DIVERT && mib[3] == DIVERT6CTL_STATS)) {
685 if (mib[1] == PF_UNIX) {
686 len = sysctl_unix(string, &bufp, mib, flags, &type);
691 if (mib[1] == PF_LINK) {
692 len = sysctl_link(string, &bufp, mib, flags, &type);
697 if (mib[1] == PF_BPF) {
698 len = sysctl_bpf(string, &bufp, mib, flags, &type);
703 if (mib[1] == PF_MPLS) {
704 len = sysctl_mpls(string, &bufp, mib, flags, &type);
709 if (mib[1] == PF_PIPEX) {
710 len = sysctl_pipex(string, &bufp, mib, flags, &type);
721 mib[2] = CTL_DEBUG_VALUE;
727 if (mib[1] == CPU_CONSDEV)
731 if (mib[1] == CPU_CPUID)
735 if (mib[1] == CPU_CPUFEATURE)
739 if (mib[1] == CPU_BLK2CHR) {
742 mib[2] = makedev(atoi(bufp),0);
750 if (mib[1] == CPU_CHR2BLK) {
753 mib[2] = makedev(atoi(bufp),0);
761 if (mib[1] == CPU_BIOS) {
762 len = sysctl_bios(string, &bufp, mib, flags, &type);
765 if (mib[2] == BIOS_DEV)
767 if (mib[2] == BIOS_DISKINFO)
773 if (mib[1] == CPU_CHIPSET) {
774 len = sysctl_chipset(string, &bufp, mib, flags, &type);
783 len = sysctl_fs(string, &bufp, mib, flags, &type);
789 if (mib[1])
790 len = sysctl_vfs(string, &bufp, mib, flags, &type);
792 len = sysctl_vfsgen(string, &bufp, mib, flags, &type);
808 warnx("illegal top level value: %d", mib[0]);
864 if (sysctl(mib, len, buf, &size, newval, newsize) == -1) {
1185 parse_baddynamic(int mib[], size_t len, char *string, void **newvalp,
1200 if (sysctl(mib, len, newbaddynamic,
1241 int mib[3], loc, i;
1247 mib[0] = CTL_DEBUG;
1248 mib[2] = CTL_DEBUG_NAME;
1250 mib[1] = i;
1252 if (sysctl(mib, 3, &names[loc], &size, NULL, 0) == -1)
1274 int mib[4], maxtypenum, cnt, loc, size;
1280 mib[0] = CTL_VFS;
1281 mib[1] = VFS_GENERIC;
1282 mib[2] = VFS_MAXTYPENUM;
1284 if (sysctl(mib, 3, &maxtypenum, &buflen, NULL, 0) == -1)
1302 mib[2] = VFS_CONF;
1305 mib[3] = cnt - 1;
1306 if (sysctl(mib, 4, &vfc, &buflen, NULL, 0) == -1) {
1347 sysctl_vfsgen(char *string, char **bufpp, int mib[], int flags, int *typep)
1361 mib[1] = VFS_GENERIC;
1362 mib[2] = VFS_CONF;
1363 mib[3] = indx;
1365 if (sysctl(mib, 4, &vfc, &size, NULL, 0) == -1) {
1383 sysctl_vfs(char *string, char **bufpp, int mib[], int flags, int *typep)
1385 struct list *lp = &vfsvars[mib[1]];
1400 mib[1] = vfs_typenums[mib[1]];
1401 mib[2] = indx;
1413 sysctl_fs(char *string, char **bufpp, int mib[], int flags, int *typep)
1423 mib[2] = indx;
1436 sysctl_bios(char *string, char **bufpp, int mib[], int flags, int *typep)
1447 mib[2] = indx;
1466 mib[3] = strtonum(name, 0, INT_MAX, &errstr);
1487 sysctl_swpenc(char *string, char **bufpp, int mib[], int flags, int *typep)
1497 mib[2] = indx;
1803 sysctl_nchstats(char *string, char **bufpp, int mib[], int flags, int *typep)
1817 mib[2] = indx;
1824 if (sysctl(mib, 2, &nch, &size, NULL, 0) == -1)
1875 sysctl_tty(char *string, char **bufpp, int mib[], int flags, int *typep)
1885 mib[2] = indx;
1900 sysctl_forkstat(char *string, char **bufpp, int mib[], int flags, int *typep)
1920 if (sysctl(mib, 2, &fks, &size, NULL, 0) == -1)
1959 sysctl_malloc(char *string, char **bufpp, int mib[], int flags, int *typep)
1973 mib[2] = indx;
1974 if (mib[2] == KERN_MALLOC_BUCKET) {
1977 stor = mib[2];
1978 mib[2] = KERN_MALLOC_BUCKETS;
1980 if (sysctl(mib, 3, buf, &size, NULL, 0) == -1)
1982 mib[2] = stor;
1998 mib[3] = strtonum(name, 0, INT_MAX, &errstr);
2002 } else if (mib[2] == KERN_MALLOC_BUCKETS) {
2005 } else if (mib[2] == KERN_MALLOC_KMEMSTATS) {
2007 stor = mib[2];
2008 mib[2] = KERN_MALLOC_KMEMNAMES;
2010 if (sysctl(mib, 3, buf, &size, NULL, 0) == -1)
2012 mib[2] = stor;
2052 mib[3] = stor;
2054 } else if (mib[2] == KERN_MALLOC_KMEMNAMES) {
2069 sysctl_chipset(char *string, char **bufpp, int mib[], int flags, int *typep)
2082 mib[2] = indx;
2085 switch(mib[2]) {
2091 if (sysctl(mib, 3, &q, &len, NULL, 0) == -1)
2097 if (sysctl(mib, 3, &bwx, &len, NULL, 0) == -1)
2102 if (sysctl(mib, 3, NULL, &len, NULL, 0) == -1)
2107 if (sysctl(mib, 3, p, &len, NULL, 0) == -1) {
2125 sysctl_inet(char *string, char **bufpp, int mib[], int flags, int *typep)
2136 mib[2] = indx;
2151 mib[3] = indx;
2163 mib[4] = tindx;
2261 sysctl_inet6(char *string, char **bufpp, int mib[], int flags, int *typep)
2272 mib[2] = indx;
2287 mib[3] = indx;
2299 mib[4] = tindx;
2318 sysctl_unix(char *string, char **bufpp, int mib[], int flags, int *typep)
2329 mib[2] = indx;
2343 mib[3] = indx;
2357 sysctl_link(char *string, char **bufpp, int mib[], int flags, int *typep)
2368 mib[2] = indx;
2383 mib[3] = indx;
2390 sysctl_bpf(char *string, char **bufpp, int mib[], int flags, int *typep)
2400 mib[2] = indx;
2410 sysctl_mpls(char *string, char **bufpp, int mib[], int flags, int *typep)
2421 mib[2] = indx;
2433 mib[3] = tindx;
2442 sysctl_pipex(char *string, char **bufpp, int mib[], int flags, int *typep)
2453 mib[2] = indx;
2465 mib[3] = tindx;
2476 sysctl_seminfo(char *string, char **bufpp, int mib[], int flags, int *typep)
2486 mib[2] = indx;
2495 sysctl_shminfo(char *string, char **bufpp, int mib[], int flags, int *typep)
2505 mib[2] = indx;
2514 sysctl_watchdog(char *string, char **bufpp, int mib[], int flags,
2525 mib[2] = indx;
2534 sysctl_tc(char *string, char **bufpp, int mib[], int flags,
2545 mib[2] = indx;
2554 sysctl_sensors(char *string, char **bufpp, int mib[], int flags, int *typep)
2567 mib[2] = dev;
2568 if (sysctl(mib, 3, &snsrdev, &sdlen, NULL, 0) == -1) {
2578 print_sensordev(buf, mib, 3, &snsrdev);
2594 mib[2] = dev;
2595 if (sysctl(mib, 3, &snsrdev, &sdlen, NULL, 0) == -1) {
2614 print_sensordev(string, mib, 3, &snsrdev);
2646 mib[3] = type;
2653 print_sensordev(string, mib, 4, &snsrdev);
2663 mib[4] = numt;
2673 print_sensordev(char *string, int mib[], u_int mlen, struct sensordev *snsrdev)
2680 mib[3] = type;
2683 print_sensordev(buf, mib, mlen+1, snsrdev);
2691 type = mib[3];
2693 mib[4] = numt;
2695 print_sensordev(buf, mib, mlen+1, snsrdev);
2708 if (sysctl(mib, 5, &snsr, &slen, NULL, 0) == -1)
2876 sysctl_audio(char *string, char **bufpp, int mib[], int flags, int *typep)
2886 mib[2] = indx;
2895 sysctl_video(char *string, char **bufpp, int mib[], int flags, int *typep)
2905 mib[2] = indx;
2914 sysctl_witness(char *string, char **bufpp, int mib[], int flags, int *typep)
2924 mib[2] = indx;
2933 sysctl_battery(char *string, char **bufpp, int mib[], int flags,
2944 mib[2] = indx;