- /*
+/*
Unix SMB/CIFS implementation.
Copyright (C) Rafal Szczesniak 2005
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/>.
*/
/*
c->status = dcerpc_ndr_request_recv(req);
if (!composite_is_ok(c)) return;
+ if (s->monitor_fn) {
+ struct monitor_msg msg;
+
+ msg.type = rpc_close;
+ msg.data = NULL;
+ msg.data_size = 0;
+ s->monitor_fn(&msg);
+ }
+
/* reset domain handle and associated data in libnet_context */
s->ctx->samr.name = NULL;
s->ctx->samr.access_mask = 0;
c->status = dcerpc_ndr_request_recv(req);
if (!composite_is_ok(c)) return;
+ if (s->monitor_fn) {
+ struct monitor_msg msg;
+
+ msg.type = rpc_connect;
+ msg.data = NULL;
+ msg.data_size = 0;
+ s->monitor_fn(&msg);
+ }
+
r = &s->lookup;
/* prepare for samr_LookupDomain call */
/* receive samr_LookupDomain reply */
c->status = dcerpc_ndr_request_recv(req);
+ if (s->monitor_fn) {
+ struct monitor_msg msg;
+ struct msg_rpc_lookup_domain data;
+
+ data.domain_name = s->domain_name.string;
+
+ msg.type = rpc_lookup_domain;
+ msg.data = (void*)&data;
+ msg.data_size = sizeof(data);
+ s->monitor_fn(&msg);
+ }
+
r = &s->open;
/* check the rpc layer status */
c->status = dcerpc_ndr_request_recv(req);
if (!composite_is_ok(c)) return;
+ if (s->monitor_fn) {
+ struct monitor_msg msg;
+
+ msg.type = rpc_open_domain;
+ msg.data = NULL;
+ msg.data_size = 0;
+ s->monitor_fn(&msg);
+ }
+
composite_done(c);
}
s->rpcconn.in.dcerpc_iface = &dcerpc_table_samr;
/* send rpc pipe connect request */
- rpcconn_req = libnet_RpcConnect_send(ctx, c, &s->rpcconn);
+ rpcconn_req = libnet_RpcConnect_send(ctx, c, &s->rpcconn, s->monitor_fn);
if (composite_nomem(rpcconn_req, c)) return c;
composite_continue(c, rpcconn_req, continue_domain_open_rpc_connect, c);
s->rpcconn.in.dcerpc_iface = &dcerpc_table_lsarpc;
/* send rpc pipe connect request */
- rpcconn_req = libnet_RpcConnect_send(ctx, c, &s->rpcconn);
+ rpcconn_req = libnet_RpcConnect_send(ctx, c, &s->rpcconn, s->monitor_fn);
if (composite_nomem(rpcconn_req, c)) return c;
composite_continue(c, rpcconn_req, continue_rpc_connect_lsa, c);
s->rpcconn.in.name = s->hostname;
s->rpcconn.in.dcerpc_iface = &dcerpc_table_samr;
- rpcconn_req = libnet_RpcConnect_send(ctx, c, &s->rpcconn);
+ rpcconn_req = libnet_RpcConnect_send(ctx, c, &s->rpcconn, s->monitor_fn);
if (composite_nomem(rpcconn_req, c)) return c;
composite_continue(c, rpcconn_req, continue_rpc_connect, c);