2 * /src/NTP/ntp4-dev/kernel/sys/parsestreams.h,v 4.5 2005/06/25 10:52:47 kardel RELEASE_20050625_A
4 * parsestreams.h,v 4.5 2005/06/25 10:52:47 kardel RELEASE_20050625_A
6 * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
7 * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the author nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 #if !(defined(lint) || defined(__GNUC__))
35 static char sysparsehrcsid[] = "parsestreams.h,v 4.5 2005/06/25 10:52:47 kardel RELEASE_20050625_A";
39 #if defined(KERNEL) || defined(_KERNEL)
44 #if defined(PARSESTREAM) && defined(HAVE_SYS_STREAM_H)
47 #ifdef HAVE_SYS_TERMIOS_H
48 #include <sys/termios.h>
51 #include <sys/ppsclock.h>
57 #if defined(PARSESTREAM) && (defined(_sun) || defined(__sun)) && defined(HAVE_SYS_STREAM_H)
59 * Sorry, but in SunOS 4.x AND Solaris 2.x kernels there are no
60 * mem* operations. I don't want them - bcopy, bzero
61 * are fine in the kernel
63 #undef HAVE_STRING_H /* don't include that at kernel level - prototype mismatch in Solaris 2.6 */
64 #include "ntp_string.h"
69 struct parsestream /* parse module local data */
71 queue_t *parse_queue; /* read stream for this channel */
72 queue_t *parse_dqueue; /* driver queue entry (PPS support) */
73 unsigned long parse_status; /* operation flags */
74 void *parse_data; /* local data space (PPS support) */
75 parse_t parse_io; /* io structure */
76 struct ppsclockev parse_ppsclockev; /* copy of last pps event */
79 typedef struct parsestream parsestream_t;
81 #define PARSE_ENABLE 0x0001
83 /*--------------- debugging support ---------------------------------*/
85 #define DD_OPEN 0x00000001
86 #define DD_CLOSE 0x00000002
87 #define DD_RPUT 0x00000004
88 #define DD_WPUT 0x00000008
89 #define DD_RSVC 0x00000010
90 #define DD_PARSE 0x00000020
91 #define DD_INSTALL 0x00000040
92 #define DD_ISR 0x00000080
93 #define DD_RAWDCF 0x00000100
95 extern int parsedebug;
99 #define parseprintf(X, Y) if ((X) & parsedebug) printf Y
103 #define parseprintf(X, Y)
112 * Revision 4.5 2005/06/25 10:52:47 kardel
113 * fix version id / add version log
115 * Revision 4.4 1998/06/14 21:09:32 kardel
118 * Revision 4.3 1998/06/13 18:14:32 kardel
119 * make mem*() to b*() mapping magic work on Solaris too
121 * Revision 4.2 1998/06/13 15:16:22 kardel
122 * fix mem*() to b*() function macro emulation
124 * Revision 4.1 1998/06/13 11:50:37 kardel
125 * STREAM macro gone in favor of HAVE_SYS_STREAM_H
127 * Revision 4.0 1998/04/10 19:51:30 kardel
128 * Start 4.0 release version numbering
130 * Revision 1.2 1998/04/10 19:27:42 kardel
131 * initial NTP VERSION 4 integration of PARSE with GPS166 binary support