summaryrefslogtreecommitdiff
path: root/source4/lib/util_strlist.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-11-01 22:48:25 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:11 -0500
commit284349482f5293a9a23d0f72d7c2aab46b55843b (patch)
tree6f96931afb18ea841983a2895b62c97fed9f77b7 /source4/lib/util_strlist.c
parent9f14afa12c11d02a49f4f310c3f8d834ce8a835d (diff)
downloadsamba-284349482f5293a9a23d0f72d7c2aab46b55843b.tar.gz
samba-284349482f5293a9a23d0f72d7c2aab46b55843b.tar.bz2
samba-284349482f5293a9a23d0f72d7c2aab46b55843b.zip
r3443: the next stage in the include files re-organisation.
I have created the include/system/ directory, which will contain the wrappers for the system includes for logical subsystems. So far I have created include/system/kerberos.h and include/system/network.h, which contain all the system includes for kerberos code and networking code. These are the included in subsystems that need kerberos or networking respectively. Note that this method avoids the mess of #ifdef HAVE_XXX_H in every C file, instead each C module includes the include/system/XXX.h file for the logical system support it needs, and the details are kept isolated in include/system/ This patch also creates a "struct ipv4_addr" which replaces "struct in_addr" in our code. That avoids every C file needing to import all the system networking headers. (This used to be commit 2e25c71853f8996f73755277e448e7d670810349)
Diffstat (limited to 'source4/lib/util_strlist.c')
-rw-r--r--source4/lib/util_strlist.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source4/lib/util_strlist.c b/source4/lib/util_strlist.c
index 12fb0946e2..0b32955ac2 100644
--- a/source4/lib/util_strlist.c
+++ b/source4/lib/util_strlist.c
@@ -228,7 +228,7 @@ BOOL str_list_substitute(char **list, const char *pattern, const char *insert)
* reallocated to new length
**/
-char* ipstr_list_add(char** ipstr_list, const struct in_addr *ip)
+char* ipstr_list_add(char** ipstr_list, const struct ipv4_addr *ip)
{
char* new_ipstr = NULL;
@@ -237,10 +237,10 @@ char* ipstr_list_add(char** ipstr_list, const struct in_addr *ip)
/* attempt to convert ip to a string and append colon separator to it */
if (*ipstr_list) {
- asprintf(&new_ipstr, "%s%s%s", *ipstr_list, IPSTR_LIST_SEP,inet_ntoa(*ip));
+ asprintf(&new_ipstr, "%s%s%s", *ipstr_list, IPSTR_LIST_SEP,sys_inet_ntoa(*ip));
SAFE_FREE(*ipstr_list);
} else {
- asprintf(&new_ipstr, "%s", inet_ntoa(*ip));
+ asprintf(&new_ipstr, "%s", sys_inet_ntoa(*ip));
}
*ipstr_list = new_ipstr;
return *ipstr_list;
@@ -256,7 +256,7 @@ char* ipstr_list_add(char** ipstr_list, const struct in_addr *ip)
* @return pointer to allocated ip string
**/
-char* ipstr_list_make(char** ipstr_list, const struct in_addr* ip_list, int ip_count)
+char* ipstr_list_make(char** ipstr_list, const struct ipv4_addr* ip_list, int ip_count)
{
int i;
@@ -283,7 +283,7 @@ char* ipstr_list_make(char** ipstr_list, const struct in_addr* ip_list, int ip_c
* @return number of succesfully parsed addresses
**/
-int ipstr_list_parse(const char* ipstr_list, struct in_addr** ip_list)
+int ipstr_list_parse(const char* ipstr_list, struct ipv4_addr** ip_list)
{
fstring token_str;
int count;
@@ -294,14 +294,14 @@ int ipstr_list_parse(const char* ipstr_list, struct in_addr** ip_list)
next_token(&ipstr_list, token_str, IPSTR_LIST_SEP, FSTRING_LEN);
count++) {
- struct in_addr addr;
+ struct ipv4_addr addr;
/* convert single token to ip address */
- if ( (addr.s_addr = inet_addr(token_str)) == INADDR_NONE )
+ if ( (addr.s_addr = sys_inet_addr(token_str)) == INADDR_NONE )
break;
/* prepare place for another in_addr structure */
- *ip_list = Realloc(*ip_list, (count + 1) * sizeof(struct in_addr));
+ *ip_list = Realloc(*ip_list, (count + 1) * sizeof(struct ipv4_addr));
if (!*ip_list) return -1;
(*ip_list)[count] = addr;