Skip to content

Commit

Permalink
sd-device: introduce sd_device_monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
yuwata committed Oct 16, 2018
1 parent 8da2f9e commit b1c097a
Show file tree
Hide file tree
Showing 5 changed files with 819 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/libsystemd/libsystemd.sym
Original file line number Diff line number Diff line change
Expand Up @@ -647,4 +647,20 @@ global:
sd_hwdb_enumerate;

sd_id128_get_boot_app_specific;

sd_device_monitor_new;
sd_device_monitor_ref;
sd_device_monitor_unref;

sd_device_monitor_set_receive_buffer_size;
sd_device_monitor_attach_event;
sd_device_monitor_detach_event;
sd_device_monitor_get_event;
sd_device_monitor_start;
sd_device_monitor_stop;

sd_device_monitor_filter_add_match_subsystem_devtype;
sd_device_monitor_filter_add_match_tag;
sd_device_monitor_filter_update;
sd_device_monitor_filter_remove;
} LIBSYSTEMD_239;
2 changes: 2 additions & 0 deletions src/libsystemd/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ libsystemd_sources = files('''
sd-device/device-enumerator-private.h
sd-device/device-enumerator.c
sd-device/device-internal.h
sd-device/device-monitor-private.h
sd-device/device-monitor.c
sd-device/device-private.c
sd-device/device-private.h
sd-device/device-util.h
Expand Down
20 changes: 20 additions & 0 deletions src/libsystemd/sd-device/device-monitor-private.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once

#include "sd-device.h"

typedef enum MonitorNetlinkGroup {
MONITOR_GROUP_NONE,
MONITOR_GROUP_KERNEL,
MONITOR_GROUP_UDEV,
_MONITOR_NETLINK_GROUP_MAX,
_MONITOR_NETLINK_GROUP_INVALID = -1,
} MonitorNetlinkGroup;

int device_monitor_new_full(sd_device_monitor **ret, MonitorNetlinkGroup group, int fd);
int device_monitor_disconnect(sd_device_monitor *m);
int device_monitor_allow_unicast_sender(sd_device_monitor *m, sd_device_monitor *sender);
int device_monitor_enable_receiving(sd_device_monitor *m);
int device_monitor_get_fd(sd_device_monitor *m);
int device_monitor_send_device(sd_device_monitor *m, sd_device_monitor *destination, sd_device *device);
int device_monitor_receive_device(sd_device_monitor *m, sd_device **ret);
Loading

0 comments on commit b1c097a

Please sign in to comment.