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 * @(#) $Id: scsp_timer.c,v 1.1 1998/09/15 08:23:17 phk 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 __RCSID("@(#) $Id: scsp_timer.c,v 1.1 1998/09/15 08:23:17 phk Exp $");
65 * Process an SCSP Open timeout
67 * The open timer is set when an attempt to open a VCC to a DCS fails.
68 * This routine will be called when the timer fires and will retry
69 * the open. Retries can continue indefinitely.
72 * stp pointer to an SCSP timer block
79 scsp_open_timeout(stp)
85 * Back off to start of DCS entry
87 dcsp = (Scsp_dcs *) ((caddr_t)stp -
88 (int)(&((Scsp_dcs *)0)->sd_open_t));
91 * Retry the connection
93 if (scsp_dcs_connect(dcsp)) {
95 * Connect failed -- we hope the error was temporary
96 * and set the timer to try again later
98 HARP_TIMER(&dcsp->sd_open_t, SCSP_Open_Interval,
105 * Process an SCSP Hello timeout
107 * The Hello timer fires every SCSP_HELLO_Interval seconds. This
108 * routine will notify the Hello FSM when the timer fires.
111 * stp pointer to an SCSP timer block
118 scsp_hello_timeout(stp)
124 * Back off to start of DCS entry
126 dcsp = (Scsp_dcs *) ((caddr_t)stp -
127 (int)(&((Scsp_dcs *)0)->sd_hello_h_t));
132 (void)scsp_hfsm(dcsp, SCSP_HFSM_HELLO_T, (Scsp_msg *)0);
139 * Process an SCSP receive timeout
141 * The receive timer is started whenever the Hello FSM receives a
142 * Hello message from its DCS. If the timer fires, it means that no
143 * Hello messages have been received in the DCS's Hello interval.
146 * stp pointer to an SCSP timer block
153 scsp_hello_rcv_timeout(stp)
159 * Back off to start of DCS entry
161 dcsp = (Scsp_dcs *) ((caddr_t)stp -
162 (int)(&((Scsp_dcs *)0)->sd_hello_rcv_t));
167 (void)scsp_hfsm(dcsp, SCSP_HFSM_RCV_T, (void *)0);
174 * Process an SCSP CA retransmit timeout
177 * stp pointer to an SCSP timer block
184 scsp_ca_retran_timeout(stp)
190 * Back off to start of DCS entry
192 dcsp = (Scsp_dcs *) ((caddr_t)stp -
193 (int)(&((Scsp_dcs *)0)->sd_ca_rexmt_t));
198 (void)scsp_cafsm(dcsp, SCSP_CAFSM_CA_T, (void *)0);
205 * Process an SCSP CSUS retransmit timeout
208 * stp pointer to an SCSP timer block
215 scsp_csus_retran_timeout(stp)
221 * Back off to start of DCS entry
223 dcsp = (Scsp_dcs *) ((caddr_t)stp -
224 (int)(&((Scsp_dcs *)0)->sd_csus_rexmt_t));
229 (void)scsp_cafsm(dcsp, SCSP_CAFSM_CSUS_T, (void *)0);
236 * Process an SCSP CSU Req retransmit timeout
239 * stp pointer to an SCSP timer block
246 scsp_csu_req_retran_timeout(stp)
253 * Back off to start of CSU Request retransmission entry
255 rxp = (Scsp_csu_rexmt *) ((caddr_t)stp -
256 (int)(&((Scsp_csu_rexmt *)0)->sr_t));
262 (void)scsp_cafsm(dcsp, SCSP_CAFSM_CSU_T, (void *)rxp);