1: /*
2: * six-byte packet header for asynch lines.
3: * headers for other devices take up the same
4: * or less space. If this changes the header
5: * struct will have to become a union.
6: */
7: struct {
8: char sync; /* sync byte */
9: char ksize; /* encoded packet size */
10: u_short sum; /* block check of data packet */
11: char cntl; /* control byte */
12: char ccntl; /* block check of header */
13: };
14: #define HDRSIZ 6
15:
16: /*
17: * Control structure for a packet driver connection.
18: */
19: struct pack {
20: short p_state; /* line state */
21: short p_bits; /* mask for getepack */
22: short p_rsize; /* input packet size */
23: short p_xsize; /* output packet size */
24: struct header p_ihbuf; /* input header */
25: struct header p_ohbuf; /* output header */
26: char *p_rptr;
27: char p_mode;
28: char **p_ipool; /* head link to input buffer pool */
29: char **p_io; /* input buffer given to driver */
30: char p_xcount; /* # active output buffers */
31: char p_rcount;
32: char p_nout, p_tout;
33: char p_lpsize; /* log(psize/32) */
34: char p_timer;
35: char p_obusy;
36: char p_srxmit;
37: char p_rwindow; /* window size */
38: char p_swindow;
39: char p_msg; /* control msg */
40: char p_rmsg; /* repeated control msg */
41: char p_ps, p_pr; /* last packet sent, recv'd */
42: char p_rpr; /* copy of remote pr */
43: char p_nxtps; /* next output seq number */
44: char p_imap; /* bit map of input buffers */
45: char p_pscopy; /* newest output packet */
46: char *p_ob[8]; /* output buffers */
47: char *p_ib[8]; /* input buffers */
48: char p_os[8]; /* output buffer status */
49: char p_is[8]; /* input buffer status */
50: short p_osum[8]; /* output checksums */
51: short p_isum[8]; /* input checksums */
52: DSYSTEM;
53: };
54: #define CHECK 0125252
55: #define SYN 020
56: #define MOD8 7
57: #define NOTCNTL(a) (a & 0300)
58: #ifndef MIN
59: #define MIN(a,b) (((a)<(b))? (a):(b))
60: #endif
61:
62: char next[8];
63: char mask[8];
64: short npbits;
65: short pkactive;
66: short pkzot;
67: short pkdisc;
68:
69: /*
70: * driver state
71: */
72: #define DEAD 0
73: #define INITa 1
74: #define INITb 2
75: #define INITab 3
76: #define LIVE 010
77: #define RXMIT 020
78: #define RREJ 040
79: #define PDEBUG 0200
80: #define DRAINO 0400
81: #define WAITO 01000
82: #define DOWN 02000
83: #define RCLOSE 04000
84: #define BADFRAME 020000
85:
86: /*
87: * modes
88: */
89: #define SLOWMODE 0100
90: /*
91: * io buffer states
92: */
93: #define B_NULL 0
94: #define B_READY 1
95: #define B_SENT 2
96: #define B_RESID 010
97: #define B_COPY 020
98: #define B_MARK 040
99: #define B_SHORT 0100
100:
101: /*
102: * control messages
103: */
104: #define CLOSE 1
105: #define RJ 2
106: #define SRJ 3
107: #define RR 4
108: #define INITC 5
109: #define INITB 6
110: #define INITA 7
111:
112: #define M_RJ 4
113: #define M_SRJ 010
114: #define M_RR 020
115: #define M_INITC 040
116: #define M_CLOSE 2
117: #define M_INITA 0200
118: #define M_INITB 0100
119:
120:
121:
122: #define PKOPRI 31
123: #define PKIPRI 30
124:
125: #define NPLINES 8
126:
127: /*
128: * packet ioctl buf
129: */
130: struct piocb {
131: u_short t;
132: short psize;
133: short mode;
134: short state;
135: char window;
136: };
137:
138: short pkdebug;
139: short pksizes[];
140:
141: #define Pwrite 1
142: #define Poutput 1
143: #define Pxint 1
144:
145:
146: #define Print 01
147: #define Prend 01
148: #define Pacc 01
149: #define Pread 01
150:
151: short *PTRACE;
152:
153:
154: #define ISCNTL(a) ((a & 0300) == 0)
Defined variables
mask
defined in line
63;
never used
next
defined in line
62;
never used
pkzot
defined in line
66;
never used
Defined struct's
defined in line
7; used 4 times
pack
defined in line
19;
never used
Defined macros
CHECK
defined in line
54;
never used
DEAD
defined in line
72;
never used
DOWN
defined in line
82;
never used
INITa
defined in line
73;
never used
INITb
defined in line
74;
never used
LIVE
defined in line
76;
never used
MIN
defined in line
59; used 1 times
MOD8
defined in line
56;
never used
M_RJ
defined in line
112;
never used
M_RR
defined in line
114;
never used
Pacc
defined in line
148;
never used
RJ
defined in line
105;
never used
RR
defined in line
107;
never used
RREJ
defined in line
78;
never used
RXMIT
defined in line
77;
never used
SRJ
defined in line
106;
never used
SYN
defined in line
55;
never used
WAITO
defined in line
81;
never used