r20648: Closer to a build... Add missing header file.
[Samba.git] / source / nbt_server / nbt_server.h
blobe5a33ca5f15b4d6f3d8e637c341f823d989f3e21
1 /*
2 Unix SMB/CIFS implementation.
4 NBT server structures
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/irpc.h"
27 #include "lib/messaging/irpc.h"
29 /*
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;
35 struct nbt_name name;
36 uint16_t nb_flags;
37 struct timeval registration_time;
38 uint32_t ttl;
40 /* if registered with a wins server, then this lists the server being
41 used */
42 const char *wins_server;
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;
52 const char *netmask;
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
62 struct nbtd_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;
79 struct ldb_context *sam_ctx;
84 /* check a condition on an incoming packet */
85 #define NBTD_ASSERT_PACKET(packet, src, test) do { \
86 if (!(test)) { \
87 nbtd_bad_packet(packet, src, #test); \
88 return; \
89 } \
90 } while (0)
92 #include "nbt_server/nbt_server_proto.h"