1 #ifndef SCHEDCORE_H 2 #define SCHEDCORE_H 3 4 config_require(utilities/iquery) 5 6 /* 7 * Values for schedType field 8 */ 9 #define SCHED_TYPE_PERIODIC 1 10 #define SCHED_TYPE_CALENDAR 2 11 #define SCHED_TYPE_ONESHOT 3 12 13 /* 14 * Schedule flags 15 */ 16 #define SCHEDULE_FLAG_ENABLED 0x01 /* for schedAdminStatus */ 17 #define SCHEDULE_FLAG_ACTIVE 0x02 /* for schedRowStatus */ 18 #define SCHEDULE_FLAG_VALID 0x04 /* for row creation/undo */ 19 20 /* 21 * All Schedule-MIB OCTET STRING objects are either short (32-char) 22 * tags, or SnmpAdminString values (i.e. 255 characters) 23 */ 24 #define SCHED_STR1_LEN 32 25 #define SCHED_STR2_LEN 255 26 27 /* 28 * Data structure for a schedTable row entry 29 */ 30 struct schedTable_entry { 31 /* 32 * Index values 33 */ 34 char schedOwner[SCHED_STR1_LEN+1]; 35 char schedName[ SCHED_STR1_LEN+1]; 36 37 /* 38 * Column values - schedule actions 39 */ 40 char schedDescr[SCHED_STR2_LEN+1]; 41 u_long schedInterval; 42 char schedWeekDay; 43 char schedMonth[2]; 44 char schedDay[4+4]; 45 char schedHour[3]; 46 char schedMinute[8]; 47 char schedContextName[SCHED_STR1_LEN+1]; 48 oid schedVariable[ MAX_OID_LEN ]; 49 size_t schedVariable_len; 50 long schedValue; 51 52 /* 53 * Column values - schedule control 54 */ 55 long schedType; 56 u_long schedFailures; 57 long schedLastFailure; 58 time_t schedLastFailed; 59 long schedStorageType; 60 u_long schedTriggers; 61 62 /* 63 * Supporting values 64 */ 65 time_t schedLastRun; 66 time_t schedNextRun; 67 unsigned int schedCallbackID; 68 netsnmp_session *session; 69 long flags; 70 }; 71 72 /* 73 * function declarations 74 */ 75 extern netsnmp_tdata *schedule_table; 76 void init_schedule_container(void); 77 void init_schedCore(void); 78 79 netsnmp_tdata_row * 80 schedTable_createEntry(const char *schedOwner, const char *schedName); 81 void schedTable_removeEntry(netsnmp_tdata_row *row); 82 void sched_nextTime( struct schedTable_entry *entry ); 83 void sched_nextRowTime( netsnmp_tdata_row *row ); 84 85 #endif /* SCHEDCORE_H */ 86