summaryrefslogtreecommitdiff
path: root/src/devices/nm-device-generic.c
AgeCommit message (Collapse)AuthorFilesLines
2015-06-19device: add nm_device_get_type_description() functionThomas Haller1-0/+9
Add a function to get a concise representation of the device type. libnm already has nm_device_get_type_description() for that and it is shown by nmcli -f GENERAL.TYPE device show Reimplement that function for nm-core. Just take care that the two implementations don't diverge. (cherry picked from commit e9e9d44468de460afaa11865bae321145b78212e)
2015-06-17platform: add self argument to platform functionsThomas Haller1-2/+2
Most nm_platform_*() functions operate on the platform singleton nm_platform_get(). That made sense because the NMPlatform instance was mainly to hook fake platform for testing. While the implicit argument saved some typing, I think explicit is better. Especially, because NMPlatform could become a more usable object then just a hook for testing. With this change, NMPlatform instances can be used individually, not only as a singleton instance. Before this change, the constructor of NMLinuxPlatform could not call any nm_platform_*() functions because the singleton was not yet initialized. We could only instantiate an incomplete instance, register it via nm_platform_setup(), and then complete initialization via singleton->setup(). With this change, we can create and fully initialize NMPlatform instances before/without setting them up them as singleton. Also, currently there is no clear distinction between functions that operate on the NMPlatform instance, and functions that can be used stand-alone (e.g. nm_platform_ip4_address_to_string()). The latter can not be mocked for testing. With this change, the distinction becomes obvious. That is also useful because it becomes clearer which functions make use of the platform cache and which not. Inside nm-linux-platform.c, continue the pattern that the self instance is named @platform. That makes sense because its type is NMPlatform, and not NMLinuxPlatform what we would expect from a paramter named @self. This is a major diff that causes some pain when rebasing. Try to rebase to the parent commit of this commit as a first step. Then rebase on top of this commit using merge-strategy "ours". (cherry picked from commit c6529a9d748ad3c8ee37431d020a7b9223992a23)
2015-05-13device: use NMDeviceCapabilities enum for device capabilitiesThomas Haller1-1/+1
(cherry picked from commit 2117bef864c1820da337e2b491ba67f865955ec0)
2014-10-28libnm-core: add nm-core-types.h, remove cross-includesDan Winship1-1/+1
Add nm-core-types.h, typedefing all of the GObject types in libnm-core; this is needed so that nm-setting.h can reference NMConnection in addition to nm-connection.h referencing NMSetting. Removing the cross-includes from the various headers causes lots of fallout elsewhere. (In particular, nm-utils.h used to include nm-connection.h, which included every setting header, so any file that included nm-utils.h automatically got most of the rest of libnm-core without needing to pay attention to specifics.) Fix this up by including nm-core-internal.h from those files that are now missing includes.
2014-10-22devices: drop device-type-specific error domainsDan Winship1-15/+0
Most NMDevice types defined their own error domain but then never used it. A few did use their errors, but some of those errors are redundant with NMDeviceError, and others can be added to it.
2014-06-19all: remove remaining GParamSpec name/blurb stringsDan Winship1-4/+3
Remove all remaining GParamSpec name and blurb strings (and fix indentation while we're there), and add G_PARAM_STATIC_STRINGS to all paramspecs that were lacking it.
2014-05-30core: remove unused 'error' argument to check_connection_compatible()Dan Williams1-14/+4
Nothing uses the error, so simplify some code and save 5K (0.45%) in binary size.
2014-04-07core: convert unmanaged bits to flagsDan Williams1-1/+1
Instead of tracking unmanaged-ness in a couple variables (and because I'd like to add one for user-unmanaged later) let's do it in a single flags variable, and consolidate setting of the unmanaged states in one place.
2013-12-02core: updating a Generic setting should set the interface nameDan Williams1-0/+8
Generic connections need an interface name, and that can only be stored in the Connection setting.
2013-11-08core: implement update_connection() for Generic devicesDan Williams1-0/+10
tun/tap, macvlan, and GRE devices may be bridge, bond, or team slaves and should get that configuration detected at startup.
2013-11-06core: use carrier for determining when generic devices are availableDan Williams1-7/+0
2013-06-05devices: make constructors take an NMPlatformLinkDan Winship1-7/+3
Rather than passing UDI, ifname, and driver name to the device constructors as separate arguments, just pass the NMPlatformLink instead and let it parse them out. Virtual types still take UDI and ifname separately, since we create fake NMDevices for them for autoactivating connections. That's weird in other ways too though, so perhaps this should be revisted.
2013-05-20devices, platform: fix up carrier-detection detectionDan Winship1-0/+10
Some devices aren't expected to support carrier detection, so there's no reason to have NMDevice log about it. Move that message into NMDeviceEthernet, where failure to support carrier-detect really is worth mentioning. Also, make NMDeviceEthernet use NMPlatform for carrier-detection detection (and move the MII carrier-detect-support check from NMDeviceEthernet into NMLinuxPlatform). Finally, have NMDeviceGeneric actually check whether the device supports carrier detect, rather than just always assuming it doesn't.
2013-05-20core: clean up and simplify device capabilities handlingDan Williams1-7/+0
This is really, really old 2007-era code. Any NMDevice that gets created is already supported, so there's no reason to have every device set NM_DEVICE_CAP_NM_SUPPORTED. For those subclasses that only set that capability, we can remove the subclass method entirely. Next, it turns out that the "type capabilities" code wasn't used anywhere, so remove that too. Lastly, "cipsec" interfaces haven't been used on linux in about 5 years (they were created by the Cisco binary-only IPSec kernel module for Cisco VPNs long before vpnc and openswan came around) so we can remove that code too.
2013-05-20core: make nm-properties-changed-signal always export the right propertiesDan Winship1-16/+4
Change the way that nm-properties-changed-signal works, and parse the dbus-binding-tool-generated info to get the exact list of properties that it's expected to export. This makes NM_PROPERTY_PARAM_NO_EXPORT unnecessary, and also fixes the problem of properties like NMDevice:hw-address being exported on classes where it shouldn't be.
2013-05-08core: move devices into a subdirectoryDan Winship1-0/+229
We have lots of device types and will soon have lots more, so let's put them in their own directory.