diff options
author | Pavel Šimerda <psimerda@redhat.com> | 2013-07-31 23:59:50 +0200 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2013-08-03 00:15:07 -0500 |
commit | 320a9d16a3067df32f5ad8a2bb3770104ec359b1 (patch) | |
tree | a8388971596829daef6eeab6b4544e35fbe988b7 /callouts | |
parent | 6762b2f792ba4d4dcc511b63555015a00addf04d (diff) | |
download | NetworkManager-320a9d16a3067df32f5ad8a2bb3770104ec359b1.tar.gz |
all: replace struct in_addr with guint32
Diffstat (limited to 'callouts')
-rw-r--r-- | callouts/nm-dispatcher-utils.c | 20 | ||||
-rw-r--r-- | callouts/tests/test-dispatcher-envp.c | 16 |
2 files changed, 18 insertions, 18 deletions
diff --git a/callouts/nm-dispatcher-utils.c b/callouts/nm-dispatcher-utils.c index 8824295d23..4c047da0ed 100644 --- a/callouts/nm-dispatcher-utils.c +++ b/callouts/nm-dispatcher-utils.c @@ -112,17 +112,17 @@ construct_ip4_items (GSList *items, GHashTable *ip4_config, const char *prefix) NMIP4Address *addr = (NMIP4Address *) iter->data; char str_addr[INET_ADDRSTRLEN + 1]; char str_gw[INET_ADDRSTRLEN + 1]; - struct in_addr tmp_addr; + guint32 tmp_addr; guint32 ip_prefix = nm_ip4_address_get_prefix (addr); char *addrtmp; memset (str_addr, 0, sizeof (str_addr)); - tmp_addr.s_addr = nm_ip4_address_get_address (addr); + tmp_addr = nm_ip4_address_get_address (addr); if (!inet_ntop (AF_INET, &tmp_addr, str_addr, sizeof (str_addr))) continue; memset (str_gw, 0, sizeof (str_gw)); - tmp_addr.s_addr = nm_ip4_address_get_gateway (addr); + tmp_addr = nm_ip4_address_get_gateway (addr); inet_ntop (AF_INET, &tmp_addr, str_gw, sizeof (str_gw)); addrtmp = g_strdup_printf ("%sIP4_ADDRESS_%d=%s/%d %s", prefix, num++, str_addr, ip_prefix, str_gw); @@ -146,10 +146,10 @@ construct_ip4_items (GSList *items, GHashTable *ip4_config, const char *prefix) tmp = g_string_new (NULL); g_string_append_printf (tmp, "%sIP4_NAMESERVERS=", prefix); for (i = 0; i < dns->len; i++) { - struct in_addr addr; + guint32 addr; char buf[INET_ADDRSTRLEN + 1]; - addr.s_addr = g_array_index (dns, guint32, i); + addr = g_array_index (dns, guint32, i); memset (buf, 0, sizeof (buf)); if (inet_ntop (AF_INET, &addr, buf, sizeof (buf))) { if (!first) @@ -176,10 +176,10 @@ construct_ip4_items (GSList *items, GHashTable *ip4_config, const char *prefix) tmp = g_string_new (NULL); g_string_append_printf (tmp, "%sIP4_WINS_SERVERS=", prefix); for (i = 0; i < wins->len; i++) { - struct in_addr addr; + guint32 addr; char buf[INET_ADDRSTRLEN + 1]; - addr.s_addr = g_array_index (wins, guint32, i); + addr = g_array_index (wins, guint32, i); memset (buf, 0, sizeof (buf)); if (inet_ntop (AF_INET, &addr, buf, sizeof (buf))) { if (!first) @@ -201,18 +201,18 @@ construct_ip4_items (GSList *items, GHashTable *ip4_config, const char *prefix) NMIP4Route *route = (NMIP4Route *) iter->data; char str_addr[INET_ADDRSTRLEN + 1]; char str_nh[INET_ADDRSTRLEN + 1]; - struct in_addr tmp_addr; + guint32 tmp_addr; guint32 ip_prefix = nm_ip4_route_get_prefix (route); guint32 metric = nm_ip4_route_get_metric (route); char *routetmp; memset (str_addr, 0, sizeof (str_addr)); - tmp_addr.s_addr = nm_ip4_route_get_dest (route); + tmp_addr = nm_ip4_route_get_dest (route); if (!inet_ntop (AF_INET, &tmp_addr, str_addr, sizeof (str_addr))) continue; memset (str_nh, 0, sizeof (str_nh)); - tmp_addr.s_addr = nm_ip4_route_get_next_hop (route); + tmp_addr = nm_ip4_route_get_next_hop (route); inet_ntop (AF_INET, &tmp_addr, str_nh, sizeof (str_nh)); routetmp = g_strdup_printf ("%sIP4_ROUTE_%d=%s/%d %s %d", prefix, num++, str_addr, ip_prefix, str_nh, metric); diff --git a/callouts/tests/test-dispatcher-envp.c b/callouts/tests/test-dispatcher-envp.c index 65f3b538b9..c8c0aadefc 100644 --- a/callouts/tests/test-dispatcher-envp.c +++ b/callouts/tests/test-dispatcher-envp.c @@ -238,10 +238,10 @@ add_uint_array (GKeyFile *kf, items = g_array_sized_new (FALSE, TRUE, sizeof (guint32), g_strv_length (split)); for (iter = split; iter && *iter; iter++) { if (strlen (g_strstrip (*iter))) { - struct in_addr addr; + guint32 addr; g_assert_cmpint (inet_pton (AF_INET, *iter, &addr), ==, 1); - g_array_append_val (items, addr.s_addr); + g_array_append_val (items, addr); } } value_hash_add_uint_array (props, key, items); @@ -294,7 +294,7 @@ parse_ip4 (GKeyFile *kf, GHashTable **out_props, const char *section, GError **e list = NULL; for (iter = split; iter && *iter; iter++) { NMIP4Address *addr; - struct in_addr a; + guint32 a; char *p; if (strlen (g_strstrip (*iter)) == 0) @@ -307,7 +307,7 @@ parse_ip4 (GKeyFile *kf, GHashTable **out_props, const char *section, GError **e *p++ = '\0'; g_assert_cmpint (inet_pton (AF_INET, *iter, &a), ==, 1); - nm_ip4_address_set_address (addr, a.s_addr); + nm_ip4_address_set_address (addr, a); nm_ip4_address_set_prefix (addr, (guint) atoi (p)); p = strchr (p, ' '); @@ -315,7 +315,7 @@ parse_ip4 (GKeyFile *kf, GHashTable **out_props, const char *section, GError **e p++; g_assert_cmpint (inet_pton (AF_INET, p, &a), ==, 1); - nm_ip4_address_set_gateway (addr, a.s_addr); + nm_ip4_address_set_gateway (addr, a); list = g_slist_append (list, addr); } @@ -338,7 +338,7 @@ parse_ip4 (GKeyFile *kf, GHashTable **out_props, const char *section, GError **e list = NULL; for (iter = split; iter && *iter; iter++) { NMIP4Route *route; - struct in_addr a; + guint32 a; char *p; if (strlen (g_strstrip (*iter)) == 0) @@ -351,7 +351,7 @@ parse_ip4 (GKeyFile *kf, GHashTable **out_props, const char *section, GError **e *p++ = '\0'; g_assert_cmpint (inet_pton (AF_INET, *iter, &a), ==, 1); - nm_ip4_route_set_dest (route, a.s_addr); + nm_ip4_route_set_dest (route, a); nm_ip4_route_set_prefix (route, (guint) atoi (p)); p = strchr (p, ' '); @@ -359,7 +359,7 @@ parse_ip4 (GKeyFile *kf, GHashTable **out_props, const char *section, GError **e p++; g_assert_cmpint (inet_pton (AF_INET, p, &a), ==, 1); - nm_ip4_route_set_next_hop (route, a.s_addr); + nm_ip4_route_set_next_hop (route, a); p = strchr (p, ' '); g_assert (p); |