summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/libnet/composite.h37
-rw-r--r--source4/libnet/libnet_domain.c62
-rw-r--r--source4/libnet/libnet_rpc.c16
-rw-r--r--source4/libnet/userinfo.c8
-rw-r--r--source4/libnet/userman.c16
-rw-r--r--source4/torture/libnet/userinfo.c6
-rw-r--r--source4/torture/libnet/userman.c2
7 files changed, 103 insertions, 44 deletions
diff --git a/source4/libnet/composite.h b/source4/libnet/composite.h
index c888f513d1..ac4d320f09 100644
--- a/source4/libnet/composite.h
+++ b/source4/libnet/composite.h
@@ -24,22 +24,27 @@
*/
-#define rpc_create_user (0x00000001)
-#define rpc_open_user (0x00000002)
-#define rpc_query_user (0x00000003)
-#define rpc_close_user (0x00000004)
-#define rpc_lookup_name (0x00000005)
-#define rpc_delete_user (0x00000006)
-#define rpc_set_user (0x00000007)
-#define rpc_close (0x00000008)
-#define rpc_connect (0x00000009)
-#define rpc_lookup_domain (0x00000010)
-#define rpc_open_domain (0x00000011)
-#define rpc_open_policy (0x00000012)
-#define rpc_query_policy (0x00000013)
-
-#define net_lookup_dc (0x00000100)
-#define net_rpc_connect (0x00000200)
+#define mon_SamrCreateUser (0x00000001)
+#define mon_SamrOpenUser (0x00000002)
+#define mon_SamrQueryUser (0x00000003)
+#define mon_SamrCloseUser (0x00000004)
+#define mon_SamrLookupName (0x00000005)
+#define mon_SamrDeleteUser (0x00000006)
+#define mon_SamrSetUser (0x00000007)
+#define mon_SamrClose (0x00000008)
+#define mon_SamrConnect (0x00000009)
+#define mon_SamrLookupDomain (0x0000000A)
+#define mon_SamrOpenDomain (0x0000000B)
+#define mon_SamrEnumDomains (0x0000000C)
+#define mon_LsaOpenPolicy (0x0000000D)
+#define mon_LsaQueryPolicy (0x0000000E)
+#define mon_LsaClose (0x0000000F)
+
+#define mon_NetLookupDc (0x00000100)
+#define mon_NetRpcConnect (0x00000200)
+
+#define mon_Mask_Rpc (0x000000FF)
+#define mon_Mask_Net (0x0000FF00)
struct monitor_msg {
diff --git a/source4/libnet/libnet_domain.c b/source4/libnet/libnet_domain.c
index 0b28093949..500d5f817d 100644
--- a/source4/libnet/libnet_domain.c
+++ b/source4/libnet/libnet_domain.c
@@ -103,7 +103,7 @@ static void continue_domain_open_close(struct rpc_request *req)
if (s->monitor_fn) {
struct monitor_msg msg;
- msg.type = rpc_close;
+ msg.type = mon_SamrClose;
msg.data = NULL;
msg.data_size = 0;
s->monitor_fn(&msg);
@@ -148,7 +148,7 @@ static void continue_domain_open_connect(struct rpc_request *req)
if (s->monitor_fn) {
struct monitor_msg msg;
- msg.type = rpc_connect;
+ msg.type = mon_SamrConnect;
msg.data = NULL;
msg.data_size = 0;
s->monitor_fn(&msg);
@@ -189,7 +189,7 @@ static void continue_domain_open_lookup(struct rpc_request *req)
data.domain_name = s->domain_name.string;
- msg.type = rpc_lookup_domain;
+ msg.type = mon_SamrLookupDomain;
msg.data = (void*)&data;
msg.data_size = sizeof(data);
s->monitor_fn(&msg);
@@ -237,7 +237,7 @@ static void continue_domain_open_open(struct rpc_request *req)
if (s->monitor_fn) {
struct monitor_msg msg;
- msg.type = rpc_open_domain;
+ msg.type = mon_SamrOpenDomain;
msg.data = NULL;
msg.data_size = 0;
s->monitor_fn(&msg);
@@ -518,6 +518,15 @@ static void continue_lsa_policy_open(struct rpc_request *req)
c->status = dcerpc_ndr_request_recv(req);
if (!composite_is_ok(c)) return;
+ if (s->monitor_fn) {
+ struct monitor_msg msg;
+
+ msg.type = mon_LsaOpenPolicy;
+ msg.data = NULL;
+ msg.data_size = 0;
+ s->monitor_fn(&msg);
+ }
+
composite_done(c);
}
@@ -709,6 +718,15 @@ static void continue_lsa_close(struct rpc_request *req)
c->status = dcerpc_ndr_request_recv(req);
if (!composite_is_ok(c)) return;
+ if (s->monitor_fn) {
+ struct monitor_msg msg;
+
+ msg.type = mon_LsaClose;
+ msg.data = NULL;
+ msg.data_size = 0;
+ s->monitor_fn(&msg);
+ }
+
composite_done(c);
}
@@ -801,6 +819,15 @@ static void continue_samr_close(struct rpc_request *req)
c->status = dcerpc_ndr_request_recv(req);
if (!composite_is_ok(c)) return;
+
+ if (s->monitor_fn) {
+ struct monitor_msg msg;
+
+ msg.type = mon_SamrClose;
+ msg.data = NULL;
+ msg.data_size = 0;
+ s->monitor_fn(&msg);
+ }
composite_done(c);
}
@@ -954,6 +981,15 @@ static void continue_samr_connect(struct rpc_request *req)
c->status = dcerpc_ndr_request_recv(req);
if (!composite_is_ok(c)) return;
+ if (s->monitor_fn) {
+ struct monitor_msg msg;
+
+ msg.type = mon_SamrConnect;
+ msg.data = NULL;
+ msg.data_size = 0;
+ s->monitor_fn(&msg);
+ }
+
s->enumdom.in.connect_handle = &s->connect_handle;
s->enumdom.in.resume_handle = &s->resume_handle;
s->enumdom.in.buf_size = s->buf_size;
@@ -984,6 +1020,15 @@ static void continue_samr_enum_domains(struct rpc_request *req)
c->status = dcerpc_ndr_request_recv(req);
if (!composite_is_ok(c)) return;
+ if (s->monitor_fn) {
+ struct monitor_msg msg;
+
+ msg.type = mon_SamrEnumDomains;
+ msg.data = NULL;
+ msg.data_size = 0;
+ s->monitor_fn(&msg);
+ }
+
if (NT_STATUS_IS_OK(s->enumdom.out.result)) {
s->domains = get_domain_list(c, s);
@@ -1035,6 +1080,15 @@ static void continue_samr_close_handle(struct rpc_request *req)
c->status = dcerpc_ndr_request_recv(req);
if (!composite_is_ok(c)) return;
+ if (s->monitor_fn) {
+ struct monitor_msg msg;
+
+ msg.type = mon_SamrClose;
+ msg.data = NULL;
+ msg.data_size = 0;
+ s->monitor_fn(&msg);
+ }
+
/* did everything go fine ? */
if (!NT_STATUS_IS_OK(s->samrclose.out.result)) {
composite_error(c, s->samrclose.out.result);
diff --git a/source4/libnet/libnet_rpc.c b/source4/libnet/libnet_rpc.c
index 7f4ab0021a..02d7cf0c00 100644
--- a/source4/libnet/libnet_rpc.c
+++ b/source4/libnet/libnet_rpc.c
@@ -148,7 +148,7 @@ static void continue_pipe_connect(struct composite_context *ctx)
data.transport = binding->transport;
data.domain_name = binding->target_hostname;
- msg.type = net_rpc_connect;
+ msg.type = mon_NetRpcConnect;
msg.data = (void*)&data;
msg.data_size = sizeof(data);
s->monitor_fn(&msg);
@@ -307,7 +307,7 @@ static void continue_lookup_dc(struct composite_context *ctx)
data.hostname = s->f.out.dcs[0].name;
data.address = s->f.out.dcs[0].address;
- msg.type = net_lookup_dc;
+ msg.type = mon_NetLookupDc;
msg.data = &data;
msg.data_size = sizeof(data);
s->monitor_fn(&msg);
@@ -360,7 +360,7 @@ static void continue_rpc_connect(struct composite_context *ctx)
data.transport = binding->transport;
data.domain_name = binding->target_hostname;
- msg.type = net_rpc_connect;
+ msg.type = mon_NetRpcConnect;
msg.data = (void*)&data;
msg.data_size = sizeof(data);
s->monitor_fn(&msg);
@@ -528,7 +528,7 @@ static void continue_dci_rpc_connect(struct composite_context *ctx)
data.transport = binding->transport;
data.domain_name = binding->target_hostname;
- msg.type = net_rpc_connect;
+ msg.type = mon_NetRpcConnect;
msg.data = (void*)&data;
msg.data_size = sizeof(data);
s->monitor_fn(&msg);
@@ -596,7 +596,7 @@ static void continue_lsa_policy(struct rpc_request *req)
if (s->monitor_fn) {
struct monitor_msg msg;
- msg.type = rpc_open_policy;
+ msg.type = mon_LsaOpenPolicy;
msg.data = NULL;
msg.data_size = 0;
s->monitor_fn(&msg);
@@ -669,7 +669,7 @@ static void continue_lsa_query_info2(struct rpc_request *req)
if (s->monitor_fn) {
struct monitor_msg msg;
- msg.type = rpc_query_policy;
+ msg.type = mon_LsaQueryPolicy;
msg.data = NULL;
msg.data_size = 0;
s->monitor_fn(&msg);
@@ -710,7 +710,7 @@ static void continue_lsa_query_info(struct rpc_request *req)
if (s->monitor_fn) {
struct monitor_msg msg;
- msg.type = rpc_query_policy;
+ msg.type = mon_LsaQueryPolicy;
msg.data = NULL;
msg.data_size = 0;
s->monitor_fn(&msg);
@@ -816,7 +816,7 @@ static void continue_secondary_conn(struct composite_context *ctx)
data.transport = binding->transport;
data.domain_name = binding->target_hostname;
- msg.type = net_rpc_connect;
+ msg.type = mon_NetRpcConnect;
msg.data = (void*)&data;
msg.data_size = sizeof(data);
s->monitor_fn(&msg);
diff --git a/source4/libnet/userinfo.c b/source4/libnet/userinfo.c
index 1e9daa5549..847997fc12 100644
--- a/source4/libnet/userinfo.c
+++ b/source4/libnet/userinfo.c
@@ -79,7 +79,7 @@ static void continue_userinfo_lookup(struct rpc_request *req)
/* issue a monitor message */
if (s->monitor_fn) {
- msg.type = rpc_lookup_name;
+ msg.type = mon_SamrLookupName;
msg_lookup = talloc(s, struct msg_rpc_lookup_name);
msg_lookup->rid = s->lookup.out.rids.ids;
msg_lookup->count = s->lookup.out.rids.count;
@@ -137,7 +137,7 @@ static void continue_userinfo_openuser(struct rpc_request *req)
/* issue a monitor message */
if (s->monitor_fn) {
- msg.type = rpc_open_user;
+ msg.type = mon_SamrOpenUser;
msg_open = talloc(s, struct msg_rpc_open_user);
msg_open->rid = s->openuser.in.rid;
msg_open->access_mask = s->openuser.in.access_mask;
@@ -187,7 +187,7 @@ static void continue_userinfo_getuser(struct rpc_request *req)
/* issue a monitor message */
if (s->monitor_fn) {
- msg.type = rpc_query_user;
+ msg.type = mon_SamrQueryUser;
msg_query = talloc(s, struct msg_rpc_query_user);
msg_query->level = s->queryuserinfo.in.level;
msg.data = (void*)msg_query;
@@ -232,7 +232,7 @@ static void continue_userinfo_closeuser(struct rpc_request *req)
/* issue a monitor message */
if (s->monitor_fn) {
- msg.type = rpc_close_user;
+ msg.type = mon_SamrClose;
msg_close = talloc(s, struct msg_rpc_close_user);
msg_close->rid = s->openuser.in.rid;
msg.data = (void*)msg_close;
diff --git a/source4/libnet/userman.c b/source4/libnet/userman.c
index 94448535cd..2efb892155 100644
--- a/source4/libnet/userman.c
+++ b/source4/libnet/userman.c
@@ -85,7 +85,7 @@ static void useradd_handler(struct rpc_request *req)
c->status = useradd_create(c, s);
/* prepare a message to pass to monitor function */
- msg.type = rpc_create_user;
+ msg.type = mon_SamrCreateUser;
rpc_create = talloc(s, struct msg_rpc_create_user);
rpc_create->rid = *s->createuser.out.rid;
msg.data = (void*)rpc_create;
@@ -350,7 +350,7 @@ static void userdel_handler(struct rpc_request *req)
c->status = userdel_lookup(c, s);
/* monitor message */
- msg.type = rpc_lookup_name;
+ msg.type = mon_SamrLookupName;
msg_lookup = talloc(s, struct msg_rpc_lookup_name);
msg_lookup->rid = s->lookupname.out.rids.ids;
@@ -363,7 +363,7 @@ static void userdel_handler(struct rpc_request *req)
c->status = userdel_open(c, s);
/* monitor message */
- msg.type = rpc_open_user;
+ msg.type = mon_SamrOpenUser;
msg_open = talloc(s, struct msg_rpc_open_user);
msg_open->rid = s->openuser.in.rid;
@@ -376,7 +376,7 @@ static void userdel_handler(struct rpc_request *req)
c->status = userdel_delete(c, s);
/* monitor message */
- msg.type = rpc_delete_user;
+ msg.type = mon_SamrDeleteUser;
msg.data = NULL;
msg.data_size = 0;
break;
@@ -829,7 +829,7 @@ static void usermod_handler(struct rpc_request *req)
if (NT_STATUS_IS_OK(c->status)) {
/* monitor message */
- msg.type = rpc_lookup_name;
+ msg.type = mon_SamrLookupName;
msg_lookup = talloc(s, struct msg_rpc_lookup_name);
msg_lookup->rid = s->lookupname.out.rids.ids;
@@ -844,7 +844,7 @@ static void usermod_handler(struct rpc_request *req)
if (NT_STATUS_IS_OK(c->status)) {
/* monitor message */
- msg.type = rpc_open_user;
+ msg.type = mon_SamrOpenUser;
msg_open = talloc(s, struct msg_rpc_open_user);
msg_open->rid = s->openuser.in.rid;
@@ -859,7 +859,7 @@ static void usermod_handler(struct rpc_request *req)
if (NT_STATUS_IS_OK(c->status)) {
/* monitor message */
- msg.type = rpc_query_user;
+ msg.type = mon_SamrQueryUser;
msg.data = NULL;
msg.data_size = 0;
}
@@ -870,7 +870,7 @@ static void usermod_handler(struct rpc_request *req)
if (NT_STATUS_IS_OK(c->status)) {
/* monitor message */
- msg.type = rpc_set_user;
+ msg.type = mon_SamrSetUser;
msg.data = NULL;
msg.data_size = 0;
}
diff --git a/source4/torture/libnet/userinfo.c b/source4/torture/libnet/userinfo.c
index b1c48d9f39..42050419f9 100644
--- a/source4/torture/libnet/userinfo.c
+++ b/source4/torture/libnet/userinfo.c
@@ -226,16 +226,16 @@ static void msg_handler(struct monitor_msg *m)
struct msg_rpc_close_user *msg_close;
switch (m->type) {
- case rpc_open_user:
+ case mon_SamrOpenUser:
msg_open = (struct msg_rpc_open_user*)m->data;
printf("monitor_msg: user opened (rid=%d, access_mask=0x%08x)\n",
msg_open->rid, msg_open->access_mask);
break;
- case rpc_query_user:
+ case mon_SamrQueryUser:
msg_query = (struct msg_rpc_query_user*)m->data;
printf("monitor_msg: user queried (level=%d)\n", msg_query->level);
break;
- case rpc_close_user:
+ case mon_SamrCloseUser:
msg_close = (struct msg_rpc_close_user*)m->data;
printf("monitor_msg: user closed (rid=%d)\n", msg_close->rid);
break;
diff --git a/source4/torture/libnet/userman.c b/source4/torture/libnet/userman.c
index c754c92626..7ffbe43fbb 100644
--- a/source4/torture/libnet/userman.c
+++ b/source4/torture/libnet/userman.c
@@ -104,7 +104,7 @@ static void msg_handler(struct monitor_msg *m)
struct msg_rpc_create_user *msg_create;
switch (m->type) {
- case rpc_create_user:
+ case mon_SamrCreateUser:
msg_create = (struct msg_rpc_create_user*)m->data;
printf("monitor_msg: user created (rid=%d)\n", msg_create->rid);
break;