1 /*
2  * $Header$
3  *
4  * pgpool: a language independent connection pool server for PostgreSQL
5  * written by Tatsuo Ishii
6  *
7  * Copyright (c) 2003-2016	PgPool Global Development Group
8  *
9  * Permission to use, copy, modify, and distribute this software and
10  * its documentation for any purpose and without fee is hereby
11  * granted, provided that the above copyright notice appear in all
12  * copies and that both that copyright notice and this permission
13  * notice appear in supporting documentation, and that the name of the
14  * author not be used in advertising or publicity pertaining to
15  * distribution of the software without specific, written prior
16  * permission. The author makes no representations about the
17  * suitability of this software for any purpose.  It is provided "as
18  * is" without express or implied warranty.
19  *
20  *
21  * pcp.h - master header file.
22  */
23 
24 #ifndef PCP_H
25 #define PCP_H
26 
27 #include "pool_type.h"
28 #include "pool_config.h"
29 
30 
31 #define MAX_USER_PASSWD_LEN    128
32 /* The largest PCP packet a PCP frontend can send is
33  * the user authentication packet, and the maximum size
34  * of the PCP authentication packet can be
35  * MAX_USER_PASSWD_LEN + MAX_USER_PASSWD_LEN + SIZE OF INT */
36 #define MAX_PCP_PACKET_LENGTH	260
37 
38 typedef struct PCPWDNodeInfo
39 {
40 	int			state;
41 	char		nodeName[WD_MAX_HOST_NAMELEN];
42 	char		hostName[WD_MAX_HOST_NAMELEN];	/* host name */
43 	char		stateName[WD_MAX_HOST_NAMELEN]; /* state name */
44 	int			wd_port;		/* watchdog port */
45 	int			wd_priority;	/* node priority in leader election */
46 	int			pgpool_port;	/* pgpool port */
47 	char		delegate_ip[WD_MAX_HOST_NAMELEN];	/* delegate IP */
48 	int			id;
49 }			PCPWDNodeInfo;
50 
51 typedef struct PCPWDClusterInfo
52 {
53 	int			remoteNodeCount;
54 	int			quorumStatus;
55 	int			aliveNodeCount;
56 	bool		escalated;
57 	char		masterNodeName[WD_MAX_HOST_NAMELEN];
58 	char		masterHostName[WD_MAX_HOST_NAMELEN];
59 	int			nodeCount;
60 	PCPWDNodeInfo nodeList[1];
61 }			PCPWDClusterInfo;
62 
63 /* --------------------------------
64  * pcp.c
65  * --------------------------------
66  */
67 
68 /* ------------------------------
69  * pcp_error.c
70  * ------------------------------
71  */
72 
73 #endif							/* PCP_H */
74