Created
October 8, 2011 18:53
-
-
Save fdr/1272698 to your computer and use it in GitHub Desktop.
port data structure from febe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef struct Port | |
{ | |
pgsocket sock; /* File descriptor */ | |
bool noblock; /* is the socket in non-blocking mode? */ | |
ProtocolVersion proto; /* FE/BE protocol version */ | |
SockAddr laddr; /* local addr (postmaster) */ | |
SockAddr raddr; /* remote addr (client) */ | |
char *remote_host; /* name (or ip addr) of remote host */ | |
char *remote_hostname;/* name (not ip addr) of remote host, if | |
* available */ | |
int remote_hostname_resolv; /* +1 = remote_hostname is known to | |
* resolve to client's IP address; -1 | |
* = remote_hostname is known NOT to | |
* resolve to client's IP address; 0 = | |
* we have not done the forward DNS | |
* lookup yet */ | |
char *remote_port; /* text rep of remote port */ | |
CAC_state canAcceptConnections; /* postmaster connection status */ | |
/* | |
* Information that needs to be saved from the startup packet and passed | |
* into backend execution. "char *" fields are NULL if not set. | |
* guc_options points to a List of alternating option names and values. | |
*/ | |
char *database_name; | |
char *user_name; | |
char *cmdline_options; | |
List *guc_options; | |
/* | |
* Information that needs to be held during the authentication cycle. | |
*/ | |
HbaLine *hba; | |
char md5Salt[4]; /* Password salt */ | |
/* | |
* Information that really has no business at all being in struct Port, | |
* but since it gets used by elog.c in the same way as database_name and | |
* other members of this struct, we may as well keep it here. | |
*/ | |
TimestampTz SessionStartTime; /* backend start time */ | |
/* | |
* TCP keepalive settings. | |
* | |
* default values are 0 if AF_UNIX or not yet known; current values are 0 | |
* if AF_UNIX or using the default. Also, -1 in a default value means we | |
* were unable to find out the default (getsockopt failed). | |
*/ | |
int default_keepalives_idle; | |
int default_keepalives_interval; | |
int default_keepalives_count; | |
int keepalives_idle; | |
int keepalives_interval; | |
int keepalives_count; | |
#if defined(ENABLE_GSS) || defined(ENABLE_SSPI) | |
/* | |
* If GSSAPI is supported, store GSSAPI information. Oterwise, store a | |
* NULL pointer to make sure offsets in the struct remain the same. | |
*/ | |
pg_gssinfo *gss; | |
#else | |
void *gss; | |
#endif | |
/* | |
* SSL structures (keep these last so that USE_SSL doesn't affect | |
* locations of other fields) | |
*/ | |
#ifdef USE_SSL | |
SSL *ssl; | |
X509 *peer; | |
char peer_dn[128 + 1]; | |
char peer_cn[SM_USER + 1]; | |
unsigned long count; | |
#endif | |
} Port; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment