mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-06 09:26:17 +01:00
Merge branch 'nm-nl' into 'main'
Enable GNetworkMonitorNetlink on FreeBSD See merge request GNOME/glib!4376
This commit is contained in:
commit
3dcf1ea13d
@ -38,8 +38,14 @@
|
|||||||
|
|
||||||
/* must come at the end to pick system includes from
|
/* must come at the end to pick system includes from
|
||||||
* gnetworkingprivate.h */
|
* gnetworkingprivate.h */
|
||||||
|
#ifdef HAVE_LINUX_NETLINK_H
|
||||||
#include <linux/netlink.h>
|
#include <linux/netlink.h>
|
||||||
#include <linux/rtnetlink.h>
|
#include <linux/rtnetlink.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NETLINK_NETLINK_H
|
||||||
|
#include <netlink/netlink.h>
|
||||||
|
#include <netlink/netlink_route.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
static GInitableIface *initable_parent_iface;
|
static GInitableIface *initable_parent_iface;
|
||||||
static void g_network_monitor_netlink_iface_init (GNetworkMonitorInterface *iface);
|
static void g_network_monitor_netlink_iface_init (GNetworkMonitorInterface *iface);
|
||||||
@ -124,6 +130,7 @@ g_network_monitor_netlink_initable_init (GInitable *initable,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef SO_PASSCRED
|
||||||
if (!g_socket_set_option (nl->priv->sock, SOL_SOCKET, SO_PASSCRED,
|
if (!g_socket_set_option (nl->priv->sock, SOL_SOCKET, SO_PASSCRED,
|
||||||
TRUE, NULL))
|
TRUE, NULL))
|
||||||
{
|
{
|
||||||
@ -133,6 +140,7 @@ g_network_monitor_netlink_initable_init (GInitable *initable,
|
|||||||
g_strerror (errsv));
|
g_strerror (errsv));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Request the current state */
|
/* Request the current state */
|
||||||
if (!request_dump (nl, error))
|
if (!request_dump (nl, error))
|
||||||
|
@ -400,10 +400,12 @@ headers = [
|
|||||||
'inttypes.h',
|
'inttypes.h',
|
||||||
'libproc.h',
|
'libproc.h',
|
||||||
'limits.h',
|
'limits.h',
|
||||||
|
'linux/netlink.h',
|
||||||
'locale.h',
|
'locale.h',
|
||||||
'mach/mach_time.h',
|
'mach/mach_time.h',
|
||||||
'memory.h',
|
'memory.h',
|
||||||
'mntent.h',
|
'mntent.h',
|
||||||
|
'netlink/netlink.h',
|
||||||
'poll.h',
|
'poll.h',
|
||||||
'pwd.h',
|
'pwd.h',
|
||||||
'sched.h',
|
'sched.h',
|
||||||
@ -461,7 +463,7 @@ if cc.check_header('malloc.h')
|
|||||||
glib_conf_prefix = glib_conf_prefix + '#define HAVE_MALLOC_H 1\n'
|
glib_conf_prefix = glib_conf_prefix + '#define HAVE_MALLOC_H 1\n'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if cc.check_header('linux/netlink.h')
|
if glib_conf.has('HAVE_LINUX_NETLINK_H') or glib_conf.has('HAVE_NETLINK_NETLINK_H')
|
||||||
glib_conf.set('HAVE_NETLINK', 1)
|
glib_conf.set('HAVE_NETLINK', 1)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user