aboutsummaryrefslogtreecommitdiffstats
path: root/man/man2const/IP_PASSSEC.2const
blob: 46845cf3d8ce8d6d7272d008d2bd120721faad3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
.\" Copyright, the authors of the Linux man-pages project
.\"
.\" SPDX-License-Identifier: Linux-man-pages-copyleft
.\"
.TH IP_PASSSEC 2const (date) "Linux man-pages (unreleased)"
.SH NAME
IP_PASSSEC
\-
receive the security context of the peer socket
.SH LIBRARY
Standard C library
.RI ( libc ,\~ \-lc )
.SH SYNOPSIS
.nf
.BR "#include <netinet/in.h>" "  /* Definition of " IP* " constants */"
.B #include <sys/socket.h>
.P
.BI int\~setsockopt(int\~ sockfd ,\~IPPROTO_IP,\~IP_PASSSEC,
.BI "               const\~int\~*" enable ,\~sizeof(int));
.BI int\~getsockopt(int\~ sockfd ,\~IPPROTO_IP,\~IP_PASSSEC,
.BI "               int\~*" enabled ,\~sizeof(int));
.fi
.SH DESCRIPTION
If labeled IPSEC or NetLabel is configured on the sending and receiving
hosts, this option enables receiving of the security context of the peer
socket in an ancillary message of type
.B SCM_SECURITY
retrieved using
.BR recvmsg (2).
.P
This option is supported only for UDP sockets;
for TCP or SCTP sockets,
see
.BR SO_PEERSEC (2const).
.P
The security context returned in the
.B SCM_SECURITY
ancillary message
is of the same format as the one described in
.BR SO_PEERSEC (2const).
.SH ERRORS
See
.BR IPPROTO_IP (2const).
See
.BR setsockopt (2).
See
.BR ip (7).
.SH STANDARDS
Linux.
.SH HISTORY
Linux 2.6.17.
.\" commit 2c7946a7bf45ae86736ab3b43d0085e43947945c
.SH CAVEATS
The reuse of the
.B SCM_SECURITY
message type for the
.B IP_PASSSEC
socket option was likely a mistake, since other IP control messages use
their own numbering scheme in the IP namespace and often use the
socket option value as the message type.
There is no conflict currently since the IP option with the same value as
.B SCM_SECURITY
is
.BR IP_HDRINCL (2const)
and this is never used for a control message type.
.SH SEE ALSO
.BR IPPROTO_IP (2const),
.BR setsockopt (2),
.BR ip (7)