summaryrefslogtreecommitdiff
path: root/libnm-core/nm-utils.c
Commit message (Collapse)AuthorAgeFilesLines
* libnm-core: add _nm_utils_hash_values_to_slist()Thomas Haller2014-08-221-0/+28
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* all: add nm-core-internal.h headerThomas Haller2014-08-221-19/+0
| | | | | | | | | | | | | | | | Add a header file to expose private utility functions from libnm-core that can be used by NetworkManager (core) and libnm.so. The header is also used to give privileged access to libnm-core. Since NM links statically, these functions are not exported and not part of public ABI. This also removes the NM_UTILS_PRIVATE_CALL() macro and libnm.so no longer exports nm_utils_get_private(). Before, this functionality was partly declared in nm-utils-private.h. This was wrong because nm-utils-private.h is for functionality entirely private to libnm-core. Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-core: clarify a comment about InfiniBand hardware address matchingDan Winship2014-08-201-2/+3
|
* libnm-core, etc: add nm_utils_hwaddr_matches()Dan Winship2014-08-071-0/+88
| | | | | | | Add nm_utils_hwaddr_matches(), for comparing hardware addresses for equality, allowing either binary or ASCII hardware addresses to be passed, and handling the special rules for InfiniBand hardware addresses automatically. Update code to use it.
* libnm-core: include ETH_ALEN/INFINIBAND_ALEN defines in nm-utils.hDan Winship2014-08-071-1/+0
| | | | | | | | Include <linux/if_ether.h> and <linux/if_infiniband.h> from nm-utils.h, to get ETH_ALEN and INFINIBAND_ALEN, and remove those includes (as well as <net/ethernet.h> and <netinet/ether.h>, and various headers that had been included to get the ARPHRD_* constants) from other files where they're not needed now.
* libnm-core: rewrite nm_utils_hwaddr_ntoa()Dan Winship2014-08-071-6/+6
| | | | | Rather than returning from the middle of the loop, just rearrange things so we can exit the loop like normal people.
* libnm-core, etc: drop type-based hwaddr funcs, port to length-based onesDan Winship2014-08-071-90/+52
| | | | | | | | | | Drop the arptype-based nm_utils_hwaddr funcs, and rename the length-based ones to no longer have _len in their names. This also switches nm_utils_hwaddr_atoba() to using a length rather than an arptype, and adds a length argument to nm_utils_hwaddr_valid() (making nm_utils_hwaddr_valid() now a replacement for nm_utils_hwaddr_aton() in some places, where we were only using aton() to do validity checking).
* libnm, libnm-utils: error out if mixed libnm/libnm-util symbols are detectedDan Winship2014-08-011-0/+13
| | | | | If a program accidentally ends up linking in both libnm and libnm-util (presumably via different dependencies), error out immediately.
* libnm: add NetworkManager.h, disallow including individual headersDan Winship2014-08-011-1/+0
| | | | | | | | | | Add NetworkManager.h, which includes all of the other NM header, and require all external users of libnm to use that rather than the individual headers. (An exception is made for nm-dbus-interface.h, nm-vpn-dbus-interface.h, and nm-version.h, which can be included separately.)
* libnm: remove Since tags and NM_AVAILABLE_IN_* attributesDan Winship2014-08-011-30/+0
| | | | Everything currently in libnm has always been there.
* libnm: remove all deprecated functions and typesDan Winship2014-08-011-62/+0
| | | | | | | Remove deprecated functions and enum types. For now, deprecated properties are still around, because removing them would cause warnings when talking to older implementations.
* libnm: add libnm/libnm-core (part 2)Dan Winship2014-08-011-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | This fixes up the code from the previous "clean" import, and adds build infrastructure. [There are two slightly orthogonal sets of changes in this patch. First, the files added in the previous commit were modified as followed: # Replace internal references to "libnm-util" and "libnm-glib" with "libnm" perl -pi -e 's/libnm-(util|glib)/libnm/;' libnm-core/*.[ch] libnm-core/tests/*.[ch] libnm/*.[ch] libnm/tests/*.[ch] # Fix includes of the enum-types files perl -pi -e 's/nm-utils-enum-types/nm-core-enum-types/;' libnm-core/*.[ch] libnm-core/tests/*.[ch] libnm/*.[ch] libnm/tests/*.[ch] perl -pi -e 's/nm-glib-enum-types/nm-enum-types/;' libnm/*.[ch] libnm/tests/*.[ch] # Fix some python example code perl -pi -e 's/import NMClient/import NM/;' -e 's/NMClient.Client\(\)/NM.Client()/;' libnm/nm-client.c Then, the build infrastructure was added (without further modifying any existing files in libnm-core or libnm.) Note: to regenerate libnm.ver after rebase: (head -2 libnm-util/libnm-util.ver; (grep -h '\s'nm_ libnm-util/libnm-util.ver libnm-glib/libnm-glib.ver | env LANG=C sort); tail -3 libnm-util/libnm-util.ver) > libnm/libnm.ver ]
* libnm: add libnm/libnm-core (part 1)Dan Winship2014-08-011-0/+2531
This commit begins creating the new "libnm", which will replace libnm-util and libnm-glib. The main reason for the libnm-util/libnm-glib split is that the daemon needs to link to libnm-util (to get NMSettings, NMConnection, etc), but can't link to libnm-glib (because it uses many of the same type names as the NetworkManager daemon. eg, NMDevice). So the daemon links to only libnm-util, but basically all clients link to both. With libnm, there will be only a single client-visible library, and NetworkManager will internally link against a private "libnm-core" containing the parts that used to be in libnm-util. (The "libnm-core" parts still need to be in their own directory so that the daemon can see those header files without also seeing the ones in libnm/ that conflict with its own headers.) [This commit just copies the source code from libnm-util/ to libnm-core/, and libnm-glib/ to libnm/: mkdir -p libnm-core/tests/ mkdir -p libnm/tests/ cp libnm-util/*.[ch] libnm-util/nm-version.h.in libnm-core/ rm -f libnm-core/nm-version.h libnm-core/nm-setting-template.[ch] libnm-core/nm-utils-enum-types.[ch] cp libnm-util/tests/*.[ch] libnm-core/tests/ cp libnm-glib/*.[ch] libnm/ rm -f libnm/libnm_glib.[ch] libnm/libnm-glib-test.c libnm/nm-glib-enum-types.[ch] cp libnm-glib/tests/*.[ch] libnm/tests/ ]