Copyright (C) Jim McDonough (jmcd@us.ibm.com) 2003.
Copyright (C) James J Myers 2003
Copyright (C) Tim Potter 2000-2001
-
+
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/>.
*/
Copyright (C) Andrew Tridgell 1994-1998
Copyright (C) Jelmer Vernooij 2003
Copyright (C) Jeremy Allison 2006
-
+
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/>.
*/
rcls = IVAL(cli->inbuf, smb_rcls);
return (rcls & 0xF0000000) == 0xC0000000;
}
-
+
/* Return error if error class in non-zero */
rcls = CVAL(cli->inbuf, smb_rcls);
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/>.
-
+
Converted to store WINS data in a tdb. Dec 2005. JRA.
*/
/* We're using a byte-by-byte compare, so we must be sure that
* unused space doesn't have garbage in it.
*/
-
+
for( i = strlen( namerec->name.name ); i < sizeof( namerec->name.name ); i++ ) {
namerec->name.name[i] = '\0';
}
break;
}
}
-
+
DLIST_ADD(wins_server_subnet->namelist, namerec);
return namerec;
}
static uint64_t general_id = 1;
DEBUG(5,("get_global_id_and_update: updating version ID: %d\n", (int)general_id));
-
+
*current_id = general_id;
-
+
if (update) {
general_id++;
}
return;
}
}
-
+
/* Use the name without the nametype (and scope) appended */
namestr = nmb_namestr(&namerec->name);
remove_name_from_namelist(subrec, namerec);
namerec = NULL;
}
-
+
/*
* Deal with the case where the name found was a dns entry.
* Remove it as we now have a NetBIOS client registering the
update_wins_owner(namerec, our_fake_ip);
update_wins_flag(namerec, WINS_ACTIVE);
}
-
+
wins_hook("refresh", namerec, ttl);
send_wins_name_registration_response(0, ttl, p);
return;
/***********************************************************************
Deal with the special name query for *<1b>.
***********************************************************************/
-
+
static void process_wins_dmb_query_request(struct subnet_record *subrec,
struct packet_struct *p)
{
DEBUG(3,("wins_process_name_release_request: %s name release for name %s \
IP %s\n", releasing_group_name ? "Group" : "Unique", nmb_namestr(question), inet_ntoa(from_ip) ));
-
+
/*
* Deal with policy regarding 0x1d names.
*/
/*
* See if the name already exists.
*/
-
+
namerec = find_name_on_subnet(subrec, question, FIND_ANY_NAME);
if( (namerec == NULL) || ((namerec != NULL) && (namerec->data.source != REGISTER_NAME)) ) {
if (buf==NULL) {
return;
}
-
+
/* Record should use UNIX codepage. Ensure this is so in the wrepld code. JRA. */
record=(WINS_RECORD *)buf;
-
+
make_nmb_name(&question, record->name, record->type);
namerec = find_name_on_subnet(wins_server_subnet, &question, FIND_ANY_NAME);
get_global_id_and_update(&namerec->data.id, True);
else
overwrite=True;
-
+
} else {
/* the 2 records have different IP address */
if (namerec->data.wins_flags&WINS_ACTIVE) {
}
}
-
+
/* the replica is a standard group */
if (record->wins_flags&WINS_NGROUP || record->wins_flags&WINS_SGROUP) {
/* if the database record is unique and active force a name release */
/* send a release name to the unique node */
;
overwrite=True;
-
+
}
-
+
/* the replica is a special group */
if (record->wins_flags&WINS_SGROUP && namerec->data.wins_flags&WINS_SGROUP) {
if (namerec->data.wins_flags&WINS_ACTIVE) {
overwrite=True;
}
}
-
+
/* the replica is a multihomed host */
-
+
/* I'm giving up on multi homed. Too much complex to understand */
-
+
if (record->wins_flags&WINS_MHOMED) {
if (! (namerec->data.wins_flags&WINS_ACTIVE)) {
if ( !(namerec->data.wins_flags&WINS_RELEASED) && !(namerec->data.wins_flags&WINS_NGROUP))
else {
if (ip_equal_v4(record->wins_ip, namerec->data.wins_ip))
overwrite=True;
-
+
if (ip_equal_v4(namerec->data.wins_ip, our_fake_ip))
if (namerec->data.wins_flags&WINS_UNIQUE)
get_global_id_and_update(&namerec->data.id, True);
-
+
}
-
+
if (record->wins_flags&WINS_ACTIVE && namerec->data.wins_flags&WINS_ACTIVE)
if (namerec->data.wins_flags&WINS_UNIQUE ||
namerec->data.wins_flags&WINS_MHOMED)
if (ip_equal_v4(record->wins_ip, namerec->data.wins_ip))
overwrite=True;
-
+
}
if (overwrite == False)