mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-10-15 20:45:32 +00:00
core/devices: Add P2P Wifi device and peer tracking
This only adds the new device type and simple peer list handling.
This commit is contained in:
parent
42e60e327f
commit
00e64d1332
134
Makefile.am
134
Makefile.am
|
@ -389,30 +389,32 @@ introspection_libnmdbus_la_CPPFLAGS = $(GLIB_CFLAGS)
|
||||||
introspection_sources = \
|
introspection_sources = \
|
||||||
introspection/org.freedesktop.NetworkManager.AccessPoint.c \
|
introspection/org.freedesktop.NetworkManager.AccessPoint.c \
|
||||||
introspection/org.freedesktop.NetworkManager.AccessPoint.h \
|
introspection/org.freedesktop.NetworkManager.AccessPoint.h \
|
||||||
introspection/org.freedesktop.NetworkManager.Connection.Active.c \
|
|
||||||
introspection/org.freedesktop.NetworkManager.Connection.Active.h \
|
|
||||||
introspection/org.freedesktop.NetworkManager.AgentManager.c \
|
introspection/org.freedesktop.NetworkManager.AgentManager.c \
|
||||||
introspection/org.freedesktop.NetworkManager.AgentManager.h \
|
introspection/org.freedesktop.NetworkManager.AgentManager.h \
|
||||||
introspection/org.freedesktop.NetworkManager.Checkpoint.c \
|
introspection/org.freedesktop.NetworkManager.Checkpoint.c \
|
||||||
introspection/org.freedesktop.NetworkManager.Checkpoint.h \
|
introspection/org.freedesktop.NetworkManager.Checkpoint.h \
|
||||||
|
introspection/org.freedesktop.NetworkManager.Connection.Active.c \
|
||||||
|
introspection/org.freedesktop.NetworkManager.Connection.Active.h \
|
||||||
|
introspection/org.freedesktop.NetworkManager.DHCP4Config.c \
|
||||||
|
introspection/org.freedesktop.NetworkManager.DHCP4Config.h \
|
||||||
|
introspection/org.freedesktop.NetworkManager.DHCP6Config.c \
|
||||||
|
introspection/org.freedesktop.NetworkManager.DHCP6Config.h \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Adsl.c \
|
introspection/org.freedesktop.NetworkManager.Device.Adsl.c \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Adsl.h \
|
introspection/org.freedesktop.NetworkManager.Device.Adsl.h \
|
||||||
|
introspection/org.freedesktop.NetworkManager.Device.Bluetooth.c \
|
||||||
|
introspection/org.freedesktop.NetworkManager.Device.Bluetooth.h \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Bond.c \
|
introspection/org.freedesktop.NetworkManager.Device.Bond.c \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Bond.h \
|
introspection/org.freedesktop.NetworkManager.Device.Bond.h \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Bridge.c \
|
introspection/org.freedesktop.NetworkManager.Device.Bridge.c \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Bridge.h \
|
introspection/org.freedesktop.NetworkManager.Device.Bridge.h \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Bluetooth.c \
|
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Bluetooth.h \
|
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Dummy.c \
|
introspection/org.freedesktop.NetworkManager.Device.Dummy.c \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Dummy.h \
|
introspection/org.freedesktop.NetworkManager.Device.Dummy.h \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Wired.c \
|
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Wired.h \
|
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Generic.c \
|
introspection/org.freedesktop.NetworkManager.Device.Generic.c \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Generic.h \
|
introspection/org.freedesktop.NetworkManager.Device.Generic.h \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Infiniband.c \
|
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Infiniband.h \
|
|
||||||
introspection/org.freedesktop.NetworkManager.Device.IPTunnel.c \
|
introspection/org.freedesktop.NetworkManager.Device.IPTunnel.c \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.IPTunnel.h \
|
introspection/org.freedesktop.NetworkManager.Device.IPTunnel.h \
|
||||||
|
introspection/org.freedesktop.NetworkManager.Device.Infiniband.c \
|
||||||
|
introspection/org.freedesktop.NetworkManager.Device.Infiniband.h \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Lowpan.c \
|
introspection/org.freedesktop.NetworkManager.Device.Lowpan.c \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Lowpan.h \
|
introspection/org.freedesktop.NetworkManager.Device.Lowpan.h \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Macsec.c \
|
introspection/org.freedesktop.NetworkManager.Device.Macsec.c \
|
||||||
|
@ -423,12 +425,14 @@ introspection_sources = \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Modem.h \
|
introspection/org.freedesktop.NetworkManager.Device.Modem.h \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.OlpcMesh.c \
|
introspection/org.freedesktop.NetworkManager.Device.OlpcMesh.c \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.OlpcMesh.h \
|
introspection/org.freedesktop.NetworkManager.Device.OlpcMesh.h \
|
||||||
|
introspection/org.freedesktop.NetworkManager.Device.OvsBridge.c \
|
||||||
|
introspection/org.freedesktop.NetworkManager.Device.OvsBridge.h \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.OvsInterface.c \
|
introspection/org.freedesktop.NetworkManager.Device.OvsInterface.c \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.OvsInterface.h \
|
introspection/org.freedesktop.NetworkManager.Device.OvsInterface.h \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.OvsPort.c \
|
introspection/org.freedesktop.NetworkManager.Device.OvsPort.c \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.OvsPort.h \
|
introspection/org.freedesktop.NetworkManager.Device.OvsPort.h \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.OvsBridge.c \
|
introspection/org.freedesktop.NetworkManager.Device.P2PWireless.c \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.OvsBridge.h \
|
introspection/org.freedesktop.NetworkManager.Device.P2PWireless.h \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Ppp.c \
|
introspection/org.freedesktop.NetworkManager.Device.Ppp.c \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Ppp.h \
|
introspection/org.freedesktop.NetworkManager.Device.Ppp.h \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Statistics.c \
|
introspection/org.freedesktop.NetworkManager.Device.Statistics.c \
|
||||||
|
@ -443,28 +447,26 @@ introspection_sources = \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Vlan.h \
|
introspection/org.freedesktop.NetworkManager.Device.Vlan.h \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Vxlan.c \
|
introspection/org.freedesktop.NetworkManager.Device.Vxlan.c \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Vxlan.h \
|
introspection/org.freedesktop.NetworkManager.Device.Vxlan.h \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.WireGuard.c \
|
|
||||||
introspection/org.freedesktop.NetworkManager.Device.WireGuard.h \
|
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Wireless.c \
|
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Wireless.h \
|
|
||||||
introspection/org.freedesktop.NetworkManager.Device.WiMax.c \
|
introspection/org.freedesktop.NetworkManager.Device.WiMax.c \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.WiMax.h \
|
introspection/org.freedesktop.NetworkManager.Device.WiMax.h \
|
||||||
|
introspection/org.freedesktop.NetworkManager.Device.WireGuard.c \
|
||||||
|
introspection/org.freedesktop.NetworkManager.Device.WireGuard.h \
|
||||||
|
introspection/org.freedesktop.NetworkManager.Device.Wired.c \
|
||||||
|
introspection/org.freedesktop.NetworkManager.Device.Wired.h \
|
||||||
|
introspection/org.freedesktop.NetworkManager.Device.Wireless.c \
|
||||||
|
introspection/org.freedesktop.NetworkManager.Device.Wireless.h \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Wpan.c \
|
introspection/org.freedesktop.NetworkManager.Device.Wpan.c \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Wpan.h \
|
introspection/org.freedesktop.NetworkManager.Device.Wpan.h \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.c \
|
introspection/org.freedesktop.NetworkManager.Device.c \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.h \
|
introspection/org.freedesktop.NetworkManager.Device.h \
|
||||||
introspection/org.freedesktop.NetworkManager.DHCP4Config.c \
|
|
||||||
introspection/org.freedesktop.NetworkManager.DHCP4Config.h \
|
|
||||||
introspection/org.freedesktop.NetworkManager.DHCP6Config.c \
|
|
||||||
introspection/org.freedesktop.NetworkManager.DHCP6Config.h \
|
|
||||||
introspection/org.freedesktop.NetworkManager.DnsManager.c \
|
introspection/org.freedesktop.NetworkManager.DnsManager.c \
|
||||||
introspection/org.freedesktop.NetworkManager.DnsManager.h \
|
introspection/org.freedesktop.NetworkManager.DnsManager.h \
|
||||||
introspection/org.freedesktop.NetworkManager.IP4Config.c \
|
introspection/org.freedesktop.NetworkManager.IP4Config.c \
|
||||||
introspection/org.freedesktop.NetworkManager.IP4Config.h \
|
introspection/org.freedesktop.NetworkManager.IP4Config.h \
|
||||||
introspection/org.freedesktop.NetworkManager.IP6Config.c \
|
introspection/org.freedesktop.NetworkManager.IP6Config.c \
|
||||||
introspection/org.freedesktop.NetworkManager.IP6Config.h \
|
introspection/org.freedesktop.NetworkManager.IP6Config.h \
|
||||||
introspection/org.freedesktop.NetworkManager.c \
|
introspection/org.freedesktop.NetworkManager.P2PPeer.c \
|
||||||
introspection/org.freedesktop.NetworkManager.h \
|
introspection/org.freedesktop.NetworkManager.P2PPeer.h \
|
||||||
introspection/org.freedesktop.NetworkManager.PPP.c \
|
introspection/org.freedesktop.NetworkManager.PPP.c \
|
||||||
introspection/org.freedesktop.NetworkManager.PPP.h \
|
introspection/org.freedesktop.NetworkManager.PPP.h \
|
||||||
introspection/org.freedesktop.NetworkManager.SecretAgent.c \
|
introspection/org.freedesktop.NetworkManager.SecretAgent.c \
|
||||||
|
@ -476,56 +478,62 @@ introspection_sources = \
|
||||||
introspection/org.freedesktop.NetworkManager.VPN.Connection.c \
|
introspection/org.freedesktop.NetworkManager.VPN.Connection.c \
|
||||||
introspection/org.freedesktop.NetworkManager.VPN.Connection.h \
|
introspection/org.freedesktop.NetworkManager.VPN.Connection.h \
|
||||||
introspection/org.freedesktop.NetworkManager.VPN.Plugin.c \
|
introspection/org.freedesktop.NetworkManager.VPN.Plugin.c \
|
||||||
introspection/org.freedesktop.NetworkManager.VPN.Plugin.h
|
introspection/org.freedesktop.NetworkManager.VPN.Plugin.h \
|
||||||
|
introspection/org.freedesktop.NetworkManager.c \
|
||||||
|
introspection/org.freedesktop.NetworkManager.h \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
nodist_introspection_libnmdbus_la_SOURCES = $(introspection_sources)
|
nodist_introspection_libnmdbus_la_SOURCES = $(introspection_sources)
|
||||||
|
|
||||||
DBUS_INTERFACE_DOCS = \
|
DBUS_INTERFACE_DOCS = \
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.AccessPoint.xml \
|
docs/api/dbus-org.freedesktop.NetworkManager.AccessPoint.xml \
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Connection.Active.xml \
|
docs/api/dbus-org.freedesktop.NetworkManager.AgentManager.xml \
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Checkpoint.xml \
|
docs/api/dbus-org.freedesktop.NetworkManager.Checkpoint.xml \
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Device.Team.xml \
|
docs/api/dbus-org.freedesktop.NetworkManager.Connection.Active.xml \
|
||||||
|
docs/api/dbus-org.freedesktop.NetworkManager.DHCP4Config.xml \
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.DHCP6Config.xml \
|
docs/api/dbus-org.freedesktop.NetworkManager.DHCP6Config.xml \
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Device.Wireless.xml \
|
docs/api/dbus-org.freedesktop.NetworkManager.Device.Adsl.xml \
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.xml \
|
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.VPN.Connection.xml \
|
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.SecretAgent.xml \
|
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Device.xml \
|
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.VPN.Plugin.xml \
|
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Device.Bluetooth.xml \
|
docs/api/dbus-org.freedesktop.NetworkManager.Device.Bluetooth.xml \
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Device.Dummy.xml \
|
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Device.Vxlan.xml \
|
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Settings.Connection.xml \
|
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Device.Bond.xml \
|
docs/api/dbus-org.freedesktop.NetworkManager.Device.Bond.xml \
|
||||||
|
docs/api/dbus-org.freedesktop.NetworkManager.Device.Bridge.xml \
|
||||||
|
docs/api/dbus-org.freedesktop.NetworkManager.Device.Dummy.xml \
|
||||||
|
docs/api/dbus-org.freedesktop.NetworkManager.Device.Generic.xml \
|
||||||
|
docs/api/dbus-org.freedesktop.NetworkManager.Device.IPTunnel.xml \
|
||||||
|
docs/api/dbus-org.freedesktop.NetworkManager.Device.Infiniband.xml \
|
||||||
|
docs/api/dbus-org.freedesktop.NetworkManager.Device.Lowpan.xml \
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Device.Macsec.xml \
|
docs/api/dbus-org.freedesktop.NetworkManager.Device.Macsec.xml \
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Device.Macvlan.xml \
|
docs/api/dbus-org.freedesktop.NetworkManager.Device.Macvlan.xml \
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.PPP.xml \
|
docs/api/dbus-org.freedesktop.NetworkManager.Device.Modem.xml \
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Device.Vlan.xml \
|
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Device.Adsl.xml \
|
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.AgentManager.xml \
|
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Device.WiMax.xml \
|
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Device.Wpan.xml \
|
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Device.IPTunnel.xml \
|
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Device.Tun.xml \
|
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Device.Bridge.xml \
|
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Device.OlpcMesh.xml \
|
docs/api/dbus-org.freedesktop.NetworkManager.Device.OlpcMesh.xml \
|
||||||
|
docs/api/dbus-org.freedesktop.NetworkManager.Device.OvsBridge.xml \
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Device.OvsInterface.xml \
|
docs/api/dbus-org.freedesktop.NetworkManager.Device.OvsInterface.xml \
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Device.OvsPort.xml \
|
docs/api/dbus-org.freedesktop.NetworkManager.Device.OvsPort.xml \
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Device.OvsBridge.xml \
|
docs/api/dbus-org.freedesktop.NetworkManager.Device.P2PWireless.xml \
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Device.Ppp.xml \
|
docs/api/dbus-org.freedesktop.NetworkManager.Device.Ppp.xml \
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.DHCP4Config.xml \
|
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Device.Generic.xml \
|
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Device.Infiniband.xml \
|
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Device.Modem.xml \
|
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.IP6Config.xml \
|
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Device.Veth.xml \
|
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Settings.xml \
|
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Device.Wired.xml \
|
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Device.WireGuard.xml \
|
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.IP4Config.xml \
|
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Device.Statistics.xml \
|
docs/api/dbus-org.freedesktop.NetworkManager.Device.Statistics.xml \
|
||||||
|
docs/api/dbus-org.freedesktop.NetworkManager.Device.Team.xml \
|
||||||
|
docs/api/dbus-org.freedesktop.NetworkManager.Device.Tun.xml \
|
||||||
|
docs/api/dbus-org.freedesktop.NetworkManager.Device.Veth.xml \
|
||||||
|
docs/api/dbus-org.freedesktop.NetworkManager.Device.Vlan.xml \
|
||||||
|
docs/api/dbus-org.freedesktop.NetworkManager.Device.Vxlan.xml \
|
||||||
|
docs/api/dbus-org.freedesktop.NetworkManager.Device.WiMax.xml \
|
||||||
|
docs/api/dbus-org.freedesktop.NetworkManager.Device.WireGuard.xml \
|
||||||
|
docs/api/dbus-org.freedesktop.NetworkManager.Device.Wired.xml \
|
||||||
|
docs/api/dbus-org.freedesktop.NetworkManager.Device.Wireless.xml \
|
||||||
|
docs/api/dbus-org.freedesktop.NetworkManager.Device.Wpan.xml \
|
||||||
|
docs/api/dbus-org.freedesktop.NetworkManager.Device.xml \
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.DnsManager.xml \
|
docs/api/dbus-org.freedesktop.NetworkManager.DnsManager.xml \
|
||||||
docs/api/dbus-org.freedesktop.NetworkManager.Device.Lowpan.xml
|
docs/api/dbus-org.freedesktop.NetworkManager.IP4Config.xml \
|
||||||
|
docs/api/dbus-org.freedesktop.NetworkManager.IP6Config.xml \
|
||||||
|
docs/api/dbus-org.freedesktop.NetworkManager.P2PPeer.xml \
|
||||||
|
docs/api/dbus-org.freedesktop.NetworkManager.PPP.xml \
|
||||||
|
docs/api/dbus-org.freedesktop.NetworkManager.SecretAgent.xml \
|
||||||
|
docs/api/dbus-org.freedesktop.NetworkManager.Settings.Connection.xml \
|
||||||
|
docs/api/dbus-org.freedesktop.NetworkManager.Settings.xml \
|
||||||
|
docs/api/dbus-org.freedesktop.NetworkManager.VPN.Connection.xml \
|
||||||
|
docs/api/dbus-org.freedesktop.NetworkManager.VPN.Plugin.xml \
|
||||||
|
docs/api/dbus-org.freedesktop.NetworkManager.xml \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
introspection/%.c: introspection/%.xml
|
introspection/%.c: introspection/%.xml
|
||||||
@$(MKDIR_P) introspection/
|
@$(MKDIR_P) introspection/
|
||||||
|
@ -566,6 +574,7 @@ dbusinterfaces_DATA = \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.OvsInterface.xml \
|
introspection/org.freedesktop.NetworkManager.Device.OvsInterface.xml \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.OvsPort.xml \
|
introspection/org.freedesktop.NetworkManager.Device.OvsPort.xml \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.OvsBridge.xml \
|
introspection/org.freedesktop.NetworkManager.Device.OvsBridge.xml \
|
||||||
|
introspection/org.freedesktop.NetworkManager.Device.P2PWireless.xml \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Ppp.xml \
|
introspection/org.freedesktop.NetworkManager.Device.Ppp.xml \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Statistics.xml \
|
introspection/org.freedesktop.NetworkManager.Device.Statistics.xml \
|
||||||
introspection/org.freedesktop.NetworkManager.Device.Team.xml \
|
introspection/org.freedesktop.NetworkManager.Device.Team.xml \
|
||||||
|
@ -584,6 +593,7 @@ dbusinterfaces_DATA = \
|
||||||
introspection/org.freedesktop.NetworkManager.IP4Config.xml \
|
introspection/org.freedesktop.NetworkManager.IP4Config.xml \
|
||||||
introspection/org.freedesktop.NetworkManager.IP6Config.xml \
|
introspection/org.freedesktop.NetworkManager.IP6Config.xml \
|
||||||
introspection/org.freedesktop.NetworkManager.xml \
|
introspection/org.freedesktop.NetworkManager.xml \
|
||||||
|
introspection/org.freedesktop.NetworkManager.P2PPeer.xml \
|
||||||
introspection/org.freedesktop.NetworkManager.PPP.xml \
|
introspection/org.freedesktop.NetworkManager.PPP.xml \
|
||||||
introspection/org.freedesktop.NetworkManager.SecretAgent.xml \
|
introspection/org.freedesktop.NetworkManager.SecretAgent.xml \
|
||||||
introspection/org.freedesktop.NetworkManager.Settings.Connection.xml \
|
introspection/org.freedesktop.NetworkManager.Settings.Connection.xml \
|
||||||
|
@ -3240,24 +3250,30 @@ if WITH_WIFI
|
||||||
core_plugins += src/devices/wifi/libnm-device-plugin-wifi.la
|
core_plugins += src/devices/wifi/libnm-device-plugin-wifi.la
|
||||||
|
|
||||||
src_devices_wifi_libnm_device_plugin_wifi_la_SOURCES = \
|
src_devices_wifi_libnm_device_plugin_wifi_la_SOURCES = \
|
||||||
src/devices/wifi/nm-wifi-factory.c \
|
src/devices/wifi/nm-device-olpc-mesh.c \
|
||||||
|
src/devices/wifi/nm-device-olpc-mesh.h \
|
||||||
|
src/devices/wifi/nm-device-p2p-wifi.c \
|
||||||
|
src/devices/wifi/nm-device-p2p-wifi.h \
|
||||||
src/devices/wifi/nm-device-wifi.c \
|
src/devices/wifi/nm-device-wifi.c \
|
||||||
src/devices/wifi/nm-device-wifi.h \
|
src/devices/wifi/nm-device-wifi.h \
|
||||||
src/devices/wifi/nm-wifi-ap.c \
|
src/devices/wifi/nm-wifi-ap.c \
|
||||||
src/devices/wifi/nm-wifi-ap.h \
|
src/devices/wifi/nm-wifi-ap.h \
|
||||||
src/devices/wifi/nm-wifi-utils.c \
|
|
||||||
src/devices/wifi/nm-wifi-utils.h \
|
|
||||||
src/devices/wifi/nm-wifi-common.c \
|
src/devices/wifi/nm-wifi-common.c \
|
||||||
src/devices/wifi/nm-wifi-common.h \
|
src/devices/wifi/nm-wifi-common.h \
|
||||||
src/devices/wifi/nm-device-olpc-mesh.c \
|
src/devices/wifi/nm-wifi-factory.c \
|
||||||
src/devices/wifi/nm-device-olpc-mesh.h
|
src/devices/wifi/nm-wifi-p2p-peer.c \
|
||||||
|
src/devices/wifi/nm-wifi-p2p-peer.h \
|
||||||
|
src/devices/wifi/nm-wifi-utils.c \
|
||||||
|
src/devices/wifi/nm-wifi-utils.h \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
if WITH_IWD
|
if WITH_IWD
|
||||||
src_devices_wifi_libnm_device_plugin_wifi_la_SOURCES += \
|
src_devices_wifi_libnm_device_plugin_wifi_la_SOURCES += \
|
||||||
src/devices/wifi/nm-device-iwd.c \
|
src/devices/wifi/nm-device-iwd.c \
|
||||||
src/devices/wifi/nm-device-iwd.h \
|
src/devices/wifi/nm-device-iwd.h \
|
||||||
src/devices/wifi/nm-iwd-manager.c \
|
src/devices/wifi/nm-iwd-manager.c \
|
||||||
src/devices/wifi/nm-iwd-manager.h
|
src/devices/wifi/nm-iwd-manager.h \
|
||||||
|
$(NULL)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
src_devices_wifi_libnm_device_plugin_wifi_la_CPPFLAGS = $(src_cppflags_device_plugin)
|
src_devices_wifi_libnm_device_plugin_wifi_la_CPPFLAGS = $(src_cppflags_device_plugin)
|
||||||
|
|
|
@ -352,6 +352,7 @@ NM_UTILS_LOOKUP_STR_DEFINE (nmc_device_reason_to_string, NMDeviceStateReason,
|
||||||
NM_UTILS_LOOKUP_ITEM (NM_DEVICE_STATE_REASON_IP_ADDRESS_DUPLICATE, N_("A duplicate IP address was detected")),
|
NM_UTILS_LOOKUP_ITEM (NM_DEVICE_STATE_REASON_IP_ADDRESS_DUPLICATE, N_("A duplicate IP address was detected")),
|
||||||
NM_UTILS_LOOKUP_ITEM (NM_DEVICE_STATE_REASON_IP_METHOD_UNSUPPORTED, N_("The selected IP method is not supported")),
|
NM_UTILS_LOOKUP_ITEM (NM_DEVICE_STATE_REASON_IP_METHOD_UNSUPPORTED, N_("The selected IP method is not supported")),
|
||||||
NM_UTILS_LOOKUP_ITEM (NM_DEVICE_STATE_REASON_SRIOV_CONFIGURATION_FAILED, N_("Failed to configure SR-IOV parameters")),
|
NM_UTILS_LOOKUP_ITEM (NM_DEVICE_STATE_REASON_SRIOV_CONFIGURATION_FAILED, N_("Failed to configure SR-IOV parameters")),
|
||||||
|
NM_UTILS_LOOKUP_ITEM (NM_DEVICE_STATE_REASON_PEER_NOT_FOUND, N_("The Wi-Fi P2P peer could not be found")),
|
||||||
)
|
)
|
||||||
|
|
||||||
NM_UTILS_LOOKUP_STR_DEFINE (nm_active_connection_state_reason_to_string, NMActiveConnectionStateReason,
|
NM_UTILS_LOOKUP_STR_DEFINE (nm_active_connection_state_reason_to_string, NMActiveConnectionStateReason,
|
||||||
|
|
|
@ -42,42 +42,43 @@ MKHTML_OPTIONS=--path="$(abs_srcdir)"
|
||||||
content_files = \
|
content_files = \
|
||||||
$(GENERATED_FILES) \
|
$(GENERATED_FILES) \
|
||||||
dbus-org.freedesktop.NetworkManager.AccessPoint.xml \
|
dbus-org.freedesktop.NetworkManager.AccessPoint.xml \
|
||||||
dbus-org.freedesktop.NetworkManager.Connection.Active.xml \
|
|
||||||
dbus-org.freedesktop.NetworkManager.Device.Team.xml \
|
|
||||||
dbus-org.freedesktop.NetworkManager.DHCP6Config.xml \
|
|
||||||
dbus-org.freedesktop.NetworkManager.Device.Wireless.xml \
|
|
||||||
dbus-org.freedesktop.NetworkManager.xml \
|
|
||||||
dbus-org.freedesktop.NetworkManager.VPN.Connection.xml \
|
|
||||||
dbus-org.freedesktop.NetworkManager.SecretAgent.xml \
|
|
||||||
dbus-org.freedesktop.NetworkManager.Device.xml \
|
|
||||||
dbus-org.freedesktop.NetworkManager.VPN.Plugin.xml \
|
|
||||||
dbus-org.freedesktop.NetworkManager.Device.Bluetooth.xml \
|
|
||||||
dbus-org.freedesktop.NetworkManager.Device.Dummy.xml \
|
|
||||||
dbus-org.freedesktop.NetworkManager.Device.Vxlan.xml \
|
|
||||||
dbus-org.freedesktop.NetworkManager.Settings.Connection.xml \
|
|
||||||
dbus-org.freedesktop.NetworkManager.Device.Bond.xml \
|
|
||||||
dbus-org.freedesktop.NetworkManager.Device.Macvlan.xml \
|
|
||||||
dbus-org.freedesktop.NetworkManager.Device.Macsec.xml \
|
|
||||||
dbus-org.freedesktop.NetworkManager.PPP.xml \
|
|
||||||
dbus-org.freedesktop.NetworkManager.Device.Vlan.xml \
|
|
||||||
dbus-org.freedesktop.NetworkManager.Device.Adsl.xml \
|
|
||||||
dbus-org.freedesktop.NetworkManager.AgentManager.xml \
|
dbus-org.freedesktop.NetworkManager.AgentManager.xml \
|
||||||
dbus-org.freedesktop.NetworkManager.Device.IPTunnel.xml \
|
dbus-org.freedesktop.NetworkManager.Connection.Active.xml \
|
||||||
dbus-org.freedesktop.NetworkManager.Device.Tun.xml \
|
|
||||||
dbus-org.freedesktop.NetworkManager.Device.Bridge.xml \
|
|
||||||
dbus-org.freedesktop.NetworkManager.Device.OlpcMesh.xml \
|
|
||||||
dbus-org.freedesktop.NetworkManager.DHCP4Config.xml \
|
dbus-org.freedesktop.NetworkManager.DHCP4Config.xml \
|
||||||
|
dbus-org.freedesktop.NetworkManager.DHCP6Config.xml \
|
||||||
|
dbus-org.freedesktop.NetworkManager.Device.Adsl.xml \
|
||||||
|
dbus-org.freedesktop.NetworkManager.Device.Bluetooth.xml \
|
||||||
|
dbus-org.freedesktop.NetworkManager.Device.Bond.xml \
|
||||||
|
dbus-org.freedesktop.NetworkManager.Device.Bridge.xml \
|
||||||
|
dbus-org.freedesktop.NetworkManager.Device.Dummy.xml \
|
||||||
dbus-org.freedesktop.NetworkManager.Device.Generic.xml \
|
dbus-org.freedesktop.NetworkManager.Device.Generic.xml \
|
||||||
|
dbus-org.freedesktop.NetworkManager.Device.IPTunnel.xml \
|
||||||
dbus-org.freedesktop.NetworkManager.Device.Infiniband.xml \
|
dbus-org.freedesktop.NetworkManager.Device.Infiniband.xml \
|
||||||
|
dbus-org.freedesktop.NetworkManager.Device.Macsec.xml \
|
||||||
|
dbus-org.freedesktop.NetworkManager.Device.Macvlan.xml \
|
||||||
dbus-org.freedesktop.NetworkManager.Device.Modem.xml \
|
dbus-org.freedesktop.NetworkManager.Device.Modem.xml \
|
||||||
dbus-org.freedesktop.NetworkManager.IP6Config.xml \
|
dbus-org.freedesktop.NetworkManager.Device.OlpcMesh.xml \
|
||||||
dbus-org.freedesktop.NetworkManager.Device.Veth.xml \
|
|
||||||
dbus-org.freedesktop.NetworkManager.Settings.xml \
|
|
||||||
dbus-org.freedesktop.NetworkManager.Device.Wired.xml \
|
|
||||||
dbus-org.freedesktop.NetworkManager.Device.WireGuard.xml \
|
|
||||||
dbus-org.freedesktop.NetworkManager.IP4Config.xml \
|
|
||||||
dbus-org.freedesktop.NetworkManager.Device.Statistics.xml \
|
dbus-org.freedesktop.NetworkManager.Device.Statistics.xml \
|
||||||
|
dbus-org.freedesktop.NetworkManager.Device.Team.xml \
|
||||||
|
dbus-org.freedesktop.NetworkManager.Device.Tun.xml \
|
||||||
|
dbus-org.freedesktop.NetworkManager.Device.Veth.xml \
|
||||||
|
dbus-org.freedesktop.NetworkManager.Device.Vlan.xml \
|
||||||
|
dbus-org.freedesktop.NetworkManager.Device.Vxlan.xml \
|
||||||
|
dbus-org.freedesktop.NetworkManager.Device.WireGuard.xml \
|
||||||
|
dbus-org.freedesktop.NetworkManager.Device.P2PWireless.xml \
|
||||||
|
dbus-org.freedesktop.NetworkManager.Device.Wired.xml \
|
||||||
|
dbus-org.freedesktop.NetworkManager.Device.Wireless.xml \
|
||||||
|
dbus-org.freedesktop.NetworkManager.Device.xml \
|
||||||
dbus-org.freedesktop.NetworkManager.DnsManager.xml \
|
dbus-org.freedesktop.NetworkManager.DnsManager.xml \
|
||||||
|
dbus-org.freedesktop.NetworkManager.IP4Config.xml \
|
||||||
|
dbus-org.freedesktop.NetworkManager.IP6Config.xml \
|
||||||
|
dbus-org.freedesktop.NetworkManager.PPP.xml \
|
||||||
|
dbus-org.freedesktop.NetworkManager.SecretAgent.xml \
|
||||||
|
dbus-org.freedesktop.NetworkManager.Settings.Connection.xml \
|
||||||
|
dbus-org.freedesktop.NetworkManager.Settings.xml \
|
||||||
|
dbus-org.freedesktop.NetworkManager.VPN.Connection.xml \
|
||||||
|
dbus-org.freedesktop.NetworkManager.VPN.Plugin.xml \
|
||||||
|
dbus-org.freedesktop.NetworkManager.xml \
|
||||||
$(top_builddir)/libnm-core/nm-dbus-types.xml \
|
$(top_builddir)/libnm-core/nm-dbus-types.xml \
|
||||||
$(top_builddir)/libnm-core/nm-vpn-dbus-types.xml \
|
$(top_builddir)/libnm-core/nm-vpn-dbus-types.xml \
|
||||||
$(top_builddir)/man/nmcli.xml \
|
$(top_builddir)/man/nmcli.xml \
|
||||||
|
|
|
@ -206,6 +206,7 @@
|
||||||
<xi:include href="dbus-org.freedesktop.NetworkManager.Device.Vxlan.xml"/>
|
<xi:include href="dbus-org.freedesktop.NetworkManager.Device.Vxlan.xml"/>
|
||||||
<xi:include href="dbus-org.freedesktop.NetworkManager.Device.WireGuard.xml"/>
|
<xi:include href="dbus-org.freedesktop.NetworkManager.Device.WireGuard.xml"/>
|
||||||
<xi:include href="dbus-org.freedesktop.NetworkManager.Device.Wireless.xml"/>
|
<xi:include href="dbus-org.freedesktop.NetworkManager.Device.Wireless.xml"/>
|
||||||
|
<xi:include href="dbus-org.freedesktop.NetworkManager.Device.P2PWireless.xml"/>
|
||||||
<xi:include href="dbus-org.freedesktop.NetworkManager.Device.Wpan.xml"/>
|
<xi:include href="dbus-org.freedesktop.NetworkManager.Device.Wpan.xml"/>
|
||||||
<xi:include href="dbus-org.freedesktop.NetworkManager.PPP.xml"/>
|
<xi:include href="dbus-org.freedesktop.NetworkManager.PPP.xml"/>
|
||||||
</chapter>
|
</chapter>
|
||||||
|
@ -247,6 +248,12 @@
|
||||||
<xi:include href="dbus-org.freedesktop.NetworkManager.AccessPoint.xml"/>
|
<xi:include href="dbus-org.freedesktop.NetworkManager.AccessPoint.xml"/>
|
||||||
</chapter>
|
</chapter>
|
||||||
|
|
||||||
|
<chapter id="ref-dbus-p2p-peers">
|
||||||
|
<title>The <literal>/org/freedesktop/NetworkManager/P2PPeer/*</literal> objects</title>
|
||||||
|
<!-- TODO: Describe the objects here -->
|
||||||
|
<xi:include href="dbus-org.freedesktop.NetworkManager.P2PPeer.xml"/>
|
||||||
|
</chapter>
|
||||||
|
|
||||||
<chapter id="ref-dbus-checkpoint">
|
<chapter id="ref-dbus-checkpoint">
|
||||||
<title>The <literal>/org/freedesktop/NetworkManager/Checkpoint/*</literal> objects</title>
|
<title>The <literal>/org/freedesktop/NetworkManager/Checkpoint/*</literal> objects</title>
|
||||||
<!-- TODO: Describe the objects here -->
|
<!-- TODO: Describe the objects here -->
|
||||||
|
|
|
@ -23,6 +23,7 @@ ifaces = [
|
||||||
'org.freedesktop.NetworkManager.Device.OvsInterface',
|
'org.freedesktop.NetworkManager.Device.OvsInterface',
|
||||||
'org.freedesktop.NetworkManager.Device.OvsPort',
|
'org.freedesktop.NetworkManager.Device.OvsPort',
|
||||||
'org.freedesktop.NetworkManager.Device.OvsBridge',
|
'org.freedesktop.NetworkManager.Device.OvsBridge',
|
||||||
|
'org.freedesktop.NetworkManager.Device.P2PWireless',
|
||||||
'org.freedesktop.NetworkManager.Device.Ppp',
|
'org.freedesktop.NetworkManager.Device.Ppp',
|
||||||
'org.freedesktop.NetworkManager.Device.Statistics',
|
'org.freedesktop.NetworkManager.Device.Statistics',
|
||||||
'org.freedesktop.NetworkManager.Device.Team',
|
'org.freedesktop.NetworkManager.Device.Team',
|
||||||
|
@ -42,6 +43,7 @@ ifaces = [
|
||||||
'org.freedesktop.NetworkManager.IP4Config',
|
'org.freedesktop.NetworkManager.IP4Config',
|
||||||
'org.freedesktop.NetworkManager.IP6Config',
|
'org.freedesktop.NetworkManager.IP6Config',
|
||||||
'org.freedesktop.NetworkManager',
|
'org.freedesktop.NetworkManager',
|
||||||
|
'org.freedesktop.NetworkManager.P2PPeer',
|
||||||
'org.freedesktop.NetworkManager.PPP',
|
'org.freedesktop.NetworkManager.PPP',
|
||||||
'org.freedesktop.NetworkManager.SecretAgent',
|
'org.freedesktop.NetworkManager.SecretAgent',
|
||||||
'org.freedesktop.NetworkManager.Settings.Connection',
|
'org.freedesktop.NetworkManager.Settings.Connection',
|
||||||
|
|
|
@ -0,0 +1,65 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<node name="/">
|
||||||
|
<!--
|
||||||
|
org.freedesktop.NetworkManager.Device.P2PWireless:
|
||||||
|
@short_description: P2P Wi-Fi Device
|
||||||
|
|
||||||
|
-->
|
||||||
|
<interface name="org.freedesktop.NetworkManager.Device.P2PWireless">
|
||||||
|
<annotation name="org.gtk.GDBus.C.Name" value="Device_P2P_Wifi"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
HwAddress:
|
||||||
|
|
||||||
|
The active hardware address of the device.
|
||||||
|
-->
|
||||||
|
<property name="HwAddress" type="s" access="read"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
GroupOwner:
|
||||||
|
|
||||||
|
Whether this device is currently the group owner.
|
||||||
|
-->
|
||||||
|
<property name="GroupOwner" type="b" access="read"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
WFDIEs:
|
||||||
|
|
||||||
|
The Wi-Fi Display information elements.
|
||||||
|
-->
|
||||||
|
<property name="WFDIEs" type="ay" access="read">
|
||||||
|
<!-- gdbus-codegen assumes that "ay" means "non-UTF-8 string" and
|
||||||
|
won't deal with '\0' bytes correctly.
|
||||||
|
-->
|
||||||
|
<annotation name="org.gtk.GDBus.C.ForceGVariant" value="1"/>
|
||||||
|
</property>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Peers:
|
||||||
|
|
||||||
|
List of object paths of peers visible to this p2p wireless device.
|
||||||
|
-->
|
||||||
|
<property name="Peers" type="ao" access="read"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
PeerAdded:
|
||||||
|
@peer: The object path of the newly found access point.
|
||||||
|
|
||||||
|
Emitted when a new P2P peer is found by the device.
|
||||||
|
-->
|
||||||
|
<signal name="PeerAdded">
|
||||||
|
<arg name="peer" type="o"/>
|
||||||
|
</signal>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
PeerRemoved:
|
||||||
|
@peer: The object path of the P2P peer that has disappeared.
|
||||||
|
|
||||||
|
Emitted when a P2P peer disappears from view of the device.
|
||||||
|
-->
|
||||||
|
<signal name="PeerRemoved">
|
||||||
|
<arg name="peer" type="o"/>
|
||||||
|
</signal>
|
||||||
|
|
||||||
|
</interface>
|
||||||
|
</node>
|
78
introspection/org.freedesktop.NetworkManager.P2PPeer.xml
Normal file
78
introspection/org.freedesktop.NetworkManager.P2PPeer.xml
Normal file
|
@ -0,0 +1,78 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<node name="/">
|
||||||
|
<!--
|
||||||
|
org.freedesktop.NetworkManager.P2PPeer:
|
||||||
|
@short_description: P2P Wi-Fi Peer
|
||||||
|
|
||||||
|
-->
|
||||||
|
<interface name="org.freedesktop.NetworkManager.P2PPeer">
|
||||||
|
<annotation name="org.gtk.GDBus.C.Name" value="P2P_Peer"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Flags:
|
||||||
|
|
||||||
|
Flags describing the capabilities of the access point.
|
||||||
|
|
||||||
|
Returns: <link linkend="NM80211ApFlags">NM80211ApFlags</link>
|
||||||
|
-->
|
||||||
|
<property name="Flags" type="u" access="read"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Manufacturer:
|
||||||
|
|
||||||
|
The manufacturer of the P2P peer.
|
||||||
|
-->
|
||||||
|
<property name="Manufacturer" type="s" access="read"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Model:
|
||||||
|
|
||||||
|
The model of the P2P peer.
|
||||||
|
-->
|
||||||
|
<property name="Model" type="s" access="read"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
ModelNumber:
|
||||||
|
|
||||||
|
The model number of the P2P peer.
|
||||||
|
-->
|
||||||
|
<property name="ModelNumber" type="s" access="read"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Serial:
|
||||||
|
|
||||||
|
The serial number of the P2P peer.
|
||||||
|
-->
|
||||||
|
<property name="Serial" type="s" access="read"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Wfdies:
|
||||||
|
|
||||||
|
The Wi-Fi Display Information Elements of the P2P peer.
|
||||||
|
-->
|
||||||
|
<property name="WfdIEs" type="ay" access="read"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
HwAddress:
|
||||||
|
|
||||||
|
The hardware address (BSSID) of the access point.
|
||||||
|
-->
|
||||||
|
<property name="HwAddress" type="s" access="read"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Strength:
|
||||||
|
|
||||||
|
The current signal quality of the access point, in percent.
|
||||||
|
-->
|
||||||
|
<property name="Strength" type="y" access="read"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
LastSeen:
|
||||||
|
|
||||||
|
The timestamp (in CLOCK_BOOTTIME seconds) for the last time the access
|
||||||
|
point was found in scan results. A value of -1 means the access point has
|
||||||
|
never been found in scan results.
|
||||||
|
-->
|
||||||
|
<property name="LastSeen" type="i" access="read"/>
|
||||||
|
</interface>
|
||||||
|
</node>
|
|
@ -44,6 +44,7 @@
|
||||||
#define NM_DBUS_INTERFACE_DEVICE_WIRED NM_DBUS_INTERFACE_DEVICE ".Wired"
|
#define NM_DBUS_INTERFACE_DEVICE_WIRED NM_DBUS_INTERFACE_DEVICE ".Wired"
|
||||||
#define NM_DBUS_INTERFACE_DEVICE_ADSL NM_DBUS_INTERFACE_DEVICE ".Adsl"
|
#define NM_DBUS_INTERFACE_DEVICE_ADSL NM_DBUS_INTERFACE_DEVICE ".Adsl"
|
||||||
#define NM_DBUS_INTERFACE_DEVICE_WIRELESS NM_DBUS_INTERFACE_DEVICE ".Wireless"
|
#define NM_DBUS_INTERFACE_DEVICE_WIRELESS NM_DBUS_INTERFACE_DEVICE ".Wireless"
|
||||||
|
#define NM_DBUS_INTERFACE_DEVICE_P2P_WIRELESS NM_DBUS_INTERFACE_DEVICE ".P2PWireless"
|
||||||
#define NM_DBUS_INTERFACE_DEVICE_BLUETOOTH NM_DBUS_INTERFACE_DEVICE ".Bluetooth"
|
#define NM_DBUS_INTERFACE_DEVICE_BLUETOOTH NM_DBUS_INTERFACE_DEVICE ".Bluetooth"
|
||||||
#define NM_DBUS_INTERFACE_DEVICE_OLPC_MESH NM_DBUS_INTERFACE_DEVICE ".OlpcMesh"
|
#define NM_DBUS_INTERFACE_DEVICE_OLPC_MESH NM_DBUS_INTERFACE_DEVICE ".OlpcMesh"
|
||||||
#define NM_DBUS_INTERFACE_DEVICE_OVS_INTERFACE NM_DBUS_INTERFACE_DEVICE ".OvsInterface"
|
#define NM_DBUS_INTERFACE_DEVICE_OVS_INTERFACE NM_DBUS_INTERFACE_DEVICE ".OvsInterface"
|
||||||
|
@ -51,6 +52,8 @@
|
||||||
#define NM_DBUS_INTERFACE_DEVICE_OVS_BRIDGE NM_DBUS_INTERFACE_DEVICE ".OvsBridge"
|
#define NM_DBUS_INTERFACE_DEVICE_OVS_BRIDGE NM_DBUS_INTERFACE_DEVICE ".OvsBridge"
|
||||||
#define NM_DBUS_PATH_ACCESS_POINT NM_DBUS_PATH "/AccessPoint"
|
#define NM_DBUS_PATH_ACCESS_POINT NM_DBUS_PATH "/AccessPoint"
|
||||||
#define NM_DBUS_INTERFACE_ACCESS_POINT NM_DBUS_INTERFACE ".AccessPoint"
|
#define NM_DBUS_INTERFACE_ACCESS_POINT NM_DBUS_INTERFACE ".AccessPoint"
|
||||||
|
#define NM_DBUS_PATH_P2P_PEER NM_DBUS_PATH "/P2PPeer"
|
||||||
|
#define NM_DBUS_INTERFACE_P2P_PEER NM_DBUS_INTERFACE ".P2PPeer"
|
||||||
#define NM_DBUS_INTERFACE_DEVICE_MODEM NM_DBUS_INTERFACE_DEVICE ".Modem"
|
#define NM_DBUS_INTERFACE_DEVICE_MODEM NM_DBUS_INTERFACE_DEVICE ".Modem"
|
||||||
#define NM_DBUS_INTERFACE_DEVICE_WIMAX NM_DBUS_INTERFACE_DEVICE ".WiMax"
|
#define NM_DBUS_INTERFACE_DEVICE_WIMAX NM_DBUS_INTERFACE_DEVICE ".WiMax"
|
||||||
#define NM_DBUS_INTERFACE_WIMAX_NSP NM_DBUS_INTERFACE ".WiMax.Nsp"
|
#define NM_DBUS_INTERFACE_WIMAX_NSP NM_DBUS_INTERFACE ".WiMax.Nsp"
|
||||||
|
@ -563,6 +566,7 @@ typedef enum {
|
||||||
* @NM_DEVICE_STATE_REASON_IP_ADDRESS_DUPLICATE: a duplicate IP address was detected
|
* @NM_DEVICE_STATE_REASON_IP_ADDRESS_DUPLICATE: a duplicate IP address was detected
|
||||||
* @NM_DEVICE_STATE_REASON_IP_METHOD_UNSUPPORTED: The selected IP method is not supported
|
* @NM_DEVICE_STATE_REASON_IP_METHOD_UNSUPPORTED: The selected IP method is not supported
|
||||||
* @NM_DEVICE_STATE_REASON_SRIOV_CONFIGURATION_FAILED: configuration of SR-IOV parameters failed
|
* @NM_DEVICE_STATE_REASON_SRIOV_CONFIGURATION_FAILED: configuration of SR-IOV parameters failed
|
||||||
|
* @NM_DEVICE_STATE_REASON_PEER_NOT_FOUND: The Wi-Fi P2P peer could not be found
|
||||||
*
|
*
|
||||||
* Device state change reason codes
|
* Device state change reason codes
|
||||||
*/
|
*/
|
||||||
|
@ -634,6 +638,7 @@ typedef enum {
|
||||||
NM_DEVICE_STATE_REASON_IP_ADDRESS_DUPLICATE = 64,
|
NM_DEVICE_STATE_REASON_IP_ADDRESS_DUPLICATE = 64,
|
||||||
NM_DEVICE_STATE_REASON_IP_METHOD_UNSUPPORTED = 65,
|
NM_DEVICE_STATE_REASON_IP_METHOD_UNSUPPORTED = 65,
|
||||||
NM_DEVICE_STATE_REASON_SRIOV_CONFIGURATION_FAILED = 66,
|
NM_DEVICE_STATE_REASON_SRIOV_CONFIGURATION_FAILED = 66,
|
||||||
|
NM_DEVICE_STATE_REASON_PEER_NOT_FOUND = 67,
|
||||||
} NMDeviceStateReason;
|
} NMDeviceStateReason;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -742,6 +742,7 @@ NM_UTILS_LOOKUP_STR_DEFINE (nm_device_state_reason_to_str, NMDeviceStateReason,
|
||||||
NM_UTILS_LOOKUP_STR_ITEM (NM_DEVICE_STATE_REASON_IP_ADDRESS_DUPLICATE, "ip-address-duplicate"),
|
NM_UTILS_LOOKUP_STR_ITEM (NM_DEVICE_STATE_REASON_IP_ADDRESS_DUPLICATE, "ip-address-duplicate"),
|
||||||
NM_UTILS_LOOKUP_STR_ITEM (NM_DEVICE_STATE_REASON_IP_METHOD_UNSUPPORTED, "ip-method-unsupported"),
|
NM_UTILS_LOOKUP_STR_ITEM (NM_DEVICE_STATE_REASON_IP_METHOD_UNSUPPORTED, "ip-method-unsupported"),
|
||||||
NM_UTILS_LOOKUP_STR_ITEM (NM_DEVICE_STATE_REASON_SRIOV_CONFIGURATION_FAILED, "sriov-configuration-failed"),
|
NM_UTILS_LOOKUP_STR_ITEM (NM_DEVICE_STATE_REASON_SRIOV_CONFIGURATION_FAILED, "sriov-configuration-failed"),
|
||||||
|
NM_UTILS_LOOKUP_STR_ITEM (NM_DEVICE_STATE_REASON_PEER_NOT_FOUND, "peer-not-found"),
|
||||||
);
|
);
|
||||||
|
|
||||||
#define reason_to_string_a(reason) NM_UTILS_LOOKUP_STR_A (nm_device_state_reason_to_str, reason)
|
#define reason_to_string_a(reason) NM_UTILS_LOOKUP_STR_A (nm_device_state_reason_to_str, reason)
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
common_sources = files(
|
common_sources = files(
|
||||||
'nm-wifi-ap.c',
|
'nm-wifi-ap.c',
|
||||||
|
'nm-wifi-p2p-peer.c',
|
||||||
'nm-wifi-utils.c',
|
'nm-wifi-utils.c',
|
||||||
)
|
)
|
||||||
|
|
||||||
sources = common_sources + files(
|
sources = common_sources + files(
|
||||||
'nm-wifi-factory.c',
|
|
||||||
'nm-wifi-common.c',
|
|
||||||
'nm-device-wifi.c',
|
|
||||||
'nm-device-olpc-mesh.c',
|
'nm-device-olpc-mesh.c',
|
||||||
|
'nm-device-p2p-wifi.c',
|
||||||
|
'nm-device-wifi.c',
|
||||||
|
'nm-wifi-common.c',
|
||||||
|
'nm-wifi-factory.c',
|
||||||
)
|
)
|
||||||
|
|
||||||
if enable_iwd
|
if enable_iwd
|
||||||
|
|
1287
src/devices/wifi/nm-device-p2p-wifi.c
Normal file
1287
src/devices/wifi/nm-device-p2p-wifi.c
Normal file
File diff suppressed because it is too large
Load diff
56
src/devices/wifi/nm-device-p2p-wifi.h
Normal file
56
src/devices/wifi/nm-device-p2p-wifi.h
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
/* NetworkManager -- P2P Wi-Fi Device
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the
|
||||||
|
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
|
* Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* (C) Copyright 2018 Red Hat, Inc.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __NM_DEVICE_P2P_WIFI_H__
|
||||||
|
#define __NM_DEVICE_P2P_WIFI_H__
|
||||||
|
|
||||||
|
#include "devices/nm-device.h"
|
||||||
|
#include "supplicant/nm-supplicant-interface.h"
|
||||||
|
|
||||||
|
#define NM_TYPE_DEVICE_P2P_WIFI (nm_device_p2p_wifi_get_type ())
|
||||||
|
#define NM_DEVICE_P2P_WIFI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_P2P_WIFI, NMDeviceP2PWifi))
|
||||||
|
#define NM_DEVICE_P2P_WIFI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_P2P_WIFI, NMDeviceP2PWifiClass))
|
||||||
|
#define NM_IS_DEVICE_P2P_WIFI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_P2P_WIFI))
|
||||||
|
#define NM_IS_DEVICE_P2P_WIFI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_P2P_WIFI))
|
||||||
|
#define NM_DEVICE_P2P_WIFI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_P2P_WIFI, NMDeviceP2PWifiClass))
|
||||||
|
|
||||||
|
#define NM_DEVICE_P2P_WIFI_GROUP_OWNER "group-owner"
|
||||||
|
#define NM_DEVICE_P2P_WIFI_PEERS "peers"
|
||||||
|
#define NM_DEVICE_P2P_WIFI_GROUPS "groups"
|
||||||
|
#define NM_DEVICE_P2P_WIFI_WFDIES "WFDIEs"
|
||||||
|
|
||||||
|
#define NM_DEVICE_P2P_WIFI_MGMT_IFACE "mgmt-iface"
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct _NMDeviceP2PWifi NMDeviceP2PWifi;
|
||||||
|
typedef struct _NMDeviceP2PWifiClass NMDeviceP2PWifiClass;
|
||||||
|
|
||||||
|
GType nm_device_p2p_wifi_get_type (void);
|
||||||
|
|
||||||
|
NMDevice* nm_device_p2p_wifi_new (NMSupplicantInterface *mgmt_iface,
|
||||||
|
const char* iface);
|
||||||
|
|
||||||
|
NMSupplicantInterface * nm_device_p2p_wifi_get_mgmt_iface (NMDeviceP2PWifi *self);
|
||||||
|
void nm_device_p2p_wifi_set_mgmt_iface (NMDeviceP2PWifi *self,
|
||||||
|
NMSupplicantInterface *iface);
|
||||||
|
|
||||||
|
void nm_device_p2p_wifi_remove (NMDeviceP2PWifi *self);
|
||||||
|
|
||||||
|
#endif /* __NM_DEVICE_P2P_WIFI_H__ */
|
808
src/devices/wifi/nm-wifi-p2p-peer.c
Normal file
808
src/devices/wifi/nm-wifi-p2p-peer.c
Normal file
|
@ -0,0 +1,808 @@
|
||||||
|
/* NetworkManager -- P2P Wi-Fi Peer
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the
|
||||||
|
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
|
* Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2018 Red Hat, Inc.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "nm-default.h"
|
||||||
|
|
||||||
|
#include "nm-wifi-p2p-peer.h"
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "nm-setting-wireless.h"
|
||||||
|
|
||||||
|
#include "nm-wifi-utils.h"
|
||||||
|
#include "NetworkManagerUtils.h"
|
||||||
|
#include "nm-utils.h"
|
||||||
|
#include "nm-core-internal.h"
|
||||||
|
#include "platform/nm-platform.h"
|
||||||
|
#include "devices/nm-device.h"
|
||||||
|
#include "nm-dbus-manager.h"
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
NM_GOBJECT_PROPERTIES_DEFINE (NMWifiP2PPeer,
|
||||||
|
PROP_NAME,
|
||||||
|
PROP_MANUFACTURER,
|
||||||
|
PROP_MODEL,
|
||||||
|
PROP_MODEL_NUMBER,
|
||||||
|
PROP_SERIAL,
|
||||||
|
//PROP_PRIMARY_DEVICE_TYPE, { "PrimaryDeviceType", WPAS_DBUS_NEW_IFACE_P2P_PEER, "ay",
|
||||||
|
// "devicecapability", WPAS_DBUS_NEW_IFACE_P2P_PEER, "y",
|
||||||
|
// "groupcapability", WPAS_DBUS_NEW_IFACE_P2P_PEER, "y",
|
||||||
|
// "SecondaryDeviceTypes", WPAS_DBUS_NEW_IFACE_P2P_PEER, "aay",
|
||||||
|
// "VendorExtension", WPAS_DBUS_NEW_IFACE_P2P_PEER, "aay",
|
||||||
|
PROP_WFD_IES,
|
||||||
|
PROP_GROUPS,
|
||||||
|
|
||||||
|
PROP_HW_ADDRESS,
|
||||||
|
//PROP_MODE,
|
||||||
|
PROP_STRENGTH,
|
||||||
|
PROP_LAST_SEEN,
|
||||||
|
|
||||||
|
//PROP_MAX_BITRATE,
|
||||||
|
// One of the following (FLAGS would simply mirror/use the same as AP flags)
|
||||||
|
PROP_FLAGS,
|
||||||
|
//PROP_CONFIG_METHOD,
|
||||||
|
);
|
||||||
|
|
||||||
|
struct _NMWifiP2PPeerPrivate {
|
||||||
|
char *supplicant_path; /* D-Bus object path of this Peer from wpa_supplicant */
|
||||||
|
|
||||||
|
/* Scanned or cached values */
|
||||||
|
char * name;
|
||||||
|
char * manufacturer;
|
||||||
|
char * model;
|
||||||
|
char * model_number;
|
||||||
|
char * serial;
|
||||||
|
|
||||||
|
char * address;
|
||||||
|
|
||||||
|
GBytes * wfd_ies;
|
||||||
|
char ** groups;
|
||||||
|
|
||||||
|
guint8 strength;
|
||||||
|
|
||||||
|
NM80211ApFlags flags; /* General flags */
|
||||||
|
|
||||||
|
/* Non-scanned attributes */
|
||||||
|
gint32 last_seen; /* Timestamp when the Peer was seen lastly (obtained via nm_utils_get_monotonic_timestamp_s()) */
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct _NMWifiP2PPeerPrivate NMWifiP2PPeerPrivate;
|
||||||
|
|
||||||
|
struct _NMWifiP2PPeerClass {
|
||||||
|
NMDBusObjectClass parent;
|
||||||
|
};
|
||||||
|
|
||||||
|
G_DEFINE_TYPE (NMWifiP2PPeer, nm_wifi_p2p_peer, NM_TYPE_DBUS_OBJECT)
|
||||||
|
|
||||||
|
#define NM_WIFI_P2P_PEER_GET_PRIVATE(self) _NM_GET_PRIVATE_PTR(self, NMWifiP2PPeer, NM_IS_WIFI_P2P_PEER)
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
const char *
|
||||||
|
nm_wifi_p2p_peer_get_supplicant_path (NMWifiP2PPeer *peer)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (NM_IS_WIFI_P2P_PEER (peer), NULL);
|
||||||
|
|
||||||
|
return NM_WIFI_P2P_PEER_GET_PRIVATE (peer)->supplicant_path;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *
|
||||||
|
nm_wifi_p2p_peer_get_name (const NMWifiP2PPeer *peer)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (NM_IS_WIFI_P2P_PEER (peer), NULL);
|
||||||
|
|
||||||
|
return NM_WIFI_P2P_PEER_GET_PRIVATE (peer)->name;
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
nm_wifi_p2p_peer_set_name (NMWifiP2PPeer *peer, const char *name)
|
||||||
|
{
|
||||||
|
NMWifiP2PPeerPrivate *priv = NM_WIFI_P2P_PEER_GET_PRIVATE (peer);
|
||||||
|
g_return_val_if_fail (NM_IS_WIFI_P2P_PEER (peer), FALSE);
|
||||||
|
|
||||||
|
if (g_strcmp0 (name, priv->name) == 0)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
g_clear_pointer (&priv->name, g_free);
|
||||||
|
if (name)
|
||||||
|
priv->name = g_strdup (name);
|
||||||
|
|
||||||
|
_notify (peer, PROP_NAME);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *
|
||||||
|
nm_wifi_p2p_peer_get_manufacturer (const NMWifiP2PPeer *peer)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (NM_IS_WIFI_P2P_PEER (peer), NULL);
|
||||||
|
|
||||||
|
return NM_WIFI_P2P_PEER_GET_PRIVATE (peer)->manufacturer;
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
nm_wifi_p2p_peer_set_manufacturer (NMWifiP2PPeer *peer, const char *manufacturer)
|
||||||
|
{
|
||||||
|
NMWifiP2PPeerPrivate *priv = NM_WIFI_P2P_PEER_GET_PRIVATE (peer);
|
||||||
|
g_return_val_if_fail (NM_IS_WIFI_P2P_PEER (peer), FALSE);
|
||||||
|
|
||||||
|
if (g_strcmp0 (manufacturer, priv->manufacturer) == 0)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
g_clear_pointer (&priv->manufacturer, g_free);
|
||||||
|
if (manufacturer)
|
||||||
|
priv->manufacturer = g_strdup (manufacturer);
|
||||||
|
|
||||||
|
_notify (peer, PROP_MANUFACTURER);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *
|
||||||
|
nm_wifi_p2p_peer_get_model (const NMWifiP2PPeer *peer)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (NM_IS_WIFI_P2P_PEER (peer), NULL);
|
||||||
|
|
||||||
|
return NM_WIFI_P2P_PEER_GET_PRIVATE (peer)->model;
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
nm_wifi_p2p_peer_set_model (NMWifiP2PPeer *peer, const char *model)
|
||||||
|
{
|
||||||
|
NMWifiP2PPeerPrivate *priv = NM_WIFI_P2P_PEER_GET_PRIVATE (peer);
|
||||||
|
g_return_val_if_fail (NM_IS_WIFI_P2P_PEER (peer), FALSE);
|
||||||
|
|
||||||
|
if (g_strcmp0 (model, priv->model) == 0)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
g_clear_pointer (&priv->model, g_free);
|
||||||
|
if (model)
|
||||||
|
priv->model = g_strdup (model);
|
||||||
|
|
||||||
|
_notify (peer, PROP_MODEL);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *
|
||||||
|
nm_wifi_p2p_peer_get_model_number (const NMWifiP2PPeer *peer)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (NM_IS_WIFI_P2P_PEER (peer), NULL);
|
||||||
|
|
||||||
|
return NM_WIFI_P2P_PEER_GET_PRIVATE (peer)->model_number;
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
nm_wifi_p2p_peer_set_model_number (NMWifiP2PPeer *peer, const char *model_number)
|
||||||
|
{
|
||||||
|
NMWifiP2PPeerPrivate *priv = NM_WIFI_P2P_PEER_GET_PRIVATE (peer);
|
||||||
|
g_return_val_if_fail (NM_IS_WIFI_P2P_PEER (peer), FALSE);
|
||||||
|
|
||||||
|
if (g_strcmp0 (model_number, priv->model_number) == 0)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
g_clear_pointer (&priv->model_number, g_free);
|
||||||
|
if (model_number)
|
||||||
|
priv->model_number = g_strdup (model_number);
|
||||||
|
|
||||||
|
_notify (peer, PROP_MODEL_NUMBER);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *
|
||||||
|
nm_wifi_p2p_peer_get_serial (const NMWifiP2PPeer *peer)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (NM_IS_WIFI_P2P_PEER (peer), NULL);
|
||||||
|
|
||||||
|
return NM_WIFI_P2P_PEER_GET_PRIVATE (peer)->serial;
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
nm_wifi_p2p_peer_set_serial (NMWifiP2PPeer *peer, const char *serial)
|
||||||
|
{
|
||||||
|
NMWifiP2PPeerPrivate *priv = NM_WIFI_P2P_PEER_GET_PRIVATE (peer);
|
||||||
|
g_return_val_if_fail (NM_IS_WIFI_P2P_PEER (peer), FALSE);
|
||||||
|
|
||||||
|
if (g_strcmp0 (serial, priv->serial) == 0)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
g_clear_pointer (&priv->serial, g_free);
|
||||||
|
if (serial)
|
||||||
|
priv->serial = g_strdup (serial);
|
||||||
|
|
||||||
|
_notify (peer, PROP_SERIAL);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
GBytes *
|
||||||
|
nm_wifi_p2p_peer_get_wfd_ies (const NMWifiP2PPeer *peer)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (NM_IS_WIFI_P2P_PEER (peer), NULL);
|
||||||
|
|
||||||
|
return NM_WIFI_P2P_PEER_GET_PRIVATE (peer)->wfd_ies;
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
nm_wifi_p2p_peer_set_wfd_ies (NMWifiP2PPeer *peer, GBytes *wfd_ies)
|
||||||
|
{
|
||||||
|
NMWifiP2PPeerPrivate *priv;
|
||||||
|
|
||||||
|
g_return_val_if_fail (NM_IS_WIFI_P2P_PEER (peer), FALSE);
|
||||||
|
|
||||||
|
priv = NM_WIFI_P2P_PEER_GET_PRIVATE (peer);
|
||||||
|
|
||||||
|
if (nm_gbytes_equal0 (priv->wfd_ies, wfd_ies))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
g_bytes_unref (priv->wfd_ies);
|
||||||
|
priv->wfd_ies = wfd_ies ? g_bytes_ref (wfd_ies) : NULL;
|
||||||
|
|
||||||
|
_notify (peer, PROP_WFD_IES);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *const*
|
||||||
|
nm_wifi_p2p_peer_get_groups (const NMWifiP2PPeer *peer)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (NM_IS_WIFI_P2P_PEER (peer), NULL);
|
||||||
|
|
||||||
|
return (const char * const*) NM_WIFI_P2P_PEER_GET_PRIVATE (peer)->groups;
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
nm_wifi_p2p_peer_set_groups (NMWifiP2PPeer *peer, const char** groups)
|
||||||
|
{
|
||||||
|
NMWifiP2PPeerPrivate *priv;
|
||||||
|
|
||||||
|
g_return_val_if_fail (NM_IS_WIFI_P2P_PEER (peer), FALSE);
|
||||||
|
g_return_val_if_fail (groups != NULL, FALSE);
|
||||||
|
|
||||||
|
priv = NM_WIFI_P2P_PEER_GET_PRIVATE (peer);
|
||||||
|
|
||||||
|
if (_nm_utils_strv_equal (priv->groups, (char **) groups))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
g_strfreev (priv->groups);
|
||||||
|
priv->groups = g_strdupv ((char**) groups);
|
||||||
|
|
||||||
|
_notify (peer, PROP_GROUPS);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *
|
||||||
|
nm_wifi_p2p_peer_get_address (const NMWifiP2PPeer *peer)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (NM_IS_WIFI_P2P_PEER (peer), NULL);
|
||||||
|
|
||||||
|
return NM_WIFI_P2P_PEER_GET_PRIVATE (peer)->address;
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
nm_wifi_p2p_peer_set_address_bin (NMWifiP2PPeer *peer, const guint8 addr[static ETH_ALEN])
|
||||||
|
{
|
||||||
|
NMWifiP2PPeerPrivate *priv = NM_WIFI_P2P_PEER_GET_PRIVATE (peer);
|
||||||
|
|
||||||
|
if ( priv->address
|
||||||
|
&& nm_utils_hwaddr_matches (addr, ETH_ALEN, priv->address, -1))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
g_free (priv->address);
|
||||||
|
priv->address = nm_utils_hwaddr_ntoa (addr, ETH_ALEN);
|
||||||
|
_notify (peer, PROP_HW_ADDRESS);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
nm_wifi_p2p_peer_set_address (NMWifiP2PPeer *peer, const char *addr)
|
||||||
|
{
|
||||||
|
guint8 addr_buf[ETH_ALEN];
|
||||||
|
|
||||||
|
g_return_val_if_fail (NM_IS_WIFI_P2P_PEER (peer), FALSE);
|
||||||
|
|
||||||
|
if ( !addr
|
||||||
|
|| !nm_utils_hwaddr_aton (addr, addr_buf, sizeof (addr_buf)))
|
||||||
|
g_return_val_if_reached (FALSE);
|
||||||
|
|
||||||
|
return nm_wifi_p2p_peer_set_address_bin (peer, addr_buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
gint8
|
||||||
|
nm_wifi_p2p_peer_get_strength (NMWifiP2PPeer *peer)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (NM_IS_WIFI_P2P_PEER (peer), 0);
|
||||||
|
|
||||||
|
return NM_WIFI_P2P_PEER_GET_PRIVATE (peer)->strength;
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
nm_wifi_p2p_peer_set_strength (NMWifiP2PPeer *peer, const gint8 strength)
|
||||||
|
{
|
||||||
|
NMWifiP2PPeerPrivate *priv;
|
||||||
|
|
||||||
|
g_return_val_if_fail (NM_IS_WIFI_P2P_PEER (peer), FALSE);
|
||||||
|
|
||||||
|
priv = NM_WIFI_P2P_PEER_GET_PRIVATE (peer);
|
||||||
|
|
||||||
|
if (priv->strength != strength) {
|
||||||
|
priv->strength = strength;
|
||||||
|
_notify (peer, PROP_STRENGTH);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
NM80211ApFlags
|
||||||
|
nm_wifi_p2p_peer_get_flags (const NMWifiP2PPeer *peer)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (NM_IS_WIFI_P2P_PEER (peer), NM_802_11_AP_FLAGS_NONE);
|
||||||
|
|
||||||
|
return NM_WIFI_P2P_PEER_GET_PRIVATE (peer)->flags;
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
nm_wifi_p2p_peer_set_last_seen (NMWifiP2PPeer *peer, gint32 last_seen)
|
||||||
|
{
|
||||||
|
NMWifiP2PPeerPrivate *priv;
|
||||||
|
|
||||||
|
g_return_val_if_fail (NM_IS_WIFI_P2P_PEER (peer), FALSE);
|
||||||
|
|
||||||
|
priv = NM_WIFI_P2P_PEER_GET_PRIVATE (peer);
|
||||||
|
|
||||||
|
if (priv->last_seen != last_seen) {
|
||||||
|
priv->last_seen = last_seen;
|
||||||
|
_notify (peer, PROP_LAST_SEEN);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
nm_wifi_p2p_peer_update_from_properties (NMWifiP2PPeer *peer,
|
||||||
|
const char *supplicant_path,
|
||||||
|
GVariant *properties)
|
||||||
|
{
|
||||||
|
NMWifiP2PPeerPrivate *priv;
|
||||||
|
const guint8 *bytes;
|
||||||
|
GVariant *v;
|
||||||
|
gsize len;
|
||||||
|
const char *s;
|
||||||
|
const char **sv;
|
||||||
|
gint32 i32;
|
||||||
|
gboolean changed = FALSE;
|
||||||
|
|
||||||
|
g_return_val_if_fail (NM_IS_WIFI_P2P_PEER (peer), FALSE);
|
||||||
|
g_return_val_if_fail (properties, FALSE);
|
||||||
|
|
||||||
|
priv = NM_WIFI_P2P_PEER_GET_PRIVATE (peer);
|
||||||
|
|
||||||
|
g_object_freeze_notify (G_OBJECT (peer));
|
||||||
|
|
||||||
|
if (g_variant_lookup (properties, "level", "i", &i32))
|
||||||
|
changed |= nm_wifi_p2p_peer_set_strength (peer, nm_wifi_utils_level_to_quality (i32));
|
||||||
|
|
||||||
|
if (g_variant_lookup (properties, "DeviceName", "&s", &s))
|
||||||
|
changed |= nm_wifi_p2p_peer_set_name (peer, s);
|
||||||
|
|
||||||
|
if (g_variant_lookup (properties, "Manufacturer", "&s", &s))
|
||||||
|
changed |= nm_wifi_p2p_peer_set_manufacturer (peer, s);
|
||||||
|
|
||||||
|
if (g_variant_lookup (properties, "Model", "&s", &s))
|
||||||
|
changed |= nm_wifi_p2p_peer_set_model (peer, s);
|
||||||
|
|
||||||
|
if (g_variant_lookup (properties, "ModelNumber", "&s", &s))
|
||||||
|
changed |= nm_wifi_p2p_peer_set_model_number (peer, s);
|
||||||
|
|
||||||
|
if (g_variant_lookup (properties, "Serial", "&s", &s))
|
||||||
|
changed |= nm_wifi_p2p_peer_set_serial (peer, s);
|
||||||
|
|
||||||
|
v = g_variant_lookup_value (properties, "DeviceAddress", G_VARIANT_TYPE_BYTESTRING);
|
||||||
|
if (v) {
|
||||||
|
bytes = g_variant_get_fixed_array (v, &len, 1);
|
||||||
|
if ( len == ETH_ALEN
|
||||||
|
&& memcmp (bytes, nm_ip_addr_zero.addr_eth, ETH_ALEN) != 0
|
||||||
|
&& memcmp (bytes, (char[ETH_ALEN]) { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }, ETH_ALEN) != 0)
|
||||||
|
changed |= nm_wifi_p2p_peer_set_address_bin (peer, bytes);
|
||||||
|
g_variant_unref (v);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* The IEs property contains the WFD R1 subelements */
|
||||||
|
v = g_variant_lookup_value (properties, "IEs", G_VARIANT_TYPE_BYTESTRING);
|
||||||
|
if (v) {
|
||||||
|
gs_unref_bytes GBytes *b = NULL;
|
||||||
|
|
||||||
|
bytes = g_variant_get_fixed_array (v, &len, 1);
|
||||||
|
b = g_bytes_new (bytes, len);
|
||||||
|
changed |= nm_wifi_p2p_peer_set_wfd_ies (peer, b);
|
||||||
|
g_variant_unref (v);
|
||||||
|
}
|
||||||
|
|
||||||
|
v = g_variant_lookup_value (properties, "Groups", G_VARIANT_TYPE_OBJECT_PATH_ARRAY);
|
||||||
|
if (v) {
|
||||||
|
sv = g_variant_get_objv (v, NULL);
|
||||||
|
changed |= nm_wifi_p2p_peer_set_groups (peer, sv);
|
||||||
|
g_free (sv);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*if (max_rate)
|
||||||
|
changed |= nm_wifi_p2p_peer_set_max_bitrate (peer, max_rate / 1000);*/
|
||||||
|
|
||||||
|
if (!priv->supplicant_path) {
|
||||||
|
priv->supplicant_path = g_strdup (supplicant_path);
|
||||||
|
changed = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
changed |= nm_wifi_p2p_peer_set_last_seen (peer, nm_utils_get_monotonic_timestamp_s ());
|
||||||
|
|
||||||
|
g_object_thaw_notify (G_OBJECT (peer));
|
||||||
|
|
||||||
|
return changed;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *
|
||||||
|
nm_wifi_p2p_peer_to_string (const NMWifiP2PPeer *self,
|
||||||
|
char *str_buf,
|
||||||
|
gsize buf_len,
|
||||||
|
gint32 now_s)
|
||||||
|
{
|
||||||
|
const NMWifiP2PPeerPrivate *priv;
|
||||||
|
const char *supplicant_id = "-";
|
||||||
|
const char* export_path;
|
||||||
|
|
||||||
|
g_return_val_if_fail (NM_IS_WIFI_P2P_PEER (self), NULL);
|
||||||
|
|
||||||
|
priv = NM_WIFI_P2P_PEER_GET_PRIVATE (self);
|
||||||
|
|
||||||
|
if (priv->supplicant_path)
|
||||||
|
supplicant_id = strrchr (priv->supplicant_path, '/') ?: supplicant_id;
|
||||||
|
|
||||||
|
export_path = nm_dbus_object_get_path (NM_DBUS_OBJECT (self));
|
||||||
|
if (export_path)
|
||||||
|
export_path = strrchr (export_path, '/') ?: export_path;
|
||||||
|
else
|
||||||
|
export_path = "/";
|
||||||
|
|
||||||
|
g_snprintf (str_buf, buf_len,
|
||||||
|
"%17s [n:%s, m:%s, mod:%s, mod_num:%s, ser:%s] %3us sup:%s [nm:%s]",
|
||||||
|
priv->address ?: "(none)",
|
||||||
|
priv->name,
|
||||||
|
priv->manufacturer,
|
||||||
|
priv->model,
|
||||||
|
priv->model_number,
|
||||||
|
priv->serial,
|
||||||
|
priv->last_seen > 0 ? ((now_s > 0 ? now_s : nm_utils_get_monotonic_timestamp_s ()) - priv->last_seen) : -1,
|
||||||
|
supplicant_id,
|
||||||
|
export_path);
|
||||||
|
|
||||||
|
return str_buf;
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
nm_wifi_p2p_peer_check_compatible (NMWifiP2PPeer *self,
|
||||||
|
NMConnection *connection)
|
||||||
|
{
|
||||||
|
NMWifiP2PPeerPrivate *priv;
|
||||||
|
NMSettingP2PWireless *s_p2p_wireless;
|
||||||
|
const char *hwaddr;
|
||||||
|
|
||||||
|
g_return_val_if_fail (NM_IS_WIFI_P2P_PEER (self), FALSE);
|
||||||
|
g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE);
|
||||||
|
|
||||||
|
priv = NM_WIFI_P2P_PEER_GET_PRIVATE (self);
|
||||||
|
|
||||||
|
s_p2p_wireless = NM_SETTING_P2P_WIRELESS (nm_connection_get_setting (connection, NM_TYPE_SETTING_P2P_WIRELESS));
|
||||||
|
if (s_p2p_wireless == NULL)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
hwaddr = nm_setting_p2p_wireless_get_peer (s_p2p_wireless);
|
||||||
|
if ( hwaddr
|
||||||
|
&& ( !priv->address
|
||||||
|
|| !nm_utils_hwaddr_matches (hwaddr, -1, priv->address, -1)))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void
|
||||||
|
get_property (GObject *object, guint prop_id,
|
||||||
|
GValue *value, GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
NMWifiP2PPeer *self = NM_WIFI_P2P_PEER (object);
|
||||||
|
NMWifiP2PPeerPrivate *priv = NM_WIFI_P2P_PEER_GET_PRIVATE (self);
|
||||||
|
|
||||||
|
switch (prop_id) {
|
||||||
|
case PROP_FLAGS:
|
||||||
|
g_value_set_uint (value, priv->flags);
|
||||||
|
break;
|
||||||
|
case PROP_NAME:
|
||||||
|
g_value_set_string (value, priv->name);
|
||||||
|
break;
|
||||||
|
case PROP_MANUFACTURER:
|
||||||
|
g_value_set_string (value, priv->manufacturer);
|
||||||
|
break;
|
||||||
|
case PROP_MODEL:
|
||||||
|
g_value_set_string (value, priv->model);
|
||||||
|
break;
|
||||||
|
case PROP_MODEL_NUMBER:
|
||||||
|
g_value_set_string (value, priv->model_number);
|
||||||
|
break;
|
||||||
|
case PROP_SERIAL:
|
||||||
|
g_value_set_string (value, priv->serial);
|
||||||
|
break;
|
||||||
|
case PROP_WFD_IES:
|
||||||
|
g_value_take_variant (value, nm_utils_gbytes_to_variant_ay (priv->wfd_ies));
|
||||||
|
break;
|
||||||
|
case PROP_GROUPS:
|
||||||
|
g_value_set_variant (value,
|
||||||
|
g_variant_new_strv ( (const char*const*) priv->groups
|
||||||
|
?: NM_PTRARRAY_EMPTY (const char *),
|
||||||
|
-1));
|
||||||
|
break;
|
||||||
|
case PROP_HW_ADDRESS:
|
||||||
|
g_value_set_string (value, priv->address);
|
||||||
|
break;
|
||||||
|
case PROP_STRENGTH:
|
||||||
|
g_value_set_uchar (value, priv->strength);
|
||||||
|
break;
|
||||||
|
case PROP_LAST_SEEN:
|
||||||
|
g_value_set_int (value,
|
||||||
|
priv->last_seen > 0
|
||||||
|
? (int) nm_utils_monotonic_timestamp_as_boottime (priv->last_seen, NM_UTILS_NS_PER_SECOND)
|
||||||
|
: -1);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void
|
||||||
|
nm_wifi_p2p_peer_init (NMWifiP2PPeer *self)
|
||||||
|
{
|
||||||
|
NMWifiP2PPeerPrivate *priv;
|
||||||
|
|
||||||
|
priv = G_TYPE_INSTANCE_GET_PRIVATE (self, NM_TYPE_WIFI_P2P_PEER, NMWifiP2PPeerPrivate);
|
||||||
|
|
||||||
|
self->_priv = priv;
|
||||||
|
|
||||||
|
c_list_init (&self->peers_lst);
|
||||||
|
|
||||||
|
priv->flags = NM_802_11_AP_FLAGS_NONE;
|
||||||
|
priv->last_seen = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
NMWifiP2PPeer *
|
||||||
|
nm_wifi_p2p_peer_new_from_properties (const char *supplicant_path, GVariant *properties)
|
||||||
|
{
|
||||||
|
NMWifiP2PPeer *peer;
|
||||||
|
|
||||||
|
g_return_val_if_fail (supplicant_path != NULL, NULL);
|
||||||
|
g_return_val_if_fail (properties != NULL, NULL);
|
||||||
|
|
||||||
|
peer = (NMWifiP2PPeer *) g_object_new (NM_TYPE_WIFI_P2P_PEER, NULL);
|
||||||
|
nm_wifi_p2p_peer_update_from_properties (peer, supplicant_path, properties);
|
||||||
|
|
||||||
|
/* ignore peers with invalid or missing address */
|
||||||
|
if (!nm_wifi_p2p_peer_get_address (peer)) {
|
||||||
|
g_object_unref (peer);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return peer;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
finalize (GObject *object)
|
||||||
|
{
|
||||||
|
NMWifiP2PPeer *self = NM_WIFI_P2P_PEER (object);
|
||||||
|
NMWifiP2PPeerPrivate *priv = NM_WIFI_P2P_PEER_GET_PRIVATE (self);
|
||||||
|
|
||||||
|
nm_assert (!self->wifi_device);
|
||||||
|
nm_assert (c_list_is_empty (&self->peers_lst));
|
||||||
|
|
||||||
|
g_free (priv->supplicant_path);
|
||||||
|
g_free (priv->name);
|
||||||
|
g_free (priv->manufacturer);
|
||||||
|
g_free (priv->model);
|
||||||
|
g_free (priv->model_number);
|
||||||
|
g_free (priv->serial);
|
||||||
|
g_free (priv->address);
|
||||||
|
g_bytes_unref (priv->wfd_ies);
|
||||||
|
g_strfreev (priv->groups);
|
||||||
|
|
||||||
|
G_OBJECT_CLASS (nm_wifi_p2p_peer_parent_class)->finalize (object);
|
||||||
|
}
|
||||||
|
|
||||||
|
static const NMDBusInterfaceInfoExtended interface_info_p2p_peer = {
|
||||||
|
.parent = NM_DEFINE_GDBUS_INTERFACE_INFO_INIT (
|
||||||
|
NM_DBUS_INTERFACE_P2P_PEER,
|
||||||
|
.properties = NM_DEFINE_GDBUS_PROPERTY_INFOS (
|
||||||
|
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE ("Flags", "u", NM_WIFI_P2P_PEER_FLAGS),
|
||||||
|
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE ("Name", "s", NM_WIFI_P2P_PEER_NAME),
|
||||||
|
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE ("Manufacturer", "s", NM_WIFI_P2P_PEER_MANUFACTURER),
|
||||||
|
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE ("Model", "s", NM_WIFI_P2P_PEER_MODEL),
|
||||||
|
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE ("ModelNumber", "s", NM_WIFI_P2P_PEER_MODEL_NUMBER),
|
||||||
|
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE ("Serial", "s", NM_WIFI_P2P_PEER_SERIAL),
|
||||||
|
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE ("WfdIEs", "ay", NM_WIFI_P2P_PEER_WFD_IES),
|
||||||
|
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE ("Groups", "as", NM_WIFI_P2P_PEER_GROUPS),
|
||||||
|
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE ("HwAddress", "s", NM_WIFI_P2P_PEER_HW_ADDRESS),
|
||||||
|
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE ("Strength", "y", NM_WIFI_P2P_PEER_STRENGTH),
|
||||||
|
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE ("LastSeen", "i", NM_WIFI_P2P_PEER_LAST_SEEN),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
.legacy_property_changed = FALSE,
|
||||||
|
};
|
||||||
|
|
||||||
|
static void
|
||||||
|
nm_wifi_p2p_peer_class_init (NMWifiP2PPeerClass *p2p_peer_class)
|
||||||
|
{
|
||||||
|
GObjectClass *object_class = G_OBJECT_CLASS (p2p_peer_class);
|
||||||
|
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS (p2p_peer_class);
|
||||||
|
|
||||||
|
g_type_class_add_private (object_class, sizeof (NMWifiP2PPeerPrivate));
|
||||||
|
|
||||||
|
dbus_object_class->export_path = NM_DBUS_EXPORT_PATH_NUMBERED (NM_DBUS_PATH_P2P_PEER);
|
||||||
|
dbus_object_class->interface_infos = NM_DBUS_INTERFACE_INFOS (&interface_info_p2p_peer);
|
||||||
|
|
||||||
|
object_class->get_property = get_property;
|
||||||
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
|
obj_properties[PROP_FLAGS] =
|
||||||
|
g_param_spec_uint (NM_WIFI_P2P_PEER_FLAGS, "", "",
|
||||||
|
NM_802_11_AP_FLAGS_NONE,
|
||||||
|
NM_802_11_AP_FLAGS_PRIVACY,
|
||||||
|
NM_802_11_AP_FLAGS_NONE,
|
||||||
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
|
obj_properties[PROP_NAME] =
|
||||||
|
g_param_spec_string (NM_WIFI_P2P_PEER_NAME, "", "",
|
||||||
|
NULL,
|
||||||
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
|
obj_properties[PROP_MANUFACTURER] =
|
||||||
|
g_param_spec_string (NM_WIFI_P2P_PEER_MANUFACTURER, "", "",
|
||||||
|
NULL,
|
||||||
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
|
obj_properties[PROP_MODEL] =
|
||||||
|
g_param_spec_string (NM_WIFI_P2P_PEER_MODEL, "", "",
|
||||||
|
NULL,
|
||||||
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
|
obj_properties[PROP_MODEL_NUMBER] =
|
||||||
|
g_param_spec_string (NM_WIFI_P2P_PEER_MODEL_NUMBER, "", "",
|
||||||
|
NULL,
|
||||||
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
|
obj_properties[PROP_SERIAL] =
|
||||||
|
g_param_spec_string (NM_WIFI_P2P_PEER_SERIAL, "", "",
|
||||||
|
NULL,
|
||||||
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
|
obj_properties[PROP_WFD_IES] =
|
||||||
|
g_param_spec_variant (NM_WIFI_P2P_PEER_WFD_IES, "", "",
|
||||||
|
G_VARIANT_TYPE ("ay"),
|
||||||
|
NULL,
|
||||||
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
|
obj_properties[PROP_GROUPS] =
|
||||||
|
g_param_spec_variant (NM_WIFI_P2P_PEER_GROUPS, "", "",
|
||||||
|
G_VARIANT_TYPE ("as"),
|
||||||
|
NULL,
|
||||||
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
|
obj_properties[PROP_HW_ADDRESS] =
|
||||||
|
g_param_spec_string (NM_WIFI_P2P_PEER_HW_ADDRESS, "", "",
|
||||||
|
NULL,
|
||||||
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
|
obj_properties[PROP_STRENGTH] =
|
||||||
|
g_param_spec_uchar (NM_WIFI_P2P_PEER_STRENGTH, "", "",
|
||||||
|
0, G_MAXINT8, 0,
|
||||||
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
|
obj_properties[PROP_LAST_SEEN] =
|
||||||
|
g_param_spec_int (NM_WIFI_P2P_PEER_LAST_SEEN, "", "",
|
||||||
|
-1, G_MAXINT, -1,
|
||||||
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
|
g_object_class_install_properties (object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
const char **
|
||||||
|
nm_wifi_p2p_peers_get_paths (const CList *peers_lst_head)
|
||||||
|
{
|
||||||
|
NMWifiP2PPeer *peer;
|
||||||
|
const char **list;
|
||||||
|
const char *path;
|
||||||
|
gsize i, n;
|
||||||
|
|
||||||
|
n = c_list_length (peers_lst_head);
|
||||||
|
list = g_new (const char *, n + 1);
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
if (n > 0) {
|
||||||
|
c_list_for_each_entry (peer, peers_lst_head, peers_lst) {
|
||||||
|
nm_assert (i < n);
|
||||||
|
path = nm_dbus_object_get_path (NM_DBUS_OBJECT (peer));
|
||||||
|
nm_assert (path);
|
||||||
|
|
||||||
|
list[i++] = path;
|
||||||
|
}
|
||||||
|
nm_assert (i <= n);
|
||||||
|
}
|
||||||
|
list[i] = NULL;
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
NMWifiP2PPeer *
|
||||||
|
nm_wifi_p2p_peers_find_first_compatible (const CList *peers_lst_head,
|
||||||
|
NMConnection *connection)
|
||||||
|
{
|
||||||
|
NMWifiP2PPeer *peer;
|
||||||
|
|
||||||
|
g_return_val_if_fail (connection, NULL);
|
||||||
|
|
||||||
|
c_list_for_each_entry (peer, peers_lst_head, peers_lst) {
|
||||||
|
if (nm_wifi_p2p_peer_check_compatible (peer, connection))
|
||||||
|
return peer;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
NMWifiP2PPeer *
|
||||||
|
nm_wifi_p2p_peers_find_by_supplicant_path (const CList *peers_lst_head, const char *path)
|
||||||
|
{
|
||||||
|
NMWifiP2PPeer *peer;
|
||||||
|
|
||||||
|
g_return_val_if_fail (path != NULL, NULL);
|
||||||
|
|
||||||
|
c_list_for_each_entry (peer, peers_lst_head, peers_lst) {
|
||||||
|
if (nm_streq0 (path, nm_wifi_p2p_peer_get_supplicant_path (peer)))
|
||||||
|
return peer;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
NMWifiP2PPeer *
|
||||||
|
nm_wifi_p2p_peer_lookup_for_device (NMDevice *device, const char *exported_path)
|
||||||
|
{
|
||||||
|
NMWifiP2PPeer *peer;
|
||||||
|
|
||||||
|
g_return_val_if_fail (NM_IS_DEVICE (device), NULL);
|
||||||
|
|
||||||
|
peer = (NMWifiP2PPeer *) nm_dbus_manager_lookup_object (nm_dbus_object_get_manager (NM_DBUS_OBJECT (device)),
|
||||||
|
exported_path);
|
||||||
|
if ( !peer
|
||||||
|
|| !NM_IS_WIFI_P2P_PEER (peer)
|
||||||
|
|| peer->wifi_device != device)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
return peer;
|
||||||
|
}
|
114
src/devices/wifi/nm-wifi-p2p-peer.h
Normal file
114
src/devices/wifi/nm-wifi-p2p-peer.h
Normal file
|
@ -0,0 +1,114 @@
|
||||||
|
/* NetworkManager -- P2P Wi-Fi Peer
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the
|
||||||
|
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
|
* Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2018 Red Hat, Inc.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __NM_WIFI_P2P_PEER_H__
|
||||||
|
#define __NM_WIFI_P2P_PEER_H__
|
||||||
|
|
||||||
|
#include "nm-dbus-object.h"
|
||||||
|
#include "nm-dbus-interface.h"
|
||||||
|
#include "nm-connection.h"
|
||||||
|
|
||||||
|
#define NM_TYPE_WIFI_P2P_PEER (nm_wifi_p2p_peer_get_type ())
|
||||||
|
#define NM_WIFI_P2P_PEER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_WIFI_P2P_PEER, NMWifiP2PPeer))
|
||||||
|
#define NM_WIFI_P2P_PEER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_WIFI_P2P_PEER, NMWifiP2PPeerClass))
|
||||||
|
#define NM_IS_WIFI_P2P_PEER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_WIFI_P2P_PEER))
|
||||||
|
#define NM_IS_WIFI_P2P_PEER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_WIFI_P2P_PEER))
|
||||||
|
#define NM_WIFI_P2P_PEER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_WIFI_P2P_PEER, NMWifiP2PPeerClass))
|
||||||
|
|
||||||
|
#define NM_WIFI_P2P_PEER_FLAGS "flags"
|
||||||
|
#define NM_WIFI_P2P_PEER_NAME "name"
|
||||||
|
#define NM_WIFI_P2P_PEER_MANUFACTURER "manufacturer"
|
||||||
|
#define NM_WIFI_P2P_PEER_MODEL "model"
|
||||||
|
#define NM_WIFI_P2P_PEER_MODEL_NUMBER "model-number"
|
||||||
|
#define NM_WIFI_P2P_PEER_SERIAL "serial"
|
||||||
|
#define NM_WIFI_P2P_PEER_WFD_IES "wfd-ies"
|
||||||
|
#define NM_WIFI_P2P_PEER_GROUPS "groups"
|
||||||
|
#define NM_WIFI_P2P_PEER_HW_ADDRESS "hw-address"
|
||||||
|
#define NM_WIFI_P2P_PEER_STRENGTH "strength"
|
||||||
|
#define NM_WIFI_P2P_PEER_LAST_SEEN "last-seen"
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
NMDBusObject parent;
|
||||||
|
NMDevice *wifi_device;
|
||||||
|
CList peers_lst;
|
||||||
|
struct _NMWifiP2PPeerPrivate *_priv;
|
||||||
|
} NMWifiP2PPeer;
|
||||||
|
|
||||||
|
typedef struct _NMWifiP2PPeerClass NMWifiP2PPeerClass;
|
||||||
|
|
||||||
|
GType nm_wifi_p2p_peer_get_type (void);
|
||||||
|
|
||||||
|
NMWifiP2PPeer * nm_wifi_p2p_peer_new_from_properties (const char *supplicant_path,
|
||||||
|
GVariant *properties);
|
||||||
|
|
||||||
|
gboolean nm_wifi_p2p_peer_update_from_properties (NMWifiP2PPeer *peer,
|
||||||
|
const char *supplicant_path,
|
||||||
|
GVariant *properties);
|
||||||
|
|
||||||
|
gboolean nm_wifi_p2p_peer_check_compatible (NMWifiP2PPeer *self,
|
||||||
|
NMConnection *connection);
|
||||||
|
|
||||||
|
const char * nm_wifi_p2p_peer_get_supplicant_path (NMWifiP2PPeer *peer);
|
||||||
|
|
||||||
|
const char * nm_wifi_p2p_peer_get_name (const NMWifiP2PPeer *peer);
|
||||||
|
gboolean nm_wifi_p2p_peer_set_name (NMWifiP2PPeer *peer,
|
||||||
|
const char *name);
|
||||||
|
const char * nm_wifi_p2p_peer_get_manufacturer (const NMWifiP2PPeer *peer);
|
||||||
|
gboolean nm_wifi_p2p_peer_set_manufacturer (NMWifiP2PPeer *peer,
|
||||||
|
const char *manufacturer);
|
||||||
|
const char * nm_wifi_p2p_peer_get_model (const NMWifiP2PPeer *peer);
|
||||||
|
gboolean nm_wifi_p2p_peer_set_model (NMWifiP2PPeer *peer,
|
||||||
|
const char *model);
|
||||||
|
const char * nm_wifi_p2p_peer_get_model_number (const NMWifiP2PPeer *peer);
|
||||||
|
gboolean nm_wifi_p2p_peer_set_model_number (NMWifiP2PPeer *peer,
|
||||||
|
const char *number);
|
||||||
|
const char * nm_wifi_p2p_peer_get_serial (const NMWifiP2PPeer *peer);
|
||||||
|
gboolean nm_wifi_p2p_peer_set_serial (NMWifiP2PPeer *peer,
|
||||||
|
const char *serial);
|
||||||
|
|
||||||
|
GBytes * nm_wifi_p2p_peer_get_wfd_ies (const NMWifiP2PPeer *peer);
|
||||||
|
gboolean nm_wifi_p2p_peer_set_wfd_ies (NMWifiP2PPeer *peer,
|
||||||
|
GBytes *bytes);
|
||||||
|
|
||||||
|
const char *const*nm_wifi_p2p_peer_get_groups (const NMWifiP2PPeer *peer);
|
||||||
|
|
||||||
|
const char * nm_wifi_p2p_peer_get_address (const NMWifiP2PPeer *peer);
|
||||||
|
gboolean nm_wifi_p2p_peer_set_address (NMWifiP2PPeer *peer,
|
||||||
|
const char *addr);
|
||||||
|
gint8 nm_wifi_p2p_peer_get_strength (NMWifiP2PPeer *peer);
|
||||||
|
gboolean nm_wifi_p2p_peer_set_strength (NMWifiP2PPeer *peer,
|
||||||
|
gint8 strength);
|
||||||
|
NM80211ApFlags nm_wifi_p2p_peer_get_flags (const NMWifiP2PPeer *self);
|
||||||
|
|
||||||
|
const char *nm_wifi_p2p_peer_to_string (const NMWifiP2PPeer *self,
|
||||||
|
char *str_buf,
|
||||||
|
gsize buf_len,
|
||||||
|
gint32 now_s);
|
||||||
|
|
||||||
|
const char **nm_wifi_p2p_peers_get_paths (const CList *peers_lst_head);
|
||||||
|
|
||||||
|
NMWifiP2PPeer *nm_wifi_p2p_peers_find_first_compatible (const CList *peers_lst_head,
|
||||||
|
NMConnection *connection);
|
||||||
|
|
||||||
|
NMWifiP2PPeer *nm_wifi_p2p_peers_find_by_supplicant_path (const CList *peers_lst_head, const char *path);
|
||||||
|
|
||||||
|
NMWifiP2PPeer *nm_wifi_p2p_peer_lookup_for_device (NMDevice *device, const char *exported_path);
|
||||||
|
|
||||||
|
#endif /* __NM_WIFI_P2P_PEER_H__ */
|
|
@ -152,6 +152,7 @@ typedef enum {
|
||||||
NM_LINK_TYPE_WIMAX,
|
NM_LINK_TYPE_WIMAX,
|
||||||
NM_LINK_TYPE_WPAN,
|
NM_LINK_TYPE_WPAN,
|
||||||
NM_LINK_TYPE_6LOWPAN,
|
NM_LINK_TYPE_6LOWPAN,
|
||||||
|
NM_LINK_TYPE_P2P_WIFI,
|
||||||
|
|
||||||
/* Software types */
|
/* Software types */
|
||||||
NM_LINK_TYPE_BNEP = 0x10000, /* Bluetooth Ethernet emulation */
|
NM_LINK_TYPE_BNEP = 0x10000, /* Bluetooth Ethernet emulation */
|
||||||
|
|
|
@ -84,6 +84,8 @@
|
||||||
send_interface="org.freedesktop.NetworkManager.WiMax.Nsp"/>
|
send_interface="org.freedesktop.NetworkManager.WiMax.Nsp"/>
|
||||||
<allow send_destination="org.freedesktop.NetworkManager"
|
<allow send_destination="org.freedesktop.NetworkManager"
|
||||||
send_interface="org.freedesktop.NetworkManager.AccessPoint"/>
|
send_interface="org.freedesktop.NetworkManager.AccessPoint"/>
|
||||||
|
<allow send_destination="org.freedesktop.NetworkManager"
|
||||||
|
send_interface="org.freedesktop.NetworkManager.P2PPeer"/>
|
||||||
|
|
||||||
<!-- Devices (read-only, no security required) -->
|
<!-- Devices (read-only, no security required) -->
|
||||||
<allow send_destination="org.freedesktop.NetworkManager"
|
<allow send_destination="org.freedesktop.NetworkManager"
|
||||||
|
@ -92,6 +94,8 @@
|
||||||
<!-- Devices (read/write, secured with PolicyKit) -->
|
<!-- Devices (read/write, secured with PolicyKit) -->
|
||||||
<allow send_destination="org.freedesktop.NetworkManager"
|
<allow send_destination="org.freedesktop.NetworkManager"
|
||||||
send_interface="org.freedesktop.NetworkManager.Device.Wireless"/>
|
send_interface="org.freedesktop.NetworkManager.Device.Wireless"/>
|
||||||
|
<allow send_destination="org.freedesktop.NetworkManager"
|
||||||
|
send_interface="org.freedesktop.NetworkManager.Device.P2PWireless"/>
|
||||||
<allow send_destination="org.freedesktop.NetworkManager"
|
<allow send_destination="org.freedesktop.NetworkManager"
|
||||||
send_interface="org.freedesktop.NetworkManager.Device"/>
|
send_interface="org.freedesktop.NetworkManager.Device"/>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue