PostgreSQL Source Code  git master
pqcomm.h File Reference
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
Include dependency graph for pqcomm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  sockaddr_storage
 
struct  SockAddr
 
struct  StartupPacket
 
struct  CancelRequestPacket
 

Macros

#define ss_family   ss_stuff.sa.sa_family
 
#define UNIXSOCK_PATH(path, port, sockdir)
 
#define UNIXSOCK_PATH_BUFLEN   sizeof(((struct sockaddr_un *) NULL)->sun_path)
 
#define PG_PROTOCOL_MAJOR(v)   ((v) >> 16)
 
#define PG_PROTOCOL_MINOR(v)   ((v) & 0x0000ffff)
 
#define PG_PROTOCOL(m, n)   (((m) << 16) | (n))
 
#define PG_PROTOCOL_EARLIEST   PG_PROTOCOL(2,0)
 
#define PG_PROTOCOL_LATEST   PG_PROTOCOL(3,0)
 
#define SM_DATABASE   64
 
#define SM_USER   32
 
#define SM_DATABASE_USER   (SM_DATABASE+SM_USER+1) /* +1 for @ */
 
#define SM_OPTIONS   64
 
#define SM_UNUSED   64
 
#define SM_TTY   64
 
#define MAX_STARTUP_PACKET_LENGTH   10000
 
#define AUTH_REQ_OK   0 /* User is authenticated */
 
#define AUTH_REQ_KRB4   1 /* Kerberos V4. Not supported any more. */
 
#define AUTH_REQ_KRB5   2 /* Kerberos V5. Not supported any more. */
 
#define AUTH_REQ_PASSWORD   3 /* Password */
 
#define AUTH_REQ_CRYPT   4 /* crypt password. Not supported any more. */
 
#define AUTH_REQ_MD5   5 /* md5 password */
 
#define AUTH_REQ_SCM_CREDS   6 /* transfer SCM credentials */
 
#define AUTH_REQ_GSS   7 /* GSSAPI without wrap() */
 
#define AUTH_REQ_GSS_CONT   8 /* Continue GSS exchanges */
 
#define AUTH_REQ_SSPI   9 /* SSPI negotiate without wrap() */
 
#define AUTH_REQ_SASL   10 /* Begin SASL authentication */
 
#define AUTH_REQ_SASL_CONT   11 /* Continue SASL authentication */
 
#define AUTH_REQ_SASL_FIN   12 /* Final SASL message */
 
#define CANCEL_REQUEST_CODE   PG_PROTOCOL(1234,5678)
 
#define NEGOTIATE_SSL_CODE   PG_PROTOCOL(1234,5679)
 

Typedefs

typedef uint32 ProtocolVersion
 
typedef ProtocolVersion MsgType
 
typedef uint32 PacketLen
 
typedef struct StartupPacket StartupPacket
 
typedef uint32 AuthRequest
 
typedef struct CancelRequestPacket CancelRequestPacket
 

Variables

bool Db_user_namespace
 

Macro Definition Documentation

◆ AUTH_REQ_CRYPT

#define AUTH_REQ_CRYPT   4 /* crypt password. Not supported any more. */

Definition at line 169 of file pqcomm.h.

Referenced by pg_fe_sendauth().

◆ AUTH_REQ_GSS

#define AUTH_REQ_GSS   7 /* GSSAPI without wrap() */

Definition at line 172 of file pqcomm.h.

Referenced by ClientAuthentication(), and pg_fe_sendauth().

◆ AUTH_REQ_GSS_CONT

#define AUTH_REQ_GSS_CONT   8 /* Continue GSS exchanges */

Definition at line 173 of file pqcomm.h.

Referenced by CheckSCRAMAuth(), and pg_fe_sendauth().

◆ AUTH_REQ_KRB4

#define AUTH_REQ_KRB4   1 /* Kerberos V4. Not supported any more. */

Definition at line 166 of file pqcomm.h.

Referenced by pg_fe_sendauth().

◆ AUTH_REQ_KRB5

#define AUTH_REQ_KRB5   2 /* Kerberos V5. Not supported any more. */

Definition at line 167 of file pqcomm.h.

Referenced by pg_fe_sendauth().

◆ AUTH_REQ_MD5

#define AUTH_REQ_MD5   5 /* md5 password */

Definition at line 170 of file pqcomm.h.

Referenced by CheckMD5Auth(), pg_fe_sendauth(), pg_password_sendauth(), and PQconnectPoll().

◆ AUTH_REQ_OK

#define AUTH_REQ_OK   0 /* User is authenticated */

Definition at line 165 of file pqcomm.h.

Referenced by ClientAuthentication(), pg_fe_sendauth(), PQconnectPoll(), and sendAuthRequest().

◆ AUTH_REQ_PASSWORD

#define AUTH_REQ_PASSWORD   3 /* Password */

◆ AUTH_REQ_SASL

#define AUTH_REQ_SASL   10 /* Begin SASL authentication */

Definition at line 175 of file pqcomm.h.

Referenced by CheckSCRAMAuth(), and pg_fe_sendauth().

◆ AUTH_REQ_SASL_CONT

#define AUTH_REQ_SASL_CONT   11 /* Continue SASL authentication */

Definition at line 176 of file pqcomm.h.

Referenced by CheckSCRAMAuth(), and pg_fe_sendauth().

◆ AUTH_REQ_SASL_FIN

#define AUTH_REQ_SASL_FIN   12 /* Final SASL message */

Definition at line 177 of file pqcomm.h.

Referenced by CheckSCRAMAuth(), pg_fe_sendauth(), and sendAuthRequest().

◆ AUTH_REQ_SCM_CREDS

#define AUTH_REQ_SCM_CREDS   6 /* transfer SCM credentials */

Definition at line 171 of file pqcomm.h.

Referenced by pg_fe_sendauth().

◆ AUTH_REQ_SSPI

#define AUTH_REQ_SSPI   9 /* SSPI negotiate without wrap() */

Definition at line 174 of file pqcomm.h.

Referenced by ClientAuthentication(), and pg_fe_sendauth().

◆ CANCEL_REQUEST_CODE

#define CANCEL_REQUEST_CODE   PG_PROTOCOL(1234,5678)

Definition at line 190 of file pqcomm.h.

Referenced by internal_cancel(), and ProcessStartupPacket().

◆ MAX_STARTUP_PACKET_LENGTH

#define MAX_STARTUP_PACKET_LENGTH   10000

Definition at line 160 of file pqcomm.h.

Referenced by ProcessStartupPacket().

◆ NEGOTIATE_SSL_CODE

#define NEGOTIATE_SSL_CODE   PG_PROTOCOL(1234,5679)

Definition at line 205 of file pqcomm.h.

Referenced by PQconnectPoll(), and ProcessStartupPacket().

◆ PG_PROTOCOL

#define PG_PROTOCOL (   m,
 
)    (((m) << 16) | (n))

Definition at line 106 of file pqcomm.h.

Referenced by connectDBStart(), and PQconnectPoll().

◆ PG_PROTOCOL_EARLIEST

#define PG_PROTOCOL_EARLIEST   PG_PROTOCOL(2,0)

Definition at line 110 of file pqcomm.h.

Referenced by ProcessStartupPacket().

◆ PG_PROTOCOL_LATEST

#define PG_PROTOCOL_LATEST   PG_PROTOCOL(3,0)

◆ PG_PROTOCOL_MAJOR

◆ PG_PROTOCOL_MINOR

#define PG_PROTOCOL_MINOR (   v)    ((v) & 0x0000ffff)

Definition at line 105 of file pqcomm.h.

Referenced by ProcessStartupPacket().

◆ SM_DATABASE

#define SM_DATABASE   64

Definition at line 133 of file pqcomm.h.

Referenced by pqBuildStartupPacket2().

◆ SM_DATABASE_USER

#define SM_DATABASE_USER   (SM_DATABASE+SM_USER+1) /* +1 for @ */

Definition at line 136 of file pqcomm.h.

◆ SM_OPTIONS

#define SM_OPTIONS   64

Definition at line 137 of file pqcomm.h.

Referenced by pqBuildStartupPacket2().

◆ SM_TTY

#define SM_TTY   64

Definition at line 139 of file pqcomm.h.

Referenced by pqBuildStartupPacket2().

◆ SM_UNUSED

#define SM_UNUSED   64

Definition at line 138 of file pqcomm.h.

◆ SM_USER

#define SM_USER   32

Definition at line 134 of file pqcomm.h.

Referenced by pqBuildStartupPacket2().

◆ ss_family

#define ss_family   ss_stuff.sa.sa_family

Definition at line 54 of file pqcomm.h.

◆ UNIXSOCK_PATH

#define UNIXSOCK_PATH (   path,
  port,
  sockdir 
)
Value:
snprintf(path, sizeof(path), "%s/.s.PGSQL.%d", \
((sockdir) && *(sockdir) != '\0') ? (sockdir) : \
(port))
static const char * sockdir
Definition: pg_regress.c:102
int snprintf(char *str, size_t count, const char *fmt,...) pg_attribute_printf(3
static int port
Definition: pg_regress.c:90
#define DEFAULT_PGSOCKET_DIR

Definition at line 70 of file pqcomm.h.

Referenced by connectDBStart(), stop_postmaster(), and StreamServerPort().

◆ UNIXSOCK_PATH_BUFLEN

#define UNIXSOCK_PATH_BUFLEN   sizeof(((struct sockaddr_un *) NULL)->sun_path)

Definition at line 86 of file pqcomm.h.

Referenced by connectDBStart(), and StreamServerPort().

Typedef Documentation

◆ AuthRequest

Definition at line 179 of file pqcomm.h.

◆ CancelRequestPacket

◆ MsgType

Definition at line 115 of file pqcomm.h.

◆ PacketLen

Definition at line 124 of file pqcomm.h.

◆ ProtocolVersion

Definition at line 113 of file pqcomm.h.

◆ StartupPacket

Variable Documentation

◆ Db_user_namespace

bool Db_user_namespace

Definition at line 241 of file postmaster.c.

Referenced by CheckMD5Auth(), parse_hba_line(), and ProcessStartupPacket().