mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-09 13:02:01 +03:00
* samba/tests/summary.c: Remove. The test is now included ...
* samba/configure.in: ... here. * samba/tests/README: Remove, it's irrelevant. * samba/architecture.doc: Likewise. * samba/include/dlinklist.h: Remove, it's unused. Adjust dependencies. * samba/libsmb/namequery.c (name_status): Remove, it's unused. * Makefile.am: Remove unused Samba files.
This commit is contained in:
parent
a64b930445
commit
31ed57778b
@ -1,5 +1,14 @@
|
|||||||
2003-08-30 Pavel Roskin <proski@gnu.org>
|
2003-08-30 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
|
* samba/tests/summary.c: Remove. The test is now included ...
|
||||||
|
* samba/configure.in: ... here.
|
||||||
|
* samba/tests/README: Remove, it's irrelevant.
|
||||||
|
* samba/architecture.doc: Likewise.
|
||||||
|
* samba/include/dlinklist.h: Remove, it's unused. Adjust
|
||||||
|
dependencies.
|
||||||
|
* samba/libsmb/namequery.c (): Remove, it's unused.
|
||||||
|
* Makefile.am: Remove unused Samba files.
|
||||||
|
|
||||||
* samba/include/smb.h: Remove unneeded includes.
|
* samba/include/smb.h: Remove unneeded includes.
|
||||||
* samba/include/ntdomain.h: Remove, it's unused.
|
* samba/include/ntdomain.h: Remove, it's unused.
|
||||||
* samba/include/rpc*.h: Likewise.
|
* samba/include/rpc*.h: Likewise.
|
||||||
|
@ -82,113 +82,6 @@ static void _interpret_node_status(char *p, char *master,char *rname)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
do a netbios name status query on a host
|
|
||||||
|
|
||||||
the "master" parameter is a hack used for finding workgroups.
|
|
||||||
**************************************************************************/
|
|
||||||
BOOL name_status(int fd,char *name,int name_type,BOOL recurse,
|
|
||||||
struct in_addr to_ip,char *master,char *rname,
|
|
||||||
void (*fn)(struct packet_struct *))
|
|
||||||
{
|
|
||||||
BOOL found=False;
|
|
||||||
int retries = 2;
|
|
||||||
int retry_time = 5000;
|
|
||||||
struct timeval tval;
|
|
||||||
struct packet_struct p;
|
|
||||||
struct packet_struct *p2;
|
|
||||||
struct nmb_packet *nmb = &p.packet.nmb;
|
|
||||||
static int name_trn_id = 0;
|
|
||||||
|
|
||||||
memset((char *)&p,'\0',sizeof(p));
|
|
||||||
|
|
||||||
if (!name_trn_id) name_trn_id = ((unsigned)time(NULL)%(unsigned)0x7FFF) +
|
|
||||||
((unsigned)getpid()%(unsigned)100);
|
|
||||||
name_trn_id = (name_trn_id+1) % (unsigned)0x7FFF;
|
|
||||||
|
|
||||||
nmb->header.name_trn_id = name_trn_id;
|
|
||||||
nmb->header.opcode = 0;
|
|
||||||
nmb->header.response = False;
|
|
||||||
nmb->header.nm_flags.bcast = False;
|
|
||||||
nmb->header.nm_flags.recursion_available = False;
|
|
||||||
nmb->header.nm_flags.recursion_desired = False;
|
|
||||||
nmb->header.nm_flags.trunc = False;
|
|
||||||
nmb->header.nm_flags.authoritative = False;
|
|
||||||
nmb->header.rcode = 0;
|
|
||||||
nmb->header.qdcount = 1;
|
|
||||||
nmb->header.ancount = 0;
|
|
||||||
nmb->header.nscount = 0;
|
|
||||||
nmb->header.arcount = 0;
|
|
||||||
|
|
||||||
make_nmb_name(&nmb->question.question_name,name,name_type);
|
|
||||||
|
|
||||||
nmb->question.question_type = 0x21;
|
|
||||||
nmb->question.question_class = 0x1;
|
|
||||||
|
|
||||||
p.ip = to_ip;
|
|
||||||
p.port = NMB_PORT;
|
|
||||||
p.fd = fd;
|
|
||||||
p.timestamp = time(NULL);
|
|
||||||
p.packet_type = NMB_PACKET;
|
|
||||||
|
|
||||||
GetTimeOfDay(&tval);
|
|
||||||
|
|
||||||
if (!send_packet(&p))
|
|
||||||
return(False);
|
|
||||||
|
|
||||||
retries--;
|
|
||||||
|
|
||||||
while (1)
|
|
||||||
{
|
|
||||||
struct timeval tval2;
|
|
||||||
GetTimeOfDay(&tval2);
|
|
||||||
if (TvalDiff(&tval,&tval2) > retry_time) {
|
|
||||||
if (!retries) break;
|
|
||||||
if (!found && !send_packet(&p))
|
|
||||||
return False;
|
|
||||||
GetTimeOfDay(&tval);
|
|
||||||
retries--;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((p2=receive_packet(fd,NMB_PACKET,90)))
|
|
||||||
{
|
|
||||||
struct nmb_packet *nmb2 = &p2->packet.nmb;
|
|
||||||
debug_nmb_packet(p2);
|
|
||||||
|
|
||||||
if (nmb->header.name_trn_id != nmb2->header.name_trn_id ||
|
|
||||||
!nmb2->header.response) {
|
|
||||||
/* its not for us - maybe deal with it later */
|
|
||||||
if (fn)
|
|
||||||
fn(p2);
|
|
||||||
else
|
|
||||||
free_packet(p2);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nmb2->header.opcode != 0 ||
|
|
||||||
nmb2->header.nm_flags.bcast ||
|
|
||||||
nmb2->header.rcode ||
|
|
||||||
!nmb2->header.ancount ||
|
|
||||||
nmb2->answers->rr_type != 0x21) {
|
|
||||||
/* XXXX what do we do with this? could be a redirect, but
|
|
||||||
we'll discard it for the moment */
|
|
||||||
free_packet(p2);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
_interpret_node_status(&nmb2->answers->rdata[0], master,rname);
|
|
||||||
free_packet(p2);
|
|
||||||
return(True);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
DEBUG(0,("No status response (this is not unusual)\n"));
|
|
||||||
|
|
||||||
return(False);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
do a netbios name query to find someones IP
|
do a netbios name query to find someones IP
|
||||||
returns an array of IP addresses or NULL if none
|
returns an array of IP addresses or NULL if none
|
||||||
|
Loading…
Reference in New Issue
Block a user