s4-idmap: Add mapping using uidNumber and gidNumber like idmap_ad
[samba.git] / source4 / winbind / wb_server.h
index 7906e52de694620a3e108fefeb6991513dcb054d..12dd1888ed1ffdf9bb14d0793a2d04d4d3ec2209 100644 (file)
@@ -7,7 +7,7 @@
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include "nsswitch/winbindd_nss.h"
-
-
-
-#define WINBINDD_SAMBA3_SOCKET "pipe"
-/* the privileged socket is in smbd_tmp_dir() */
-#define WINBINDD_SAMBA3_PRIVILEGED_SOCKET "winbind_pipe"
+#include "nsswitch/winbind_nss_config.h"
+#include "nsswitch/winbind_struct_protocol.h"
+#include "winbind/idmap.h"
+#include "libnet/libnet.h"
 
 /* this struct stores global data for the winbind task */
 struct wbsrv_service {
        struct task_server *task;
 
        const struct dom_sid *primary_sid;
+       enum netr_SchannelType sec_channel_type;
        struct wbsrv_domain *domains;
+       struct idmap_context *idmap_ctx;
+       const char *priv_pipe_dir;
+       const char *pipe_dir;
 };
 
 struct wbsrv_samconn {
@@ -48,10 +48,7 @@ struct wb_dom_info {
        const char *name;
        const char *dns_name;
        const struct dom_sid *sid;
-
-       const char *dc_name;
-       const char *dc_dns_name;
-       const char *dc_address;
+       struct nbt_dc_name *dc;
 };
 
 struct wbsrv_domain {
@@ -59,18 +56,18 @@ struct wbsrv_domain {
 
        struct wb_dom_info *info;
 
-       struct dcerpc_pipe *lsa_pipe;
-       struct policy_handle *lsa_policy;
-       uint8_t lsa_auth_type;
+       /* Details for the server we are currently talking to */
+       const char *dc_address;
+       const char *dc_name;
+
+       struct libnet_context *libnet_ctx;
 
-       struct dcerpc_pipe *samr_pipe;
-       struct policy_handle *samr_handle;
-       struct policy_handle *domain_handle;
+       struct dcerpc_binding *lsa_binding;
 
-       struct ldap_connection *ldap_conn;
+       struct dcerpc_binding *samr_binding;
 
        struct dcerpc_pipe *netlogon_pipe;
-       struct cli_credentials *schannel_creds;
+       struct dcerpc_binding *netlogon_binding;
 };
 
 /*
@@ -79,7 +76,7 @@ struct wbsrv_domain {
 struct wbsrv_listen_socket {
        const char *socket_path;
        struct wbsrv_service *service;
-       BOOL privileged;
+       bool privileged;
 };
 
 /*
@@ -98,13 +95,45 @@ struct wbsrv_connection {
        /* how many calls are pending */
        uint32_t pending_calls;
 
-       struct packet_context *packet;
+       struct tstream_context *tstream;
+
+       struct tevent_queue *send_queue;
+
+       struct loadparm_context *lp_ctx;
 };
 
 #define WBSRV_SAMBA3_SET_STRING(dest, src) do { \
-       strncpy(dest, src, sizeof(dest)-1);\
+       memset(dest, 0, sizeof(dest));\
+       strlcpy((dest), (src) ? (src) : "", sizeof(dest));\
 } while(0)
 
+/*
+  state of a pwent query
+*/
+struct wbsrv_pwent {
+       /* Current UserList structure, contains 1+ user structs */
+       struct libnet_UserList *user_list;
+
+       /* Index of the next user struct in the current UserList struct */
+       uint32_t page_index;
+
+       /* The libnet_ctx to use for the libnet_UserList call */
+       struct libnet_context *libnet_ctx;
+};
+/*
+  state of a grent query
+*/
+struct wbsrv_grent {
+       /* Current UserList structure, contains 1+ user structs */
+       struct libnet_GroupList *group_list;
+
+       /* Index of the next user struct in the current UserList struct */
+       uint32_t page_index;
+
+       /* The libnet_ctx to use for the libnet_UserList call */
+       struct libnet_context *libnet_ctx;
+};
+
 /*
   state of one request
 
@@ -130,20 +159,24 @@ struct wbsrv_samba3_call {
        /* the connection the call belongs to */
        struct wbsrv_connection *wbconn;
 
-       /* the backend should use this event context */
-       struct event_context *event_ctx;
-
        /* here the backend can store stuff like composite_context's ... */
        void *private_data;
 
        /* the request structure of the samba3 protocol */
-       struct winbindd_request request;
+       struct winbindd_request *request;
        
        /* the response structure of the samba3 protocol*/
-       struct winbindd_response response;
+       struct winbindd_response *response;
+
+       DATA_BLOB in;
+       DATA_BLOB out;
+       struct iovec out_iov[1];
 };
 
 struct netr_LMSessionKey;
 struct netr_UserSessionKey;
+struct winbind_SamLogon;
+struct winbind_DsrUpdateReadOnlyServerDnsRecords;
 
+#include "winbind/wb_async_helpers.h"
 #include "winbind/wb_proto.h"