} else {
int i, num_interfaces;
- num_interfaces = iface_count(ifaces);
+ num_interfaces = iface_list_count(ifaces);
for (i=0;i<num_interfaces;i++) {
- const char *bcast = iface_n_bcast(ifaces, i);
+ const char *bcast = iface_list_n_bcast(ifaces, i);
if (bcast == NULL) continue;
status = do_node_query(nbtsock, bcast, nbt_port,
node_name, node_type, true);
exit(1);
}
- load_interfaces(NULL, lpcfg_interfaces(cmdline_lp_ctx), &ifaces);
+ load_interface_list(NULL, lpcfg_interfaces(cmdline_lp_ctx), &ifaces);
ev = s4_event_context_init(talloc_autofree_context());
TALLOC_CTX *tmp_ctx = talloc_new(cldapd);
NTSTATUS status;
- num_interfaces = iface_count(ifaces);
+ num_interfaces = iface_list_count(ifaces);
/* if we are allowing incoming packets from any address, then
we need to bind to the wildcard address */
/* now we have to also listen on the specific interfaces,
so that replies always come from the right IP */
for (i=0; i<num_interfaces; i++) {
- const char *address = talloc_strdup(tmp_ctx, iface_n_ip(ifaces, i));
+ const char *address = talloc_strdup(tmp_ctx, iface_list_n_ip(ifaces, i));
status = cldapd_add_socket(cldapd, lp_ctx, address);
NT_STATUS_NOT_OK_RETURN(status);
}
NTSTATUS status;
struct interface *ifaces;
- load_interfaces(task, lpcfg_interfaces(task->lp_ctx), &ifaces);
+ load_interface_list(task, lpcfg_interfaces(task->lp_ctx), &ifaces);
- if (iface_count(ifaces) == 0) {
+ if (iface_list_count(ifaces) == 0) {
task_server_terminate(task, "cldapd: no network interfaces configured", false);
return;
}
client_site = samdb_client_site_name(sam_ctx, mem_ctx,
src_address, NULL);
NT_STATUS_HAVE_NO_MEMORY(client_site);
- load_interfaces(mem_ctx, lpcfg_interfaces(lp_ctx), &ifaces);
+ load_interface_list(mem_ctx, lpcfg_interfaces(lp_ctx), &ifaces);
/*
* TODO: the caller should pass the address which the client
* used to trigger this call, as the client is able to reach
* this ip.
*/
if (src_address) {
- pdc_ip = iface_best_ip(ifaces, src_address);
+ pdc_ip = iface_list_best_ip(ifaces, src_address);
} else {
- pdc_ip = iface_n_ip(ifaces, 0);
+ pdc_ip = iface_list_n_ip(ifaces, 0);
}
ZERO_STRUCTP(netlogon);
return NT_STATUS_INTERNAL_ERROR;
}
- num_interfaces = iface_count(ifaces);
+ num_interfaces = iface_list_count(ifaces);
for (i=0; i<num_interfaces; i++) {
- const char *address = talloc_strdup(tmp_ctx, iface_n_ip(ifaces, i));
+ const char *address = talloc_strdup(tmp_ctx, iface_list_n_ip(ifaces, i));
status = dns_add_socket(dns, model_ops, "dns", address, DNS_SERVICE_PORT);
NT_STATUS_NOT_OK_RETURN(status);
break;
}
- load_interfaces(task, lpcfg_interfaces(task->lp_ctx), &ifaces);
+ load_interface_list(task, lpcfg_interfaces(task->lp_ctx), &ifaces);
- if (iface_count(ifaces) == 0) {
+ if (iface_list_count(ifaces) == 0) {
task_server_terminate(task, "dns: no network interfaces configured", false);
return;
}
#include "param/param.h"
/* This defines task_server_terminate */
#include "smbd/process_model.h"
-/* We get load_interfaces from here */
+/* We get load_interface_list from here */
#include "socket/netif.h"
/* NTSTATUS-related stuff */
#include "libcli/util/ntstatus.h"
return NT_STATUS_INTERNAL_ERROR;
}
- num_interfaces = iface_count(ifaces);
+ num_interfaces = iface_list_count(ifaces);
for(i=0; i<num_interfaces; i++) {
- const char *address = talloc_strdup(tmp_ctx, iface_n_ip(ifaces, i));
+ const char *address = talloc_strdup(tmp_ctx, iface_list_n_ip(ifaces, i));
status = echo_add_socket(echo, model_ops, "echo", address, ECHO_SERVICE_PORT);
NT_STATUS_NOT_OK_RETURN(status);
break;
}
- load_interfaces(task, lpcfg_interfaces(task->lp_ctx), &ifaces);
+ load_interface_list(task, lpcfg_interfaces(task->lp_ctx), &ifaces);
- if (iface_count(ifaces) == 0) {
+ if (iface_list_count(ifaces) == 0) {
task_server_terminate(task,
"echo: No network interfaces configured",
false);
return NT_STATUS_INTERNAL_ERROR;
}
- num_interfaces = iface_count(ifaces);
+ num_interfaces = iface_list_count(ifaces);
/* if we are allowing incoming packets from any address, then
we need to bind to the wildcard address */
}
for (i=0; i<num_interfaces; i++) {
- const char *address = talloc_strdup(tmp_ctx, iface_n_ip(ifaces, i));
+ const char *address = talloc_strdup(tmp_ctx, iface_list_n_ip(ifaces, i));
if (kdc_port) {
status = kdc_add_socket(kdc, model_ops,
break;
}
- load_interfaces(task, lpcfg_interfaces(task->lp_ctx), &ifaces);
+ load_interface_list(task, lpcfg_interfaces(task->lp_ctx), &ifaces);
- if (iface_count(ifaces) == 0) {
+ if (iface_list_count(ifaces) == 0) {
task_server_terminate(task, "kdc: no network interfaces configured", false);
return;
}
int num_interfaces;
int i;
- load_interfaces(task, lpcfg_interfaces(task->lp_ctx), &ifaces);
- num_interfaces = iface_count(ifaces);
+ load_interface_list(task, lpcfg_interfaces(task->lp_ctx), &ifaces);
+ num_interfaces = iface_list_count(ifaces);
/* We have been given an interfaces line, and been
told to only bind to those interfaces. Create a
socket per interface and bind to only these.
*/
for(i = 0; i < num_interfaces; i++) {
- const char *address = iface_n_ip(ifaces, i);
+ const char *address = iface_list_n_ip(ifaces, i);
status = add_socket(task, task->lp_ctx, model_ops, address, ldap_service);
if (!NT_STATUS_IS_OK(status)) goto failed;
}
/****************************************************************************
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;
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;
/**
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;
/**
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;
/**
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;
/**
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;
/**
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;
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;
/**
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),
TALLOC_CTX *mem_ctx = tctx;
struct interface *ifaces;
- load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
+ load_interface_list(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
status = socket_create("ip", SOCKET_TYPE_DGRAM, &sock1, 0);
torture_assert_ntstatus_ok(tctx, status, "creating DGRAM IP socket 1");
talloc_steal(mem_ctx, sock2);
localhost = socket_address_from_strings(sock1, sock1->backend_name,
- iface_best_ip(ifaces, "127.0.0.1"), 0);
+ iface_list_best_ip(ifaces, "127.0.0.1"), 0);
torture_assert(tctx, localhost, "Localhost not found");
srv_addr = socket_get_my_addr(sock1, mem_ctx);
torture_assert(tctx, srv_addr != NULL &&
- strcmp(srv_addr->addr, iface_best_ip(ifaces, "127.0.0.1")) == 0,
+ strcmp(srv_addr->addr, iface_list_best_ip(ifaces, "127.0.0.1")) == 0,
talloc_asprintf(tctx,
"Expected server address of %s but got %s",
- iface_best_ip(ifaces, "127.0.0.1"), srv_addr ? srv_addr->addr : NULL));
+ iface_list_best_ip(ifaces, "127.0.0.1"), srv_addr ? srv_addr->addr : NULL));
torture_comment(tctx, "server port is %d\n", srv_addr->port);
torture_assert_ntstatus_ok(tctx, status, "creating IP stream socket 1");
talloc_steal(mem_ctx, sock2);
- load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
+ load_interface_list(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
localhost = socket_address_from_strings(sock1, sock1->backend_name,
- iface_best_ip(ifaces, "127.0.0.1"), 0);
+ iface_list_best_ip(ifaces, "127.0.0.1"), 0);
torture_assert(tctx, localhost, "Localhost not found");
status = socket_listen(sock1, localhost, 0, 0);
torture_assert(tctx, srv_addr && srv_addr->addr,
"Unexpected socket_get_my_addr NULL\n");
- torture_assert_str_equal(tctx, srv_addr->addr, iface_best_ip(ifaces, "127.0.0.1"),
+ torture_assert_str_equal(tctx, srv_addr->addr, iface_list_best_ip(ifaces, "127.0.0.1"),
"Unexpected server address");
torture_comment(tctx, "server port is %d\n", srv_addr->port);
int i, count=0;
struct resolve_bcast_data *data = talloc_get_type(userdata, struct resolve_bcast_data);
- num_interfaces = iface_count(data->ifaces);
+ num_interfaces = iface_list_count(data->ifaces);
address_list = talloc_array(mem_ctx, const char *, num_interfaces+1);
if (address_list == NULL) return NULL;
for (i=0;i<num_interfaces;i++) {
- const char *bcast = iface_n_bcast(data->ifaces, i);
+ const char *bcast = iface_list_n_bcast(data->ifaces, i);
if (bcast == NULL) continue;
address_list[count] = talloc_strdup(address_list, bcast);
if (address_list[count] == NULL) {
bool resolve_context_add_bcast_method_lp(struct resolve_context *ctx, struct loadparm_context *lp_ctx)
{
struct interface *ifaces;
- load_interfaces(ctx, lpcfg_interfaces(lp_ctx), &ifaces);
+ load_interface_list(ctx, lpcfg_interfaces(lp_ctx), &ifaces);
return resolve_context_add_bcast_method(ctx, ifaces, lpcfg_nbt_port(lp_ctx), lpcfg_parm_int(lp_ctx, NULL, "nbt", "timeout", 1));
}
bool resolve_context_add_wins_method_lp(struct resolve_context *ctx, struct loadparm_context *lp_ctx)
{
struct interface *ifaces;
- load_interfaces(ctx, lpcfg_interfaces(lp_ctx), &ifaces);
+ load_interface_list(ctx, lpcfg_interfaces(lp_ctx), &ifaces);
return resolve_context_add_wins_method(ctx, lpcfg_wins_server_list(lp_ctx), ifaces, lpcfg_nbt_port(lp_ctx), lpcfg_parm_int(lp_ctx, NULL, "nbt", "timeout", 1));
}
const char *wrepl_best_ip(struct loadparm_context *lp_ctx, const char *peer_ip)
{
struct interface *ifaces;
- load_interfaces(lp_ctx, lpcfg_interfaces(lp_ctx), &ifaces);
- return iface_best_ip(ifaces, peer_ip);
+ load_interface_list(lp_ctx, lpcfg_interfaces(lp_ctx), &ifaces);
+ return iface_list_best_ip(ifaces, peer_ip);
}
struct wrepl_connect_state {
NTSTATUS nbtd_startup_interfaces(struct nbtd_server *nbtsrv, struct loadparm_context *lp_ctx,
struct interface *ifaces)
{
- int num_interfaces = iface_count(ifaces);
+ int num_interfaces = iface_list_count(ifaces);
int i;
TALLOC_CTX *tmp_ctx = talloc_new(nbtsrv);
NTSTATUS status;
for non-WINS queries not made on a specific
interface */
if (num_interfaces > 0) {
- primary_address = iface_n_ip(ifaces, 0);
+ primary_address = iface_list_n_ip(ifaces, 0);
} else {
primary_address = inet_ntoa(interpret_addr2(
lpcfg_netbios_name(lp_ctx)));
}
for (i=0; i<num_interfaces; i++) {
- const char *bcast = iface_n_bcast(ifaces, i);
+ const char *bcast = iface_list_n_bcast(ifaces, i);
const char *address, *netmask;
/* we can't assume every interface is broadcast capable */
if (bcast == NULL) continue;
- address = talloc_strdup(tmp_ctx, iface_n_ip(ifaces, i));
+ address = talloc_strdup(tmp_ctx, iface_list_n_ip(ifaces, i));
bcast = talloc_strdup(tmp_ctx, bcast);
- netmask = talloc_strdup(tmp_ctx, iface_n_netmask(ifaces, i));
+ netmask = talloc_strdup(tmp_ctx, iface_list_n_netmask(ifaces, i));
status = nbtd_add_socket(nbtsrv, lp_ctx,
address, address, bcast, netmask);
bool is_loopback = false;
if (iface->ip_address) {
- is_loopback = iface_same_net(iface->ip_address, "127.0.0.1", "255.0.0.0");
+ is_loopback = iface_list_same_net(iface->ip_address, "127.0.0.1", "255.0.0.0");
ret = str_list_add(ret, iface->ip_address);
}
if (!iface2->ip_address) continue;
if (!is_loopback) {
- if (iface_same_net(iface2->ip_address, "127.0.0.1", "255.0.0.0")) {
+ if (iface_list_same_net(iface2->ip_address, "127.0.0.1", "255.0.0.0")) {
continue;
}
}
/* try to find a exact match */
for (cur=nbtd_server->interfaces;cur;cur=cur->next) {
- if (iface_same_net(address, cur->ip_address, cur->netmask)) {
+ if (iface_list_same_net(address, cur->ip_address, cur->netmask)) {
DEBUG(10,("find interface for dst[%s] ip: %s/%s (iface[%p])\n",
address, cur->ip_address, cur->netmask, cur));
return cur;
NTSTATUS status;
struct interface *ifaces;
- load_interfaces(task, lpcfg_interfaces(task->lp_ctx), &ifaces);
+ load_interface_list(task, lpcfg_interfaces(task->lp_ctx), &ifaces);
- if (iface_count(ifaces) == 0) {
+ if (iface_list_count(ifaces) == 0) {
task_server_terminate(task, "nbtd: no network interfaces configured", false);
return;
}
owner = lpcfg_parm_string(lp_ctx, NULL, "winsdb", "local_owner");
if (!owner) {
struct interface *ifaces;
- load_interfaces(module, lpcfg_interfaces(lp_ctx), &ifaces);
- owner = iface_n_ip(ifaces, 0);
+ load_interface_list(module, lpcfg_interfaces(lp_ctx), &ifaces);
+ owner = iface_list_n_ip(ifaces, 0);
if (!owner) {
owner = "0.0.0.0";
}
bool same;
/* if the current one is in the same subnet, use it */
- same = iface_same_net(addresses[idx], src->addr, mask);
+ same = iface_list_same_net(addresses[idx], src->addr, mask);
if (same) {
sidx = idx;
break;
if (owner == NULL) {
struct interface *ifaces;
- load_interfaces(nbtsrv->task, lpcfg_interfaces(nbtsrv->task->lp_ctx), &ifaces);
- owner = iface_n_ip(ifaces, 0);
+ load_interface_list(nbtsrv->task, lpcfg_interfaces(nbtsrv->task->lp_ctx), &ifaces);
+ owner = iface_list_n_ip(ifaces, 0);
}
nbtsrv->winssrv->wins_db = winsdb_connect(nbtsrv->winssrv, nbtsrv->task->event_ctx,
int i;
struct interface *ifaces;
- load_interfaces(dce_ctx, lpcfg_interfaces(lp_ctx), &ifaces);
+ load_interface_list(dce_ctx, lpcfg_interfaces(lp_ctx), &ifaces);
- num_interfaces = iface_count(ifaces);
+ num_interfaces = iface_list_count(ifaces);
for(i = 0; i < num_interfaces; i++) {
- const char *address = iface_n_ip(ifaces, i);
+ const char *address = iface_list_n_ip(ifaces, i);
status = add_socket_rpc_tcp_iface(dce_ctx, e, event_ctx, model_ops, address);
NT_STATUS_NOT_OK_RETURN(status);
}
return NULL;
}
- load_interfaces(tmp_ctx, lpcfg_interfaces(lp_ctx), &ifaces);
+ load_interface_list(tmp_ctx, lpcfg_interfaces(lp_ctx), &ifaces);
- count = iface_count(ifaces);
+ count = iface_list_count(ifaces);
/* first count how many are not loopback addresses */
for (ifcount = i = 0; i<count; i++) {
- const char *ip = iface_n_ip(ifaces, i);
- if (!(!all_interfaces && iface_same_net(ip, "127.0.0.1", "255.0.0.0"))) {
+ const char *ip = iface_list_n_ip(ifaces, i);
+ if (!(!all_interfaces && iface_list_same_net(ip, "127.0.0.1", "255.0.0.0"))) {
ifcount++;
}
}
pylist = PyList_New(ifcount);
for (ifcount = i = 0; i<count; i++) {
- const char *ip = iface_n_ip(ifaces, i);
- if (!(!all_interfaces && iface_same_net(ip, "127.0.0.1", "255.0.0.0"))) {
+ const char *ip = iface_list_n_ip(ifaces, i);
+ if (!(!all_interfaces && iface_list_same_net(ip, "127.0.0.1", "255.0.0.0"))) {
PyList_SetItem(pylist, ifcount, PyString_FromString(ip));
ifcount++;
}
int i;
struct interface *ifaces;
- load_interfaces(task, lpcfg_interfaces(task->lp_ctx), &ifaces);
+ load_interface_list(task, lpcfg_interfaces(task->lp_ctx), &ifaces);
- num_interfaces = iface_count(ifaces);
+ num_interfaces = iface_list_count(ifaces);
/* We have been given an interfaces line, and been
told to only bind to those interfaces. Create a
socket per interface and bind to only these.
*/
for(i = 0; i < num_interfaces; i++) {
- const char *address = iface_n_ip(ifaces, i);
+ const char *address = iface_list_n_ip(ifaces, i);
status = smbsrv_add_socket(task, task->event_ctx, task->lp_ctx, task->model_ops, address);
if (!NT_STATUS_IS_OK(status)) goto failed;
}
int i;
struct interface *ifaces;
- load_interfaces(task, lpcfg_interfaces(task->lp_ctx), &ifaces);
+ load_interface_list(task, lpcfg_interfaces(task->lp_ctx), &ifaces);
- num_interfaces = iface_count(ifaces);
+ num_interfaces = iface_list_count(ifaces);
/* We have been given an interfaces line, and been
told to only bind to those interfaces. Create a
socket per interface and bind to only these.
*/
for(i = 0; i < num_interfaces; i++) {
- const char *address = iface_n_ip(ifaces, i);
+ const char *address = iface_list_n_ip(ifaces, i);
status = samba3_add_socket(task,
task->event_ctx,
task->lp_ctx,
&name, tctx, &address, tctx->ev),
talloc_asprintf(tctx, "Failed to resolve %s", name.name));
- load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
- myaddress = talloc_strdup(dgmsock, iface_best_ip(ifaces, address));
+ load_interface_list(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
+ myaddress = talloc_strdup(dgmsock, iface_list_best_ip(ifaces, address));
socket_address = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name,
&name, tctx, &address, tctx->ev),
talloc_asprintf(tctx, "Failed to resolve %s", name.name));
- load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
- myaddress = talloc_strdup(dgmsock, iface_best_ip(ifaces, address));
+ load_interface_list(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
+ myaddress = talloc_strdup(dgmsock, iface_list_best_ip(ifaces, address));
socket_address = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name,
myaddress, lpcfg_dgram_port(tctx->lp_ctx));
0, 0, &name, tctx, &address, tctx->ev),
talloc_asprintf(tctx, "Failed to resolve %s", name.name));
- load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
- myaddress = talloc_strdup(dgmsock, iface_best_ip(ifaces, address));
+ load_interface_list(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
+ myaddress = talloc_strdup(dgmsock, iface_list_best_ip(ifaces, address));
socket_address = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name,
myaddress, lpcfg_dgram_port(tctx->lp_ctx));
if (!torture_nbt_get_name(tctx, &name, &address))
return false;
- load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
+ load_interface_list(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
- myaddress = iface_best_ip(ifaces, address);
+ myaddress = iface_list_best_ip(ifaces, address);
socket_address = socket_address_from_strings(tctx, nbtsock->sock->backend_name,
myaddress, 0);
if (!torture_nbt_get_name(tctx, &name, &address))
return false;
- load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
+ load_interface_list(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
- myaddress = iface_best_ip(ifaces, address);
+ myaddress = iface_list_best_ip(ifaces, address);
socket_address = socket_address_from_strings(tctx, nbtsock->sock->backend_name,
myaddress, 0);
struct interface *ifaces;
bool low_port = try_low_port;
- load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
+ load_interface_list(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
- myaddress = talloc_strdup(tctx, iface_best_ip(ifaces, address));
+ myaddress = talloc_strdup(tctx, iface_list_best_ip(ifaces, address));
socket_address = socket_address_from_strings(tctx,
nbtsock->sock->backend_name,
state->registered = talloc_zero_array(state, bool, state->num_names);
state->wins_server = address;
state->wins_port = lpcfg_nbt_port(tctx->lp_ctx);
- load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
- state->my_ip = talloc_strdup(tctx, iface_best_ip(ifaces, address));
+ load_interface_list(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
+ state->my_ip = talloc_strdup(tctx, iface_list_best_ip(ifaces, address));
state->ttl = timelimit;
my_ip = socket_address_from_strings(nbtsock, nbtsock->sock->backend_name,
ctx->nbtsock = nbt_name_socket_init(ctx, tctx->ev);
if (!ctx->nbtsock) return NULL;
- load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
+ load_interface_list(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
- ctx->myaddr = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_best_ip(ifaces, address), 0);
+ ctx->myaddr = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_list_best_ip(ifaces, address), 0);
if (!ctx->myaddr) return NULL;
- for (i = 0; i < iface_count(ifaces); i++) {
- if (strcmp(ctx->myaddr->addr, iface_n_ip(ifaces, i)) == 0) continue;
- ctx->myaddr2 = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_n_ip(ifaces, i), 0);
+ for (i = 0; i < iface_list_count(ifaces); i++) {
+ if (strcmp(ctx->myaddr->addr, iface_list_n_ip(ifaces, i)) == 0) continue;
+ ctx->myaddr2 = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_list_n_ip(ifaces, i), 0);
if (!ctx->myaddr2) return NULL;
break;
}
ctx->addresses_best[0].owner = ctx->b.address;
ctx->addresses_best[0].ip = ctx->myaddr->addr;
- ctx->addresses_all_num = iface_count(ifaces);
+ ctx->addresses_all_num = iface_list_count(ifaces);
ctx->addresses_all = talloc_array(ctx, struct wrepl_ip, ctx->addresses_all_num);
if (!ctx->addresses_all) return NULL;
for (i=0; i < ctx->addresses_all_num; i++) {
ctx->addresses_all[i].owner = ctx->b.address;
- ctx->addresses_all[i].ip = talloc_strdup(ctx->addresses_all, iface_n_ip(ifaces, i));
+ ctx->addresses_all[i].ip = talloc_strdup(ctx->addresses_all, iface_list_n_ip(ifaces, i));
if (!ctx->addresses_all[i].ip) return NULL;
}
lpcfg_set_cmdline(tctx->lp_ctx, "dcerpc endpoint servers", "spoolss");
- load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
- address = iface_n_ip(ifaces, 0);
+ load_interface_list(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
+ address = iface_list_n_ip(ifaces, 0);
torture_comment(tctx, "Listening for callbacks on %s\n", address);
int i;
struct interface *ifaces;
- load_interfaces(NULL, lpcfg_interfaces(task->lp_ctx), &ifaces);
+ load_interface_list(NULL, lpcfg_interfaces(task->lp_ctx), &ifaces);
- num_interfaces = iface_count(ifaces);
+ num_interfaces = iface_list_count(ifaces);
for(i = 0; i < num_interfaces; i++) {
- const char *address = iface_n_ip(ifaces, i);
+ const char *address = iface_list_n_ip(ifaces, i);
status = stream_setup_socket(task,
task->event_ctx,
task->lp_ctx, model_ops,
int i;
struct interface *ifaces;
- load_interfaces(task, lpcfg_interfaces(lp_ctx), &ifaces);
+ load_interface_list(task, lpcfg_interfaces(lp_ctx), &ifaces);
- num_interfaces = iface_count(ifaces);
+ num_interfaces = iface_list_count(ifaces);
/* We have been given an interfaces line, and been
told to only bind to those interfaces. Create a
socket per interface and bind to only these.
*/
for(i = 0; i < num_interfaces; i++) {
- address = iface_n_ip(ifaces, i);
+ address = iface_list_n_ip(ifaces, i);
status = stream_setup_socket(task, task->event_ctx,
task->lp_ctx, model_ops,
&wreplsrv_stream_ops,
if (owner == NULL) {
struct interface *ifaces;
- load_interfaces(service, lpcfg_interfaces(lp_ctx), &ifaces);
- owner = iface_n_ip(ifaces, 0);
+ load_interface_list(service, lpcfg_interfaces(lp_ctx), &ifaces);
+ owner = iface_list_n_ip(ifaces, 0);
}
service->wins_db = winsdb_connect(service, service->task->event_ctx, lp_ctx, owner, WINSDB_HANDLE_CALLER_WREPL);