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