2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
34 * (C) COPYRIGHT Apple Computer, Inc. 1992-1996
39 /* Definitions for ATP protocol and streams module, per
40 * AppleTalk Transaction Protocol documentation from
41 * `Inside AppleTalk', July 14, 1986.
46 #include <sys/appleapiopts.h>
48 #ifdef __APPLE_API_OBSOLETE
50 #define AT_PAP_DATA_SIZE 512 /* Maximum PAP data size */
51 #define AT_PAP_STATUS_SIZE 255 /* Maximum PAP status length */
52 #define PAP_TIMEOUT 120
54 /* PAP packet types */
56 #define AT_PAP_TYPE_OPEN_CONN 0x01 /* Open-Connection packet */
57 #define AT_PAP_TYPE_OPEN_CONN_REPLY 0x02 /* Open-Connection-Reply packet */
58 #define AT_PAP_TYPE_SEND_DATA 0x03 /* Send-Data packet */
59 #define AT_PAP_TYPE_DATA 0x04 /* Data packet */
60 #define AT_PAP_TYPE_TICKLE 0x05 /* Tickle packet */
61 #define AT_PAP_TYPE_CLOSE_CONN 0x06 /* Close-Connection packet */
62 #define AT_PAP_TYPE_CLOSE_CONN_REPLY 0x07 /* Close-Connection-Reply pkt */
63 #define AT_PAP_TYPE_SEND_STATUS 0x08 /* Send-Status packet */
64 #define AT_PAP_TYPE_SEND_STS_REPLY 0x09 /* Send-Status-Reply packet */
65 #define AT_PAP_TYPE_READ_LW 0x0A /* Read LaserWriter Message */
68 /* PAP packet structure */
71 u_char at_pap_connection_id
;
73 u_char at_pap_sequence_number
[2];
74 u_char at_pap_responding_socket
;
75 u_char at_pap_flow_quantum
;
76 u_char at_pap_wait_time_or_result
[2];
77 u_char at_pap_buffer
[AT_PAP_DATA_SIZE
];
81 /* ioctl definitions */
83 #define AT_PAP_SETHDR (('~'<<8)|0)
84 #define AT_PAP_READ (('~'<<8)|1)
85 #define AT_PAP_WRITE (('~'<<8)|2)
86 #define AT_PAP_WRITE_EOF (('~'<<8)|3)
87 #define AT_PAP_WRITE_FLUSH (('~'<<8)|4)
88 #define AT_PAP_READ_IGNORE (('~'<<8)|5)
89 #define AT_PAPD_SET_STATUS (('~'<<8)|40)
90 #define AT_PAPD_GET_NEXT_JOB (('~'<<8)|41)
92 extern char at_pap_status
[];
93 extern char *pap_status ();
95 #define NPAPSERVERS 10 /* the number of active PAP servers/node */
96 #define NPAPSESSIONS 40 /* the number of active PAP sockets/node */
98 #define AT_PAP_HDR_SIZE (DDP_X_HDR_SIZE + ATP_HDR_SIZE)
100 #define ATP_DDP_HDR(c) ((at_ddp_t *)(c))
102 #define PAP_SOCKERR "Unable to open PAP socket"
103 #define P_NOEXIST "Printer not found"
104 #define P_UNREACH "Unable to establish PAP session"
107 u_char pap_inuse
; /* true if this one is allocated */
108 u_char pap_tickle
; /* true if we are tickling the other end */
109 u_char pap_request
; /* bitmap from a received request */
110 u_char pap_eof
; /* true if we have received an EOF */
111 u_char pap_eof_sent
; /* true if we have sent an EOF */
112 u_char pap_sent
; /* true if we have sent anything (and
113 therefore may have to send an eof
115 u_char pap_error
; /* error message from read request */
116 u_char pap_timer
; /* a timeout is pending */
117 u_char pap_closing
; /* the link is closing and/or closed */
118 u_char pap_request_count
; /* number of outstanding requests */
119 u_char pap_req_timer
; /* the request timer is running */
120 u_char pap_ending
; /* we are waiting for atp to flush */
121 u_char pap_read_ignore
; /* we are in 'read with ignore' mode */
123 u_char pap_req_socket
;
127 u_short pap_send_count
; /* the sequence number to send on the
128 next send data request */
129 u_short pap_rcv_count
; /* the sequence number expected to
130 receive on the next request */
131 u_short pap_tid
; /* ATP transaction ID for responses */
132 u_char pap_connID
; /* our connection ID */
134 int pap_ignore_id
; /* the transaction ID for read ignore */
135 int pap_tickle_id
; /* the transaction ID for tickles */
138 #endif /* __APPLE_API_OBSOLETE */
139 #endif /* _NETAT_PAP_H_ */