setfib (2)
Leading comments
Copyright (c) 2008 Cisco Systems. All rights reserved. Author: Julian Elischer Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Neither the name of the Cisco Systems nor the names of its employees may be used to endorse or promote products derived from this sof...
NAME
setfib - set the default FIB (routing table) for the calling process.LIBRARY
Lb libcSYNOPSIS
In sys/socket.h Ft int Fn setfib int fibDESCRIPTION
The Fn setfib system call sets the associated fib for all sockets opened subsequent to the call, to be that of the argument Fa fib . The Fa fib argument must be greater than or equal to 0 and less than the current system maximum which may be retrieved by the net.fibs sysctl. The system maximum is set in the kernel configuration file withoptions ROUTETABLES= N
or in /boot/loader.conf with
net.fibs= Qq N
where N is an integer. This maximum is capped at 65536 due to the implementation storing the fib number in a 16-bit field in the mbuf(9) packet header, however it is not suggested that one use such a large number as memory is allocated for every FIB regardless of whether it is used, and there are places where all FIBs are iterated over.
The default fib of the process will be applied to all protocol families that support multiple fibs, and ignored by those that do not. The default fib for a process may be overridden for a socket with the use of the SO_SETFIB socket option.