1 /*-------------------------------------------------------------------------
4 * Definitions for network authentication routines
7 * Copyright (c) 1994, Regents of the University of California
9 * $Id: auth.h,v 1.7 1997/09/08 21:52:28 momjian Exp $
11 *-------------------------------------------------------------------------
16 #include <libpq/pqcomm.h>
18 /*----------------------------------------------------------------
19 * Common routines and definitions
20 *----------------------------------------------------------------
23 /* what we call "no authentication system" */
24 #define UNAUTHNAME "unauth"
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 */
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);
40 /* the value that matches any dbName value when doing
41 host based authentication*/
42 #define ALL_DBNAME "*"
44 #define PG_KRB4_VERSION "PGVER4.1" /* at most KRB_SENDAUTH_VLEN chars */
45 #define PG_KRB5_VERSION "PGVER5.1"