summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/server/src/server-handshake.c
diff options
context:
space:
mode:
authorPrasanna Kumar Kalever <prasanna.kalever@redhat.com>2016-08-30 13:40:41 +0530
committerRaghavendra G <rgowdapp@redhat.com>2016-09-06 02:30:05 -0700
commitdb3286184a1ab89d3edb9cf4d645a2db724fada0 (patch)
treed21e510517962e23c099fa249f632e12a54b1dc0 /xlators/protocol/server/src/server-handshake.c
parentc67386e1e8edcbdf2f8dca06fc7984df2adb1f06 (diff)
protocol-server: generate events
This patch add/generate the events seen from/in the protocol server side, which will be consumed by the new eventing framework. ------------------------------------------------------------------------- | event | description | |-------------------------------|---------------------------------------| | EVENT_CLIENT_CONNECT | new client connected | |-------------------------------|---------------------------------------| | EVENT_CLIENT_AUTH_REJECT | client cannot be authenticated | |-------------------------------|---------------------------------------| | EVENT_CLIENT_DISCONNECT | client had disconnected | ------------------------------------------------------------------------- Thanks to "Raghavendra Talur" <rtalur@redhat.com> for all the help Change-Id: I4fda83fae7747507f64d81a7645cc3a8a2fbaeae BUG: 1369403 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com> Reviewed-on: http://review.gluster.org/15294 Tested-by: Prasanna Kumar Kalever <pkalever@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/protocol/server/src/server-handshake.c')
-rw-r--r--xlators/protocol/server/src/server-handshake.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/xlators/protocol/server/src/server-handshake.c b/xlators/protocol/server/src/server-handshake.c
index 7715952..1230cdf 100644
--- a/xlators/protocol/server/src/server-handshake.c
+++ b/xlators/protocol/server/src/server-handshake.c
@@ -18,6 +18,7 @@
#include "authenticate.h"
#include "server-messages.h"
#include "syscall.h"
+#include "events.h"
struct __get_xl_struct {
const char *name;
@@ -690,6 +691,15 @@ server_setvolume (rpcsvc_request_t *req)
"accepted client from %s (version: %s)",
client->client_uid,
(clnt_version) ? clnt_version : "old");
+
+ gf_event (EVENT_CLIENT_CONNECT, "client_uid=%s;"
+ "client_identifier=%s;server_identifier=%s;"
+ "brick_path=%s",
+ client->client_uid,
+ req->trans->peerinfo.identifier,
+ req->trans->myinfo.identifier,
+ name);
+
op_ret = 0;
client->bound_xl = xl;
ret = dict_set_str (reply, "ERROR", "Success");
@@ -697,6 +707,13 @@ server_setvolume (rpcsvc_request_t *req)
gf_msg_debug (this->name, 0, "failed to set error "
"msg");
} else {
+ gf_event (EVENT_CLIENT_AUTH_REJECT, "client_uid=%s;"
+ "client_identifier=%s;server_identifier=%s;"
+ "brick_path=%s",
+ client->client_uid,
+ req->trans->peerinfo.identifier,
+ req->trans->myinfo.identifier,
+ name);
gf_msg (this->name, GF_LOG_ERROR, EACCES,
PS_MSG_AUTHENTICATE_ERROR, "Cannot authenticate client"
" from %s %s", client->client_uid,