|
|
1.1 root 1: /* @(#)pk.h 5.6 (Berkeley) 4/5/88 */
2:
3: struct header {
4: char sync;
5: char ksize;
6: unsigned short sum;
7: char cntl;
8: char ccntl;
9: };
10:
11: #define HDRSIZ 6 /* Packet header size */
12: #define PACKSIZE 64 /* Standard packet size */
13: #define WINDOWS 7 /* number of outstanding un-ack'd packets */
14:
15: struct pack {
16: short p_state; /* line state */
17: short p_bits; /* mask for getepack */
18: short p_rsize; /* input packet size */
19: short p_xsize; /* output packet size */
20: struct header p_ihbuf; /* input header */
21: struct header p_ohbuf; /* output header */
22: char *p_rptr;
23: char **p_ipool;
24: char p_xcount; /* # active output buffers */
25: char p_rcount;
26: char p_lpsize; /* log(psize/32) */
27: char p_obusy; /* output busy? for reentrant pkoutput() */
28: char p_srxmit;
29: char p_rwindow; /* window size */
30: char p_swindow;
31: char p_msg; /* control msg */
32: char p_rmsg; /* repeated control msg */
33: char p_ps,p_pr; /* last packet sent, recv'd */
34: char p_rpr;
35: char p_nxtps; /* next output seq number */
36: char p_imap; /* bit map of input buffers */
37: char p_pscopy; /* newest output packet */
38: char *p_ob[8]; /* output buffers */
39: char *p_ib[8]; /* input buffers */
40: char p_os[8]; /* output buffer status */
41: char p_is[8]; /* input buffer status */
42: short p_osum[8]; /* output checksums */
43: short p_isum[8]; /* input checksums */
44: int p_ifn, p_ofn;
45: };
46:
47: #define CHECK 0125252
48: #define SYN 020
49: #define MOD8 7
50: #define ISCNTL(a) ((a & 0300)==0)
51: /* MIN may have been defined in <sys/param.h> */
52: #undef MIN
53: #define MIN(a,b) ((a<b)? a:b)
54:
55: extern char next[8];
56: extern char mask[8];
57:
58: /*
59: * driver state
60: */
61: #define DEAD 0
62: #define INITa 1
63: #define INITb 2
64: #define INITab 3
65: #define LIVE 010
66: #define RXMIT 020
67: #define RREJ 040
68: #define PDEBUG 0200
69: #define DRAINO 0400
70: #define WAITO 01000
71: #define DOWN 02000
72: #define RCLOSE 04000
73: #define BADFRAME 020000
74:
75: /*
76: * io buffer states
77: */
78: #define B_NULL 0
79: #define B_READY 1
80: #define B_SENT 2
81: #define B_RESID 010
82: #define B_COPY 020
83: #define B_MARK 040
84: #define B_SHORT 0100
85:
86: /* read or write */
87:
88: #define B_WRITE 0
89: #define B_READ 1
90:
91: /*
92: * control messages
93: */
94: #define CLOSE 1
95: #define RJ 2
96: #define SRJ 3
97: #define RR 4
98: #define INITC 5
99: #define INITB 6
100: #define INITA 7
101:
102: #define M_CLOSE 002
103: #define M_RJ 004
104: #define M_SRJ 010
105: #define M_RR 020
106: #define M_INITC 040
107: #define M_INITA 0200
108: #define M_INITB 0100
109:
110: #define NPLINES 2
111:
112: extern int pksizes[];
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.