11/*-------------------------------------------------------------------------
22 *
33 * libpq_be.h
4- * This file contains definitions for structures and
5- * externs for functions used by the POSTGRES backend.
4+ * This file contains definitions for structures and externs used
5+ * by the postmaster during client authentication.
6+ *
7+ * Note that this is backend-internal and is NOT exported to clients.
8+ * Structs that need to be client-visible are in pqcomm.h.
69 *
710 *
811 * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
912 * Portions Copyright (c) 1994, Regents of the University of California
1013 *
11- * $Id: libpq-be.h,v 1.26 2001/11/1204:19:15 tgl Exp $
14+ * $Id: libpq-be.h,v 1.27 2001/11/1205:43:25 tgl Exp $
1215 *
1316 *-------------------------------------------------------------------------
1417 */
@@ -35,78 +38,6 @@ typedef struct PasswordPacketV0
3538}PasswordPacketV0 ;
3639
3740
38- /*
39- * Password packet. The length of the password can be changed without
40- * affecting anything.
41- */
42-
43- typedef struct PasswordPacket
44- {
45- char passwd [100 ];/* The password. */
46- }PasswordPacket ;
47-
48-
49- /* Error message packet. */
50-
51- typedef struct ErrorMessagePacket
52- {
53- char data [1 + 100 ];/* 'E' + the message. */
54- }ErrorMessagePacket ;
55-
56-
57- /* Authentication request packet. */
58-
59- typedef struct AuthRequestPacket
60- {
61- char data [1 + sizeof (AuthRequest )+ 4 ];/* 'R' + the request +
62- * optional salt. */
63- }AuthRequestPacket ;
64-
65-
66- /* These are used by the packet handling routines. */
67-
68- typedef enum
69- {
70- Idle ,
71- ReadingPacketLength ,
72- ReadingPacket ,
73- WritingPacket
74- }PacketState ;
75-
76- typedef int (* PacketDoneProc ) (void * arg ,PacketLen pktlen ,void * pktdata );
77-
78- typedef struct Packet
79- {
80- PacketState state ;/* What's in progress. */
81- PacketLen len ;/* Actual length */
82- int nrtodo ;/* Bytes still to transfer */
83- char * ptr ;/* Buffer pointer */
84- PacketDoneProc iodone ;/* I/O complete callback */
85- void * arg ;/* Argument to callback */
86-
87- /*
88- * We declare the data buffer as a union of the allowed packet types,
89- * mainly to ensure that enough space is allocated for the largest
90- * one.
91- */
92-
93- union
94- {
95- /* These are outgoing so have no packet length prepended. */
96-
97- ErrorMessagePacket em ;
98- AuthRequestPacket ar ;
99-
100- /* These are incoming and have a packet length prepended. */
101-
102- StartupPacket si ;
103- CancelRequestPacket canc ;
104- PasswordPacketV0 pwv0 ;
105- PasswordPacket pw ;
106- }pkt ;
107- }Packet ;
108-
109-
11041/*
11142 * This is used by the postmaster in its communication with frontends.It is
11243 * contains all state information needed during this communication before the
@@ -116,9 +47,8 @@ typedef struct Packet
11647typedef struct Port
11748{
11849int sock ;/* File descriptor */
119- Packet pktInfo ;/* For the packet handlers */
120- SockAddr laddr ;/* local addr (us) */
121- SockAddr raddr ;/* remote addr (them) */
50+ SockAddr laddr ;/* local addr (postmaster) */
51+ SockAddr raddr ;/* remote addr (client) */
12252char md5Salt [4 ];/* Password salt */
12353char cryptSalt [2 ];/* Password salt */
12454