2 Unix SMB/CIFS implementation.
4 structures for WINS replication client library
6 Copyright (C) Andrew Tridgell 2005
7 Copyright (C) Stefan Metzmacher 2005-2010
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #include "librpc/gen_ndr/nbt.h"
24 #include "librpc/gen_ndr/winsrepl.h"
29 main context structure for the wins replication client library
32 struct socket_context *sock;
33 struct packet_context *packet;
36 struct tevent_context *ctx;
37 struct tevent_fd *fde;
40 /* a queue of replies waiting to be received */
41 struct wrepl_request *recv_queue;
43 /* the default timeout for requests, 0 means no timeout */
44 #define WREPL_SOCKET_REQUEST_TIMEOUT (60)
45 uint32_t request_timeout;
47 /* counter for request timeouts, after 2 timeouts the socket is marked as dead */
48 uint32_t timeout_count;
50 /* remember is the socket is dead */
53 /* remember if we need to free the wrepl_socket at the end of wrepl_socket_dead() */
56 struct smb_iconv_convenience *iconv_convenience;
59 struct wrepl_send_ctrl {
61 bool disconnect_after_send;
67 struct wrepl_associate {
70 uint16_t major_version;
77 struct wrepl_associate_stop {
85 pull the partner table
87 struct wrepl_pull_table {
92 uint32_t num_partners;
93 struct wrepl_wins_owner *partners;
97 #define WREPL_NAME_TYPE(flags) (flags & WREPL_FLAGS_RECORD_TYPE)
98 #define WREPL_NAME_STATE(flags) ((flags & WREPL_FLAGS_RECORD_STATE)>>2)
99 #define WREPL_NAME_NODE(flags) ((flags & WREPL_FLAGS_NODE_TYPE)>>5)
100 #define WREPL_NAME_IS_STATIC(flags) ((flags & WREPL_FLAGS_IS_STATIC)?true:false)
102 #define WREPL_NAME_FLAGS(type, state, node, is_static) \
103 (type | (state << 2) | (node << 5) | \
104 (is_static ? WREPL_FLAGS_IS_STATIC : 0))
106 struct wrepl_address {
112 struct nbt_name name;
113 enum wrepl_name_type type;
114 enum wrepl_name_state state;
115 enum wrepl_name_node node;
120 uint32_t num_addresses;
121 struct wrepl_address *addresses;
125 a full pull replication
127 struct wrepl_pull_names {
130 struct wrepl_wins_owner partner;
134 struct wrepl_name *names;
138 struct resolve_context;
140 #include "libcli/wrepl/winsrepl_proto.h"