Skip to content

Commit 5378cce

Browse files
committed
Adding new sockopt entries for FreeBSD related to routing
1 parent c375a10 commit 5378cce

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/sys/socket/sockopt.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,26 @@ sockopt_impl!(
746746
libc::IP_BINDANY,
747747
bool
748748
);
749+
#[cfg(target_os = "freebsd")]
750+
sockopt_impl!(
751+
/// Set the route table (FIB) for this socket up to the `net.fibs` OID limit
752+
/// (more specific than the setfib command line/call which are process based).
753+
Fib,
754+
SetOnly,
755+
libc::SOL_SOCKET,
756+
libc::SO_SETFIB,
757+
i32
758+
);
759+
#[cfg(target_os = "freebsd")]
760+
sockopt_impl!(
761+
/// Set `so_user_cookie` for this socket allowing network traffic based
762+
/// upon it, similar to Linux's netfilter MARK.
763+
UserCookie,
764+
SetOnly,
765+
libc::SOL_SOCKET,
766+
libc::SO_USER_COOKIE,
767+
u32
768+
);
749769
#[cfg(target_os = "linux")]
750770
sockopt_impl!(
751771
/// Set the mark for each packet sent through this socket (similar to the

0 commit comments

Comments
 (0)