xref: /netbsd-src/share/man/man7/sysctl.7 (revision 2e2322c9c07009df921d11b1268f8506affbb8ba)
1.\"	$NetBSD: sysctl.7,v 1.104 2016/11/17 01:22:00 pgoyette Exp $
2.\"
3.\" Copyright (c) 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors
15.\"    may be used to endorse or promote products derived from this software
16.\"    without specific prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE.
29.\"
30.\"	@(#)sysctl.3	8.4 (Berkeley) 5/9/95
31.\"
32.Dd November 17, 2016
33.Dt SYSCTL 7
34.Os
35.Sh NAME
36.Nm sysctl
37.Nd system information variables
38.Sh DESCRIPTION
39The
40.Xr sysctl 3
41library function and the
42.Xr sysctl 8
43utility are used to get and set values of system variables, maintained
44by the kernel.
45The variables are organized in a tree and identified by a sequence of
46numbers, conventionally separated by dots with the topmost identifier
47at the left side.
48The numbers have corresponding text names.
49The
50.Xr sysctlnametomib 3
51function or the
52.Fl M
53argument to the
54.Xr sysctl 8
55utility can be used to convert the text representation to the
56numeric one.
57.Pp
58The individual sysctl variables are described below, both the textual
59and numeric form where applicable.
60The textual names can be used as argument to the
61.Xr sysctl 8
62utility and in the file
63.Pa /etc/sysctl.conf .
64The numeric names are usually defined as preprocessor constants and
65are intended for use by programs.
66Every such constant expands to one integer, which identifies the
67sysctl variable relative to the upper level of the tree.
68See the
69.Xr sysctl 3
70manual page for programming examples.
71.Ss Top level names
72The top level names are defined with a
73.Va CTL_
74prefix in
75.In sys/sysctl.h ,
76and are as follows.
77The next and subsequent levels down are found in the include files
78listed here, and described in separate sections below.
79.Bl -column "security" ".Dv CTL_SECURITY" ".In uvm/uvm_param.h" "High kernel limits"
80.It Sy Name  Ta Sy Constant     Ta Sy Next level names Ta Sy Description
81.It kern     Ta Dv CTL_KERN     Ta In sys/sysctl.h     Ta High kernel limits
82.It vm       Ta Dv CTL_VM       Ta In uvm/uvm_param.h  Ta Virtual memory
83.It vfs      Ta Dv CTL_VFS      Ta In sys/mount.h      Ta Filesystem
84.It net      Ta Dv CTL_NET      Ta In sys/socket.h     Ta Networking
85.It debug    Ta Dv CTL_DEBUG    Ta In sys/sysctl.h     Ta Debugging
86.It hw       Ta Dv CTL_HW       Ta In sys/sysctl.h     Ta Generic CPU, I/O
87.It machdep  Ta Dv CTL_MACHDEP  Ta In sys/sysctl.h     Ta Machine dependent
88.It user     Ta Dv CTL_USER     Ta In sys/sysctl.h     Ta User-level
89.It ddb      Ta Dv CTL_DDB      Ta In sys/sysctl.h     Ta In-kernel debugger
90.It proc     Ta Dv CTL_PROC     Ta In sys/sysctl.h     Ta Per-process
91.It vendor   Ta Dv CTL_VENDOR   Ta ?                   Ta Vendor specific
92.It emul     Ta Dv CTL_EMUL     Ta In sys/sysctl.h     Ta Emulation settings
93.It security Ta Dv CTL_SECURITY Ta In sys/sysctl.h     Ta Security settings
94.El
95.Ss The debug.* subtree
96The debugging variables vary from system to system.
97A debugging variable may be added or deleted without need to recompile
98.Nm
99to know about it.
100Each time it runs,
101.Nm
102gets the list of debugging variables from the kernel and
103displays their current values.
104The system defines twenty
105.Vt ( struct ctldebug )
106variables named
107.Dv debug0
108through
109.Dv debug19 .
110They are declared as separate variables so that they can be
111individually initialized at the location of their associated variable.
112The loader prevents multiple use of the same variable by issuing errors
113if a variable is initialized in more than one place.
114For example, to export the variable
115.Va dospecialcheck
116as a debugging variable, the following declaration would be used:
117.Pp
118.Bd -literal -offset indent -compact
119int dospecialcheck = 1;
120struct ctldebug debug5 = { "dospecialcheck", \*[Am]dospecialcheck };
121.Ed
122.Pp
123Note that the dynamic implementation of
124.Nm
125currently in use largely makes this particular
126.Nm
127interface obsolete.
128See
129.Xr sysctl 8
130.\" and
131.\" .Xr sysctl 9
132for more information.
133.Ss The vfs.* subtree
134A distinguished second level name,
135.Li vfs.generic ( Dv VFS_GENERIC ) ,
136is used to get general information about all file systems.
137It has the following third level identifiers:
138.Bl -tag -width "123456"
139.It Li vfs.generic.maxtypenum ( Dv VFS_MAXTYPENUM )
140The highest valid file system type number.
141.It Li vfs.generic.conf ( Dv VFS_CONF )
142Returns configuration information about the file system type given as a fourth
143level identifier.
144.It Li vfs.generic.usermount ( Dv VFS_USERMOUNT )
145Determines if non superuser mounts are allowed, defaults to
146.Dv 0 .
147.It Li vfs.generic.magiclinks ( Dv VFS_MAGICLINKS )
148Controls if expansion of variables is going to be performed on pathnames
149or not.
150Defaults to no variable expansion,
151.Dv 0 .
152Variables are of the form
153.Li @name
154and the variables supported are described in
155.Xr symlink 7
156under
157.Dq "MAGIC SYMLINKS" .
158.El
159.Pp
160A second level name for controlling the
161.Xr wapbl 4
162(Write Ahead Physical Block Logging file system journalling)
163capabilities with the following third level identifiers:
164.Bl -tag -width "123456"
165.It Li vfs.wapbl.flush_disk_cache
166Controls whether to attempt to flush the disk cache on each commit.
167It defaults to 1 and it should always be on to ensure integrity
168of file system metadata in the event of a power loss.
169For slow disks, turning it off can improve performance.
170.It Li vfs.wapbl.verbose_commit
171For each transaction log commit, print the number of bytes written
172and the time it took to commit as seconds.nanoseconds.
173.El
174.Pp
175The remaining second level identifiers are the file system names, identified
176by the type number returned by a
177.Xr statvfs 2
178call or from
179.Li vfs.generic.conf .
180.Pp
181The third level identifiers available for each file system
182are given in the header file that defines the mount
183argument structure for that file system.
184.Ss The hw.* subtree
185The string and integer information available for the
186.Li hw
187level is detailed below.
188The changeable column shows whether a process with appropriate
189privilege may change the value.
190.Bl -column "hw.machine_arch" "integer" "Changeable" -offset indent
191.It Sy Second level name	Sy Type	Sy Changeable
192.It hw.alignbytes	integer	no
193.It hw.byteorder	integer	no
194.It hw.cnmagic	string	yes
195.It hw.disknames	string	no
196.It hw.diskstats	struct	no
197.It hw.machine	string	no
198.It hw.machine_arch	string	no
199.It hw.model	string	no
200.It hw.ncpu	integer	no
201.It hw.ncpuonline	integer	no
202.It hw.pagesize	integer	no
203.It hw.physmem	integer	no
204.It hw.physmem64	quad	no
205.It hw.usermem	integer	no
206.It hw.usermem64	quad	no
207.El
208.Bl -tag -width "123456"
209.It Li hw.alignbytes ( Dv HW_ALIGNBYTES )
210Alignment constraint for all possible data types.
211This shows the value
212.Dv ALIGNBYTES
213in
214.In machine/param.h ,
215at the kernel compilation time.
216.It Li hw.byteorder ( Dv HW_BYTEORDER )
217The byteorder (4321, or 1234).
218.It Li hw.cnmagic ( Dv HW_CNMAGIC )
219The console magic key sequence.
220.It Li hw.disknames ( Dv HW_DISKNAMES )
221The list of (space separated) disk device names on the system.
222.It Li hw.iostatnames ( Dv HW_IOSTATNAMES )
223A space separated list of devices that will have I/O statistics
224collected on them.
225.It Li hw.iostats ( Dv HW_IOSTATS )
226Return statistical information on the NFS mounts, disk and tape
227devices on the system.
228An array of
229.Vt struct io_sysctl
230structures is returned,
231whose size depends on the current number of such objects in the system.
232The third level name is the size of the
233.Vt struct io_sysctl .
234The type of object can be determined by examining the
235.Va type
236element of
237.Vt struct io_sysctl .
238Which can be
239.Dv IOSTAT_DISK
240(disk drive),
241.Dv IOSTAT_TAPE
242(tape drive), or
243.Dv IOSTAT_NFS
244(NFS mount).
245.It Li hw.machine ( Dv HW_MACHINE )
246The machine class.
247.It Li hw.machine_arch ( Dv HW_MACHINE_ARCH )
248The machine CPU class.
249.It Li hw.model ( Dv HW_MODEL )
250The machine model.
251.It Li hw.ncpu ( Dv HW_NCPU )
252The number of CPUs configured.
253.It Li hw.ncpuonline ( Dv HW_NCPUONLINE )
254The number of CPUs online.
255.It Li hw.pagesize ( Dv HW_PAGESIZE )
256The software page size.
257.It Li hw.physmem ( Dv HW_PHYSMEM )
258The bytes of physical memory as a 32-bit integer.
259.It Li hw.physmem64 ( Dv HW_PHYSMEM64 )
260The bytes of physical memory as a 64-bit integer.
261.It Li hw.usermem ( Dv HW_USERMEM )
262The bytes of non-kernel memory as a 32-bit integer.
263.It Li hw.usermem64 ( Dv HW_USERMEM64 )
264The bytes of non-kernel memory as a 64-bit integer.
265.El
266.Ss The kern.* subtree
267This subtree includes data generally related to the kernel.
268The string and integer information available for the
269.Li kern
270level is detailed below.
271The changeable column shows whether a process with appropriate
272privilege may change the value.
273.Bl -column "kern.posix_reader_writer_locks" \
274"struct kinfo_drivers" "not applicable"
275.It Sy Second level name	Sy Type	Sy Changeable
276.It kern.aio_listio_max	integer	yes
277.It kern.aio_max	integer	yes
278.It kern.arandom	integer	no
279.It kern.argmax	integer	no
280.It kern.boothowto	integer	no
281.It kern.boottime	struct timeval	no
282.It kern.buildinfo	string	no
283.\".It kern.bufq	node	not applicable
284.It kern.ccpu	integer	no
285.It kern.clockrate	struct clockinfo	no
286.It kern.consdev	integer	no
287.It kern.coredump	node	not applicable
288.It kern.cp_id	struct	no
289.It kern.cp_time	uint64_t[\|]	no
290.It kern.cryptodevallowsoft	integer	yes
291.It kern.defcorename	string	yes
292.It kern.detachall	integer	yes
293.It kern.domainname	string	yes
294.It kern.drivers	struct kinfo_drivers	no
295.It kern.dump_on_panic	integer	yes
296.It kern.file	struct file	no
297.It kern.forkfsleep	integer	yes
298.It kern.fscale	integer	no
299.It kern.fsync	integer	no
300.It kern.hardclock_ticks	integer	no
301.It kern.hostid	integer	yes
302.It kern.hostname	string	yes
303.It kern.iov_max	integer	no
304.It kern.ipc	node	not applicable
305.It kern.job_control	integer	no
306.It kern.labeloffset	integer	no
307.It kern.labelsector	integer	no
308.It kern.login_name_max	integer	no
309.It kern.logsigexit	integer	yes
310.It kern.mapped_files	integer	no
311.It kern.maxfiles	integer	yes
312.It kern.maxlwp	integer	yes
313.It kern.maxpartitions	integer	no
314.It kern.maxphys	integer	no
315.It kern.maxproc	integer	yes
316.It kern.maxptys	integer	yes
317.It kern.maxvnodes	integer	yes
318.It kern.messages	integer yes
319.It kern.mbuf	node	not applicable
320.It kern.memlock	integer	no
321.It kern.memlock_range	integer	no
322.It kern.memory_protection	integer	no
323.It kern.module	node	not applicable
324.It kern.monotonic_clock	integer	no
325.It kern.mqueue	node	not applicable
326.It kern.msgbuf	integer	no
327.It kern.msgbufsize	integer	no
328.It kern.ngroups	integer	no
329.\".It kern.no_sa_support	integer	yes
330.It kern.ntptime	struct ntptimeval	no
331.It kern.osrelease	string	no
332.It kern.osrevision	integer	no
333.It kern.ostype	string	no
334.\".It kern.panic_now	integer	yes
335.It kern.pipe	node	not applicable
336.It kern.pool	struct pool_sysctl	no
337.\" .It kern.posix	node	not applicable
338.It kern.posix1version	integer	no
339.It kern.posix_aio	integer	no
340.It kern.posix_barriers	integer	no
341.It kern.posix_reader_writer_locks	integer	no
342.\".It kern.posix_sched	integer	yes
343.It kern.posix_semaphores	integer	no
344.It kern.posix_spin_locks	integer	no
345.It kern.posix_threads	integer	no
346.It kern.posix_timers	integer	no
347.It kern.proc	struct kinfo_proc	no
348.It kern.proc2	struct kinfo_proc2	no
349.It kern.proc_args	string	no
350.It kern.profiling	node	not applicable
351.\".It kern.pset	node	not applicable
352.It kern.rawpartition	integer	no
353.It kern.root_device	string	no
354.It kern.root_partition	integer	no
355.It kern.rtc_offset	integer	yes
356.It kern.saved_ids	integer	no
357.It kern.sbmax	integer	yes
358.\".It kern.sched	node	not applicable
359.It kern.securelevel	integer	raise only
360.It kern.somaxkva	integer	yes
361.It kern.synchronized_io	integer	no
362.It kern.timecounter	node	not applicable
363.It kern.timex	struct	no
364.It kern.tkstat	node	not applicable
365.It kern.tty	node	not applicable
366.It kern.urandom	integer	no
367.It kern.usercrypto	integer	yes
368.It kern.userasymcrypto	integer	yes
369.It kern.veriexec	node	not applicable
370.It kern.version	string	no
371.It kern.vnode	struct vnode	no
372.El
373.Bl -tag -width "123456"
374.It Li kern.aio_listio_max
375The maximum number of asynchronous
376.Tn I/O
377operations in a single list I/O call.
378Like with all variables related to
379.Xr aio 3 ,
380the variable may be created and removed dynamically
381upon loading or unloading the corresponding kernel module.
382.It Li kern.aio_max
383The maximum number of asynchronous I/O operations.
384.It Li kern.arandom
385This variable picks a random number each time it is queried.
386The used random number generator
387.Pf ( Tn RNG )
388is based on
389.Xr arc4random 3 .
390.It Li kern.argmax ( Dv KERN_ARGMAX )
391The maximum bytes of argument to
392.Xr execve 2 .
393.It Li kern.boothowto
394Flags passed from the boot loader; see
395.Xr reboot 2
396for the meanings of the flags.
397.It Li kern.boottime ( Dv KERN_BOOTTIME )
398A
399.Vt struct timeval
400structure is returned.
401This structure contains the time that the system was booted.
402.It Li kern.bufq
403This variable contains information on the
404.Xr bufq 9
405subsystem.
406Currently, the only third level name implemented is
407.Dv kern.bufq.strategies
408which provides a list of buffer queue strategies currently available.
409.It Li kern.buildinfo
410When the kernel is built, the build environment may optionally provide
411arbitrary information to be stored in this variable.
412.It Li kern.ccpu ( Dv KERN_CCPU )
413The scheduler exponential decay value.
414.It Li kern.clockrate ( Dv KERN_CLOCKRATE )
415A
416.Vt struct clockinfo
417structure is returned.
418This structure contains the clock, statistics clock and profiling clock
419frequencies, the number of micro-seconds per hz tick, and the clock
420skew rate.
421Refer to
422.Xr hz 9
423for additional details.
424.It Li kern.consdev ( Dv KERN_CONSDEV )
425Console device.
426.It Li kern.coredump
427Settings related to set-id processes coredumps.
428By default, set-id processes do not dump core in situations where
429other processes would.
430The settings in this node allows an administrator to change this
431behavior.
432.Pp
433The third level name is
434.Dv kern.coredump.setid
435and fourth level variables are described below.
436.Bl -column "kern.coredump.setid.group" "integer" "Changeable" -offset indent
437.It Sy Fourth level name	Sy Type	Sy Changeable
438.It kern.coredump.setid.dump	integer	yes
439.It kern.coredump.setid.group	integer	yes
440.It kern.coredump.setid.mode	integer	yes
441.It kern.coredump.setid.owner	integer	yes
442.It kern.coredump.setid.path	string	yes
443.El
444.Bl -tag -width "123456"
445.It Li kern.coredump.setid.dump
446If non-zero, set-id processes will dump core.
447.It Li kern.coredump.setid.group
448The group-id for the set-id processes' coredump.
449.It Li kern.coredump.setid.mode
450The mode for the set-id processes' coredump.
451See
452.Xr chmod 1 .
453.It Li kern.coredump.setid.owner
454The user-id that will be used as the owner of the set-id processes'
455coredump.
456.It Li kern.coredump.setid.path
457The path to which set-id processes' coredumps will be saved to.
458Same syntax as kern.defcorename.
459.El
460.It Li kern.cp_id ( Dv KERN_CP_ID )
461Mapping of CPU number to CPU id.
462.It Li kern.cp_time ( Dv KERN_CP_TIME )
463Returns an array of
464.Dv CPUSTATES
465.Vt uint64_t Ns s .
466This array contains the
467number of clock ticks spent in different CPU states.
468On multi-processor systems, the sum across all CPUs is returned unless
469appropriate space is given for one data set for each CPU.
470Data for a specific CPU can also be obtained by adding the number of the
471CPU at the end of the MIB, enlarging it by one.
472.It Li kern.cryptodevallowsoft
473This variable controls userland access to hardware versus software transforms
474in the
475.Xr crypto 4
476system.
477The available values are as follows:
478.Bl -tag -width XX0 -offset indent
479.It Dv \*[Lt] 0
480Always force userlevel requests to use software transforms.
481.It Dv = 0
482If present, use hardware and grant userlevel requests for
483non-accelerated transforms (handling the latter in software).
484.It Dv \*[Gt] 0
485Allow user requests only for transforms which are hardware-accelerated.
486.El
487.It Li kern.defcorename ( Dv KERN_DEFCORENAME )
488Default template for the name of core dump files (see also
489.Li proc.pid.corename
490in the per-process variables
491.Li proc.* ,
492and
493.Xr core 5
494for format of this template).
495The default value is
496.Pa %n.core
497and can be changed with the kernel configuration option
498.Cd options DEFCORENAME
499(see
500.Xr options 4
501).
502.It Li kern.detachall
503Detach all devices at shutdown.
504.It Li kern.domainname ( Dv KERN_DOMAINNAME )
505Get or set the YP domain name.
506.It Li kern.drivers ( Dv KERN_DRIVERS )
507Return an array of
508.Vt struct kinfo_drivers
509that contains the name and major device numbers of all the device drivers
510in the current kernel.
511The
512.Va d_name
513field is always a NUL terminated string.
514The
515.Va d_bmajor
516field will be set to \-1 if the driver doesn't have a block device.
517.It Li kern.dump_on_panic ( Dv KERN_DUMP_ON_PANIC )
518Perform a crash dump on system
519.Xr panic 9 .
520.It Li kern.file ( Dv KERN_FILE )
521Return the entire file table.
522The returned data consists of a single
523.Vt struct filelist
524followed by an array of
525.Vt struct file ,
526whose size depends on the current number of such objects in the system.
527.It Li kern.forkfsleep ( Dv KERN_FORKFSLEEP )
528If
529.Xr fork 2
530system call fails due to limit on number of processes (either
531the global maxproc limit or user's one), wait for this many
532milliseconds before returning
533.Er EAGAIN
534error to process.
535Useful to keep heavily forking runaway processes in bay.
536Default zero (no sleep).
537Maximum is 20 seconds.
538.It Li kern.fscale ( Dv KERN_FSCALE )
539The kernel fixed-point scale factor.
540.It Li kern.fsync ( Dv KERN_FSYNC )
541Return 1 if the
542.St -p1003.1b-93
543File Synchronization Option is available
544on this system,
545otherwise\ 0.
546.It Li kern.hardclock_ticks ( Dv KERN_HARDCLOCK_TICKS )
547Returns the number of
548.Xr hardclock 9
549ticks.
550.It Li kern.hostid ( Dv KERN_HOSTID )
551Get or set the host identifier.
552This is aimed to replace the legacy
553.Xr gethostid 3
554and
555.Xr sethostid 3
556system calls.
557.It Li kern.hostname ( Dv KERN_HOSTNAME )
558Get or set the
559.Xr hostname 1 .
560.It Li kern.iov_max ( Dv KERN_IOV_MAX )
561Return the maximum number of
562.Vt iovec
563structures that a process has available for use with
564.Xr preadv 2 ,
565.Xr pwritev 2 ,
566.Xr readv 2 ,
567.Xr recvmsg 2 ,
568.Xr sendmsg 2
569and
570.Xr writev 2 .
571.It Li kern.ipc ( Dv KERN_SYSVIPC )
572Return information about the SysV IPC parameters.
573The third level names for the ipc variables are detailed below.
574.Bl -column "kern.ipc.shm_use_phys" "integer" "Changeable" -offset indent
575.It Sy Third level name	Sy Type	Sy Changeable
576.It kern.ipc.sysvmsg	integer	no
577.It kern.ipc.sysvsem	integer	no
578.It kern.ipc.sysvshm	integer	no
579.It kern.ipc.sysvipc_info	struct	no
580.It kern.ipc.shmmax	integer	yes
581.It kern.ipc.shmmni	integer	yes
582.It kern.ipc.shmseg	integer	yes
583.It kern.ipc.shmmaxpgs	integer	yes
584.It kern.ipc.shm_use_phys	integer	yes
585.It kern.ipc.msgmni	integer	yes
586.It kern.ipc.msgseg	integer	yes
587.It kern.ipc.semmni	integer	yes
588.It kern.ipc.semmns	integer	yes
589.It kern.ipc.semmnu	integer	yes
590.El
591.Bl -tag -width "123456"
592.It Li kern.ipc.sysvmsg ( Dv KERN_SYSVIPC_MSG )
593Returns 1 if System V style message queue functionality is available
594on this system,
595otherwise\ 0.
596.It Li kern.ipc.sysvsem ( Dv KERN_SYSVIPC_SEM )
597Returns 1 if System V style semaphore functionality is available
598on this system,
599otherwise\ 0.
600.It Li kern.ipc.sysvshm ( Dv KERN_SYSVIPC_SHM )
601Returns 1 if System V style share memory functionality is available
602on this system,
603otherwise\ 0.
604.It Li kern.ipc.sysvipc_info ( Dv KERN_SYSVIPC_INFO )
605Return System V style IPC configuration and run-time information.
606The fourth level name selects the System V style IPC facility.
607.Bl -column "KERN_SYSVIPC_MSG_INFO" "struct shm_sysctl_info" -offset indent
608.It Sy Fourth level name	Sy Type
609.It KERN_SYSVIPC_MSG_INFO	struct msg_sysctl_info
610.It KERN_SYSVIPC_SEM_INFO	struct sem_sysctl_info
611.It KERN_SYSVIPC_SHM_INFO	struct shm_sysctl_info
612.El
613.Bl -tag -width "123456"
614.It Li KERN_SYSVIPC_MSG_INFO
615Return information on the System V style message facility.
616The
617.Sy msg_sysctl_info
618structure is defined in
619.In sys/msg.h .
620.It Li KERN_SYSVIPC_SEM_INFO
621Return information on the System V style semaphore facility.
622The
623.Sy sem_sysctl_info
624structure is defined in
625.In sys/sem.h .
626.It Li KERN_SYSVIPC_SHM_INFO
627Return information on the System V style shared memory facility.
628The
629.Sy shm_sysctl_info
630structure is defined in
631.In sys/shm.h .
632.El
633.It Li kern.ipc.shmmax ( Dv KERN_SYSVIPC_SHMMAX )
634Max shared memory segment size in bytes.
635.It Li kern.ipc.shmmni ( Dv KERN_SYSVIPC_SHMMNI )
636Max number of shared memory identifiers.
637.It Li kern.ipc.shmseg ( Dv KERN_SYSVIPC_SHMSEG )
638Max shared memory segments per process.
639.It Li kern.ipc.shmmaxpgs ( Dv KERN_SYSVIPC_SHMMAXPGS )
640Max amount of shared memory in pages.
641.It Li kern.ipc.shm_use_phys ( Dv KERN_SYSVIPC_SHMUSEPHYS )
642Locking of shared memory in physical memory.
643If 0, memory can be swapped
644out, otherwise it will be locked in physical memory.
645.It Li kern.ipc.msgmni
646Max number of message queue identifiers.
647.It Li kern.ipc.msgseg
648Max number of number of message segments.
649.It Li kern.ipc.semmni
650Max number of number of semaphore identifiers.
651.It Li kern.ipc.semmns
652Max number of number of semaphores in system.
653.It Li kern.ipc.semmnu
654Max number of undo structures in system.
655.El
656.It Li kern.job_control ( Dv KERN_JOB_CONTROL )
657Return 1 if job control is available on this system, otherwise\ 0.
658.It Li kern.labeloffset ( Dv KERN_LABELOFFSET )
659The offset within the sector specified by
660.Dv KERN_LABELSECTOR
661of the
662.Xr disklabel 5 .
663.It Li kern.labelsector ( Dv KERN_LABELSECTOR )
664The sector number containing the
665.Xr disklabel 5 .
666.It Li kern.login_name_max ( Dv KERN_LOGIN_NAME_MAX )
667The size of the storage required for a login name, in bytes,
668including the terminating NUL.
669.It Li kern.logsigexit ( Dv KERN_LOGSIGEXIT )
670If this flag is non-zero, the kernel will
671.Xr log 9
672all process exits due to signals which create a
673.Xr core 5
674file, and whether the coredump was created.
675.It Li kern.mapped_files ( Dv KERN_MAPPED_FILES )
676Returns 1 if the
677.St -p1003.1b-93
678Memory Mapped Files Option is available on this system,
679otherwise\ 0.
680.It Li kern.maxfiles ( Dv KERN_MAXFILES )
681The maximum number of open files that may be open in the system.
682.It Li kern.maxpartitions ( Dv KERN_MAXPARTITIONS )
683The maximum number of partitions allowed per disk.
684.It Li kern.maxlwp
685The maximum number of Lightweight Processes (threads) the system allows
686per uid.
687.It Li kern.maxphys ( Dv KERN_MAXPHYS )
688Maximum raw I/O transfer size.
689.It Li kern.maxproc ( Dv KERN_MAXPROC )
690The maximum number of simultaneous processes the system will allow.
691.It Li kern.maxptys ( Dv KERN_MAXPTYS )
692The maximum number of pseudo terminals.
693This value can be both raised and lowered, though it cannot
694be set lower than number of currently used ptys.
695See also
696.Xr pty 4 .
697.It Li kern.maxvnodes ( Dv KERN_MAXVNODES )
698The maximum number of vnodes available on the system.
699This can only be raised.
700.It Li kern.mbuf ( Dv KERN_MBUF )
701Return information about the mbuf control variables.
702Mbufs are data structures which store network packets and other data
703structures in the networking code, see
704.Xr mbuf 9 .
705The third level names for the mbuf variables are detailed below.
706The changeable column shows whether a process with appropriate
707privilege may change the value.
708.Bl -column "kern.mbuf.nmbclusters" "integer" "Changeable" -offset indent
709.It Sy Third level name	Sy Type	Sy Changeable
710.\" XXX Changeable? really?
711.It kern.mbuf.mblowat	integer	yes
712.It kern.mbuf.mclbytes	integer	yes
713.It kern.mbuf.mcllowat	integer	yes
714.It kern.mbuf.msize	integer	yes
715.It kern.mbuf.nmbclusters	integer	yes
716.El
717.Pp
718The variables are as follows:
719.Bl -tag -width "123456"
720.It Li kern.mbuf.mblowat ( Dv MBUF_MBLOWAT )
721The mbuf low water mark.
722.It Li kern.mbuf.mclbytes ( Dv MBUF_MCLBYTES )
723The mbuf cluster size.
724.It Li kern.mbuf.mcllowat ( Dv MBUF_MCLLOWAT )
725The mbuf cluster low water mark.
726.It Li kern.mbuf.msize ( Dv MBUF_MSIZE )
727The mbuf base size.
728.It Li kern.mbuf.nmbclusters ( Dv MBUF_NMBCLUSTERS )
729The limit on the number of mbuf clusters.
730The variable can only be increased, and only increased on machines with
731direct-mapped pool pages.
732.El
733.It Li kern.memlock ( Dv KERN_MEMLOCK )
734Returns 1 if the
735.St -p1003.1b-93
736Process Memory Locking Option is available on this system,
737otherwise\ 0.
738.It Li kern.memlock_range ( Dv KERN_MEMLOCK_RANGE )
739Returns 1 if the
740.St -p1003.1b-93
741Range Memory Locking Option is available on this system,
742otherwise\ 0.
743.It Li kern.memory_protection ( Dv KERN_MEMORY_PROTECTION )
744Returns 1 if the
745.St -p1003.1b-93
746Memory Protection Option is available on this system,
747otherwise\ 0.
748.It Li kern.messages
749Kernel console message verbosity.
750See
751.Sy \<sys/reboot.h\>
752.Bl -column "verbosity" "setting" -offset indent
753.It Sy Verbosity       Setting
754.It \ \ \ \ 0  Silent Sy AB_SILENT
755.It \ \ \ \ 1  Quiet Sy AB_QUIET
756.It \ \ \ \ 2  Normal Sy AB_NORMAL
757.It \ \ \ \ 3  Verbose Sy AB_VERBOSE
758.It \ \ \ \ 4  Debug Sy AB_DEBUG
759.El
760.It Li kern.module
761Settings related to kernel modules.
762The third level names for the settings are described below.
763.Bl -column "kern.module.autoload" "integer" "Changeable" -offset indent
764.It Sy Third level name	Sy Type	Sy Changeable
765.It kern.module.autoload	integer	yes
766.It kern.module.autotime	integer	yes
767.It kern.module.verbose	integer	yes
768.El
769.Pp
770The variables are as follows:
771.Bl -tag -width "123456"
772.It Li kern.module.autoload
773A boolean that controls whether kernel modules are loaded automatically.
774See
775.Xr module 7
776for additional details.
777.It Li kern.module.autotime
778An integer that controls the delay before an attempt is made to
779automatically unload a module that was auto-loaded.
780Setting this value to zero disables the auto-unload function.
781.It Li kern.module.verbose
782A boolean that enables or disables verbose
783debug messages related to kernel modules.
784.El
785.It Li kern.monotonic_clock ( Dv KERN_MONOTONIC_CLOCK )
786Returns the standard version the implementation of the
787.St -p1003.1b-93
788Monotonic Clock Option conforms to,
789otherwise\ 0.
790.It Li kern.mqueue
791Settings related to
792.Tn POSIX
793message queues; see
794.Xr mqueue 3 .
795This node is created dynamically when
796the corresponding kernel module is loaded.
797The third level names for the settings are described below.
798.Bl -column "kern.mqueue.mq_max_msgsize" "integer" "Changeable" -offset indent
799.It Sy Third level name	Sy Type	Sy Changeable
800.It kern.mqueue.mq_open_max	integer	yes
801.It kern.mqueue.mq_prio_max	integer	yes
802.It kern.mqueue.mq_max_msgsize	integer	yes
803.It kern.mqueue.mq_def_maxmsg	integer	yes
804.It kern.mqueue.mq_max_maxmsg	integer	yes
805.El
806.Pp
807The variables are:
808.Bl -tag -width "123456"
809.It Li kern.mqueue.mq_open_max
810The maximum number of message queue descriptors any single process can open.
811.It Li kern.mqueue.mq_prio_max
812The maximum priority of a message.
813.It Li kern.mqueue.mq_max_msgsize
814The maximum size of a message in a message queue.
815.It Li kern.mqueue.mq_def_maxmsg
816The default maximum message count.
817.It Li kern.mqueue.mq_max_maxmsg
818The maximum number of messages in a message queue.
819.El
820.It Li kern.msgbuf ( Dv KERN_MSGBUF )
821The kernel message buffer, rotated so that the head of the circular kernel
822message buffer is at the start of the returned data.
823The returned data may contain NUL bytes.
824.It Li kern.msgbufsize ( Dv KERN_MSGBUFSIZE )
825The maximum number of characters that the kernel message buffer can hold.
826.It Li kern.ngroups ( Dv KERN_NGROUPS )
827The maximum number of supplemental groups.
828.\" .It Li kern.no_sa_support
829.\" XXX: Undocumented.
830.It Li kern.ntptime ( Dv KERN_NTPTIME )
831A
832.Vt struct ntptimeval
833structure is returned.
834This structure contains data used by the
835.Xr ntpd 8
836program.
837.It Li kern.osrelease ( Dv KERN_OSRELEASE )
838The system release string.
839.It Li kern.osrevision ( Dv KERN_OSREV )
840The system revision string.
841.It Li kern.ostype ( Dv KERN_OSTYPE )
842The system type string.
843.\".It Li kern.panic_now
844.\" XXX: Undocumented.
845.It Li kern.pipe ( Dv KERN_PIPE )
846Pipe settings.
847The third level names for the  integer pipe settings is detailed below.
848The changeable column shows whether a process with appropriate
849privilege may change the value.
850.Bl -column "kern.pipe.maxbigpipes" "integer" "Changeable" -offset indent
851.It Sy Third level name	Sy Type	Sy Changeable
852.It kern.pipe.kvasiz	integer	yes
853.It kern.pipe.maxbigpipes	integer	yes
854.It kern.pipe.maxkvasz	integer	yes
855.It kern.pipe.limitkva	integer	yes
856.It kern.pipe.nbigpipes	integer	yes
857.El
858.Pp
859The variables are as follows:
860.Bl -tag -width "123456"
861.It Li kern.pipe.kvasiz ( Dv KERN_PIPE_KVASIZ )
862Amount of kernel memory consumed by pipe buffers.
863.It Li kern.pipe.maxbigpipes ( Dv KERN_PIPE_MAXBIGPIPES )
864Maximum number of
865.Dq big
866pipes.
867.It Li kern.pipe.maxkvasz ( Dv KERN_PIPE_MAXKVASZ )
868Maximum amount of kernel memory to be used for pipes.
869.It Li kern.pipe.limitkva ( Dv KERN_PIPE_LIMITKVA )
870Limit for direct transfers via page loan.
871.It Li kern.pipe.nbigpipes ( Dv KERN_PIPE_NBIGPIPES )
872Number of
873.Dq big
874pipes.
875.El
876.It Li kern.pool
877Provides statistics about the
878.Xr pool 9
879and
880.Xr pool_cache 9
881subsystems.
882.\" XXX: Undocumented .It Li kern.posix ( ? )
883.\"	 This is a node in which the only variable is semmax.
884.It Li kern.posix1version ( Dv KERN_POSIX1 )
885The version of ISO/IEC 9945
886.Pq St -p1003.1
887with which the system attempts to comply.
888.It Li kern.posix_aio
889The version of
890.St -p1003.1
891and its Asynchronous I/O option to which the system attempts to conform.
892.It Li kern.posix_barriers ( Dv KERN_POSIX_BARRIERS )
893The version of
894.St -p1003.1
895and its
896Barriers
897option to which the system attempts to conform,
898otherwise\ 0.
899.It Li kern.posix_reader_writer_locks ( Dv KERN_POSIX_READER_WRITER_LOCKS )
900The version of
901.St -p1003.1
902and its
903Read-Write Locks
904option to which the system attempts to conform,
905otherwise\ 0.
906.\".It Li kern.posix_sched
907.\" XXX: Undocumented.
908.It Li kern.posix_semaphores ( Dv KERN_POSIX_SEMAPHORES )
909The version of
910.St -p1003.1
911and its
912Semaphores
913option to which the system attempts to conform,
914otherwise\ 0.
915.It Li kern.posix_spin_locks ( Dv KERN_POSIX_SPIN_LOCKS )
916The version of
917.St -p1003.1
918and its
919Spin Locks
920option to which the system attempts to conform,
921otherwise\ 0.
922.It Li kern.posix_threads ( Dv KERN_POSIX_THREADS )
923The version of
924.St -p1003.1
925and its
926Threads
927option to which the system attempts to conform,
928otherwise\ 0.
929.It Li kern.posix_timers ( Dv KERN_POSIX_TIMERS )
930The version of
931.St -p1003.1
932and its
933Timers
934option to which the system attempts to conform,
935otherwise\ 0.
936.It Li kern.proc ( Dv KERN_PROC )
937Return the entire process table, or a subset of it.
938An array of
939.Vt struct kinfo_proc
940structures is returned,
941whose size depends on the current number of such objects in the system.
942The third and fourth level numeric names are as follows:
943.Bl -column "KERN_PROC_SESSION" "Fourth level is:" -offset indent
944.It Sy Third level name	Sy Fourth level is:
945.It KERN_PROC_ALL	None
946.It KERN_PROC_GID	A group ID
947.It KERN_PROC_PID	A process ID
948.It KERN_PROC_PGRP	A process group
949.It KERN_PROC_RGID	A real group ID
950.It KERN_PROC_RUID	A real user ID
951.It KERN_PROC_SESSION	A session ID
952.It KERN_PROC_TTY	A tty device
953.It KERN_PROC_UID	A user ID
954.El
955.It Li kern.proc2 ( Dv KERN_PROC2 )
956As for
957.Dv KERN_PROC ,
958but an array of
959.Vt struct kinfo_proc2
960structures are returned.
961The fifth level name is the size of the
962.Vt struct kinfo_proc2
963and the sixth level name is the number of structures to return.
964.It Li kern.proc_args ( Dv KERN_PROC_ARGS )
965Return the argv or environment strings (or the number thereof)
966of a process.
967Multiple strings are returned separated by NUL characters.
968The third level name is the process ID.
969The fourth level name is as follows:
970.Bl -column "KERN_PROG_PATHNAME" "The full pathname of the executable" -offset indent
971.It Dv KERN_PROC_ARGV	The argv strings
972.It Dv KERN_PROC_ENV	The environ strings
973.It Dv KERN_PROC_NARGV	The number of argv strings
974.It Dv KERN_PROC_NENV	The number of environ strings
975.It Dv KERN_PROC_PATHNAME	The full pathname of the executable
976.El
977.It Li kern.profiling ( Dv KERN_PROF )
978Return profiling information about the kernel.
979If the kernel is not compiled for profiling,
980attempts to retrieve any of the
981.Dv KERN_PROF
982values will fail with
983.Er EOPNOTSUPP .
984The third level names for the string and integer profiling information
985is detailed below.
986The changeable column shows whether a process with appropriate
987privilege may change the value.
988.Bl -column "kern.profiling.gmonparam" "struct gmonparam" "Changeable" -offset indent
989.It Sy Third level name	Sy Type	Sy Changeable
990.It kern.profiling.count	u_short[\|]	yes
991.It kern.profiling.froms	u_short[\|]	yes
992.It kern.profiling.gmonparam	struct gmonparam	no
993.It kern.profiling.state	integer	yes
994.It kern.profiling.tos	struct tostruct	yes
995.El
996.Pp
997The variables are as follows:
998.Bl -tag -width "123456"
999.It Li kern.profiling.count ( Dv GPROF_COUNT )
1000Array of statistical program counter counts.
1001.It Li kern.profiling.froms ( Dv GPROF_FROMS )
1002Array indexed by program counter of call-from points.
1003.It Li kern.profiling.gmonparams ( Dv GPROF_GMONPARAM )
1004Structure giving the sizes of the above arrays.
1005.It Li kern.profiling.state ( Dv GPROF_STATE )
1006Profiling state.
1007If set to
1008.Dv GMON_PROF_ON ,
1009starts profiling.
1010If set to
1011.Dv GMON_PROF_OFF ,
1012stops profiling.
1013.It Li kern.profiling.tos ( Dv GPROF_TOS )
1014Array of
1015.Vt struct tostruct
1016describing destination of calls and their counts.
1017.El
1018.\" .It Li kern.pset
1019.\" XXX: Undocumented.
1020.It Li kern.rawpartition ( Dv KERN_RAWPARTITION )
1021The raw partition of a disk (a == 0).
1022.It Li kern.root_device ( Dv KERN_ROOT_DEVICE )
1023The name of the root device (e.g.,
1024.Dq wd0 ) .
1025.It Li kern.root_partition ( Dv KERN_ROOT_PARTITION )
1026The root partition on the root device (a == 0).
1027.It Li kern.rtc_offset ( Dv KERN_RTC_OFFSET )
1028Return the offset of real time clock from UTC in minutes.
1029.It Li kern.saved_ids ( Dv KERN_SAVED_IDS )
1030Returns 1 if saved set-group and saved set-user ID is available.
1031.It Li kern.sbmax ( Dv KERN_SBMAX )
1032Maximum socket buffer size.
1033.\" XXX units?
1034.It Li kern.securelevel ( Dv KERN_SECURELVL )
1035See
1036.Xr secmodel_securelevel 9 .
1037.\" .It Li kern.sched
1038.\" XXX: Undocumented.
1039.It Li kern.somaxkva ( Dv KERN_SOMAXKVA )
1040Maximum amount of kernel memory to be used for socket buffers.
1041.\" XXX units?
1042.It Li kern.synchronized_io ( Dv KERN_SYNCHRONIZED_IO )
1043Returns 1 if the
1044.St -p1003.1b-93
1045Synchronized I/O Option is available on this system,
1046otherwise\ 0.
1047.It Li kern.timecounter ( dynamic )
1048Display and control the timecounter source of the system.
1049.Bl -column "kern.timecounter.timestepwarnings" "integer" "Changeable" -offset indent
1050.It Sy Third level name	Sy Type	Sy Changeable
1051.It kern.timecounter.choice	string	no
1052.It kern.timecounter.hardware	string	yes
1053.It kern.timecounter.timestepwarnings	integer	yes
1054.El
1055.Pp
1056The variables are as follows:
1057.Bl -tag -width "123456"
1058.It Li kern.timecounter.choice ( dynamic )
1059The list of available timecounters with their quality and frequency.
1060.It Li kern.timecounter.hardware ( dynamic )
1061The currently selected timecounter source.
1062.It Li kern.timecounter.timestepwarnings ( dynamic )
1063If non-zero display a message each time the time is stepped.
1064.El
1065.It Li kern.timex ( Dv KERN_TIMEX )
1066Not available.
1067.It Li kern.tkstat ( Dv KERN_TKSTAT )
1068Return information about the number of characters sent and received
1069on ttys.
1070The third level names for the tty statistic variables are detailed below.
1071The changeable column shows whether a process
1072with appropriate privilege may change the value.
1073.Bl -column "kern.tkstat.cancc" "quad" "Changeable" -offset indent
1074.It Sy Third level name	Sy Type	Sy Changeable
1075.It kern.tkstat.cancc	quad	no
1076.It kern.tkstat.nin	quad	no
1077.It kern.tkstat.nout	quad	no
1078.It kern.tkstat.rawcc	quad	no
1079.El
1080.Pp
1081The variables are as follows:
1082.Bl -tag -width "123456"
1083.It Li kern.tkstat.cancc ( Dv KERN_TKSTAT_CANCC )
1084The number of canonical input characters.
1085.It Li kern.tkstat.nin ( Dv KERN_TKSTAT_NIN )
1086The total number of input characters.
1087.It Li kern.tkstat.nout ( Dv KERN_TKSTAT_NOUT )
1088The total number of output characters.
1089.It Li kern.tkstat.rawcc ( Dv KERN_TKSTAT_RAWCC )
1090The number of raw input characters.
1091.El
1092.It Li kern.tty
1093The third level names for the tty setup variables are detailed below.
1094The changeable column shows whether a process
1095with appropriate privilege may change the value.
1096.Bl -column "kern.tty.qsize" "int" "Changeable" -offset indent
1097.It Sy Third level name	Sy Type	Sy Changeable
1098.It kern.tty.qsize	int	yes
1099.El
1100.Pp
1101The variables are as follows:
1102.Bl -tag -width "123456"
1103.It Li kern.tty.qsize
1104Control/display the size of the default input and output queues selected
1105during tty creation.
1106Is converted to a power of two and its range is between
1107.Dv 1024
1108and
1109.Dv 65536 .
1110.El
1111.It Li kern.uidinfo
1112Resource usage for the current user.
1113.Bl -column "kern.uidinfo.proccnt" "integer" "Changeable" -offset indent
1114.It Sy Third level name	Sy Type	Sy Changeable
1115.It kern.uidinfo.proccnt	integer	no
1116.It kern.uidinfo.lwpcnt	integer	no
1117.It kern.uidinfo.lockcnt	integer	no
1118.It kern.uidinfo.sbsize	integer	no
1119.El
1120.Bl -tag -width "123456"
1121.It Li kern.uidinfo.proccnt
1122Returns the number of active processes for the current user.
1123.It Li kern.uidinfo.lwpcnt
1124Returns the number of active threads for the current user; the first thread
1125of each process is not counted.
1126.It Li kern.uidinfo.lockcnt
1127Number of locks held by the current user.
1128.It Li kern.uidinfo.sbsize
1129Number of bytes in socket buffers allocated to the current user.
1130.El
1131.It Li kern.urandom ( Dv KERN_URND )
1132Random integer value.
1133.It Li kern.usercrypto
1134When enabled, allows userland to
1135.Xr open 2
1136the
1137.Pa /dev/crypto
1138special device, used by the
1139.Xr crypto 4
1140system.
1141.It Li kern.userasymcrypto
1142Enables or disables the use of software asymmetric crypto support in the
1143.Xr crypto 4
1144system.
1145.It Li kern.veriexec
1146Runtime information for
1147.Xr veriexec 8 .
1148.Bl -column "kern.veriexec.algorithms" "integer" "Changeable" -offset indent
1149.It Sy Third level name	Sy Type	Sy Changeable
1150.It kern.veriexec.algorithms	string	no
1151.It kern.veriexec.count	node	not applicable
1152.It kern.veriexec.strict	integer	yes
1153.It kern.veriexec.verbose	integer	yes
1154.El
1155.Bl -tag -width "123456"
1156.It Li kern.veriexec.algorithms
1157Returns a string with the supported algorithms in Veriexec.
1158.It Li kern.veriexec.count
1159Sub-nodes are added to this node as new mounts are monitored by Veriexec.
1160Each mount will be under its own
1161.No tableN
1162node.
1163Under each node there will be three variables, indicating the mount
1164point, the file system type, and the number of entries.
1165.It Li kern.veriexec.strict
1166Controls the strict level of Veriexec.
1167See
1168.Xr security 7
1169for more information on each level's implications.
1170.It Li kern.veriexec.verbose
1171Controls the verbosity level of Veriexec.
1172If 0, only the minimal
1173indication required will be given about what's happening - fingerprint
1174mismatches, removal of entries from the tables, modification of a
1175fingerprinted file.
1176If 1, more messages will be printed (ie., when a file with a valid
1177fingerprint is accessed).
1178Verbose level 2 is debug mode.
1179.El
1180.It Li kern.version ( Dv KERN_VERSION )
1181The system version string.
1182.It Li kern.vnode ( Dv KERN_VNODE )
1183Return the entire vnode table.
1184Note, the vnode table is not necessarily a consistent snapshot of
1185the system.
1186The returned data consists of an array whose size depends on the
1187current number of such objects in the system.
1188Each element of the array contains the kernel address of a vnode
1189.Vt struct vnode *
1190followed by the vnode itself
1191.Vt struct vnode .
1192.\" XXX: Undocumented: kern.lwp: no children?
1193.El
1194.Ss The machdep.* subtree
1195The set of variables defined is architecture dependent.
1196Most architectures define at least the following variables.
1197.Bl -column "machdep.booted_kernel" "Type" "Changeable" -offset indent
1198.It Sy Second level name	Sy Type	Sy Changeable
1199.It Li machdep.booted_kernel	string	no
1200.El
1201.\" XXX: Document the above.
1202.Ss The net.* subtree
1203The string and integer information available for the
1204.Li net
1205level is detailed below.
1206The changeable column shows whether a process with appropriate
1207privilege may change the value.
1208The second and third levels are typically the protocol family and
1209protocol number, though this is not always the case.
1210.Bl -column "Second level name" "IPsec key management values" "Changeable" -offset indent
1211.It Sy Second level name	Sy Type	Sy Changeable
1212.It net.route	routing messages	no
1213.It net.inet	IPv4 values	yes
1214.It net.inet6	IPv6 values	yes
1215.It net.key	IPsec key management values	yes
1216.El
1217.Bl -tag -width "123456"
1218.It Li net.route ( Dv PF_ROUTE )
1219.\" XXX really?
1220Return the entire routing table or a subset of it.
1221The data is returned as a sequence of routing messages (see
1222.Xr route 4
1223for the header file, format and meaning).
1224The length of each message is contained in the message header.
1225.Pp
1226The third level name is a protocol number, which is currently always\ 0.
1227The fourth level name is an address family, which may be set to 0 to
1228select all address families.
1229The fifth and sixth level names are as follows:
1230.Bl -column "Fifth level name" "Sixth level is:" -offset indent
1231.It Sy Fifth level name	Sy Sixth level is:
1232.It NET_RT_FLAGS	rtflags
1233.It NET_RT_DUMP	None
1234.It NET_RT_IFLIST	None
1235.El
1236.It Li net.inet ( Dv PF_INET )
1237Get or set various global information about the IPv4
1238.Pq Internet Protocol version 4 .
1239The third level name is the protocol.
1240The fourth level name is the variable name.
1241The currently defined protocols and names are:
1242.Bl -column "Protocol" "anonportalgo.available" "integer" "Changeable" -offset indent
1243.It Sy Protocol	Variable	Sy Type	Sy Changeable
1244.It arp	down	integer	yes
1245.It arp	keep	integer	yes
1246.It arp	log_movements	integer	yes
1247.It arp	log_permanent_modify	integer	yes
1248.It arp	log_unknown_network	integer	yes
1249.It arp	log_wrong_iface	integer	yes
1250.It carp	allow	integer	yes
1251.It carp	preempt	integer	yes
1252.It carp	log	integer	yes
1253.It carp	arpbalance	integer	yes
1254.It icmp	errppslimit	integer	yes
1255.It icmp	maskrepl	integer	yes
1256.It icmp	rediraccept	integer	yes
1257.It icmp	redirtimeout	integer	yes
1258.It icmp	bmcastecho	integer	yes
1259.It ip	allowsrcrt	integer	yes
1260.It ip 	anonportalgo.selected	string	yes
1261.It ip 	anonportalgo.available	string	yes
1262.It ip 	anonportalgo.reserve	struct	yes
1263.It ip	anonportmax	integer	yes
1264.It ip	anonportmin	integer	yes
1265.It ip	checkinterface	integer	yes
1266.It ip	dad_count	integer	yes
1267.It ip	directed-broadcast	integer	yes
1268.It ip	do_loopback_cksum	integer	yes
1269.It ip	forwarding	integer	yes
1270.It ip	forwsrcrt	integer	yes
1271.It ip	gifttl	integer	yes
1272.It ip	grettl	integer	yes
1273.It ip	hashsize	integer	yes
1274.It ip	hostzerobroadcast	integer	yes
1275.It ip	lowportmin	integer	yes
1276.It ip	lowportmax	integer	yes
1277.It ip	maxflows	integer	yes
1278.It ip	maxfragpackets	integer	yes
1279.It ip	mtudisc	integer	yes
1280.It ip	mtudisctimeout	integer	yes
1281.It ip	random_id	integer	yes
1282.It ip	redirect	integer	yes
1283.It ip	subnetsarelocal	integer	yes
1284.It ip	ttl	integer	yes
1285.It tcp	rfc1323	integer	yes
1286.It tcp	sendspace	integer	yes
1287.It tcp	recvspace	integer	yes
1288.It tcp	mssdflt	integer	yes
1289.It tcp	syn_cache_limit	integer	yes
1290.It tcp	syn_bucket_limit	integer	yes
1291.It tcp	syn_cache_interval	integer	yes
1292.It tcp	init_win	integer	yes
1293.It tcp	init_win_local	integer	yes
1294.It tcp	mss_ifmtu	integer	yes
1295.It tcp	win_scale	integer	yes
1296.It tcp	timestamps	integer	yes
1297.It tcp	compat_42	integer	yes
1298.It tcp	cwm	integer	yes
1299.It tcp	cwm_burstsize	integer	yes
1300.It tcp	ack_on_push	integer	yes
1301.It tcp	keepidle	integer	yes
1302.It tcp	keepintvl	integer	yes
1303.It tcp	keepcnt	integer	yes
1304.It tcp	slowhz	integer	no
1305.It tcp	keepinit	integer	yes
1306.It tcp	log_refused	integer	yes
1307.It tcp	rstppslimit	integer	yes
1308.It tcp	ident	struct	no
1309.It tcp	drop	struct	no
1310.It tcp	sack.enable	integer	yes
1311.It tcp	sack.globalholes	integer	no
1312.It tcp	sack.globalmaxholes	integer	yes
1313.It tcp	sack.maxholes	integer	yes
1314.It tcp	ecn.enable	integer	yes
1315.It tcp	ecn.maxretries	integer	yes
1316.It tcp	congctl.selected	string	yes
1317.It tcp	congctl.available	string	yes
1318.It tcp	abc.enable	integer	yes
1319.It tcp	abc.aggressive	integer	yes
1320.It udp	checksum	integer	yes
1321.It udp	do_loopback_cksum	integer	yes
1322.It udp	recvspace	integer	yes
1323.It udp	sendspace	integer	yes
1324.El
1325.Pp
1326The variables are as follows:
1327.Bl -tag -width "123456"
1328.It Li arp.down
1329Failed ARP entry lifetime.
1330.It Li arp.keep
1331Valid ARP entry lifetime.
1332.It Li carp.allow
1333If set to 0, incoming
1334.Xr carp 4
1335packets will not be processed.
1336If set to any other value, processing will occur.
1337Enabled by default.
1338.It Li carp.arpbalance
1339If set to any value other than 0, the ARP balancing functionality of
1340.Xr carp 4
1341is enabled.
1342When ARP requests are received for an IP address which is part of any virtual
1343host, carp will hash the source IP in the ARP request to select one of the
1344virtual hosts from the set of all the virtual hosts which have that IP address.
1345The master of that host will respond with the correct virtual MAC address.
1346Disabled by default.
1347.It Li carp.log
1348If set to any value other than 0,
1349.Xr carp 4
1350will log errors.
1351Disabled by default.
1352.It Li carp.preempt
1353If set to 0,
1354.Xr carp 4
1355will not attempt to become master if it is receiving advertisements from
1356another active master.
1357If set to any other value, carp will become master of the virtual host if it
1358believes it can send advertisements more frequently than the current master.
1359Disabled by default.
1360.It Li ip.allowsrcrt
1361If set to 1, the host accepts source routed packets.
1362.It Li ip.anonportalgo.available
1363The available RFC 6056 port randomization algorithms.
1364.It Li ip.anonportalgo.reserve
1365A bitmask of ports that will not be used during anonymous or privileged
1366port selection.
1367.It Li ip.anonportalgo.selected
1368The currently selected RFC 6056 port randomization algorithm.
1369.It Li ip.anonportmax
1370The highest port number to use for TCP and UDP ephemeral port allocation.
1371This cannot be set to less than 1024 or greater than 65535, and must
1372be greater than
1373.Li ip.anonportmin .
1374.It Li ip.anonportmin
1375The lowest port number to use for TCP and UDP ephemeral port allocation.
1376This cannot be set to less than 1024 or greater than 65535.
1377.It Li ip.checkinterface
1378If set to non-zero, the host will reject packets addressed to it
1379that arrive on an interface not bound to that address.
1380Currently, this must be disabled if ipnat is used to translate the
1381destination address to another local interface, or if addresses
1382are added to the loopback interface instead of the interface where
1383the packets for those packets are received.
1384.It Li ip.dad_count
1385The number of
1386.Xr arp 4
1387probes sent for Address Conflict Detection.
1388Set to 0 to disable this.
1389.It Li ip.directed-broadcast
1390If set to 1, enables directed broadcast behavior for the host.
1391.It Li ip.do_loopback_cksum
1392Perform IP checksum on loopback.
1393.It Li ip.forwarding
1394If set to 1, enables IP forwarding for the host,
1395meaning that the host is acting as a router.
1396.It Li ip.forwsrcrt
1397If set to 1, enables forwarding of source-routed packets for the host.
1398This value may only be changed if the kernel security level is less than 1.
1399.It Li ip.gifttl
1400The maximum time-to-live (hop count) value for an IPv4 packet generated by
1401.Xr gif 4
1402tunnel interface.
1403.It Li ip.grettl
1404The maximum time-to-live (hop count) value for an IPv4 packet generated by
1405.Xr gre 4
1406tunnel interface.
1407.It Li ip.hashsize
1408The size of IPv4 Fast Forward hash table.
1409This value must be a power of 2 (64, 256...).
1410A larger hash table size results in fewer collisions.
1411Also see
1412.Li ip.maxflows .
1413.It Li ip.hostzerobroadcast
1414All zeroes address is broadcast address.
1415.It Li ip.lowportmax
1416The highest port number to use for TCP and UDP reserved port allocation.
1417This cannot be set to less than 0 or greater than 1024, and must
1418be greater than
1419.Li ip.lowportmin .
1420.It Li ip.lowportmin
1421The lowest port number to use for TCP and UDP reserved port allocation.
1422This cannot be set to less than 0 or greater than 1024, and must
1423be smaller than
1424.Li ip.lowportmax .
1425.It Li ip.maxflows
1426IPv4 Fast Forwarding is enabled by default.
1427If set to 0, IPv4 Fast Forwarding is disabled.
1428.Li ip.maxflows
1429controls the maximum amount of flows which can be created.
1430The default value is 256.
1431.It Li ip.maxfragpackets
1432The maximum number of fragmented packets the node will accept.
14330 means that the node will not accept any fragmented packets.
1434\-1 means that the node will accept as many fragmented packets as it receives.
1435The flag is provided basically for avoiding possible DoS attacks.
1436.It Li ip.mtudisc
1437If set to 1, enables Path MTU Discovery (RFC 1191).
1438When Path MTU Discovery is enabled, the transmitted TCP segment
1439size will be determined by the advertised maximum segment size
1440(MSS) from the remote end, as constrained by the path MTU.
1441If MTU Discovery is disabled, the transmitted segment size will
1442never be greater than
1443.Li tcp.mssdflt
1444(the local maximum segment size).
1445.It Li ip.mtudisctimeout
1446The number of seconds in which a route added by the Path MTU
1447Discovery engine will time out.
1448When the route times out, the Path
1449MTU Discovery engine will attempt to probe a larger path MTU.
1450.It Li ip.random_id
1451Assign random ip_id values.
1452.It Li ip.redirect
1453If set to 1, ICMP redirects may be sent by the host.
1454This option is ignored unless the host is routing IP packets,
1455and should normally be enabled on all systems.
1456.It Li ip.subnetsarelocal
1457If set to 1, subnets are to be considered local addresses.
1458.It Li ip.ttl
1459The maximum time-to-live (hop count) value for an IP packet sourced by
1460the system.
1461This value applies to normal transport protocols, not to ICMP.
1462.It Li icmp.errppslimit
1463The variable specifies the maximum number of outgoing ICMP error messages,
1464per second.
1465ICMP error messages that exceeded the value are subject to rate limitation
1466and will not go out from the node.
1467Negative value disables rate limitation.
1468.It Li icmp.maskrepl
1469If set to 1, ICMP network mask requests are to be answered.
1470.It Li icmp.rediraccept
1471If set to non-zero, the host will accept ICMP redirect packets.
1472Note that routers will never accept ICMP redirect packets,
1473and the variable is meaningful on IP hosts only.
1474.It Li icmp.redirtimeout
1475The variable specifies lifetime of routing entries generated by incoming
1476ICMP redirect.
1477This defaults to 600 seconds.
1478.It Li icmp.returndatabytes
1479Number of bytes to return in an ICMP error message.
1480.It Li icmp.bmcastecho
1481If set to 1, enables responding to ICMP echo or timestamp request to the
1482broadcast address.
1483.It Li tcp.ack_on_push
1484If set to 1, TCP is to immediately transmit an ACK upon reception of
1485a packet with PUSH set.
1486This can avoid losing a round trip time in some rare situations,
1487but has the caveat of potentially defeating TCP's delayed ACK algorithm.
1488Use of this option is generally not recommended, but
1489the variable exists in case your configuration really needs it.
1490.It Li tcp.compat_42
1491If set to 1, enables work-arounds for bugs in the 4.2BSD TCP implementation.
1492Use of this option is not recommended, although it may be
1493required in order to communicate with extremely old TCP implementations.
1494.It Li tcp.cwm
1495If set to 1, enables use of the Hughes/Touch/Heidemann Congestion Window
1496Monitoring algorithm.
1497This algorithm prevents line-rate bursts of packets that could
1498otherwise occur when data begins flowing on an idle TCP connection.
1499These line-rate bursts can contribute to network and router congestion.
1500This can be particularly useful on World Wide Web servers
1501which support HTTP/1.1, which has lingering connections.
1502.It Li tcp.cwm_burstsize
1503The Congestion Window Monitoring allowed burst size, in terms
1504of packet count.
1505.It Li tcp.delack_ticks
1506Number of ticks to delay sending an ACK.
1507.It Li tcp.do_loopback_cksum
1508Perform TCP checksum on loopback.
1509.It Li tcp.init_win
1510A value indicating the TCP initial congestion window.
1511The valid range
1512is 0 to 10 (maximum specified by RFC6928),
1513with a default of 4 (approximately 4K per RFC3390).
1514.It Li tcp.init_win_local
1515Like
1516.Li tcp.init_win ,
1517but used when communicating with hosts on a local network.
1518.It Li tcp.keepcnt
1519Number of keepalive probes sent before declaring a connection dead.
1520If set to zero, there is no limit;
1521keepalives will be sent until some kind of
1522response is received from the peer.
1523.It Li tcp.keepidle
1524Time a connection must be idle before keepalives are sent (if keepalives
1525are enabled for the connection).
1526See also tcp.slowhz.
1527.It Li tcp.keepintvl
1528Time after a keepalive probe is sent until, in the absence of any response,
1529another probe is sent.
1530See also tcp.slowhz.
1531.It Li tcp.log_refused
1532If set to 1, refused TCP connections to the host will be logged.
1533.It Li tcp.keepinit
1534Timeout in seconds during connection establishment.
1535.It Li tcp.mss_ifmtu
1536If set to 1, TCP calculates the outgoing maximum segment size based on
1537the MTU of the appropriate interface.
1538If set to 0, it is calculated based on the greater of the MTU of the
1539interface, and the largest (non-loopback) interface MTU on the system.
1540.It Li tcp.mssdflt
1541The default maximum segment size both advertised to the peer
1542and to use when either the peer does not advertise a maximum segment size to
1543us during connection setup or Path MTU Discovery
1544.Li ( ip.mtudisc )
1545is disabled.
1546Do not change this value unless you really know what you are doing.
1547.It Li tcp.recvspace
1548The default TCP receive buffer size.
1549.It Li tcp.rfc1323
1550If set to 1, enables RFC 1323 extensions to TCP.
1551.It Li tcp.rstppslimit
1552The variable specifies the maximum number of outgoing TCP RST packets,
1553per second.
1554TCP RST packet that exceeded the value are subject to rate limitation
1555and will not go out from the node.
1556Negative value disables rate limitation.
1557.It Li tcp.ident
1558Return the user ID of a connected socket pair.
1559(RFC1413 Identification Protocol lookups.)
1560.It Li tcp.drop
1561Drop a TCP socket pair connection.
1562.It Li tcp.sack.enable
1563If set to 1, enables RFC 2018 Selective ACKnowledgement.
1564.It Li tcp.sack.globalholes
1565Global number of TCP SACK holes.
1566.It Li tcp.sack.globalmaxholes
1567Global maximum number of TCP SACK holes.
1568.It Li tcp.sack.maxholes
1569Maximum number of TCP SACK holes allowed per connection.
1570.It Li tcp.ecn.enable
1571If set to 1, enables RFC 3168 Explicit Congestion Notification.
1572.It Li tcp.ecn.maxretries
1573Number of times to retry sending the ECN-setup packet.
1574.It Li tcp.sendspace
1575The default TCP send buffer size.
1576.It Li tcp.slowhz
1577The units for tcp.keepidle and tcp.keepintvl; those variables are in ticks
1578of a clock that ticks tcp.slowhz times per second.
1579(That is, their values
1580must be divided by the tcp.slowhz value to get times in seconds.)
1581.It Li tcp.syn_bucket_limit
1582The maximum number of entries allowed per hash bucket in the TCP
1583compressed state engine.
1584.It Li tcp.syn_cache_limit
1585The maximum number of entries allowed in the TCP compressed state
1586engine.
1587.It Li tcp.timestamps
1588If rfc1323 is enabled, a value of 1 indicates RFC 1323 time stamp options,
1589used for measuring TCP round trip times, are enabled.
1590.It Li tcp.win_scale
1591If rfc1323 is enabled, a value of 1 indicates RFC 1323 window scale options,
1592for increasing the TCP window size, are enabled.
1593.It Li tcp.congctl.available
1594The available TCP congestion control algorithms.
1595.It Li tcp.congctl.selected
1596The currently selected TCP congestion control algorithm.
1597.It Li tcp.abc.enable
1598If set to 1, use RFC 3465 Appropriate Byte Counting (ABC).
1599If set to 0, use traditional Packet Counting.
1600.It Li tcp.abc.aggressive
1601Choose the L parameter found in RFC 3465.
1602L is the maximum cwnd increase for an ack during slow start.
1603If set to 1, use L=2*SMSS.
1604If set to 0, use L=1*SMSS.
1605It has no effect unless tcp.abc.enable is set to 1.
1606.It Li udp.checksum
1607If set to 1, UDP checksums are being computed.
1608Received non-zero UDP checksums are always checked.
1609Disabling UDP checksums is strongly discouraged.
1610.It Li udp.recvspace
1611The default UDP receive buffer size.
1612.It Li udp.sendspace
1613The default UDP send buffer size.
1614.El
1615.Pp
1616For variables net.*.ipsec, please refer to
1617.Xr ipsec 4 .
1618.It Li net.inet6 ( Dv PF_INET6 )
1619Get or set various global information about the IPv6
1620.Pq Internet Protocol version 6 .
1621The third level name is the protocol.
1622The fourth level name is the variable name.
1623The currently defined protocols and names are:
1624.Bl -column "Protocol" "anonportalgo.available" "integer" "Changeable" -offset indent
1625.It Sy Protocol	Variable	Sy Type	Sy Changeable
1626.It icmp6	errppslimit	integer	yes
1627.It icmp6	mtudisc_hiwat	integer	yes
1628.It icmp6	mtudisc_lowat	integer	yes
1629.It icmp6	nd6_debug	integer	yes
1630.It icmp6	nd6_delay	integer	yes
1631.It icmp6	nd6_maxnudhint	integer	yes
1632.It icmp6	nd6_mmaxtries	integer	yes
1633.It icmp6	nd6_prune	integer	yes
1634.It icmp6	nd6_umaxtries	integer	yes
1635.It icmp6	nd6_useloopback	integer	yes
1636.It icmp6	nodeinfo	integer	yes
1637.It icmp6	rediraccept	integer	yes
1638.It icmp6	redirtimeout	integer	yes
1639.It ip6	accept_rtadv	integer	yes
1640.It ip6	addctlpolicy	struct in6_addrpolicy	no
1641.It ip6	anonportalgo.selected	string	yes
1642.It ip6	anonportalgo.available	string	yes
1643.It ip6	anonportalgo.reserve	struct	yes
1644.It ip6	anonportmax	integer	yes
1645.It ip6	anonportmin	integer	yes
1646.It ip6	auto_flowlabel	integer	yes
1647.It ip6	dad_count	integer	yes
1648.It ip6	defmcasthlim	integer	yes
1649.It ip6	forwarding	integer	yes
1650.It ip6	gifhlim	integer	yes
1651.It ip6	hashsize	integer	yes
1652.It ip6	hlim	integer	yes
1653.It ip6	hdrnestlimit	integer	yes
1654.It ip6	kame_version	string	no
1655.It ip6	keepfaith	integer	yes
1656.It ip6	log_interval	integer	yes
1657.It ip6	lowportmax	integer	yes
1658.It ip6	lowportmin	integer	yes
1659.It ip6	maxdynroutes	integer	yes
1660.It ip6	maxifprefixes	integer	yes
1661.It ip6	maxifdefrouters	integer	yes
1662.It ip6	maxflows	integer	yes
1663.It ip6	maxfragpackets	integer	yes
1664.It ip6	maxfrags	integer	yes
1665.It ip6	neighborgcthresh	integer	yes
1666.It ip6	redirect	integer	yes
1667.It ip6	rr_prune	integer	yes
1668.It ip6	use_deprecated	integer	yes
1669.It ip6	v6only	integer	yes
1670.It udp6	do_loopback_cksum	integer	yes
1671.It udp6	recvspace	integer	yes
1672.It udp6	sendspace	integer	yes
1673.El
1674.Pp
1675The variables are as follows:
1676.Bl -tag -width "123456"
1677.It Li ip6.accept_rtadv
1678If set to non-zero, the node will accept ICMPv6 router advertisement packets
1679and autoconfigures address prefixes and default routers.
1680The node must be a host
1681.Pq not a router
1682for the option to be meaningful.
1683.It Li ip6.anonportalgo.available
1684The available RFC 6056 port randomization algorithms.
1685.It Li ip6.anonportalgo.reserve
1686A bitmask of ports that will not be used during anonymous or privileged
1687port selection.
1688.It Li ip6.anonportalgo.selected
1689The currently selected RFC 6056 port randomization algorithm.
1690.It Li ip6.anonportmax
1691The highest port number to use for TCP and UDP ephemeral port allocation.
1692This cannot be set to less than 1024 or greater than 65535, and must
1693be greater than
1694.Li ip6.anonportmin .
1695.It Li ip6.anonportmin
1696The lowest port number to use for TCP and UDP ephemeral port allocation.
1697This cannot be set to less than 1024 or greater than 65535.
1698.It Li ip6.auto_flowlabel
1699On connected transport protocol packets,
1700fill IPv6 flowlabel field to help intermediate routers to identify packet flows.
1701.It Li ip6.dad_count
1702The variable configures number of IPv6 DAD
1703.Pq duplicated address detection
1704probe packets.
1705The packets will be generated when IPv6 interface addresses are configured.
1706.It Li ip6.defmcasthlim
1707The default hop limit value for an IPv6 multicast packet sourced by the node.
1708This value applies to all the transport protocols on top of IPv6.
1709There are APIs to override the value, as documented in
1710.Xr ip6 4 .
1711.It Li ip6.forwarding
1712If set to 1, enables IPv6 forwarding for the node,
1713meaning that the node is acting as a router.
1714If set to 0, disables IPv6 forwarding for the node,
1715meaning that the node is acting as a host.
1716IPv6 specification defines node behavior for
1717.Dq router
1718case and
1719.Dq host
1720case quite differently, and changing this variable during operation
1721may cause serious trouble.
1722It is recommended to configure the variable at bootstrap time,
1723and bootstrap time only.
1724.It Li ip6.gifhlim
1725The maximum hop limit value for an IPv6 packet generated by
1726.Xr gif 4
1727tunnel interface.
1728.It Li ip6.hdrnestlimit
1729The number of IPv6 extension headers permitted on incoming IPv6 packets.
1730If set to 0, the node will accept as many extension headers as possible.
1731.It Li ip6.hashsize
1732The size of IPv6 Fast Forward hash table.
1733This value must be a power of 2 (64, 256, ...).
1734A larger hash table size results in fewer collisions.
1735Also see
1736.Li ip6.maxflows .
1737.It Li ip6.hlim
1738The default hop limit value for an IPv6 unicast packet sourced by the node.
1739This value applies to all the transport protocols on top of IPv6.
1740There are APIs to override the value, as documented in
1741.Xr ip6 4 .
1742.It Li ip6.kame_version
1743The string identifies the version of KAME IPv6 stack implemented in the kernel.
1744.It Li ip6.keepfaith
1745If set to non-zero, it enables
1746.Dq FAITH
1747TCP relay IPv6-to-IPv4 translator code in the kernel.
1748Refer
1749.Xr faith 4
1750and
1751.Xr faithd 8
1752for detail.
1753.It Li ip6.log_interval
1754The variable controls amount of logs generated by IPv6 packet
1755forwarding engine, by setting interval between log output
1756.Pq in seconds .
1757.It Li ip6.lowportmax
1758The highest port number to use for TCP and UDP reserved port allocation.
1759This cannot be set to less than 0 or greater than 1024, and must
1760be greater than
1761.Li ip6.lowportmin .
1762.It Li ip6.lowportmin
1763The lowest port number to use for TCP and UDP reserved port allocation.
1764This cannot be set to less than 0 or greater than 1024, and must
1765be smaller than
1766.Li ip6.lowportmax .
1767.It Li ip6.maxdynroutes
1768Maximum number of routes created by redirect.
1769Set it to negative to disable.
1770The default value is 4096.
1771.It Li ip6.maxifprefixes
1772Maximum number of prefixes created by route advertisements per interface.
1773Set it to negative to disable.
1774The default value is 16.
1775.It Li ip6.maxifdefrouters 16
1776Maximum number of default routers created by route advertisements per interface.
1777Set it to negative to disable.
1778The default value is 16.
1779.It Li ip6.maxflows
1780IPv6 Fast Forwarding is enabled by default.
1781If set to 0, IPv6 Fast Forwarding is disabled.
1782.Li ip6.maxflows
1783controls the maximum amount of flows which can be created.
1784The default value is 256.
1785.It Li ip6.maxfragpackets
1786The maximum number of fragmented packets the node will accept.
17870 means that the node will not accept any fragmented packets.
1788\-1 means that the node will accept as many fragmented packets as it receives.
1789The flag is provided basically for avoiding possible DoS attacks.
1790.It Li ip6.maxfrags
1791The maximum number of fragments the node will accept.
17920 means that the node will not accept any fragments.
1793\-1 means that the node will accept as many fragments as it receives.
1794The flag is provided basically for avoiding possible DoS attacks.
1795.It Li ip6.neighborgcthresh
1796Maximum number of entries in neighbor cache per interface.
1797Set to negative to disable.
1798The default value is 2048.
1799.It Li ip6.redirect
1800If set to 1, ICMPv6 redirects may be sent by the node.
1801This option is ignored unless the node is routing IP packets,
1802and should normally be enabled on all systems.
1803.It Li ip6.rr_prune
1804The variable specifies interval between IPv6 router renumbering prefix
1805babysitting, in seconds.
1806.It Li ip6.use_deprecated
1807The variable controls use of deprecated address, specified in RFC 2462 5.5.4.
1808.It Li ip6.v6only
1809The variable specifies initial value for
1810.Dv IPV6_V6ONLY
1811socket option for
1812.Dv AF_INET6
1813socket.
1814Please refer to
1815.Xr ip6 4
1816for detail.
1817.It Li icmp6.errppslimit
1818The variable specifies the maximum number of outgoing ICMPv6 error messages,
1819per second.
1820ICMPv6 error messages that exceeded the value are subject to rate limitation
1821and will not go out from the node.
1822Negative value disables rate limitation.
1823.It Li icmp6.mtudisc_hiwat
1824.It Li icmp6.mtudisc_lowat
1825The variables define the maximum number of routing table entries,
1826created due to path MTU discovery
1827.Pq prevents denial-of-service attacks with ICMPv6 too big messages .
1828When IPv6 path MTU discovery happens, we keep path MTU information into
1829the routing table.
1830If the number of routing table entries exceed the value,
1831the kernel will not attempt to keep the path MTU information.
1832.Li icmp6.mtudisc_hiwat
1833is used when we have verified ICMPv6 too big messages.
1834.Li icmp6.mtudisc_lowat
1835is used when we have unverified ICMPv6 too big messages.
1836Verification is performed by using address/port pairs kept in connected pcbs.
1837Negative value disables the upper limit.
1838.It Li icmp6.nd6_debug
1839If set to non-zero, kernel IPv6 neighbor discovery code will generate
1840debugging messages.
1841The debug outputs are useful to diagnose IPv6 interoperability issues.
1842The flag must be set to 0 for normal operation.
1843.It Li icmp6.nd6_delay
1844The variable specifies
1845.Dv DELAY_FIRST_PROBE_TIME
1846timing constant in IPv6 neighbor discovery specification
1847.Pq RFC 2461 ,
1848in seconds.
1849.It Li icmp6.nd6_maxnudhint
1850IPv6 neighbor discovery permits upper layer protocols to supply reachability
1851hints, to avoid unnecessary neighbor discovery exchanges.
1852The variable defines the number of consecutive hints the neighbor discovery
1853layer will take.
1854For example, by setting the variable to 3, neighbor discovery layer
1855will take 3 consecutive hints in maximum.
1856After receiving 3 hints, neighbor discovery layer will perform
1857normal neighbor discovery process.
1858.It Li icmp6.nd6_mmaxtries
1859The variable specifies
1860.Dv MAX_MULTICAST_SOLICIT
1861constant in IPv6 neighbor discovery specification
1862.Pq RFC 2461 .
1863.It Li icmp6.nd6_prune
1864The variable specifies interval between IPv6 neighbor cache babysitting,
1865in seconds.
1866.It Li icmp6.nd6_umaxtries
1867The variable specifies
1868.Dv MAX_UNICAST_SOLICIT
1869constant in IPv6 neighbor discovery specification
1870.Pq RFC 2461 .
1871.It Li icmp6.nd6_useloopback
1872If set to non-zero, kernel IPv6 stack will use loopback interface for
1873local traffic.
1874.It Li icmp6.nodeinfo
1875The variable enables responses to ICMPv6 node information queries.
1876If you set the variable to 0, responses will not be generated for
1877ICMPv6 node information queries.
1878Since node information queries can have a security impact, it is
1879possible to fine tune which responses should be answered.
1880Two separate bits can be set.
1881.Bl -tag -width "12345"
1882.It 1
1883Respond to ICMPv6 FQDN queries, e.g.
1884.Li ping6 -w .
1885.It 2
1886Respond to ICMPv6 node addresses queries, e.g.
1887.Li ping6 -a .
1888.El
1889.It Li icmp6.rediraccept
1890If set to non-zero, the host will accept ICMPv6 redirect packets.
1891Note that IPv6 routers will never accept ICMPv6 redirect packets,
1892and the variable is meaningful on IPv6 hosts
1893.Pq non-router
1894only.
1895.It Li icmp6.redirtimeout
1896The variable specifies lifetime of routing entries generated by incoming
1897ICMPv6 redirect.
1898.It Li udp6.do_loopback_cksum
1899Perform UDP checksum on loopback.
1900.It Li udp6.recvspace
1901Default UDP receive buffer size.
1902.It Li udp6.sendspace
1903Default UDP send buffer size.
1904.El
1905.Pp
1906We reuse net.*.tcp for
1907.Tn TCP
1908over
1909.Tn IPv6 ,
1910and therefore we do not have variables net.*.tcp6.
1911Variables net.inet6.udp6 have identical meaning to net.inet.udp.
1912Please refer to
1913.Li PF_INET
1914section above.
1915For variables net.*.ipsec6, please refer to
1916.Xr ipsec 4 .
1917.It Li net.key ( Dv PF_KEY )
1918Get or set various global information about the IPsec key management.
1919The third level name is the variable name.
1920The currently defined variable and names are:
1921.Bl -column "blockacq_lifetime" "integer" "Changeable" -offset indent
1922.It Sy Variable	Type	Sy Changeable
1923.It debug	integer	yes
1924.It enabled	integer	yes
1925.It used	integer	no
1926.It spi_try	integer	yes
1927.It spi_min_value	integer	yes
1928.It spi_max_value	integer	yes
1929.It larval_lifetime	integer	yes
1930.It blockacq_count	integer	yes
1931.It blockacq_lifetime	integer	yes
1932.It esp_keymin	integer	yes
1933.It esp_auth	integer	yes
1934.It ah_keymin	integer	yes
1935.El
1936.Pp
1937The variables are as follows:
1938.Bl -tag -width "123456"
1939.It Li debug
1940Turn on debugging message from within the kernel.
1941The value is a bitmap, as defined in
1942.In netkey/key_debug.h .
1943.It Li enabled
1944Control processing of IPsec control messages.
1945.Bl -tag -width indent
1946.It 0
1947Never allow IPsec processing
1948.It 1
1949Allow IPsec processing when SPD policies are present.
1950.It 2
1951Force IPsec processing even when SPD policies are not present.
1952.El
1953.It Li used
1954Based on if IPsec is enabled, and SPD rule existance, show if
1955IPsec is being used.
1956Note that currenly once IPsec is being used, it cannot be disabled.
1957.It Li spi_try
1958The number of times the kernel will try to obtain an unique SPI
1959when it generates it from random number generator.
1960.It Li spi_min_value
1961Minimum SPI value when generating it within the kernel.
1962.It Li spi_max_value
1963Maximum SPI value when generating it within the kernel.
1964.It Li larval_lifetime
1965Lifetime for LARVAL SAD entries, in seconds.
1966.It Li blockacq_count
1967Number of ACQUIRE PF_KEY messages to be blocked after an ACQUIRE message.
1968It avoids flood of ACQUIRE PF_KEY from being sent from the kernel to the
1969key management daemon.
1970.It Li blockacq_lifetime
1971Lifetime of ACQUIRE PF_KEY message.
1972.It Li esp_keymin
1973Minimum ESP key length, in bits.
1974The value is used when the kernel creates proposal payload
1975on ACQUIRE PF_KEY message.
1976.It Li esp_auth
1977Whether ESP authentication should be used or not.
1978Non-zero value indicates that ESP authentication should be used.
1979The value is used when the kernel creates proposal payload
1980on ACQUIRE PF_KEY message.
1981.It Li ah_keymin
1982Minimum AH key length, in bits,
1983The value is used when the kernel creates proposal payload
1984on ACQUIRE PF_KEY message.
1985.El
1986.El
1987.Ss The proc.* subtree
1988The string and integer information available for the
1989.Li proc
1990level is detailed below.
1991The changeable column shows whether a process with appropriate
1992privilege may change the value.
1993These values are per-process,
1994and as such may change from one process to another.
1995When a process is created,
1996the default values are inherited from its parent.
1997When a set-user-ID or set-group-ID binary is executed, the
1998value of PROC_PID_CORENAME is reset to the system default value.
1999The second level name is either the magic value PROC_CURPROC, which
2000points to the current process, or the PID of the target process.
2001.Bl -column "proc.pid.corename" "string" "not applicable" -offset indent
2002.It Sy Third level name	Sy Type	Sy Changeable
2003.It proc.pid.corename	string	yes
2004.It proc.pid.rlimit	node	not applicable
2005.It proc.pid.stopfork	int	yes
2006.It proc.pid.stopexec	int	yes
2007.It proc.pid.stopexit	int	yes
2008.El
2009.Bl -tag -width "123456"
2010.It Li proc.pid.corename ( Dv PROC_PID_CORENAME )
2011The template used for the core dump file name (see
2012.Xr core 5
2013for details).
2014The base name must either be
2015.Pa core
2016or end with the suffix
2017.Pa .core
2018(the super-user may set arbitrary names).
2019By default it points to
2020.Dv KERN_DEFCORENAME .
2021.It Li proc.pid.rlimit ( Dv PROC_PID_LIMIT )
2022Return resources limits, as defined for the
2023.Xr getrlimit 2
2024and
2025.Xr setrlimit 2
2026system calls.
2027The fourth level name is one of:
2028.Bl -tag -width "123456"
2029.It Li proc.pid.rlimit.cputime ( Dv PROC_PID_LIMIT_CPU )
2030The maximum amount of CPU time (in seconds) to be used by each process.
2031.It Li proc.pid.rlimit.filesize ( Dv PROC_PID_LIMIT_FSIZE )
2032The largest size (in bytes) file that may be created.
2033.It Li proc.pid.rlimit.datasize ( Dv PROC_PID_LIMIT_DATA )
2034The maximum size (in bytes) of the data segment for a process;
2035this defines how far a program may extend its break with the
2036.Xr sbrk 2
2037system call.
2038.It Li proc.pid.rlimit.stacksize ( Dv PROC_PID_LIMIT_STACK )
2039The maximum size (in bytes) of the stack segment for a process;
2040this defines how far a program's stack segment may be extended.
2041Stack extension is performed automatically by the system.
2042.It Li proc.pid.rlimit.coredumpsize ( Dv PROC_PID_LIMIT_CORE )
2043The largest size (in bytes)
2044.Pa core
2045file that may be created.
2046.It Li proc.pid.rlimit.memoryuse ( Dv PROC_PID_LIMIT_RSS )
2047The maximum size (in bytes) to which a process's resident set size may
2048grow.
2049This imposes a limit on the amount of physical memory to be given to
2050a process; if memory is tight, the system will prefer to take memory
2051from processes that are exceeding their declared resident set size.
2052.It Li proc.pid.rlimit.memorylocked ( Dv PROC_PID_LIMIT_MEMLOCK )
2053The maximum size (in bytes) which a process may lock into memory
2054using the
2055.Xr mlock 2
2056function.
2057.It Li proc.pid.rlimit.maxproc ( Dv PROC_PID_LIMIT_NPROC )
2058The maximum number of simultaneous processes for this user id.
2059.It Li proc.pid.rlimit.descriptors ( Dv PROC_PID_LIMIT_NOFILE )
2060The maximum number of open files for this process.
2061.It Li proc.pid.rlimit.sbsize ( Dv PROC_PID_LIMIT_SBSIZE )
2062The maximum size (in bytes) of the socket buffers
2063set by the
2064.Xr setsockopt 2
2065.Dv SO_RCVBUF
2066and
2067.Dv SO_SNDBUF
2068options.
2069.It Li proc.pid.rlimit.vmemoryuse ( Dv PROC_PID_LIMIT_AS )
2070The maximum size (in bytes) which a process can obtain.
2071.It Li proc.pid.rlimit.maxlwp ( Dv PROC_PID_LIMIT_NTHR )
2072The maximum number of threads that cen be created and running at one time in
2073the process.
2074The first thread of each process is not counted against this.
2075.El
2076.Pp
2077The fifth level name is one of
2078.Li soft ( Dv PROC_PID_LIMIT_TYPE_SOFT )
2079or
2080.Li hard ( Dv PROC_PID_LIMIT_TYPE_HARD ) ,
2081to select respectively the soft or hard limit.
2082Both are of type integer.
2083.It Li proc.pid.stopfork ( Dv PROC_PID_STOPFORK )
2084If non zero, the process' children will be stopped after
2085.Xr fork 2
2086calls.
2087The children is created in the SSTOP state and is never scheduled
2088for running before being stopped.
2089This feature helps attaching a process with a debugger such as
2090.Xr gdb 1
2091before it had the opportunity to actually do anything.
2092.Pp
2093This value is inherited by the process's children, and it also
2094apply to emulation specific system calls that fork a new process, such as
2095.Fn sproc
2096or
2097.Fn clone .
2098.It Li proc.pid.stopexec ( Dv PROC_PID_STOPEXEC )
2099If non zero, the process will be stopped on next
2100.Xr exec 3
2101call.
2102The process created by
2103.Xr exec 3
2104is created in the SSTOP state and is never scheduled for running
2105before being stopped.
2106This feature helps attaching a process with a debugger such as
2107.Xr gdb 1
2108before it had the opportunity to actually do anything.
2109.Pp
2110This value is inherited by the process's children.
2111.It Li proc.pid.stopexit ( Dv PROC_PID_STOPEXIT )
2112If non zero, the process will be stopped on when it has cause to exit,
2113either by way of calling
2114.Xr exit 3 ,
2115.Xr _exit 2 ,
2116or by the receipt of a specific signal.
2117The process is stopped before any of its resources or vm space is
2118released allowing examination of the termination state of a process
2119before it disappears.
2120This feature can be used to examine the final conditions of the
2121process's vmspace via
2122.Xr pmap 1
2123or its resource settings with
2124.Xr sysctl 8
2125before it disappears.
2126.Pp
2127This value is also inherited by the process's children.
2128.El
2129.Ss The user.* subtree ( Dv CTL_USER )
2130The string and integer information available for the
2131.Li user
2132level is detailed below.
2133The changeable column shows whether a process with appropriate
2134privilege may change the value.
2135.Bl -column "user.coll_weights_max" "integer" "Changeable" -offset indent
2136.It Sy Second level name	Sy Type	Sy Changeable
2137.It user.atexit_max	integer	no
2138.It user.bc_base_max	integer	no
2139.It user.bc_dim_max	integer	no
2140.It user.bc_scale_max	integer	no
2141.It user.bc_string_max	integer	no
2142.It user.coll_weights_max	integer	no
2143.It user.cs_path	string	no
2144.It user.expr_nest_max	integer	no
2145.It user.line_max	integer	no
2146.It user.posix2_c_bind	integer	no
2147.It user.posix2_c_dev	integer	no
2148.It user.posix2_char_term	integer	no
2149.It user.posix2_fort_dev	integer	no
2150.It user.posix2_fort_run	integer	no
2151.It user.posix2_localedef	integer	no
2152.It user.posix2_sw_dev	integer	no
2153.It user.posix2_upe	integer	no
2154.It user.posix2_version	integer	no
2155.It user.re_dup_max	integer	no
2156.It user.stream_max	integer	no
2157.It user.stream_max	integer	no
2158.It user.tzname_max	integer	no
2159.El
2160.Bl -tag -width "123456"
2161.It Li user.atexit_max ( Dv USER_ATEXIT_MAX )
2162The maximum number of functions that may be registered with
2163.Xr atexit 3 .
2164.It Li user.bc_base_max ( Dv USER_BC_BASE_MAX )
2165The maximum ibase/obase values in the
2166.Xr bc 1
2167utility.
2168.It Li user.bc_dim_max ( Dv USER_BC_DIM_MAX )
2169The maximum array size in the
2170.Xr bc 1
2171utility.
2172.It Li user.bc_scale_max ( Dv USER_BC_SCALE_MAX )
2173The maximum scale value in the
2174.Xr bc 1
2175utility.
2176.It Li user.bc_string_max ( Dv USER_BC_STRING_MAX )
2177The maximum string length in the
2178.Xr bc 1
2179utility.
2180.It Li user.coll_weights_max ( Dv USER_COLL_WEIGHTS_MAX )
2181The maximum number of weights that can be assigned to any entry of
2182the LC_COLLATE order keyword in the locale definition file.
2183.It Li user.cs_path ( USER_CS_PATH )
2184Return a value for the
2185.Ev PATH
2186environment variable that finds all the standard utilities.
2187.It Li user.expr_nest_max ( Dv USER_EXPR_NEST_MAX )
2188The maximum number of expressions that can be nested within
2189parenthesis by the
2190.Xr expr 1
2191utility.
2192.It Li user.line_max ( Dv USER_LINE_MAX )
2193The maximum length in bytes of a text-processing utility's input
2194line.
2195.It Li user.posix2_char_term ( Dv USER_POSIX2_CHAR_TERM )
2196Return 1 if the system supports at least one terminal type capable of
2197all operations described in
2198.St -p1003.2 ,
2199otherwise\ 0.
2200.It Li user.posix2_c_bind ( Dv USER_POSIX2_C_BIND )
2201Return 1 if the system's C-language development facilities support the
2202C-Language Bindings Option, otherwise\ 0.
2203.It Li user.posix2_c_dev ( Dv USER_POSIX2_C_DEV )
2204Return 1 if the system supports the C-Language Development Utilities Option,
2205otherwise\ 0.
2206.It Li user.posix2_fort_dev ( Dv USER_POSIX2_FORT_DEV )
2207Return 1 if the system supports the FORTRAN Development Utilities Option,
2208otherwise\ 0.
2209.It Li user.posix2_fort_run ( Dv USER_POSIX2_FORT_RUN )
2210Return 1 if the system supports the FORTRAN Runtime Utilities Option,
2211otherwise\ 0.
2212.It Li user.posix2_localedef ( Dv USER_POSIX2_LOCALEDEF )
2213Return 1 if the system supports the creation of locales, otherwise\ 0.
2214.It Li user.posix2_sw_dev ( Dv USER_POSIX2_SW_DEV )
2215Return 1 if the system supports the Software Development Utilities Option,
2216otherwise\ 0.
2217.It Li user.posix2_upe ( Dv USER_POSIX2_UPE )
2218Return 1 if the system supports the User Portability Utilities Option,
2219otherwise\ 0.
2220.It Li user.posix2_version ( Dv USER_POSIX2_VERSION )
2221The version of
2222.St -p1003.2
2223with which the system attempts to comply.
2224.It Li user.re_dup_max ( Dv USER_RE_DUP_MAX )
2225The maximum number of repeated occurrences of a regular expression
2226permitted when using interval notation.
2227.It Li user.stream_max ( Dv USER_STREAM_MAX )
2228The minimum maximum number of streams that a process may have open
2229at any one time.
2230.It Li user.tzname_max ( Dv USER_TZNAME_MAX )
2231The minimum maximum number of types supported for the name of a
2232timezone.
2233.El
2234.Ss The vm.* subtree ( Dv CTL_VM )
2235The string and integer information available for the
2236.Li vm
2237level is detailed below.
2238The changeable column shows whether a process with appropriate
2239privilege may change the value.
2240.Bl -column "Second level name" "struct uvmexp_sysctl" "Changeable" -offset indent
2241.It Sy Second level name	Sy Type	Sy Changeable
2242.It vm.anonmax	int	yes
2243.It vm.anonmin	int	yes
2244.It vm.bufcache	int	yes
2245.It vm.bufmem	int	no
2246.It vm.bufmem_hiwater	int	yes
2247.It vm.bufmem_lowater	int	yes
2248.It vm.execmax	int	yes
2249.It vm.execmin	int	yes
2250.It vm.filemax	int	yes
2251.It vm.filemin	int	yes
2252.It vm.loadavg	struct loadavg	no
2253.It vm.maxslp	int	no
2254.It vm.nkmempages	int	no
2255.It vm.uspace	int	no
2256.It vm.uvmexp	struct uvmexp	no
2257.It vm.uvmexp2	struct uvmexp_sysctl	no
2258.It vm.vmmeter	struct vmtotal	no
2259.It vm.proc.map	struct kinfo_vmentry	no
2260.El
2261.Bl -tag -width "123456"
2262.It Li vm.anonmax ( Dv VM_ANONMAX )
2263The percentage of physical memory which will be reclaimed
2264from other types of memory usage to store anonymous application data.
2265.It Li vm.anonmin ( Dv VM_ANONMIN )
2266The percentage of physical memory which will be always be available for
2267anonymous application data.
2268.It Li vm.bufcache ( Dv VM_BUFCACHE )
2269The percentage of physical memory which will be available
2270for the buffer cache.
2271.It Li vm.bufmem ( Dv VM_BUFMEM )
2272The amount of kernel memory that is being used by the buffer cache.
2273.It Li vm.bufmem_lowater ( Dv VM_BUFMEM_LOWATER )
2274The minimum amount of kernel memory to reserve for the
2275buffer cache.
2276.It Li vm.bufmem_hiwater ( Dv VM_BUFMEM_HIWATER )
2277The maximum amount of kernel memory to be used for the
2278buffer cache.
2279.It Li vm.execmax ( Dv VM_EXECMAX )
2280The percentage of physical memory which will be reclaimed
2281from other types of memory usage to store cached executable data.
2282.It Li vm.execmin ( Dv VM_EXECMIN )
2283The percentage of physical memory which will be always be available for
2284cached executable data.
2285.It Li vm.filemax ( Dv VM_FILEMAX )
2286The percentage of physical memory which will be reclaimed
2287from other types of memory usage to store cached file data.
2288.It Li vm.filemin ( Dv VM_FILEMIN )
2289The percentage of physical memory which will be always be available for
2290cached file data.
2291.It Li vm.loadavg ( Dv VM_LOADAVG )
2292Return the load average history.
2293The returned data consists of a
2294.Vt struct loadavg .
2295.It Li vm.maxslp ( Dv VM_MAXSLP )
2296The value of the maxslp kernel global variable.
2297.It Li vm.vmmeter ( Dv VM_METER )
2298Return system wide virtual memory statistics.
2299The returned data consists of a
2300.Vt struct vmtotal .
2301.It vm.user_va0_disable
2302A flag which controls whether user processes can map virtual address\ 0.
2303.It Li vm.proc.map ( Dv VM_PROC )
2304The third level is
2305.dv VM_PROC_MAP ,
2306the fourth is the pid of the process to display the vm object entries for, and
2307the fifth is the size of
2308.Vt struct kinfo_vmentry .
2309Returns an array of
2310.Vt struct kinfo_vmentry
2311objects.
2312.It Li vm.uspace ( Dv VM_USPACE )
2313The number of bytes allocated for each kernel stack.
2314.It Li vm.uvmexp ( Dv VM_UVMEXP )
2315Return system wide virtual memory statistics.
2316The returned data consists of a
2317.Vt struct uvmexp .
2318.It Li vm.uvmexp2 ( Dv VM_UVMEXP2 )
2319Return system wide virtual memory statistics.
2320The returned data consists of a
2321.Vt struct uvmexp_sysctl .
2322.\" XXX vm.idlezero
2323.El
2324.Ss The ddb.* subtree ( Dv CTL_DDB )
2325The information available for the
2326.Li ddb
2327level is detailed below.
2328The changeable column shows whether a process with appropriate
2329privilege may change the value.
2330.\" XXX sort
2331.Bl -column "Second level name" "integer" "Changeable" -offset indent
2332.It Sy Second level name	Sy Type	Sy Changeable
2333.It ddb.radix	integer	yes
2334.It ddb.maxoff	integer	yes
2335.It ddb.maxwidth	integer	yes
2336.It ddb.lines	integer	yes
2337.It ddb.tabstops	integer	yes
2338.It ddb.onpanic	integer	yes
2339.It ddb.fromconsole	integer	yes
2340.It ddb.tee_msgbuf	integer	yes
2341.It ddb.commandonenter	string	yes
2342.El
2343.Bl -tag -width "123456"
2344.It Li ddb.radix ( Dv DDBCTL_RADIX )
2345The input and output radix.
2346.It Li ddb.maxoff ( Dv DDBCTL_MAXOFF )
2347The maximum symbol offset.
2348.It Li ddb.maxwidth ( Dv DDBCTL_MAXWIDTH )
2349The maximum output line width.
2350.It Li ddb.lines ( Dv DDBCTL_LINES )
2351Number of display lines.
2352.It Li ddb.tabstops ( Dv DDBCTL_TABSTOPS )
2353Tab width.
2354.It Li ddb.onpanic ( Dv DDBCTL_ONPANIC )
2355If greater than zero, DDB will be entered if the kernel panics.
2356A value of 1 causes the system to enter DDB on panic, while a value of 2
2357causes the kernel to attempt to print out a stack trace before entering DDB.
2358A value of 0 causes the kernel to attempt to print a stack trace, then
2359reboot, while a value of \-1 means neither a stack trace will be printed
2360nor DDB entered.
2361.It Li ddb.fromconsole ( Dv DDBCTL_FROMCONSOLE )
2362If not zero, DDB may be entered by sending a break on a serial
2363console or by a special key sequence on a graphics console.
2364.It Li ddb.tee_msgbuf
2365If not zero, DDB will output also to the kernel message buffer.
2366.It Li ddb.commandonenter
2367If not empty, a command to be executed on each enter to the
2368.Tn DDB .
2369.\"
2370.\" XXX: (a) ddb.commandonenter is missing in ddb(4);
2371.\"	 (b) No DDBCTL definitions for tee_msgbuf and commandonenter.
2372.El
2373.Pp
2374Some of these
2375.Tn MIB
2376nodes are also available as variables from within the debugger.
2377See
2378.Xr ddb 4
2379for more details.
2380.Ss The security.* subtree ( Dv CTL_SECURITY )
2381The
2382.Li security
2383level contains various security-related settings for
2384the system.
2385The available second level names are:
2386.Bl -column "Second level name" "integer" "Changeable" -offset indent
2387.It Sy Second level name	Sy Type	Sy Changeable
2388.It Li security.curtain	integer	yes
2389.It Li security.models	node	not applicable
2390.It Li security.pax	node	not applicable
2391.El
2392.Pp
2393Available settings are detailed below.
2394.Bl -tag -width "123456"
2395.It Li security.curtain
2396If non-zero, will filter return objects according to the user
2397.Tn ID
2398requesting information about them, preventing users from
2399accessing any objects they do not own.
2400.Pp
2401At the moment, it affects
2402.Xr ps 1 ,
2403.Xr netstat 1
2404(for
2405.Dv PF_INET ,
2406.Dv PF_INET6 ,
2407and
2408.Dv PF_UNIX
2409PCBs), and
2410.Xr w 1 .
2411.It Li security.models
2412.Nx
2413supports pluggable security models.
2414Every security model used, whether if loaded as a module or built with the system,
2415is required to add an entry to this node with at least one element,
2416.Dq name ,
2417indicating the name of the security model.
2418.Pp
2419In addition to the name, any settings and other information private to the
2420security model will be available under this node.
2421See
2422.Xr secmodel 9
2423for more information.
2424.It Li security.pax
2425Settings for PaX -- exploit mitigation features.
2426For more information on any of the PaX features, please see
2427.Xr paxctl 8
2428and
2429.Xr security 7 .
2430The available third and fourth level names are:
2431.Bl -column "security.pax.segvguard.suspend_timeout" "integer" "Changeable" \
2432-offset 2n
2433.It Sy Third and fourth level names Ta Sy Type Ta Sy Changeable
2434.It Li security.pax.aslr.enabled	integer	yes
2435.\".It Li security.pax.aslr.exec_len	integer	yes
2436.It Li security.pax.aslr.global	integer	yes
2437.\".It Li security.pax.aslr.mmap_len	integer	yes
2438.\".It Li security.pax.aslr.stack_len	integer	yes
2439.It Li security.pax.mprotect.enabled	integer	yes
2440.It Li security.pax.mprotect.global	integer	yes
2441.It Li security.pax.mprotect.ptrace	integer	yes
2442.It Li security.pax.segvguard.enabled	integer	yes
2443.It Li security.pax.segvguard.expiry_timeout	integer	yes
2444.It Li security.pax.segvguard.global	integer	yes
2445.It Li security.pax.segvguard.max_crashes	integer	yes
2446.It Li security.pax.segvguard.suspend_timeout	integer	yes
2447.El
2448.Bl -tag -width "123456"
2449.It Li security.pax.aslr.enabled
2450Enable PaX ASLR (Address Space Layout Randomization).
2451.Pp
2452The value of this
2453knob must be non-zero for PaX ASLR to be enabled, even if a program is set to
2454explicit enable.
2455.\".It Li security.pax.aslr.exec_len
2456.\" XXX: Undocumented.
2457.It Li security.pax.aslr.global
2458Specifies the default global policy for programs without an
2459explicit enable/disable flag.
2460.Pp
2461When non-zero, all programs will get PaX ASLR, except those exempted with
2462.Xr paxctl 8 .
2463Otherwise, all programs will not get PaX ASLR, except those specifically
2464marked as such with
2465.Xr paxctl 8 .
2466.\".It Li security.pax.aslr.mmap_len
2467.\" XXX: Undocumented.
2468.\" .It Li security.pax.aslr.stack_len
2469.\" XXX: Undocumented.
2470.It Li security.pax.mprotect.enabled
2471Enable PaX MPROTECT restrictions.
2472.Pp
2473These are
2474.Xr mprotect 2
2475restrictions to better enforce a W^X policy.
2476The value of this
2477knob must be non-zero for PaX MPROTECT to be enabled, even if a
2478program is set to explicit enable.
2479.It Li security.pax.mprotect.global
2480Specifies the default global policy for programs without an
2481explicit enable/disable flag.
2482.Pp
2483When non-zero, all programs will get the PaX MPROTECT restrictions,
2484except those exempted with
2485.Xr paxctl 8 .
2486Otherwise, all programs will not get the PaX MPROTECT restrictions,
2487except those specifically marked as such with
2488.Xr paxctl 8 .
2489.It Li security.pax.mprotect.ptrace
2490This variable allows
2491.Xr ptrace 2
2492to override PaX MPROTECT permissions.
2493It can have the following values:
2494.Bl -tag -width XX -compact
2495.It 0
2496Does not let override any permissions.
2497.It 1
2498Disables PaX MPROTECT from processes that start executing while traced (default).
2499.It 2
2500Bypasses PaX MPROTECT for all processes being traced.
2501.El
2502.It Li security.pax.segvguard.enabled
2503Enable PaX Segvguard.
2504.Pp
2505PaX Segvguard can detect and prevent certain exploitation attempts, where
2506an attacker may try for example to brute-force function return addresses
2507of respawning daemons.
2508.Pp
2509.Em Note :
2510The
2511.Nx
2512interface and implementation of the Segvguard is still experimental, and may
2513change in future releases.
2514.It Li security.pax.segvguard.expiry_timeout
2515If the max number was not reached within this timeout (in seconds), the entry
2516will expire.
2517.It Li security.pax.segvguard.global
2518Specifies the default global policy for programs without an
2519explicit enable/disable flag.
2520.Pp
2521When non-zero, all programs will get the PaX Segvguard,
2522except those exempted with
2523.Xr paxctl 8 .
2524Otherwise, no program will get the PaX Segvguard restrictions,
2525except those specifically marked as such with
2526.Xr paxctl 8 .
2527.It Li security.pax.segvguard.max_crashes
2528The maximum number of segfaults a program can receive before suspension.
2529.It Li security.pax.segvguard.suspend_timeout
2530Number of seconds to suspend a user from running a faulting program when the
2531limit was exceeded.
2532.El
2533.El
2534.Ss The vendor.* subtree ( Dv CTL_VENDOR )
2535The
2536.Li vendor
2537toplevel name is reserved to be used by vendors who wish to
2538have their own private MIB tree.
2539Intended use is to store values under
2540.Dq vendor.\*[Lt]yourname\*[Gt].* .
2541.Sh SEE ALSO
2542.Xr sysctl 3 ,
2543.Xr ipsec 4 ,
2544.Xr tcp 4 ,
2545.Xr security 7 ,
2546.Xr sysctl 8
2547.Sh HISTORY
2548The
2549.Nm
2550variables first appeared in
2551.Bx 4.4 .
2552