summaryrefslogtreecommitdiff
path: root/server/responder/nss
diff options
context:
space:
mode:
Diffstat (limited to 'server/responder/nss')
-rw-r--r--server/responder/nss/nsssrv.c32
-rw-r--r--server/responder/nss/nsssrv.h10
-rw-r--r--server/responder/nss/nsssrv_cmd.c2
-rw-r--r--server/responder/nss/nsssrv_dp.c20
4 files changed, 32 insertions, 32 deletions
diff --git a/server/responder/nss/nsssrv.c b/server/responder/nss/nsssrv.c
index 93490c46..0c5fd4cc 100644
--- a/server/responder/nss/nsssrv.c
+++ b/server/responder/nss/nsssrv.c
@@ -78,7 +78,7 @@ static int client_destructor(struct cli_ctx *ctx)
return 0;
}
-static void client_send(struct event_context *ev, struct cli_ctx *cctx)
+static void client_send(struct tevent_context *ev, struct cli_ctx *cctx)
{
int ret;
@@ -94,14 +94,14 @@ static void client_send(struct event_context *ev, struct cli_ctx *cctx)
}
/* ok all sent */
- EVENT_FD_NOT_WRITEABLE(cctx->cfde);
- EVENT_FD_READABLE(cctx->cfde);
+ TEVENT_FD_NOT_WRITEABLE(cctx->cfde);
+ TEVENT_FD_READABLE(cctx->cfde);
talloc_free(cctx->creq);
cctx->creq = NULL;
return;
}
-static void client_recv(struct event_context *ev, struct cli_ctx *cctx)
+static void client_recv(struct tevent_context *ev, struct cli_ctx *cctx)
{
int ret;
@@ -128,7 +128,7 @@ static void client_recv(struct event_context *ev, struct cli_ctx *cctx)
switch (ret) {
case EOK:
/* do not read anymore */
- EVENT_FD_NOT_READABLE(cctx->cfde);
+ TEVENT_FD_NOT_READABLE(cctx->cfde);
/* execute command */
ret = nss_cmd_execute(cctx);
if (ret != EOK) {
@@ -161,24 +161,24 @@ static void client_recv(struct event_context *ev, struct cli_ctx *cctx)
return;
}
-static void client_fd_handler(struct event_context *ev,
- struct fd_event *fde,
+static void client_fd_handler(struct tevent_context *ev,
+ struct tevent_fd *fde,
uint16_t flags, void *ptr)
{
struct cli_ctx *cctx = talloc_get_type(ptr, struct cli_ctx);
- if (flags & EVENT_FD_READ) {
+ if (flags & TEVENT_FD_READ) {
client_recv(ev, cctx);
return;
}
- if (flags & EVENT_FD_WRITE) {
+ if (flags & TEVENT_FD_WRITE) {
client_send(ev, cctx);
return;
}
}
-static void accept_fd_handler(struct event_context *ev,
- struct fd_event *fde,
+static void accept_fd_handler(struct tevent_context *ev,
+ struct tevent_fd *fde,
uint16_t flags, void *ptr)
{
/* accept and attach new event handler */
@@ -210,8 +210,8 @@ static void accept_fd_handler(struct event_context *ev,
return;
}
- cctx->cfde = event_add_fd(ev, cctx, cctx->cfd,
- EVENT_FD_READ, client_fd_handler, cctx);
+ cctx->cfde = tevent_add_fd(ev, cctx, cctx->cfd,
+ TEVENT_FD_READ, client_fd_handler, cctx);
if (!cctx->cfde) {
close(cctx->cfd);
talloc_free(cctx);
@@ -376,8 +376,8 @@ static int set_unix_socket(struct nss_ctx *nctx)
goto failed;
}
- nctx->lfde = event_add_fd(nctx->ev, nctx, nctx->lfd,
- EVENT_FD_READ, accept_fd_handler, nctx);
+ nctx->lfde = tevent_add_fd(nctx->ev, nctx, nctx->lfd,
+ TEVENT_FD_READ, accept_fd_handler, nctx);
/* we want default permissions on created files to be very strict,
so set our umask to 0177 */
@@ -495,7 +495,7 @@ done:
}
int nss_process_init(TALLOC_CTX *mem_ctx,
- struct event_context *ev,
+ struct tevent_context *ev,
struct confdb_ctx *cdb)
{
struct nss_ctx *nctx;
diff --git a/server/responder/nss/nsssrv.h b/server/responder/nss/nsssrv.h
index 03dc35af..333e4281 100644
--- a/server/responder/nss/nsssrv.h
+++ b/server/responder/nss/nsssrv.h
@@ -24,6 +24,7 @@
#include <stdint.h>
#include <sys/un.h>
+#include "config.h"
#include "talloc.h"
#include "tevent.h"
#include "ldb.h"
@@ -38,7 +39,6 @@
#define NSS_PACKET_MAX_RECV_SIZE 1024
/* NSS_DOMAIN_DELIM can be specified in config.h */
-#include "config.h"
#ifndef NSS_DOMAIN_DELIM
#define NSS_DOMAIN_DELIM '@'
#endif
@@ -51,8 +51,8 @@ struct sysdb_ctx;
struct getent_ctx;
struct nss_ctx {
- struct event_context *ev;
- struct fd_event *lfde;
+ struct tevent_context *ev;
+ struct tevent_fd *lfde;
int lfd;
struct sysdb_ctx *sysdb;
struct confdb_ctx *cdb;
@@ -72,10 +72,10 @@ struct nss_ctx {
};
struct cli_ctx {
- struct event_context *ev;
+ struct tevent_context *ev;
struct nss_ctx *nctx;
int cfd;
- struct fd_event *cfde;
+ struct tevent_fd *cfde;
struct sockaddr_un addr;
struct cli_request *creq;
struct getent_ctx *gctx;
diff --git a/server/responder/nss/nsssrv_cmd.c b/server/responder/nss/nsssrv_cmd.c
index 338de0ea..c61eb4f2 100644
--- a/server/responder/nss/nsssrv_cmd.c
+++ b/server/responder/nss/nsssrv_cmd.c
@@ -59,7 +59,7 @@ static void nss_cmd_done(struct nss_cmd_ctx *cmdctx)
{
/* now that the packet is in place, unlock queue
* making the event writable */
- EVENT_FD_WRITEABLE(cmdctx->cctx->cfde);
+ TEVENT_FD_WRITEABLE(cmdctx->cctx->cfde);
/* free all request related data through the talloc hierarchy */
talloc_free(cmdctx);
diff --git a/server/responder/nss/nsssrv_dp.c b/server/responder/nss/nsssrv_dp.c
index 46e21801..d4406e40 100644
--- a/server/responder/nss/nsssrv_dp.c
+++ b/server/responder/nss/nsssrv_dp.c
@@ -31,7 +31,7 @@
struct nss_dp_req {
nss_dp_callback_t callback;
void *callback_ctx;
- struct timed_event *te;
+ struct tevent_timer *te;
DBusPendingCall *pending_reply;
};
@@ -46,8 +46,8 @@ static int nss_dp_req_destructor(void *ptr)
return 0;
}
-static void nss_dp_send_acct_timeout(struct event_context *ev,
- struct timed_event *te,
+static void nss_dp_send_acct_timeout(struct tevent_context *ev,
+ struct tevent_timer *te,
struct timeval t, void *data)
{
struct nss_dp_req *ndp_req;
@@ -198,7 +198,7 @@ int nss_dp_send_acct_req(struct nss_ctx *nctx, TALLOC_CTX *memctx,
gettimeofday(&tv, NULL);
tv.tv_sec += timeout/1000;
tv.tv_usec += (timeout%1000) * 1000;
- ndp_req->te = event_add_timed(nctx->ev, memctx, tv,
+ ndp_req->te = tevent_add_timer(nctx->ev, memctx, tv,
nss_dp_send_acct_timeout, ndp_req);
/* Set up the reply handler */
@@ -327,14 +327,14 @@ struct nss_dp_pvt_ctx {
};
static int nss_dp_conn_destructor(void *data);
-static void nss_dp_reconnect(struct event_context *ev,
- struct timed_event *te,
+static void nss_dp_reconnect(struct tevent_context *ev,
+ struct tevent_timer *te,
struct timeval tv, void *data);
static void nss_dp_conn_reconnect(struct nss_dp_pvt_ctx *pvt)
{
struct nss_ctx *nctx;
- struct timed_event *te;
+ struct tevent_timer *te;
struct timeval tv;
struct sbus_method_ctx *sm_ctx;
char *sbus_address;
@@ -376,7 +376,7 @@ static void nss_dp_conn_reconnect(struct nss_dp_pvt_ctx *pvt)
tv.tv_sec = now +5;
tv.tv_usec = 0;
- te = event_add_timed(nctx->ev, nctx, tv, nss_dp_reconnect, pvt);
+ te = tevent_add_timer(nctx->ev, nctx, tv, nss_dp_reconnect, pvt);
if (te == NULL) {
DEBUG(4, ("Failed to add timed event! Giving up\n"));
} else {
@@ -385,8 +385,8 @@ static void nss_dp_conn_reconnect(struct nss_dp_pvt_ctx *pvt)
}
}
-static void nss_dp_reconnect(struct event_context *ev,
- struct timed_event *te,
+static void nss_dp_reconnect(struct tevent_context *ev,
+ struct tevent_timer *te,
struct timeval tv, void *data)
{
struct nss_dp_pvt_ctx *pvt;