|
|
1.1 root 1: /*
2: * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3: *
4: * @APPLE_LICENSE_HEADER_START@
5: *
6: * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7: * Reserved. This file contains Original Code and/or Modifications of
8: * Original Code as defined in and that are subject to the Apple Public
9: * Source License Version 1.1 (the "License"). You may not use this file
10: * except in compliance with the License. Please obtain a copy of the
11: * License at http://www.apple.com/publicsource and read it before using
12: * this file.
13: *
14: * The Original Code and all software distributed under the License are
15: * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
19: * License for the specific language governing rights and limitations
20: * under the License.
21: *
22: * @APPLE_LICENSE_HEADER_END@
23: */
24:
25:
26: /*
27: * Copyright (c) 1988, 1989 Apple Computer, Inc.
28: *
29: * The information contained herein is subject to change without
30: * notice and should not be construed as a commitment by Apple
31: * Computer, Inc. Apple Computer, Inc. assumes no responsibility
32: * for any errors that may appear.
33: *
34: * Confidential and Proprietary to Apple Computer, Inc.
35: */
36:
37: /* @(#)atlog.h: 2.0, 1.3; 7/14/89; Copyright 1988-89, Apple Computer, Inc. */
38:
39: /* These pointers are non-NULL if logging or tracing are activated. */
40: #ifndef LOG_DRIVER
41: extern char *log_errp;
42: extern char *log_trcp;
43: #endif /* LOG_DRIVER */
44:
45: /* ATTRACE() macro. Use this routine for calling
46: * streams tracing and logging. If `log' is TRUE, then
47: * this event will also be logged if logging is on.
48: */
49: #if !defined(lint) && defined(AT_DEBUG)
50: #define ATTRACE(mid,sid,level,log,fmt,arg1,arg2,arg3) \
51: if (log_trcp || (log && log_errp)) { \
52: strlog(mid,sid,level,SL_TRACE | \
53: (log ? SL_ERROR : 0) | \
54: (level <= AT_LV_FATAL ? SL_FATAL : 0), \
55: fmt,arg1,arg2,arg3); \
56: }
57: #else
58: #define ATTRACE(mid,sid,level,log,fmt,arg1,arg2,arg3) \
59: /* printf(fmt, arg1, arg2, arg3); */
60:
61: #endif
62:
63:
64: /* Levels for AppleTalk tracing */
65:
66: #define AT_LV_FATAL 1
67: #define AT_LV_ERROR 3
68: #define AT_LV_WARNING 5
69: #define AT_LV_INFO 7
70: #define AT_LV_VERBOSE 9
71:
72:
73: /* Sub-ids for AppleTalk tracing, add more if you can't figure
74: * out where your event belongs.
75: */
76:
77: #define AT_SID_INPUT 1 /* Network incoming packets */
78: #define AT_SID_OUTPUT 2 /* Network outgoing packets */
79: #define AT_SID_TIMERS 3 /* Protocol timers */
80: #define AT_SID_FLOWCTRL 4 /* Protocol flow control */
81: #define AT_SID_USERREQ 5 /* User requests */
82: #define AT_SID_RESOURCE 6 /* Resource limitations */
83:
84:
85:
86: /* Module ID's for AppleTalk subsystems */
87:
88: #define AT_MID(n) (200+n)
89:
90: #define AT_MID_MISC AT_MID(0)
91: #define AT_MID_LLAP AT_MID(1)
92: #define AT_MID_ELAP AT_MID(2)
93: #define AT_MID_DDP AT_MID(3)
94: #define AT_MID_RTMP AT_MID(4)
95: #define AT_MID_NBP AT_MID(5)
96: #define AT_MID_EP AT_MID(6)
97: #define AT_MID_ATP AT_MID(7)
98: #define AT_MID_ZIP AT_MID(8)
99: #define AT_MID_PAP AT_MID(9)
100: #define AT_MID_ASP AT_MID(10)
101: #define AT_MID_AFP AT_MID(11)
102: #define AT_MID_ADSP AT_MID(12)
103: #define AT_MID_NBPD AT_MID(13)
104: #define AT_MID_LAP AT_MID(14)
105:
106: #define AT_MID_LAST AT_MID_LAP
107:
108: #ifdef AT_MID_STRINGS
109: static char *at_mid_strings[] = {
110: "misc",
111: "LLAP",
112: "ELAP",
113: "DDP",
114: "RTMP",
115: "NBP",
116: "EP",
117: "ATP",
118: "ZIP",
119: "PAP",
120: "ASP",
121: "AFP",
122: "ADSP",
123: "NBPD",
124: "LAP"
125: };
126: #endif
127:
128:
129: #ifndef SL_FATAL
130: /* Don't define these if they're already defined */
131:
132: /* Flags for log messages */
133:
134: #define SL_FATAL 01 /* indicates fatal error */
135: #define SL_NOTIFY 02 /* logger must notify administrator */
136: #define SL_ERROR 04 /* include on the error log */
137: #define SL_TRACE 010 /* include on the trace log */
138:
139: #endif
140:
141: /* Driver and ioctl definitions */
142:
143:
144: /* DDP streams module ioctls */
145:
146: #define DDP_IOC_MYIOCTL(i) ((i>>8) == AT_MID_DDP)
147: #define DDP_IOC_GET_CFG ((AT_MID_DDP<<8) | 1)
148: #define DDP_IOC_BIND_SOCK ((AT_MID_DDP<<8) | 2)
149: #define DDP_IOC_GET_STATS ((AT_MID_DDP<<8) | 3)
150: #define DDP_IOC_LSTATUS_TABLE ((AT_MID_DDP<<8) | 4)
151: #define DDP_IOC_ULSTATUS_TABLE ((AT_MID_DDP<<8) | 5)
152: #define DDP_IOC_RSTATUS_TABLE ((AT_MID_DDP<<8) | 6)
153: #define DDP_IOC_SET_WROFF ((AT_MID_DDP<<8) | 7 )
154: #define DDP_IOC_SET_OPTS ((AT_MID_DDP<<8) | 8 )
155: #define DDP_IOC_GET_OPTS ((AT_MID_DDP<<8) | 9 )
156: #define DDP_IOC_GET_SOCK ((AT_MID_DDP<<8) | 10)
157: #define DDP_IOC_GET_PEER ((AT_MID_DDP<<8) | 11)
158: #define DDP_IOC_SET_PEER ((AT_MID_DDP<<8) | 12)
159: #define DDP_IOC_SET_PROTO ((AT_MID_DDP<<8) | 13)
160:
161:
162:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.