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 2 of the License, or
+ 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,
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, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
time_t death_time; /* The time the record must be removed (do not remove if 0). */
time_t refresh_time; /* The time the record should be refreshed. */
- SMB_BIG_UINT id; /* unique id */
+ uint64_t id; /* unique id */
struct in_addr wins_ip; /* the adress of the wins server this record comes from */
int wins_flags; /* similar to the netbios flags but different ! */
/* This structure represents an entry in a local netbios name list. */
struct name_record {
- ubi_trNode node[1];
+ struct name_record *prev, *next;
struct subnet_record *subnet;
struct nmb_name name; /* The netbios name. */
struct nmb_data data; /* The netbios data. */
/* Browser cache for synchronising browse lists. */
struct browse_cache_record {
- ubi_dlNode node[1];
- fstring lmb_name;
- fstring work_group;
+ struct browse_cache_record *prev, *next;
+ unstring lmb_name;
+ unstring work_group;
struct in_addr ip;
time_t sync_time;
time_t death_time; /* The time the record must be removed. */
enum logon_state log_state;
/* Work group info. */
- fstring work_group;
+ unstring work_group;
int token; /* Used when communicating with backup browsers. */
- fstring local_master_browser_name; /* Current local master browser. */
+ unstring local_master_browser_name; /* Current local master browser. */
/* Announce info. */
time_t lastannounce_time;
int announce_interval;
- BOOL needannounce;
+ bool needannounce;
/* Timeout time for this workgroup. 0 means permanent. */
time_t death_time;
/* Election info */
- BOOL RunningElection;
- BOOL needelection;
+ bool RunningElection;
+ bool needelection;
int ElectionCount;
uint32 ElectionCriterion;
int repeat_count;
/* Recursion protection. */
- BOOL in_expiration_processing;
+ bool in_expiration_processing;
};
/* A subnet structure. It contains a list of workgroups and netbios names. */
enum subnet_type type; /* To catagorize the subnet. */
struct work_record *workgrouplist; /* List of workgroups. */
- ubi_trRoot namelist[1]; /* List of netbios names. */
+ struct name_record *namelist; /* List of netbios names. */
struct response_record *responselist; /* List of responses expected. */
- BOOL namelist_changed;
- BOOL work_changed;
+ bool namelist_changed;
+ bool work_changed;
struct in_addr bcast_ip;
struct in_addr mask_ip;
struct in_addr myip;
int nmb_sock; /* socket to listen for unicast 137. */
+ int nmb_bcast; /* socket to listen for broadcast 137. */
int dgram_sock; /* socket to listen for unicast 138. */
+ int dgram_bcast; /* socket to listen for broadcast 138. */
};
/* A resource record. */
struct {
int name_trn_id;
int opcode;
- BOOL response;
+ bool response;
struct {
- BOOL bcast;
- BOOL recursion_available;
- BOOL recursion_desired;
- BOOL trunc;
- BOOL authoritative;
+ bool bcast;
+ bool recursion_available;
+ bool recursion_desired;
+ bool trunc;
+ bool authoritative;
} nm_flags;
int rcode;
int qdcount;
#define DGRAM_UNIQUE 0x10
#define DGRAM_GROUP 0x11
#define DGRAM_BROADCAST 0x12
+/* defined in IDL
#define DGRAM_ERROR 0x13
+*/
#define DGRAM_QUERY_REQUEST 0x14
#define DGRAM_POSITIVE_QUERY_RESPONSE 0x15
#define DGRAM_NEGATIVE_QUERT_RESPONSE 0x16
int msg_type;
struct {
enum node_type node_type;
- BOOL first;
- BOOL more;
+ bool first;
+ bool more;
} flags;
int dgm_id;
struct in_addr source_ip;
{
struct packet_struct *next;
struct packet_struct *prev;
- BOOL locked;
+ bool locked;
struct in_addr ip;
int port;
- int fd;
+ int recv_fd;
+ int send_fd;
time_t timestamp;
enum packet_type packet_type;
union {
} packet;
};
-/* NETLOGON opcodes */
-
-#define QUERYFORPDC 7 /* Query for PDC. */
-#define SAM_UAS_CHANGE 10 /* Announce change to UAS or SAM. */
-#define QUERYFORPDC_R 12 /* Response to Query for PDC. */
-#define SAMLOGON 18
-#define SAMLOGON_R 19
-#define SAMLOGON_UNK_R 21
-#define SAMLOGON_AD_UNK_R 23
-#define SAMLOGON_AD_R 25
-
/* Ids for netbios packet types. */
#define ANN_HostAnnouncement 1
char type;
int nb_flags;
int wins_flags;
- SMB_BIG_UINT id;
+ uint64_t id;
int num_ips;
struct in_addr ip[25];
struct in_addr wins_ip;