]> granicus.if.org Git - postgresql/blob - src/include/libpq/hba.h
b444e09ecf201e97000734782308db9bc37ec0a6
[postgresql] / src / include / libpq / hba.h
1 /*-------------------------------------------------------------------------
2  *
3  * hba.h
4  *        Interface to hba.c
5  *
6  *
7  * $PostgreSQL: pgsql/src/include/libpq/hba.h,v 1.59 2009/10/01 01:58:58 tgl Exp $
8  *
9  *-------------------------------------------------------------------------
10  */
11 #ifndef HBA_H
12 #define HBA_H
13
14 #include "nodes/pg_list.h"
15 #include "libpq/pqcomm.h"
16
17
18 typedef enum UserAuth
19 {
20         uaReject,
21         uaKrb5,
22         uaTrust,
23         uaIdent,
24         uaPassword,
25         uaMD5,
26         uaGSS,
27         uaSSPI,
28         uaPAM,
29         uaLDAP,
30         uaCert
31 } UserAuth;
32
33 typedef enum IPCompareMethod
34 {
35         ipCmpMask,
36         ipCmpSameHost,
37         ipCmpSameNet
38 } IPCompareMethod;
39
40 typedef enum ConnType
41 {
42         ctLocal,
43         ctHost,
44         ctHostSSL,
45         ctHostNoSSL
46 } ConnType;
47
48 typedef struct
49 {
50         int                     linenumber;
51         ConnType        conntype;
52         char       *database;
53         char       *role;
54         struct sockaddr_storage addr;
55         struct sockaddr_storage mask;
56         IPCompareMethod ip_cmp_method;
57         UserAuth        auth_method;
58
59         char       *usermap;
60         char       *pamservice;
61         bool            ldaptls;
62         char       *ldapserver;
63         int                     ldapport;
64         char       *ldapprefix;
65         char       *ldapsuffix;
66         bool            clientcert;
67         char       *krb_server_hostname;
68         char       *krb_realm;
69         bool            include_realm;
70 } HbaLine;
71
72 /* kluge to avoid including libpq/libpq-be.h here */
73 typedef struct Port hbaPort;
74
75 extern bool load_hba(void);
76 extern void load_ident(void);
77 extern int      hba_getauthmethod(hbaPort *port);
78 extern int check_usermap(const char *usermap_name,
79                           const char *pg_role, const char *auth_user,
80                           bool case_sensitive);
81 extern bool pg_isblank(const char c);
82
83 #endif   /* HBA_H */