PostgreSQL Source Code  git master
pqcomm.h File Reference
#include <sys/socket.h>
#include <sys/un.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
 
struct  AddrInfo
 
struct  CancelRequestPacket
 

Macros

#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(3,0)
 
#define PG_PROTOCOL_LATEST   PG_PROTOCOL(3,0)
 
#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_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 AUTH_REQ_MAX   AUTH_REQ_SASL_FIN /* maximum AUTH_REQ_* value */
 
#define CANCEL_REQUEST_CODE   PG_PROTOCOL(1234,5678)
 
#define NEGOTIATE_SSL_CODE   PG_PROTOCOL(1234,5679)
 
#define NEGOTIATE_GSS_CODE   PG_PROTOCOL(1234,5680)
 

Typedefs

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

Functions

static bool is_unixsock_path (const char *path)
 

Variables

PGDLLIMPORT bool Db_user_namespace
 

Macro Definition Documentation

◆ AUTH_REQ_CRYPT

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

Definition at line 123 of file pqcomm.h.

◆ AUTH_REQ_GSS

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

Definition at line 126 of file pqcomm.h.

◆ AUTH_REQ_GSS_CONT

#define AUTH_REQ_GSS_CONT   8 /* Continue GSS exchanges */

Definition at line 127 of file pqcomm.h.

◆ AUTH_REQ_KRB4

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

Definition at line 120 of file pqcomm.h.

◆ AUTH_REQ_KRB5

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

Definition at line 121 of file pqcomm.h.

◆ AUTH_REQ_MAX

#define AUTH_REQ_MAX   AUTH_REQ_SASL_FIN /* maximum AUTH_REQ_* value */

Definition at line 132 of file pqcomm.h.

◆ AUTH_REQ_MD5

#define AUTH_REQ_MD5   5 /* md5 password */

Definition at line 124 of file pqcomm.h.

◆ AUTH_REQ_OK

#define AUTH_REQ_OK   0 /* User is authenticated */

Definition at line 119 of file pqcomm.h.

◆ AUTH_REQ_PASSWORD

#define AUTH_REQ_PASSWORD   3 /* Password */

Definition at line 122 of file pqcomm.h.

◆ AUTH_REQ_SASL

#define AUTH_REQ_SASL   10 /* Begin SASL authentication */

Definition at line 129 of file pqcomm.h.

◆ AUTH_REQ_SASL_CONT

#define AUTH_REQ_SASL_CONT   11 /* Continue SASL authentication */

Definition at line 130 of file pqcomm.h.

◆ AUTH_REQ_SASL_FIN

#define AUTH_REQ_SASL_FIN   12 /* Final SASL message */

Definition at line 131 of file pqcomm.h.

◆ AUTH_REQ_SSPI

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

Definition at line 128 of file pqcomm.h.

◆ CANCEL_REQUEST_CODE

#define CANCEL_REQUEST_CODE   PG_PROTOCOL(1234,5678)

Definition at line 145 of file pqcomm.h.

◆ MAX_STARTUP_PACKET_LENGTH

#define MAX_STARTUP_PACKET_LENGTH   10000

Definition at line 114 of file pqcomm.h.

◆ NEGOTIATE_GSS_CODE

#define NEGOTIATE_GSS_CODE   PG_PROTOCOL(1234,5680)

Definition at line 161 of file pqcomm.h.

◆ NEGOTIATE_SSL_CODE

#define NEGOTIATE_SSL_CODE   PG_PROTOCOL(1234,5679)

Definition at line 160 of file pqcomm.h.

◆ PG_PROTOCOL

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

Definition at line 83 of file pqcomm.h.

◆ PG_PROTOCOL_EARLIEST

#define PG_PROTOCOL_EARLIEST   PG_PROTOCOL(3,0)

Definition at line 90 of file pqcomm.h.

◆ PG_PROTOCOL_LATEST

#define PG_PROTOCOL_LATEST   PG_PROTOCOL(3,0)

Definition at line 91 of file pqcomm.h.

◆ PG_PROTOCOL_MAJOR

#define PG_PROTOCOL_MAJOR (   v)    ((v) >> 16)

Definition at line 81 of file pqcomm.h.

◆ PG_PROTOCOL_MINOR

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

Definition at line 82 of file pqcomm.h.

◆ UNIXSOCK_PATH

#define UNIXSOCK_PATH (   path,
  port,
  sockdir 
)
Value:
AssertMacro(*(sockdir) != '\0'), \
snprintf(path, sizeof(path), "%s/.s.PGSQL.%d", \
(sockdir), (port)))
#define AssertMacro(condition)
Definition: c.h:843
static int port
Definition: pg_regress.c:109
static const char * sockdir
Definition: pg_regress.c:121

Definition at line 38 of file pqcomm.h.

◆ UNIXSOCK_PATH_BUFLEN

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

Definition at line 54 of file pqcomm.h.

Typedef Documentation

◆ AuthRequest

Definition at line 134 of file pqcomm.h.

◆ CancelRequestPacket

◆ MsgType

Definition at line 95 of file pqcomm.h.

◆ PacketLen

typedef uint32 PacketLen

Definition at line 104 of file pqcomm.h.

◆ ProtocolVersion

Definition at line 93 of file pqcomm.h.

Function Documentation

◆ is_unixsock_path()

static bool is_unixsock_path ( const char *  path)
inlinestatic

Definition at line 61 of file pqcomm.h.

62 {
63  return is_absolute_path(path) || path[0] == '@';
64 }
#define is_absolute_path(filename)
Definition: port.h:103

References is_absolute_path.

Referenced by check_pghost_envvar(), connectOptions2(), do_connect(), exec_command_conninfo(), get_prompt(), and passwordFromFile().

Variable Documentation

◆ Db_user_namespace

PGDLLIMPORT bool Db_user_namespace
extern

Definition at line 239 of file postmaster.c.

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