#include "includes.h"
#include "system/network.h"
+#include "param/param.h"
#include "lib/socket/netif.h"
#include "../lib/util/util_net.h"
#include "../lib/util/dlinklist.h"
interpret_addr2(ip2),
interpret_addr2(netmask));
}
+
+/**
+ return the list of wildcard interfaces
+ this will include the IPv4 0.0.0.0, and may include IPv6 ::
+ it is overridden by the 'socket address' option in smb.conf
+*/
+const char **iface_list_wildcard(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
+{
+ const char **ret;
+ const char *socket_address;
+
+ /* the user may have configured a specific address */
+ socket_address = lpcfg_socket_address(lp_ctx);
+ if (strcmp(socket_address, "") != 0) {
+ ret = (const char **)str_list_make(mem_ctx, socket_address, NULL);
+ return ret;
+ }
+
+ ret = (const char **)str_list_make(mem_ctx, "0.0.0.0", NULL);
+ if (ret == NULL) return NULL;
+
+#ifdef HAVE_IPV6
+ return str_list_add(ret, "::");
+#endif
+
+ return ret;
+}
bld.SAMBA_LIBRARY('netif',
source='interface.c',
- deps='samba-util interfaces',
+ deps='samba-util interfaces samba-hostconfig',
private_library=True,
autoproto='netif_proto.h'
)