]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/sys/snoop.h
Constify the module name. This silences a few warnings ("initialization
[FreeBSD/FreeBSD.git] / sys / sys / snoop.h
1 /*
2  * Copyright (c) 1995 Ugen J.S.Antsilevich
3  *
4  * Redistribution and use in source forms, with and without modification,
5  * are permitted provided that this entire comment appears intact.
6  *
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.
10  *
11  * This software is provided ``AS IS'' without any warranties of any kind.
12  *
13  * Snoop stuff.
14  *
15  * $FreeBSD$
16  */
17
18 #ifndef _SYS_SNOOP_H_
19 #define _SYS_SNOOP_H_
20
21 #ifndef _KERNEL
22 #include <sys/types.h>
23 #endif
24 #include <sys/ioccom.h>
25
26 #ifdef _KERNEL
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
31                                                  * allocate more.
32                                                  */
33 #define SNOOP_MAXLEN            (64*1024)       /* This one also,64K enough
34                                                  * If we grow more,something
35                                                  * really bad in this world..
36                                                  */
37
38 /*
39  * This is the main snoop per-device
40  * structure...
41  */
42
43 struct snoop {
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         */
58 };
59 #endif /* _KERNEL */
60
61 /*
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.
66  */
67
68 #define SNPSTTY       _IOW('T', 90, dev_t)
69 #define SNPGTTY       _IOR('T', 89, dev_t)
70
71 /*
72  * Theese values would be returned by FIONREAD ioctl
73  * instead of number of characters in buffer in case
74  * of specific errors.
75  */
76 #define SNP_OFLOW               -1
77 #define SNP_TTYCLOSE            -2
78 #define SNP_DETACH              -3
79
80 #endif /* !_SYS_SNOOP_H_ */