ped_schedule.h File Reference

Routines related to timers. More...

Go to the source code of this file.


 seconds before immediately due timeout
#define SCHEDULE_PERIOD   10
 seconds before next due timeout
 seconds before a retry after a stop
 if we have more than MAX_RETRY_ATTEMPTS within this (SCHEDULE_STOP_RETRY) many seconds, then we stop for SCHEDULE_RESTART_TIME
 number of retries associated with SCHEDULE_STOP_RETRY


int ped_schedule_init (void)
void ped_schedule_reset (void)
void ped_schedule_stop (void)

Detailed Description

Routines related to timers.

Functions to initialize timer infrastruture and register periodic updates

Definition in file ped_schedule.h.

Function Documentation

int ped_schedule_init ( void   ) 

Initialize the internals necessary for the periodic timer/scheduler. Does not set timers. That's done with ped_schedule_reset. This must be called before using ped_schedule_reset.

0 on success, and -1 on error

Definition at line 164 of file ped_schedule.c.

References period, SCHEDULE_PERIOD, and timer_set.

Referenced by ped_init().

void ped_schedule_reset ( void   ) 

Clear existing timer if it exists, and set the timer fresh again. Starts a periodic timer every SCHEDULE_PERIOD seconds, and a one-shot timer that goes off in SCHEDULE_IMMEDIATE_DELAY seconds. Timer callback is ped_periodic.

If we're resetting, then something went wrong most likely (or it's a configuration load/reload) so we have a small delay timer before retrying. If all goes well, then the periodic timer will continue checks after that.

Definition at line 187 of file ped_schedule.c.

References ped_ctx, ped_periodic(), period, SCHEDULE_IMMEDIATE_DELAY, timer_id, and timer_set.

Referenced by ped_init(), ped_periodic(), and ped_restart().

void ped_schedule_stop ( void   ) 

Clear existing schedule for shutdown

Definition at line 221 of file ped_schedule.c.

References ped_ctx, timer_id, and timer_set.

2007-2009 Juniper Networks, Inc. All rights reserved. The information contained herein is confidential information of Juniper Networks, Inc., and may not be used, disclosed, distributed, modified, or copied without the prior written consent of Juniper Networks, Inc. in an express license. This information is subject to change by Juniper Networks, Inc. Juniper Networks, the Juniper Networks logo, and JUNOS are registered trademarks of Juniper Networks, Inc. in the United States and other countries. All other trademarks, service marks, registered trademarks, or registered service marks are the property of their respective owners.
Generated on Sun May 30 20:27:06 2010 for SDK Your Net Corporation Policy Manager Example: Policy Enforcement Daemon 1.0 by Doxygen 1.5.1