in head as well ...
[kai/samba.git] / source / nsswitch / winbindd.h
1 /* 
2    Unix SMB/Netbios implementation.
3    Version 2.0
4
5    Winbind daemon for ntdom nss module
6
7    Copyright (C) Tim Potter 2000
8    
9    This library is free software; you can redistribute it and/or
10    modify it under the terms of the GNU Library General Public
11    License as published by the Free Software Foundation; either
12    version 2 of the License, or (at your option) any later version.
13    
14    This library is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17    Library General Public License for more details.
18    
19    You should have received a copy of the GNU Library General Public
20    License along with this library; if not, write to the
21    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22    Boston, MA  02111-1307, USA.   
23 */
24
25 #ifndef _WINBINDD_H
26 #define _WINBINDD_H
27
28 #include "includes.h"
29 #include "nterr.h"
30
31 #include "winbindd_nss.h"
32
33 /* Naughty global stuff */
34
35 extern int DEBUGLEVEL;
36
37 /* Client state structure */
38
39 struct winbindd_cli_state {
40     struct winbindd_cli_state *prev, *next;   /* Linked list pointers */
41     int sock;                                 /* Open socket from client */
42     pid_t pid;                                /* pid of client */
43     int read_buf_len, write_buf_len;          /* Indexes in request/response */
44     BOOL finished;                            /* Can delete from list */
45     BOOL write_extra_data;                    /* Write extra_data field */
46     struct winbindd_request request;          /* Request from client */
47     struct winbindd_response response;        /* Respose to client */
48     struct getent_state *getpwent_state;      /* State for getpwent() */
49     struct getent_state *getgrent_state;      /* State for getgrent() */
50 };
51
52 struct getent_state {
53     struct getent_state *prev, *next;
54     struct acct_info *sam_entries;
55     uint32 sam_entry_index, num_sam_entries;  
56     struct winbindd_domain *domain;
57     BOOL got_sam_entries;
58 };
59
60 /* Server state structure */
61
62 struct winbindd_state {
63         /* Netbios name of PDC */
64         fstring controller;
65         
66         /* User and group id pool */
67         uid_t uid_low, uid_high;               /* Range of uids to allocate */
68         gid_t gid_low, gid_high;               /* Range of gids to allocate */
69         
70         /* Cached handle to lsa pipe */
71         POLICY_HND lsa_handle;
72         BOOL lsa_handle_open;
73         BOOL pwdb_initialised;
74 };
75
76 extern struct winbindd_state server_state;  /* Server information */
77
78 /* Structures to hold per domain information */
79
80 struct winbindd_domain {
81
82     /* Domain information */
83
84     fstring name;                          /* Domain name */
85     fstring controller;                    /* NetBIOS name of DC */
86
87     DOM_SID sid;                           /* SID for this domain */
88     BOOL got_domain_info;                  /* Got controller and sid */
89
90     /* Cached handles to samr pipe */
91     POLICY_HND sam_handle, sam_dom_handle;
92     BOOL sam_handle_open, sam_dom_handle_open;
93
94     struct winbindd_domain *prev, *next;   /* Linked list info */
95 };
96
97 extern struct winbindd_domain *domain_list;  /* List of domains we know */
98
99 #include "winbindd_proto.h"
100
101 #include "rpc_parse.h"
102
103 #define WINBINDD_ESTABLISH_LOOP 30
104 #define DOM_SEQUENCE_NONE ((uint32)-1)
105
106 #endif /* _WINBINDD_H */