Commit | Line | Data |
---|---|---|
fa58c82e KS |
1 | /* |
2 | * Copyright (c) University of British Columbia, 1984 | |
3 | * Copyright (c) 1990 The Regents of the University of California. | |
4 | * All rights reserved. | |
5 | * | |
6 | * This code is derived from software contributed to Berkeley by | |
7 | * the Laboratory for Computation Vision and the Computer Science Department | |
8 | * of the University of British Columbia. | |
9 | * | |
10 | * %sccs.include.redist.c% | |
11 | * | |
b84e7ca8 | 12 | * @(#)hd_var.h 7.3 (Berkeley) %G% |
fa58c82e | 13 | */ |
82237f5b KS |
14 | |
15 | /* | |
16 | * | |
17 | * hdlc control block | |
18 | * | |
19 | */ | |
20 | ||
21 | struct hdtxq { | |
22 | struct mbuf *head; | |
23 | struct mbuf *tail; | |
24 | }; | |
25 | ||
26 | struct hdcb { | |
27 | struct hdcb *hd_next; /* pointer to next hdlc control block */ | |
28 | char hd_state; /* link state */ | |
29 | char hd_vs; /* send state variable */ | |
30 | char hd_vr; /* receive state variable */ | |
31 | char hd_lastrxnr; /* last received N(R) */ | |
32 | char hd_lasttxnr; /* last transmitted N(R) */ | |
33 | char hd_condition; | |
34 | #define TIMER_RECOVERY_CONDITION 0x01 | |
35 | #define REJ_CONDITION 0x02 | |
36 | #define REMOTE_RNR_CONDITION 0X04 | |
37 | char hd_retxcnt; | |
38 | char hd_xx; | |
39 | struct hdtxq hd_txq; | |
40 | struct mbuf *hd_retxq[MODULUS]; | |
41 | char hd_retxqi; | |
42 | char hd_rrtimer; | |
43 | char hd_timer; | |
44 | #define SET_TIMER(hdp) hdp->hd_timer = hd_t1 | |
45 | #define KILL_TIMER(hdp) hdp->hd_timer = 0 | |
46 | char hd_dontcopy; /* if-driver doesn't free I-frames */ | |
47 | struct ifnet *hd_ifp; /* device's network visible interface */ | |
b84e7ca8 KS |
48 | struct ifaddr *hd_ifa; /* device's X.25 network address */ |
49 | int (*hd_output)(); /* separate entry for HDLC direct output */ | |
82237f5b KS |
50 | struct x25config *hd_xcp; /* copy of &hdp->hd_if->if_addr */ |
51 | ||
52 | /* link statistics */ | |
53 | ||
54 | long hd_iframes_in; | |
55 | long hd_iframes_out; | |
56 | long hd_rrs_in; | |
57 | long hd_rrs_out; | |
58 | short hd_rejs_in; | |
59 | short hd_rejs_out; | |
60 | long hd_window_condition; | |
61 | short hd_invalid_ns; | |
62 | short hd_invalid_nr; | |
63 | short hd_timeouts; | |
64 | short hd_resets; | |
65 | short hd_unknown; | |
66 | short hd_frmrs_in; | |
67 | short hd_frmrs_out; | |
68 | short hd_rnrs_in; | |
69 | short hd_rnrs_out; | |
70 | }; | |
71 | ||
72 | #ifdef KERNEL | |
73 | struct hdcb *hdcbhead; /* head of linked list of hdcb's */ | |
74 | struct Frmr_frame hd_frmr; /* rejected frame diagnostic info */ | |
75 | struct ifqueue hdintrq; /* hdlc packet input queue */ | |
76 | ||
77 | int hd_t1; /* timer T1 value */ | |
78 | int hd_t3; /* RR send timer */ | |
79 | int hd_n2; /* frame retransmission limit */ | |
80 | #endif |