summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-04-06 18:36:57 +0200
committerThomas Haller <thaller@redhat.com>2015-04-09 17:45:59 +0200
commit7c5d361c6632236ac3eb6b929d42cd8854aba922 (patch)
treee2cf700c957aceef9a11bf6464b6686bde0baa48
parent850af91f22a2419fecd3ff277406f790525d7ce5 (diff)
downloadNetworkManager-7c5d361c6632236ac3eb6b929d42cd8854aba922.tar.gz
platform/trivial: rename object_type_from_nl_object() to _nlo_get_object_type()
The function names in linux-platform should get better prefixes indicating whether they are related to libnl or nm objects. Add a prefix _nlo_ for functions that operate on libnl objects.
-rw-r--r--src/platform/nm-linux-platform.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c
index e29c31fd06..e067f77fdd 100644
--- a/src/platform/nm-linux-platform.c
+++ b/src/platform/nm-linux-platform.c
@@ -332,7 +332,7 @@ nm_linux_platform_setup (void)
/******************************************************************/
static ObjectType
-object_type_from_nl_object (const struct nl_object *object)
+_nlo_get_object_type (const struct nl_object *object)
{
const char *type_str;
@@ -366,7 +366,7 @@ object_type_from_nl_object (const struct nl_object *object)
static void
_nl_link_family_unset (struct nl_object *obj, int *family)
{
- if (!obj || object_type_from_nl_object (obj) != OBJECT_TYPE_LINK)
+ if (!obj || _nlo_get_object_type (obj) != OBJECT_TYPE_LINK)
*family = AF_UNSPEC;
else {
*family = rtnl_link_get_family ((struct rtnl_link *) obj);
@@ -409,7 +409,7 @@ static struct nl_object *
get_kernel_object (struct nl_sock *sock, struct nl_object *needle)
{
struct nl_object *object = NULL;
- ObjectType type = object_type_from_nl_object (needle);
+ ObjectType type = _nlo_get_object_type (needle);
switch (type) {
case OBJECT_TYPE_LINK:
@@ -485,7 +485,7 @@ get_kernel_object (struct nl_sock *sock, struct nl_object *needle)
static int
add_kernel_object (struct nl_sock *sock, struct nl_object *object)
{
- switch (object_type_from_nl_object (object)) {
+ switch (_nlo_get_object_type (object)) {
case OBJECT_TYPE_LINK:
return rtnl_link_add (sock, (struct rtnl_link *) object, NLM_F_CREATE);
case OBJECT_TYPE_IP4_ADDRESS:
@@ -1432,7 +1432,7 @@ to_string_object_with_type (NMPlatform *platform, struct nl_object *obj, ObjectT
static const char *
to_string_object (NMPlatform *platform, struct nl_object *obj)
{
- return to_string_object_with_type (platform, obj, object_type_from_nl_object (obj));
+ return to_string_object_with_type (platform, obj, _nlo_get_object_type (obj));
}
#undef SET_AND_RETURN_STRING_BUFFER
@@ -1472,13 +1472,13 @@ choose_cache_by_type (NMPlatform *platform, ObjectType object_type)
static struct nl_cache *
choose_cache (NMPlatform *platform, struct nl_object *object)
{
- return choose_cache_by_type (platform, object_type_from_nl_object (object));
+ return choose_cache_by_type (platform, _nlo_get_object_type (object));
}
static gboolean
object_has_ifindex (struct nl_object *object, int ifindex)
{
- switch (object_type_from_nl_object (object)) {
+ switch (_nlo_get_object_type (object)) {
case OBJECT_TYPE_IP4_ADDRESS:
case OBJECT_TYPE_IP6_ADDRESS:
return ifindex == rtnl_addr_get_ifindex ((struct rtnl_addr *) object);
@@ -1526,7 +1526,7 @@ static void
announce_object (NMPlatform *platform, const struct nl_object *object, NMPlatformSignalChangeType change_type, NMPlatformReason reason)
{
NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (platform);
- ObjectType object_type = object_type_from_nl_object (object);
+ ObjectType object_type = _nlo_get_object_type (object);
const char *sig = signal_by_type_and_status[object_type];
switch (object_type) {
@@ -1695,7 +1695,7 @@ refresh_object (NMPlatform *platform, struct nl_object *object, gboolean removed
return FALSE;
/* Unsupported object types should never have reached the caches */
- type = object_type_from_nl_object (kernel_object);
+ type = _nlo_get_object_type (kernel_object);
g_assert (type != OBJECT_TYPE_UNKNOWN);
hack_empty_master_iff_lower_up (platform, kernel_object);
@@ -1781,7 +1781,7 @@ delete_object (NMPlatform *platform, struct nl_object *object, gboolean do_refre
int nle;
gboolean result = FALSE;
- object_type = object_type_from_nl_object (object);
+ object_type = _nlo_get_object_type (object);
g_return_val_if_fail (object_type != OBJECT_TYPE_UNKNOWN, FALSE);
switch (object_type) {
@@ -1952,7 +1952,7 @@ event_notification (struct nl_msg *msg, gpointer user_data)
nl_msg_parse (msg, ref_object, &object);
g_return_val_if_fail (object, NL_OK);
- type = object_type_from_nl_object (object);
+ type = _nlo_get_object_type (object);
if (nm_logging_enabled (LOGL_DEBUG, LOGD_PLATFORM)) {
if (type == OBJECT_TYPE_LINK) {
@@ -4165,7 +4165,7 @@ cache_announce_changes (NMPlatform *platform, struct nl_cache *new, struct nl_ca
struct nl_object *cached_object = nm_nl_cache_search (old, object);
if (cached_object) {
- ObjectType type = object_type_from_nl_object (object);
+ ObjectType type = _nlo_get_object_type (object);
if (nm_nl_object_diff (type, object, cached_object))
announce_object (platform, object, NM_PLATFORM_SIGNAL_CHANGED, NM_PLATFORM_REASON_EXTERNAL);
nl_object_put (cached_object);
@@ -4192,7 +4192,7 @@ cache_remove_unknown (struct nl_cache *cache)
struct nl_object *object;
for (object = nl_cache_get_first (cache); object; object = nl_cache_get_next (object)) {
- if (object_type_from_nl_object (object) == OBJECT_TYPE_UNKNOWN) {
+ if (_nlo_get_object_type (object) == OBJECT_TYPE_UNKNOWN) {
if (!objects_to_remove)
objects_to_remove = g_ptr_array_new_with_free_func ((GDestroyNotify) nl_object_put);
nl_object_get (object);