]> git.saurik.com Git - apple/xnu.git/blame - bsd/netat/pap.h
xnu-792.13.8.tar.gz
[apple/xnu.git] / bsd / netat / pap.h
CommitLineData
1c79356b 1/*
5d5c5d0d
A
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
8ad349bb 4 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
1c79356b 5 *
8ad349bb
A
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
14 * agreement.
15 *
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
18 * file.
19 *
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.
27 *
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
1c79356b
A
29 */
30/*
31 *
32 * ORIGINS: 82
33 *
34 * (C) COPYRIGHT Apple Computer, Inc. 1992-1996
35 * All Rights Reserved
36 *
37 */
38
39/* Definitions for ATP protocol and streams module, per
40 * AppleTalk Transaction Protocol documentation from
41 * `Inside AppleTalk', July 14, 1986.
42 */
43
44#ifndef _NETAT_PAP_H_
45#define _NETAT_PAP_H_
9bccf70c 46#include <sys/appleapiopts.h>
1c79356b 47
91447636
A
48#ifdef __APPLE_API_OBSOLETE
49
1c79356b
A
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
53
54/* PAP packet types */
55
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 */
66
67
68/* PAP packet structure */
69
70typedef struct {
71 u_char at_pap_connection_id;
72 u_char at_pap_type;
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];
78} at_pap;
79
80
81/* ioctl definitions */
82
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)
91
92extern char at_pap_status[];
93extern char *pap_status ();
94
95#define NPAPSERVERS 10 /* the number of active PAP servers/node */
96#define NPAPSESSIONS 40 /* the number of active PAP sockets/node */
97
98#define AT_PAP_HDR_SIZE (DDP_X_HDR_SIZE + ATP_HDR_SIZE)
99
100#define ATP_DDP_HDR(c) ((at_ddp_t *)(c))
101
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"
105
106struct pap_state {
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
114 on close) */
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 */
122
123 u_char pap_req_socket;
124 at_inet_t pap_to;
125 int pap_flow;
126
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 */
133
134 int pap_ignore_id; /* the transaction ID for read ignore */
135 int pap_tickle_id; /* the transaction ID for tickles */
136};
137
91447636 138#endif /* __APPLE_API_OBSOLETE */
1c79356b 139#endif /* _NETAT_PAP_H_ */