1996-10-11 11:12:18 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* hba.h--
|
1997-09-07 07:04:48 +02:00
|
|
|
* Interface to hba.c
|
1996-10-11 11:12:18 +02:00
|
|
|
*
|
|
|
|
*
|
1998-01-24 23:50:57 +01:00
|
|
|
* $Id: hba.h,v 1.6 1998/01/24 22:49:15 momjian Exp $
|
1996-10-11 11:12:18 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
#ifndef HBA_H
|
1997-09-07 07:04:48 +02:00
|
|
|
#define HBA_H
|
1996-10-11 11:12:18 +02:00
|
|
|
|
1997-03-12 22:23:16 +01:00
|
|
|
#include <libpq/pqcomm.h>
|
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
#define CONF_FILE "pg_hba.conf"
|
|
|
|
/* Name of the config file */
|
1997-03-12 22:23:16 +01:00
|
|
|
|
|
|
|
#define MAP_FILE "pg_ident.conf"
|
1997-09-07 07:04:48 +02:00
|
|
|
/* Name of the usermap file */
|
1997-03-12 22:23:16 +01:00
|
|
|
|
|
|
|
#define OLD_CONF_FILE "pg_hba"
|
1997-09-07 07:04:48 +02:00
|
|
|
/* Name of the config file in prior releases of Postgres. */
|
1997-03-12 22:23:16 +01:00
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
#define MAX_LINES 255
|
|
|
|
/* Maximum number of config lines that can apply to one database */
|
1997-03-12 22:23:16 +01:00
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
#define MAX_TOKEN 80
|
|
|
|
/* Maximum size of one token in the configuration file */
|
1997-03-12 22:23:16 +01:00
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
#define USERMAP_NAME_SIZE 16 /* Max size of a usermap name */
|
1997-03-12 22:23:16 +01:00
|
|
|
|
|
|
|
#define IDENT_PORT 113
|
1997-09-07 07:04:48 +02:00
|
|
|
/* Standard TCP port number for Ident service. Assigned by IANA */
|
1997-03-12 22:23:16 +01:00
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
#define IDENT_USERNAME_MAX 512
|
|
|
|
/* Max size of username ident server can return */
|
1997-03-12 22:23:16 +01:00
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
enum Userauth
|
|
|
|
{
|
1997-09-08 23:56:23 +02:00
|
|
|
Trust, Ident,
|
|
|
|
Password
|
1997-09-07 07:04:48 +02:00
|
|
|
};
|
1996-10-11 11:12:18 +02:00
|
|
|
|
1998-01-24 23:50:57 +01:00
|
|
|
extern int hba_recvauth(const Port *port, const char database[], const char user[],
|
1997-09-07 07:04:48 +02:00
|
|
|
const char DataDir[]);
|
|
|
|
void
|
|
|
|
find_hba_entry(const char DataDir[], const struct in_addr ip_addr,
|
|
|
|
const char database[],
|
1997-09-08 23:56:23 +02:00
|
|
|
bool *host_ok_p, enum Userauth * userauth_p,
|
1997-09-07 07:04:48 +02:00
|
|
|
char usermap_name[], bool find_password_entries);
|
1996-10-11 11:12:18 +02:00
|
|
|
|
|
|
|
#endif
|