2 * Copyright (c) 1995 Ugen J.S.Antsilevich
4 * Redistribution and use in source forms, with and without modification,
5 * are permitted provided that this entire comment appears intact.
7 * Redistribution in binary form may occur without any restrictions.
8 * Obviously, it would be nice if you gave credit where credit is due
9 * but requiring it would be too onerous.
11 * This software is provided ``AS IS'' without any warranties of any kind.
22 #include <sys/types.h>
24 #include <sys/ioccom.h>
27 #define SNOOP_MINLEN (4*1024) /* This should be power of 2.
28 * 4K tested to be the minimum
29 * for which on normal tty
30 * usage there is no need to
33 #define SNOOP_MAXLEN (64*1024) /* This one also,64K enough
34 * If we grow more,something
35 * really bad in this world..
39 * This is the main snoop per-device
44 dev_t snp_target; /* major/minor number of device*/
45 struct tty *snp_tty; /* tty device pointer */
46 u_long snp_len; /* buffer data length */
47 u_long snp_base; /* buffer data base */
48 u_long snp_blen; /* Overall buffer len */
49 caddr_t snp_buf; /* Data buffer */
50 int snp_flags; /* Flags place */
51 #define SNOOP_ASYNC 0x0002
52 #define SNOOP_OPEN 0x0004
53 #define SNOOP_RWAIT 0x0008
54 #define SNOOP_OFLOW 0x0010
55 #define SNOOP_DOWN 0x0020
56 struct selinfo snp_sel; /* Selection info */
57 int snp_olddisc; /* Old line discipline */
62 * Theese are snoop io controls
63 * SNPSTTY accepts 'struct snptty' as input.
64 * If ever type or unit set to -1,snoop device
65 * detached from its current tty.
68 #define SNPSTTY _IOW('T', 90, dev_t)
69 #define SNPGTTY _IOR('T', 89, dev_t)
72 * Theese values would be returned by FIONREAD ioctl
73 * instead of number of characters in buffer in case
77 #define SNP_TTYCLOSE -2
80 #endif /* !_SYS_SNOOP_H_ */