have to worry about LDAP structure types */
NTSTATUS smbldap_init(TALLOC_CTX *mem_ctx,
- struct event_context *event_ctx,
+ struct tevent_context *tevent_ctx,
const char *location,
struct smbldap_state **smbldap_state);
unsigned int num_failures;
time_t last_use; /* monotonic */
- struct event_context *event_context;
+ struct tevent_context *tevent_context;
struct timed_event *idle_event;
struct timeval last_rebind; /* monotonic */
const char *filter, const char **search_attr,
LDAPMessage ** result);
void smbldap_free_struct(struct smbldap_state **ldap_state) ;
-NTSTATUS smbldap_init(TALLOC_CTX *mem_ctx, struct event_context *event_ctx,
+NTSTATUS smbldap_init(TALLOC_CTX *mem_ctx, struct tevent_context *tevent_ctx,
const char *location,
struct smbldap_state **smbldap_state);
bool smbldap_has_control(LDAP *ld, const char *control);
#include "smbldap.h"
#include "secrets.h"
#include "../libcli/security/security.h"
+#include <tevent.h>
/* Try not to hit the up or down server forever */
return rc;
}
-static void smbldap_idle_fn(struct event_context *event_ctx,
+static void smbldap_idle_fn(struct tevent_context *tevent_ctx,
struct timed_event *te,
struct timeval now_abs,
void *private_data);
TALLOC_FREE(ldap_state->idle_event);
- if (ldap_state->event_context != NULL) {
- ldap_state->idle_event = event_add_timed(
- ldap_state->event_context, ldap_state,
+ if (ldap_state->tevent_context != NULL) {
+ ldap_state->idle_event = tevent_add_timer(
+ ldap_state->tevent_context, ldap_state,
timeval_current_ofs(SMBLDAP_IDLE_TIME, 0),
smbldap_idle_fn, ldap_state);
}
filter, search_attr, 0, result);
}
-static void smbldap_idle_fn(struct event_context *event_ctx,
+static void smbldap_idle_fn(struct tevent_context *tevent_ctx,
struct timed_event *te,
struct timeval now_abs,
void *private_data)
DEBUG(10,("ldap connection not idle...\n"));
/* this needs to be made monotonic clock aware inside tevent: */
- state->idle_event = event_add_timed(
- event_ctx, state,
+ state->idle_event = tevent_add_timer(
+ tevent_ctx, state,
timeval_add(&now_abs, SMBLDAP_IDLE_TIME, 0),
smbldap_idle_fn,
private_data);
Intitalise the 'general' ldap structures, on which ldap operations may be conducted
*********************************************************************/
-NTSTATUS smbldap_init(TALLOC_CTX *mem_ctx, struct event_context *event_ctx,
+NTSTATUS smbldap_init(TALLOC_CTX *mem_ctx, struct tevent_context *tevent_ctx,
const char *location,
struct smbldap_state **smbldap_state)
{
(*smbldap_state)->uri = "ldap://localhost";
}
- (*smbldap_state)->event_context = event_ctx;
+ (*smbldap_state)->tevent_context = tevent_ctx;
talloc_set_destructor(*smbldap_state, smbldap_state_destructor);
return NT_STATUS_OK;