typedef int BOOL;
-/*
- we use struct ipv4_addr to avoid having to include all the
- system networking headers everywhere
-*/
-struct ipv4_addr {
- uint32_t addr;
-};
-
#ifndef HAVE_STRERROR
extern char *sys_errlist[];
#define strerror(i) sys_errlist[i]
#include "pstring.h"
#include "smb_macros.h"
#include "smb.h"
-#include "ads.h"
#include "lib/socket/socket.h"
#include "libcli/ldap/ldap.h"
#include "byteorder.h"
#include "ntvfs/ntvfs.h"
#include "cli_context.h"
#include "nsswitch/winbind_client.h"
+#include "ads.h"
#define malloc_p(type) (type *)malloc(sizeof(type))
#define malloc_array_p(type, count) (type *)realloc_array(NULL, sizeof(type), count)
}
for (i=0;i<io->out.num_addrs;i++) {
- in.s_addr = htonl(packet->answers[0].rdata.netbios.addresses[i].ipaddr);
+ in.s_addr = htonl(packet->answers[0].rdata.netbios.addresses[i].ipaddr.addr);
addr = inet_ntoa(in);
if (addr == NULL) {
talloc_free(req);
struct nbt_rdata_address, 1);
if (packet->additional[0].rdata.netbios.addresses == NULL) goto failed;
packet->additional[0].rdata.netbios.addresses[0].nb_flags = io->in.nb_flags;
- packet->additional[0].rdata.netbios.addresses[0].ipaddr = htonl(inet_addr(io->in.address));
+ packet->additional[0].rdata.netbios.addresses[0].ipaddr.addr = htonl(inet_addr(io->in.address));
req = nbt_name_request_send(nbtsock, io->in.dest_addr, lp_nbt_port(), packet,
timeval_current_ofs(io->in.timeout, 0), False);
talloc_free(req);
return NT_STATUS_INVALID_NETWORK_RESPONSE;
}
- in.s_addr = htonl(packet->answers[0].rdata.netbios.addresses[0].ipaddr);
+ in.s_addr = htonl(packet->answers[0].rdata.netbios.addresses[0].ipaddr.addr);
addr = inet_ntoa(in);
if (addr == NULL) {
talloc_free(req);
struct nbt_rdata_address, 1);
if (packet->additional[0].rdata.netbios.addresses == NULL) goto failed;
packet->additional[0].rdata.netbios.addresses[0].nb_flags = io->in.nb_flags;
- packet->additional[0].rdata.netbios.addresses[0].ipaddr = htonl(inet_addr(io->in.address));
+ packet->additional[0].rdata.netbios.addresses[0].ipaddr.addr = htonl(inet_addr(io->in.address));
req = nbt_name_request_send(nbtsock, io->in.dest_addr, lp_nbt_port(), packet,
timeval_current_ofs(io->in.timeout, 0), False);
talloc_free(req);
return NT_STATUS_INVALID_NETWORK_RESPONSE;
}
- in.s_addr = htonl(packet->answers[0].rdata.netbios.addresses[0].ipaddr);
+ in.s_addr = htonl(packet->answers[0].rdata.netbios.addresses[0].ipaddr.addr);
addr = inet_ntoa(in);
if (addr == NULL) {
talloc_free(req);
talloc_set_destructor(req, nbt_name_request_destructor);
+ if (DEBUGLVL(10)) {
+ NDR_PRINT_DEBUG(nbt_name_packet, request);
+ }
+
status = ndr_push_struct_blob(&req->encoded, req, request,
(ndr_push_flags_fn_t)ndr_push_nbt_name_packet);
if (!NT_STATUS_IS_OK(status)) {
INIT_OBJ_FILES = librpc/gen_ndr/ndr_nbt.o
INIT_FUNCTION = dcerpc_nbt_init
NOPROTO = YES
-REQUIRED_SUBSYSTEMS = LIBNDR
+REQUIRED_SUBSYSTEMS = LIBNDR NDR_MISC
[SUBSYSTEM::NDR_ALL]
interface misc
{
+ typedef [public,noprint] struct {
+ uint32 addr;
+ } ipv4_addr;
+
typedef [public,noprint,gensize] struct {
uint32 time_low;
uint16 time_mid;
typedef struct {
nb_flags nb_flags;
- uint32 ipaddr;
+ ipv4_addr ipaddr;
} nbt_rdata_address;
typedef struct {
*/
#include "includes.h"
+#include "system/network.h"
+
+void ndr_print_ipv4_addr(struct ndr_print *ndr, const char *name, const struct ipv4_addr *_ip)
+{
+ struct ipv4_addr ip;
+
+ ip.addr = htonl(_ip->addr);
+
+ ndr->print(ndr, "%-25s: %s", name, sys_inet_ntoa(ip));
+}
/*
build a GUID from a string
struct nbt_rdata_address, 1);
if (packet->answers[0].rdata.netbios.addresses == NULL) goto failed;
packet->answers[0].rdata.netbios.addresses[0].nb_flags = nb_flags;
- packet->answers[0].rdata.netbios.addresses[0].ipaddr = htonl(inet_addr(address));
+ packet->answers[0].rdata.netbios.addresses[0].ipaddr.addr = htonl(inet_addr(address));
DEBUG(7,("Sending name query reply for %s<%02x> at %s to %s:%d\n",
name->name, name->type, src_address, address, src_port));
const char *src_address, int src_port)
{
DEBUG(0,("WINS query from %s\n", src_address));
+ if (DEBUGLVL(10)) {
+ NDR_PRINT_DEBUG(nbt_name_packet, packet);
+ }
}