LIB_WITHOUT_PROTO_OBJ = $(LIBREPLACE_OBJ) $(SOCKET_WRAPPER_OBJ) $(TALLOC_OBJ) \
lib/messages.o librpc/gen_ndr/ndr_messaging.o lib/messages_local.o \
- lib/messages_ctdbd.o lib/packet.o lib/ctdbd_conn.o lib/talloc_stack.o
+ lib/messages_ctdbd.o lib/packet.o lib/ctdbd_conn.o lib/talloc_stack.o \
+ lib/interfaces.o
LIB_WITH_PROTO_OBJ = $(VERSION_OBJ) lib/charcnv.o lib/debug.o lib/fault.o \
lib/interface.o lib/md4.o \
- lib/interfaces.o lib/pidfile.o \
+ lib/pidfile.o \
lib/signal.o lib/system.o lib/sendfile.o lib/time.o \
lib/ufc.o lib/genrand.o lib/username.o \
lib/util_pw.o lib/access.o lib/smbrun.o \
static pstring service;
static pstring options;
-static struct in_addr dest_ip;
+static struct sockaddr_storage dest_ip;
static bool have_ip;
static int smb_port = 0;
static bool got_user;
struct cli_state *c;
struct nmb_name called, calling;
char *server_n;
- struct in_addr ip;
+ struct sockaddr_storage ip;
pstring server;
char *share;
make_nmb_name(&called , server, 0x20);
again:
- zero_ip_v4(&ip);
+ zero_addr(&ip, INADDR_ANY);
if (have_ip) ip = dest_ip;
/* have to open a new connection */
} else if(!strcmp(opts, "debug")) {
DEBUGLEVEL = val;
} else if(!strcmp(opts, "ip")) {
- dest_ip = *interpret_addr2(opteq+1);
- if (is_zero_ip_v4(dest_ip)) {
+ if (!interpret_string_addr(&dest_ip, opteq+1,
+ 0)) {
fprintf(stderr,"Can't resolve address %s\n", opteq+1);
exit(1);
}
static char *
canonicalize (char *path)
{
- char *canonical = malloc (PATH_MAX + 1);
+ char *canonical = (char*)malloc (PATH_MAX + 1);
if (!canonical) {
fprintf(stderr, "Error! Not enough memory!\n");
+/*
+ Unix SMB/CIFS implementation.
+ Machine customisation and include handling
+ Copyright (C) Jeremy Allison <jra@samba.org> 2007
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
/*
This structure is used by lib/interfaces.c to return the list of network
interfaces on the machine
*/
+#ifndef _INTERFACES_H
+#define _INTERFACES_H
+
+#include "lib/replace/replace.h"
+
#define MAX_INTERFACES 128
struct iface_struct {
struct sockaddr_storage netmask;
struct sockaddr_storage bcast;
};
+
+bool make_netmask(struct sockaddr_storage *pss_out,
+ const struct sockaddr_storage *pss_in,
+ unsigned long masklen);
+void make_bcast(struct sockaddr_storage *pss_out,
+ const struct sockaddr_storage *pss_in,
+ const struct sockaddr_storage *nmask);
+void make_net(struct sockaddr_storage *pss_out,
+ const struct sockaddr_storage *pss_in,
+ const struct sockaddr_storage *nmask);
+int get_interfaces(struct iface_struct *ifaces, int max_interfaces);
+
+#endif
static void make_bcast_or_net(struct sockaddr_storage *pss_out,
const struct sockaddr_storage *pss_in,
const struct sockaddr_storage *nmask,
- bool make_bcast)
+ bool make_bcast_p)
{
unsigned int i = 0, len = 0;
char *pmask = NULL;
}
for (i = 0; i < len; i++, p++, pmask++) {
- if (make_bcast) {
+ if (make_bcast_p) {
*p = (*p & *pmask) | (*pmask ^ 0xff);
} else {
/* make_net */
#include "system/filesys.h"
#include "system/wait.h"
#include "system/terminal.h"
+#include "system/passwd.h"
/*
* Define additional missing types
open_socket_in(SOCK_STREAM, port, 0,
ifss, True);
if(s == -1) {
- return false;
+ continue;
}
/* ready to listen */
ADS_STATUS status;
bool local = False;
fstring dc_name;
- struct in_addr dc_ip;
+ struct sockaddr_storage dc_ip;
if (ad_idmap_ads != NULL) {