]> granicus.if.org Git - postgresql/blob - src/include/libpq/auth.h
6a4160e65df0b8c911370ee9a4fb7e3ae142b92a
[postgresql] / src / include / libpq / auth.h
1 /*-------------------------------------------------------------------------
2  *
3  * auth.h--
4  *        Definitions for network authentication routines
5  *
6  *
7  * Copyright (c) 1994, Regents of the University of California
8  *
9  * $Id: auth.h,v 1.7 1997/09/08 21:52:28 momjian Exp $
10  *
11  *-------------------------------------------------------------------------
12  */
13 #ifndef AUTH_H
14 #define AUTH_H
15
16 #include <libpq/pqcomm.h>
17
18 /*----------------------------------------------------------------
19  * Common routines and definitions
20  *----------------------------------------------------------------
21  */
22
23 /* what we call "no authentication system" */
24 #define UNAUTHNAME                              "unauth"
25
26 /* what a frontend uses by default */
27 #if !defined(KRB4) && !defined(KRB5)
28 #define DEFAULT_CLIENT_AUTHSVC  UNAUTHNAME
29 #else                                                   /* KRB4 || KRB5 */
30 #define DEFAULT_CLIENT_AUTHSVC  "kerberos"
31 #endif                                                  /* KRB4 || KRB5 */
32
33 extern int      fe_sendauth(MsgType msgtype, Port *port, char *hostname);
34 extern void fe_setauthsvc(char *name);
35 extern MsgType fe_getauthsvc();
36 extern char *fe_getauthname(void);
37 extern int      be_recvauth(MsgType msgtype, Port *port, char *username, StartupInfo *sp);
38 extern void be_setauthsvc(char *name);
39
40 /* the value that matches any dbName value when doing
41    host based authentication*/
42 #define ALL_DBNAME              "*"
43
44 #define PG_KRB4_VERSION "PGVER4.1"              /* at most KRB_SENDAUTH_VLEN chars */
45 #define PG_KRB5_VERSION "PGVER5.1"
46
47 #endif                                                  /* AUTH_H */