2 Unix SMB/CIFS implementation.
4 WINS Replication server
6 Copyright (C) Stefan Metzmacher 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 struct wreplsrv_service;
24 struct wreplsrv_in_connection;
25 struct wreplsrv_out_connection;
26 struct wreplsrv_partner;
27 struct wreplsrv_pull_partner_item;
28 struct wreplsrv_push_partner_item;
30 #define WREPLSRV_VALID_ASSOC_CTX 0x12345678
31 #define WREPLSRV_INVALID_ASSOC_CTX 0x0000000a
34 state of an incoming wrepl call
36 struct wreplsrv_in_call {
37 struct wreplsrv_in_connection *wreplconn;
38 struct wrepl_packet req_packet;
39 struct wrepl_packet rep_packet;
43 state of an incoming wrepl connection
45 struct wreplsrv_in_connection {
46 struct wreplsrv_in_connection *prev,*next;
47 struct stream_connection *conn;
49 /* our global service context */
50 struct wreplsrv_service *service;
53 * the partner that connects us,
54 * can be NULL, when we got a connection
55 * from an unknown address
57 struct wreplsrv_partner *partner;
60 * we need to take care of our own ip address,
61 * as this is the WINS-Owner ID the peer expect
66 /* keep track of the assoc_ctx's */
73 /* the partial input on the connection */
78 * are we currently processing a request?
79 * this prevents loops, with half async code
84 * if this is set we no longer accept incoming packets
85 * and terminate the connection after we have send all packets
89 /* the list of outgoing DATA_BLOB's that needs to be send */
90 struct data_blob_list_item *send_queue;
94 state of an outcoming wrepl connection
96 struct wreplsrv_out_connection {
97 struct wreplsrv_partner *partner;
101 state of the whole wrepl service
103 struct wreplsrv_service {
104 /* the whole wrepl service is in one task */
105 struct task_server *task;
107 /* all incoming connections */
108 struct wreplsrv_in_connection *in_connections;
110 /* all partners (pull and push) */
111 struct wreplsrv_partner *partners;
113 /* all pull partners */
114 struct wreplsrv_pull_partner *pull_partners;
116 /* all push partners */
117 struct wreplsrv_push_partner *push_partners;