1 /* GIO - GLib Input, Output and Streaming Library
3 * Copyright 2013 Red Hat, Inc.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General
16 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 #ifndef __G_CREDENTIALS_PRIVATE_H__
20 #define __G_CREDENTIALS_PRIVATE_H__
22 #include "gio/gcredentials.h"
23 #include "gio/gnetworking.h"
26 #define G_CREDENTIALS_SUPPORTED 1
27 #define G_CREDENTIALS_USE_LINUX_UCRED 1
28 #define G_CREDENTIALS_NATIVE_TYPE G_CREDENTIALS_TYPE_LINUX_UCRED
29 #define G_CREDENTIALS_NATIVE_SIZE (sizeof (struct ucred))
30 #define G_CREDENTIALS_UNIX_CREDENTIALS_MESSAGE_SUPPORTED 1
31 #define G_CREDENTIALS_SOCKET_GET_CREDENTIALS_SUPPORTED 1
32 #define G_CREDENTIALS_SPOOFING_SUPPORTED 1
34 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__GNU__)
35 #define G_CREDENTIALS_SUPPORTED 1
36 #define G_CREDENTIALS_USE_FREEBSD_CMSGCRED 1
37 #define G_CREDENTIALS_NATIVE_TYPE G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED
38 #define G_CREDENTIALS_NATIVE_SIZE (sizeof (struct cmsgcred))
39 #define G_CREDENTIALS_UNIX_CREDENTIALS_MESSAGE_SUPPORTED 1
40 #define G_CREDENTIALS_SPOOFING_SUPPORTED 1
42 #elif defined(__NetBSD__)
43 #define G_CREDENTIALS_SUPPORTED 1
44 #define G_CREDENTIALS_USE_NETBSD_UNPCBID 1
45 #define G_CREDENTIALS_NATIVE_TYPE G_CREDENTIALS_TYPE_NETBSD_UNPCBID
46 #define G_CREDENTIALS_NATIVE_SIZE (sizeof (struct unpcbid))
47 #define G_CREDENTIALS_UNIX_CREDENTIALS_MESSAGE_SUPPORTED 1
48 #define G_CREDENTIALS_SPOOFING_SUPPORTED 1
50 #elif defined(__OpenBSD__)
51 #define G_CREDENTIALS_SUPPORTED 1
52 #define G_CREDENTIALS_USE_OPENBSD_SOCKPEERCRED 1
53 #define G_CREDENTIALS_NATIVE_TYPE G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED
54 #define G_CREDENTIALS_NATIVE_SIZE (sizeof (struct sockpeercred))
55 #define G_CREDENTIALS_SOCKET_GET_CREDENTIALS_SUPPORTED 1
56 #define G_CREDENTIALS_SPOOFING_SUPPORTED 1
58 #elif defined(__sun__) || defined(__illumos__) || defined (__OpenSolaris_kernel__)
60 #define G_CREDENTIALS_SUPPORTED 1
61 #define G_CREDENTIALS_USE_SOLARIS_UCRED 1
62 #define G_CREDENTIALS_NATIVE_TYPE G_CREDENTIALS_TYPE_SOLARIS_UCRED
63 #define G_CREDENTIALS_NATIVE_SIZE (ucred_size ())
64 #define G_CREDENTIALS_UNIX_CREDENTIALS_MESSAGE_SUPPORTED 1
65 #define G_CREDENTIALS_SOCKET_GET_CREDENTIALS_SUPPORTED 1
69 #endif /* __G_CREDENTIALS_PRIVATE_H__ */