summaryrefslogtreecommitdiff
path: root/source4/lib/socket/interface.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-05-02 15:57:19 +1000
committerAndrew Tridgell <tridge@samba.org>2011-05-08 12:57:04 +0200
commit22cb631b4fd0647b70fbaaafaffda8712a84a999 (patch)
tree3522a34688c42b9698d267a8f0248b2f8c9b9dd4 /source4/lib/socket/interface.c
parent897ef820a40afffbf337b5487a49d957464def67 (diff)
downloadsamba-22cb631b4fd0647b70fbaaafaffda8712a84a999.tar.gz
samba-22cb631b4fd0647b70fbaaafaffda8712a84a999.tar.bz2
samba-22cb631b4fd0647b70fbaaafaffda8712a84a999.zip
s4-interfaces Rename interfaces code so not to conflict with source3/
The iface_count, iface_n_bcast, and load_interfaces functions conflicted with functions of the same name in source3, so the source4 functions were renamed. Hopefully we can actually wrap one around the other in future. Andrew Bartlett
Diffstat (limited to 'source4/lib/socket/interface.c')
-rw-r--r--source4/lib/socket/interface.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/source4/lib/socket/interface.c b/source4/lib/socket/interface.c
index 69b7ec1d49..4eb4f3a517 100644
--- a/source4/lib/socket/interface.c
+++ b/source4/lib/socket/interface.c
@@ -48,9 +48,9 @@ struct interface {
/****************************************************************************
Try and find an interface that matches an ip. If we cannot, return NULL
**************************************************************************/
-static struct interface *iface_find(struct interface *interfaces,
- const struct sockaddr *ip,
- bool check_mask)
+static struct interface *iface_list_find(struct interface *interfaces,
+ const struct sockaddr *ip,
+ bool check_mask)
{
struct interface *i;
@@ -79,7 +79,7 @@ static void add_interface(TALLOC_CTX *mem_ctx, const struct iface_struct *ifs, s
char addr[INET6_ADDRSTRLEN];
struct interface *iface;
- if (iface_find(*interfaces, (const struct sockaddr *)&ifs->ip, false)) {
+ if (iface_list_find(*interfaces, (const struct sockaddr *)&ifs->ip, false)) {
DEBUG(3,("add_interface: not adding duplicate interface %s\n",
print_sockaddr(addr, sizeof(addr), &ifs->ip) ));
return;
@@ -283,7 +283,7 @@ static void interpret_interface(TALLOC_CTX *mem_ctx,
/**
load the list of network interfaces
**/
-void load_interfaces(TALLOC_CTX *mem_ctx, const char **interfaces, struct interface **local_interfaces)
+void load_interface_list(TALLOC_CTX *mem_ctx, const char **interfaces, struct interface **local_interfaces)
{
const char **ptr = interfaces;
int i;
@@ -322,7 +322,7 @@ void load_interfaces(TALLOC_CTX *mem_ctx, const char **interfaces, struct interf
/**
how many interfaces do we have
**/
-int iface_count(struct interface *ifaces)
+int iface_list_count(struct interface *ifaces)
{
int ret = 0;
struct interface *i;
@@ -335,7 +335,7 @@ int iface_count(struct interface *ifaces)
/**
return IP of the Nth interface
**/
-const char *iface_n_ip(struct interface *ifaces, int n)
+const char *iface_list_n_ip(struct interface *ifaces, int n)
{
struct interface *i;
@@ -351,7 +351,7 @@ const char *iface_n_ip(struct interface *ifaces, int n)
/**
return bcast of the Nth interface
**/
-const char *iface_n_bcast(struct interface *ifaces, int n)
+const char *iface_list_n_bcast(struct interface *ifaces, int n)
{
struct interface *i;
@@ -367,7 +367,7 @@ const char *iface_n_bcast(struct interface *ifaces, int n)
/**
return netmask of the Nth interface
**/
-const char *iface_n_netmask(struct interface *ifaces, int n)
+const char *iface_list_n_netmask(struct interface *ifaces, int n)
{
struct interface *i;
@@ -384,32 +384,32 @@ const char *iface_n_netmask(struct interface *ifaces, int n)
return the local IP address that best matches a destination IP, or
our first interface if none match
*/
-const char *iface_best_ip(struct interface *ifaces, const char *dest)
+const char *iface_list_best_ip(struct interface *ifaces, const char *dest)
{
struct interface *iface;
struct sockaddr_storage ss;
if (!interpret_string_addr(&ss, dest, AI_NUMERICHOST)) {
- return iface_n_ip(ifaces, 0);
+ return iface_list_n_ip(ifaces, 0);
}
- iface = iface_find(ifaces, (const struct sockaddr *)&ss, true);
+ iface = iface_list_find(ifaces, (const struct sockaddr *)&ss, true);
if (iface) {
return iface->ip_s;
}
- return iface_n_ip(ifaces, 0);
+ return iface_list_n_ip(ifaces, 0);
}
/**
return true if an IP is one one of our local networks
*/
-bool iface_is_local(struct interface *ifaces, const char *dest)
+bool iface_list_is_local(struct interface *ifaces, const char *dest)
{
struct sockaddr_storage ss;
if (!interpret_string_addr(&ss, dest, AI_NUMERICHOST)) {
return false;
}
- if (iface_find(ifaces, (const struct sockaddr *)&ss, true)) {
+ if (iface_list_find(ifaces, (const struct sockaddr *)&ss, true)) {
return true;
}
return false;
@@ -418,7 +418,7 @@ bool iface_is_local(struct interface *ifaces, const char *dest)
/**
return true if a IP matches a IP/netmask pair
*/
-bool iface_same_net(const char *ip1, const char *ip2, const char *netmask)
+bool iface_list_same_net(const char *ip1, const char *ip2, const char *netmask)
{
return same_net_v4(interpret_addr2(ip1),
interpret_addr2(ip2),