2 Unix SMB/CIFS implementation.
6 Copyright (C) Andrew Tridgell 2005
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #include "libcli/nbt/libnbt.h"
24 #include "libcli/wrepl/winsrepl.h"
25 #include "libcli/dgram/libdgram.h"
26 #include "librpc/gen_ndr/ndr_irpc.h"
27 #include "lib/messaging/irpc.h"
30 a list of our registered names on each interface
32 struct nbtd_iface_name {
33 struct nbtd_iface_name *next, *prev;
34 struct nbtd_interface *iface;
37 struct timeval registration_time;
40 /* if registered with a wins server, then this lists the server being
46 /* a list of network interfaces we are listening on */
47 struct nbtd_interface {
48 struct nbtd_interface *next, *prev;
49 struct nbtd_server *nbtsrv;
50 const char *ip_address;
51 const char *bcast_address;
53 struct nbt_name_socket *nbtsock;
54 struct nbt_dgram_socket *dgmsock;
55 struct nbtd_iface_name *names;
60 top level context structure for the nbt server
63 struct task_server *task;
65 /* the list of local network interfaces */
66 struct nbtd_interface *interfaces;
68 /* broadcast interface used for receiving packets only */
69 struct nbtd_interface *bcast_interface;
71 /* wins client interface - used for registering and refreshing
72 our names with a WINS server */
73 struct nbtd_interface *wins_interface;
75 struct wins_server *winssrv;
77 struct nbtd_statistics stats;
82 /* check a condition on an incoming packet */
83 #define NBTD_ASSERT_PACKET(packet, src, test) do { \
85 nbtd_bad_packet(packet, src, #test); \
90 #include "nbt_server/nbt_server_proto.h"