3 * ===================================
4 * HARP | Host ATM Research Platform
5 * ===================================
8 * This Host ATM Research Platform ("HARP") file (the "Software") is
9 * made available by Network Computing Services, Inc. ("NetworkCS")
10 * "AS IS". NetworkCS does not provide maintenance, improvements or
11 * support of any kind.
13 * NETWORKCS MAKES NO WARRANTIES OR REPRESENTATIONS, EXPRESS OR IMPLIED,
14 * INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
15 * AND FITNESS FOR A PARTICULAR PURPOSE, AS TO ANY ELEMENT OF THE
16 * SOFTWARE OR ANY SUPPORT PROVIDED IN CONNECTION WITH THIS SOFTWARE.
17 * In no event shall NetworkCS be responsible for any damages, including
18 * but not limited to consequential damages, arising from or relating to
19 * any use of the Software or related support.
21 * Copyright 1994-1998 Network Computing Services, Inc.
23 * Copies of this Software may be made, however, the above copyright
24 * notice must be reproduced on all copies.
26 * @(#) $FreeBSD: src/usr.sbin/atm/scspd/scsp_timer.c,v 1.3 1999/08/28 01:15:34 peter Exp $
27 * @(#) $DragonFly: src/usr.sbin/atm/scspd/scsp_timer.c,v 1.4 2004/12/18 22:48:02 swildner Exp $
31 * Server Cache Synchronization Protocol (SCSP) Support
32 * ----------------------------------------------------
38 #include <sys/types.h>
39 #include <sys/param.h>
40 #include <sys/socket.h>
42 #include <netinet/in.h>
43 #include <netatm/queue.h>
44 #include <netatm/atm.h>
45 #include <netatm/atm_if.h>
46 #include <netatm/atm_sap.h>
47 #include <netatm/atm_sys.h>
48 #include <netatm/atm_ioctl.h>
60 * Process an SCSP Open timeout
62 * The open timer is set when an attempt to open a VCC to a DCS fails.
63 * This routine will be called when the timer fires and will retry
64 * the open. Retries can continue indefinitely.
67 * stp pointer to an SCSP timer block
74 scsp_open_timeout(Harp_timer
*stp
)
79 * Back off to start of DCS entry
81 dcsp
= (Scsp_dcs
*) ((caddr_t
)stp
-
82 (int)(&((Scsp_dcs
*)0)->sd_open_t
));
85 * Retry the connection
87 if (scsp_dcs_connect(dcsp
)) {
89 * Connect failed -- we hope the error was temporary
90 * and set the timer to try again later
92 HARP_TIMER(&dcsp
->sd_open_t
, SCSP_Open_Interval
,
99 * Process an SCSP Hello timeout
101 * The Hello timer fires every SCSP_HELLO_Interval seconds. This
102 * routine will notify the Hello FSM when the timer fires.
105 * stp pointer to an SCSP timer block
112 scsp_hello_timeout(Harp_timer
*stp
)
117 * Back off to start of DCS entry
119 dcsp
= (Scsp_dcs
*) ((caddr_t
)stp
-
120 (int)(&((Scsp_dcs
*)0)->sd_hello_h_t
));
125 scsp_hfsm(dcsp
, SCSP_HFSM_HELLO_T
, NULL
);
132 * Process an SCSP receive timeout
134 * The receive timer is started whenever the Hello FSM receives a
135 * Hello message from its DCS. If the timer fires, it means that no
136 * Hello messages have been received in the DCS's Hello interval.
139 * stp pointer to an SCSP timer block
146 scsp_hello_rcv_timeout(Harp_timer
*stp
)
151 * Back off to start of DCS entry
153 dcsp
= (Scsp_dcs
*) ((caddr_t
)stp
-
154 (int)(&((Scsp_dcs
*)0)->sd_hello_rcv_t
));
159 scsp_hfsm(dcsp
, SCSP_HFSM_RCV_T
, NULL
);
166 * Process an SCSP CA retransmit timeout
169 * stp pointer to an SCSP timer block
176 scsp_ca_retran_timeout(Harp_timer
*stp
)
181 * Back off to start of DCS entry
183 dcsp
= (Scsp_dcs
*) ((caddr_t
)stp
-
184 (int)(&((Scsp_dcs
*)0)->sd_ca_rexmt_t
));
189 scsp_cafsm(dcsp
, SCSP_CAFSM_CA_T
, NULL
);
196 * Process an SCSP CSUS retransmit timeout
199 * stp pointer to an SCSP timer block
206 scsp_csus_retran_timeout(Harp_timer
*stp
)
211 * Back off to start of DCS entry
213 dcsp
= (Scsp_dcs
*) ((caddr_t
)stp
-
214 (int)(&((Scsp_dcs
*)0)->sd_csus_rexmt_t
));
219 scsp_cafsm(dcsp
, SCSP_CAFSM_CSUS_T
, NULL
);
226 * Process an SCSP CSU Req retransmit timeout
229 * stp pointer to an SCSP timer block
236 scsp_csu_req_retran_timeout(Harp_timer
*stp
)
242 * Back off to start of CSU Request retransmission entry
244 rxp
= (Scsp_csu_rexmt
*) ((caddr_t
)stp
-
245 (int)(&((Scsp_csu_rexmt
*)0)->sr_t
));
251 scsp_cafsm(dcsp
, SCSP_CAFSM_CSU_T
, (void *)rxp
);