aboutsummaryrefslogtreecommitdiff
path: root/src/include/libpq/hba.h
blob: 8a430b94c7bd5553b8a4a2197a66b9960ffca884 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*-------------------------------------------------------------------------
 *
 * hba.h--
 *	  Interface to hba.c
 *
 *
 * $Id: hba.h,v 1.5 1997/09/08 21:52:34 momjian Exp $
 *
 *-------------------------------------------------------------------------
 */
#ifndef HBA_H
#define HBA_H

#include <libpq/pqcomm.h>

#define CONF_FILE "pg_hba.conf"
 /* Name of the config file  */

#define MAP_FILE "pg_ident.conf"
 /* Name of the usermap file */

#define OLD_CONF_FILE "pg_hba"
 /* Name of the config file in prior releases of Postgres. */

#define MAX_LINES 255
 /* Maximum number of config lines that can apply to one database	 */

#define MAX_TOKEN 80
/* Maximum size of one token in the configuration file	*/

#define USERMAP_NAME_SIZE 16	/* Max size of a usermap name */

#define IDENT_PORT 113
 /* Standard TCP port number for Ident service.  Assigned by IANA */

#define IDENT_USERNAME_MAX 512
 /* Max size of username ident server can return */

enum Userauth
{
	Trust, Ident,
				Password
};

extern int
hba_recvauth(const Port *port, const char database[], const char user[],
			 const char DataDir[]);
void
find_hba_entry(const char DataDir[], const struct in_addr ip_addr,
			   const char database[],
			   bool *host_ok_p, enum Userauth * userauth_p,
			   char usermap_name[], bool find_password_entries);

#endif