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 "libpq/protocol.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


#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_ALPN_PROTOCOL   "postgresql"
#define PG_ALPN_PROTOCOL_VECTOR   { 10, 'p','o','s','t','g','r','e','s','q','l' }


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


static bool is_unixsock_path (const char *path)

Macro Definition Documentation



Definition at line 132 of file pqcomm.h.



Definition at line 118 of file pqcomm.h.



Definition at line 167 of file pqcomm.h.



Definition at line 166 of file pqcomm.h.


#define PG_ALPN_PROTOCOL   "postgresql"

Definition at line 159 of file pqcomm.h.


#define PG_ALPN_PROTOCOL_VECTOR   { 10, 'p','o','s','t','g','r','e','s','q','l' }

Definition at line 160 of file pqcomm.h.


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

Definition at line 89 of file pqcomm.h.



Definition at line 96 of file pqcomm.h.



Definition at line 97 of file pqcomm.h.


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

Definition at line 87 of file pqcomm.h.


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

Definition at line 88 of file pqcomm.h.


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

Definition at line 44 of file pqcomm.h.


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

Definition at line 60 of file pqcomm.h.

Typedef Documentation

◆ AuthRequest

Definition at line 121 of file pqcomm.h.

◆ CancelRequestPacket

◆ MsgType

Definition at line 101 of file pqcomm.h.

◆ PacketLen

typedef uint32 PacketLen

Definition at line 110 of file pqcomm.h.

◆ ProtocolVersion

Definition at line 99 of file pqcomm.h.

Function Documentation

◆ is_unixsock_path()

static bool is_unixsock_path ( const char *  path)

Definition at line 67 of file pqcomm.h.

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

References is_absolute_path.

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