Merge branch 'master' of ssh://git.samba.org/data/git/samba
[ira/wip.git] / source4 / ldap_server / ldap_server.c
index 0aa9afbdd687d1f99013757865890abe9401d194..61ff387152aa8e681c9ff71e6d69f4f6dccea18f 100644 (file)
@@ -26,8 +26,8 @@
 #include "auth/auth.h"
 #include "auth/credentials/credentials.h"
 #include "librpc/gen_ndr/ndr_samr.h"
-#include "lib/util/dlinklist.h"
-#include "lib/util/asn1.h"
+#include "../lib/util/dlinklist.h"
+#include "../lib/util/asn1.h"
 #include "ldap_server/ldap_server.h"
 #include "smbd/service_task.h"
 #include "smbd/service_stream.h"
@@ -55,9 +55,9 @@ void ldapsrv_terminate_connection(struct ldapsrv_connection *conn,
 /*
   handle packet errors
 */
-static void ldapsrv_error_handler(void *private, NTSTATUS status)
+static void ldapsrv_error_handler(void *private_data, NTSTATUS status)
 {
-       struct ldapsrv_connection *conn = talloc_get_type(private
+       struct ldapsrv_connection *conn = talloc_get_type(private_data,
                                                          struct ldapsrv_connection);
        ldapsrv_terminate_connection(conn, nt_errstr(status));
 }
@@ -132,10 +132,10 @@ static void ldapsrv_process_message(struct ldapsrv_connection *conn,
 /*
   decode/process data
 */
-static NTSTATUS ldapsrv_decode(void *private, DATA_BLOB blob)
+static NTSTATUS ldapsrv_decode(void *private_data, DATA_BLOB blob)
 {
        NTSTATUS status;
-       struct ldapsrv_connection *conn = talloc_get_type(private
+       struct ldapsrv_connection *conn = talloc_get_type(private_data,
                                                          struct ldapsrv_connection);
        struct asn1_data *asn1 = asn1_init(conn);
        struct ldap_message *msg = talloc(conn, struct ldap_message);
@@ -167,12 +167,12 @@ static NTSTATUS ldapsrv_decode(void *private, DATA_BLOB blob)
 /*
  Idle timeout handler
 */
-static void ldapsrv_conn_idle_timeout(struct event_context *ev,
-                                     struct timed_event *te,
+static void ldapsrv_conn_idle_timeout(struct tevent_context *ev,
+                                     struct tevent_timer *te,
                                      struct timeval t,
-                                     void *private)
+                                     void *private_data)
 {
-       struct ldapsrv_connection *conn = talloc_get_type(private, struct ldapsrv_connection);
+       struct ldapsrv_connection *conn = talloc_get_type(private_data, struct ldapsrv_connection);
 
        ldapsrv_terminate_connection(conn, "Timeout. No requests after bind");
 }
@@ -183,7 +183,7 @@ static void ldapsrv_conn_idle_timeout(struct event_context *ev,
 void ldapsrv_recv(struct stream_connection *c, uint16_t flags)
 {
        struct ldapsrv_connection *conn = 
-               talloc_get_type(c->private, struct ldapsrv_connection);
+               talloc_get_type(c->private_data, struct ldapsrv_connection);
 
        if (conn->limits.ite) { /* clean initial timeout if any */
                talloc_free(conn->limits.ite);
@@ -209,17 +209,17 @@ void ldapsrv_recv(struct stream_connection *c, uint16_t flags)
 static void ldapsrv_send(struct stream_connection *c, uint16_t flags)
 {
        struct ldapsrv_connection *conn = 
-               talloc_get_type(c->private, struct ldapsrv_connection);
+               talloc_get_type(c->private_data, struct ldapsrv_connection);
        
        packet_queue_run(conn->packet);
 }
 
-static void ldapsrv_conn_init_timeout(struct event_context *ev,
-                                     struct timed_event *te,
+static void ldapsrv_conn_init_timeout(struct tevent_context *ev,
+                                     struct tevent_timer *te,
                                      struct timeval t,
-                                     void *private)
+                                     void *private_data)
 {
-       struct ldapsrv_connection *conn = talloc_get_type(private, struct ldapsrv_connection);
+       struct ldapsrv_connection *conn = talloc_get_type(private_data, struct ldapsrv_connection);
 
        ldapsrv_terminate_connection(conn, "Timeout. No requests after initial connection");
 }
@@ -328,7 +328,7 @@ failed:
 static void ldapsrv_accept(struct stream_connection *c)
 {
        struct ldapsrv_service *ldapsrv_service = 
-               talloc_get_type(c->private, struct ldapsrv_service);
+               talloc_get_type(c->private_data, struct ldapsrv_service);
        struct ldapsrv_connection *conn;
        struct cli_credentials *server_credentials;
        struct socket_address *socket_address;
@@ -347,7 +347,7 @@ static void ldapsrv_accept(struct stream_connection *c)
        conn->sockets.raw = c->socket;
        conn->lp_ctx      = ldapsrv_service->task->lp_ctx;
 
-       c->private        = conn;
+       c->private_data   = conn;
 
        socket_address = socket_get_my_addr(c->socket, conn);
        if (!socket_address) {
@@ -440,7 +440,7 @@ static const struct stream_server_ops ldap_stream_ops = {
 /*
   add a socket address to the list of events, one event per port
 */
-static NTSTATUS add_socket(struct event_context *event_context,
+static NTSTATUS add_socket(struct tevent_context *event_context,
                           struct loadparm_context *lp_ctx, 
                           const struct model_ops *model_ops,
                           const char *address, struct ldapsrv_service *ldap_service)