summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-03-26 17:36:02 +1100
committerAndrew Tridgell <tridge@samba.org>2010-03-26 17:36:02 +1100
commitfae84f98e37e99e41b23739305e7331b3a34ae48 (patch)
treeaea198725ee6e85dd81e8b35d7a93e1c86269a1f
parentc81d2ae3c9a4f9b5d2291563f141bb10d64cd650 (diff)
downloadsamba-fae84f98e37e99e41b23739305e7331b3a34ae48.tar.gz
samba-fae84f98e37e99e41b23739305e7331b3a34ae48.tar.bz2
samba-fae84f98e37e99e41b23739305e7331b3a34ae48.zip
libutil: moved the networking defines to util_net.h
These were causing thousands of warnings on solaris8
-rw-r--r--lib/util/util.h27
-rw-r--r--lib/util/util_net.c1
-rw-r--r--lib/util/util_net.h28
-rw-r--r--libcli/nbt/nbtname.c1
-rw-r--r--librpc/ndr/ndr_basic.c1
-rw-r--r--librpc/rpc/binding.c1
-rw-r--r--nsswitch/libwbclient/tests/wbclient.c1
-rw-r--r--source4/auth/gensec/gensec_gssapi.c1
-rw-r--r--source4/auth/gensec/gensec_krb5.c1
-rw-r--r--source4/lib/socket/access.c1
-rw-r--r--source4/lib/socket/interface.c1
-rw-r--r--source4/lib/socket/socket_ip.c1
-rw-r--r--source4/libcli/resolve/resolve.c1
-rw-r--r--source4/libcli/resolve/testsuite.c1
-rw-r--r--source4/libcli/smb_composite/connect.c1
-rw-r--r--source4/librpc/tests/binding_string.c1
-rw-r--r--source4/nbt_server/interfaces.c1
-rw-r--r--source4/nbt_server/wins/winsserver.c1
18 files changed, 44 insertions, 27 deletions
diff --git a/lib/util/util.h b/lib/util/util.h
index 2d4a02549f..b89a7d6050 100644
--- a/lib/util/util.h
+++ b/lib/util/util.h
@@ -663,33 +663,6 @@ _PUBLIC_ void msleep(unsigned int t);
_PUBLIC_ char* get_myname(TALLOC_CTX *mem_ctx);
/**
- Return true if a string could be a pure IP address.
-**/
-_PUBLIC_ bool is_ipaddress(const char *str);
-
-/**
- Interpret an internet address or name into an IP address in 4 byte form.
-**/
-_PUBLIC_ uint32_t interpret_addr(const char *str);
-
-/**
- A convenient addition to interpret_addr().
-**/
-_PUBLIC_ struct in_addr interpret_addr2(const char *str);
-
-/**
- Check if an IP is the 0.0.0.0.
-**/
-_PUBLIC_ bool is_zero_ip_v4(struct in_addr ip);
-
-/**
- Are two IPs on the same subnet?
-**/
-_PUBLIC_ bool same_net_v4(struct in_addr ip1,struct in_addr ip2,struct in_addr mask);
-
-_PUBLIC_ bool is_ipaddress_v4(const char *str);
-
-/**
Check if a process exists. Does this work on all unixes?
**/
_PUBLIC_ bool process_exists_by_pid(pid_t pid);
diff --git a/lib/util/util_net.c b/lib/util/util_net.c
index 9e47f51764..00a5ee4ced 100644
--- a/lib/util/util_net.c
+++ b/lib/util/util_net.c
@@ -27,6 +27,7 @@
#include "system/network.h"
#include "system/locale.h"
#include "system/filesys.h"
+#include "lib/util/util_net.h"
#undef strcasecmp
/*******************************************************************
diff --git a/lib/util/util_net.h b/lib/util/util_net.h
index 5dc4df5e12..530311e5c8 100644
--- a/lib/util/util_net.h
+++ b/lib/util/util_net.h
@@ -45,4 +45,32 @@ bool interpret_string_addr_prefer_ipv4(struct sockaddr_storage *pss,
void set_sockaddr_port(struct sockaddr *psa, uint16_t port);
+/**
+ Check if an IP is the 0.0.0.0.
+**/
+_PUBLIC_ bool is_zero_ip_v4(struct in_addr ip);
+
+/**
+ Are two IPs on the same subnet?
+**/
+_PUBLIC_ bool same_net_v4(struct in_addr ip1,struct in_addr ip2,struct in_addr mask);
+
+/**
+ Return true if a string could be a pure IP address.
+**/
+_PUBLIC_ bool is_ipaddress(const char *str);
+
+/**
+ Interpret an internet address or name into an IP address in 4 byte form.
+**/
+_PUBLIC_ uint32_t interpret_addr(const char *str);
+
+/**
+ A convenient addition to interpret_addr().
+**/
+_PUBLIC_ struct in_addr interpret_addr2(const char *str);
+
+_PUBLIC_ bool is_ipaddress_v4(const char *str);
+
+
#endif /* _SAMBA_UTIL_NET_H_ */
diff --git a/libcli/nbt/nbtname.c b/libcli/nbt/nbtname.c
index f890b91261..385905abf1 100644
--- a/libcli/nbt/nbtname.c
+++ b/libcli/nbt/nbtname.c
@@ -27,6 +27,7 @@
#include "librpc/gen_ndr/ndr_nbt.h"
#include "librpc/gen_ndr/ndr_misc.h"
#include "system/locale.h"
+#include "lib/util/util_net.h"
/* don't allow an unlimited number of name components */
#define MAX_COMPONENTS 10
diff --git a/librpc/ndr/ndr_basic.c b/librpc/ndr/ndr_basic.c
index 1fd6fdea74..f7d6ee0449 100644
--- a/librpc/ndr/ndr_basic.c
+++ b/librpc/ndr/ndr_basic.c
@@ -22,6 +22,7 @@
#include "includes.h"
#include "system/network.h"
#include "librpc/ndr/libndr.h"
+#include "lib/util/util_net.h"
#define NDR_SVAL(ndr, ofs) (NDR_BE(ndr)?RSVAL(ndr->data,ofs):SVAL(ndr->data,ofs))
#define NDR_IVAL(ndr, ofs) (NDR_BE(ndr)?RIVAL(ndr->data,ofs):IVAL(ndr->data,ofs))
diff --git a/librpc/rpc/binding.c b/librpc/rpc/binding.c
index 3f15eef926..e3edc67882 100644
--- a/librpc/rpc/binding.c
+++ b/librpc/rpc/binding.c
@@ -23,6 +23,7 @@
*/
#include "includes.h"
+#include "../../lib/util/util_net.h"
#include "librpc/gen_ndr/ndr_epmapper.h"
#include "librpc/gen_ndr/ndr_misc.h"
#include "librpc/rpc/dcerpc.h"
diff --git a/nsswitch/libwbclient/tests/wbclient.c b/nsswitch/libwbclient/tests/wbclient.c
index 6d4ea86de3..007404024d 100644
--- a/nsswitch/libwbclient/tests/wbclient.c
+++ b/nsswitch/libwbclient/tests/wbclient.c
@@ -22,6 +22,7 @@
#include "nsswitch/libwbclient/wbc_async.h"
#include "torture/smbtorture.h"
#include "torture/winbind/proto.h"
+#include "lib/util/util_net.h"
#define WBC_ERROR_EQUAL(x,y) (x == y)
diff --git a/source4/auth/gensec/gensec_gssapi.c b/source4/auth/gensec/gensec_gssapi.c
index a50190f04c..6d59bbe612 100644
--- a/source4/auth/gensec/gensec_gssapi.c
+++ b/source4/auth/gensec/gensec_gssapi.c
@@ -40,6 +40,7 @@
#include <gssapi/gssapi_krb5.h>
#include <gssapi/gssapi_spnego.h>
#include "auth/gensec/gensec_gssapi.h"
+#include "lib/util/util_net.h"
static size_t gensec_gssapi_max_input_size(struct gensec_security *gensec_security);
static size_t gensec_gssapi_max_wrapped_size(struct gensec_security *gensec_security);
diff --git a/source4/auth/gensec/gensec_krb5.c b/source4/auth/gensec/gensec_krb5.c
index e8beb4ca0f..9a96e5e983 100644
--- a/source4/auth/gensec/gensec_krb5.c
+++ b/source4/auth/gensec/gensec_krb5.c
@@ -35,6 +35,7 @@
#include "auth/gensec/gensec_proto.h"
#include "param/param.h"
#include "auth/auth_sam_reply.h"
+#include "lib/util/util_net.h"
enum GENSEC_KRB5_STATE {
GENSEC_KRB5_SERVER_START,
diff --git a/source4/lib/socket/access.c b/source4/lib/socket/access.c
index 42c42db365..ab39d63ef5 100644
--- a/source4/lib/socket/access.c
+++ b/source4/lib/socket/access.c
@@ -34,6 +34,7 @@
#include "system/network.h"
#include "lib/socket/socket.h"
#include "system/locale.h"
+#include "lib/util/util_net.h"
#define FAIL (-1)
#define ALLONES ((uint32_t)0xFFFFFFFF)
diff --git a/source4/lib/socket/interface.c b/source4/lib/socket/interface.c
index af81804911..433b212244 100644
--- a/source4/lib/socket/interface.c
+++ b/source4/lib/socket/interface.c
@@ -22,6 +22,7 @@
#include "includes.h"
#include "system/network.h"
#include "lib/socket/netif.h"
+#include "../lib/util/util_net.h"
#include "../lib/util/dlinklist.h"
/** used for network interfaces */
diff --git a/source4/lib/socket/socket_ip.c b/source4/lib/socket/socket_ip.c
index 89b310a23a..8ee12d8916 100644
--- a/source4/lib/socket/socket_ip.c
+++ b/source4/lib/socket/socket_ip.c
@@ -25,6 +25,7 @@
#include "system/filesys.h"
#include "lib/socket/socket.h"
#include "system/network.h"
+#include "lib/util/util_net.h"
static NTSTATUS ipv4_init(struct socket_context *sock)
{
diff --git a/source4/libcli/resolve/resolve.c b/source4/libcli/resolve/resolve.c
index 77f7f4f46b..9359b8f582 100644
--- a/source4/libcli/resolve/resolve.c
+++ b/source4/libcli/resolve/resolve.c
@@ -28,6 +28,7 @@
#include "lib/socket/socket.h"
#include "../lib/util/dlinklist.h"
#include "lib/tsocket/tsocket.h"
+#include "lib/util/util_net.h"
struct resolve_state {
struct resolve_context *ctx;
diff --git a/source4/libcli/resolve/testsuite.c b/source4/libcli/resolve/testsuite.c
index fdbb430a9f..86e133b524 100644
--- a/source4/libcli/resolve/testsuite.c
+++ b/source4/libcli/resolve/testsuite.c
@@ -24,6 +24,7 @@
#include "libcli/resolve/resolve.h"
#include "torture/torture.h"
#include "system/network.h"
+#include "lib/util/util_net.h"
static bool test_async_resolve(struct torture_context *tctx)
{
diff --git a/source4/libcli/smb_composite/connect.c b/source4/libcli/smb_composite/connect.c
index 14e8a1ab7f..16f2af9b3d 100644
--- a/source4/libcli/smb_composite/connect.c
+++ b/source4/libcli/smb_composite/connect.c
@@ -30,6 +30,7 @@
#include "auth/credentials/credentials.h"
#include "librpc/gen_ndr/ndr_nbt.h"
#include "param/param.h"
+#include "lib/util/util_net.h"
/* the stages of this call */
enum connect_stage {CONNECT_SOCKET,
diff --git a/source4/librpc/tests/binding_string.c b/source4/librpc/tests/binding_string.c
index 01cdfae80d..6de94eb58b 100644
--- a/source4/librpc/tests/binding_string.c
+++ b/source4/librpc/tests/binding_string.c
@@ -24,6 +24,7 @@
#include "librpc/rpc/dcerpc.h"
#include "librpc/rpc/dcerpc_proto.h"
#include "torture/torture.h"
+#include "lib/util/util_net.h"
static bool test_BindingString(struct torture_context *tctx,
const void *test_data)
diff --git a/source4/nbt_server/interfaces.c b/source4/nbt_server/interfaces.c
index 0a9196a747..99c5886fd9 100644
--- a/source4/nbt_server/interfaces.c
+++ b/source4/nbt_server/interfaces.c
@@ -29,6 +29,7 @@
#include "system/network.h"
#include "lib/socket/netif.h"
#include "param/param.h"
+#include "lib/util/util_net.h"
/*
diff --git a/source4/nbt_server/wins/winsserver.c b/source4/nbt_server/wins/winsserver.c
index 95d22242b3..ff4c5fdbb9 100644
--- a/source4/nbt_server/wins/winsserver.c
+++ b/source4/nbt_server/wins/winsserver.c
@@ -35,6 +35,7 @@
#include "lib/ldb/include/ldb.h"
#include "param/param.h"
#include "libcli/resolve/resolve.h"
+#include "lib/util/util_net.h"
/*
work out the ttl we will use given a client requested ttl