--******************************************************************************************************************** -- Created: 30-Mar-2010 17:32:55 by OpenVMS SDL EV3-3 -- Source: 12-APR-2006 13:17:31 $1$DGA7274:[LIB_ADA.LIS]CSCHEDDEF.SDL;1 --******************************************************************************************************************** with SYSTEM; use SYSTEM; with STARLET; use STARLET; with CONDITION_HANDLING; use CONDITION_HANDLING; package CSCHEDDEF is -- module $CSCHEDDEF --++ -- The following structure is the format of the records in the class -- scheduler database file. The class record is the largest record. -- The qualifying records (username, account name, and UIC) are subsets -- of the class record. ---- CSCHED_K_CLASS_NUMBER_POS : constant := 2; CSCHED_K_CLASS_NUMSIZE : constant := 2; CSCHED_K_NODE_NAME_POS : constant := 4; CSCHED_K_NODE_RECORD : constant := 20; -- End of Node record CSCHED_K_USER_NAME_POS : constant := 20; CSCHED_K_USERNAME_RECORD : constant := 52; -- End of User name record CSCHED_K_ACCOUNT_NAME_POS : constant := 52; CSCHED_K_ACCOUNT_RECORD : constant := 84; -- End of Account record CSCHED_K_UIC_POS : constant := 84; CSCHED_K_UIC_GRP_POS : constant := 86; CSCHED_K_UIC_SIZE : constant := 4; CSCHED_K_UIC_RECORD : constant := 88; -- End of UIC record CSCHED_M_WINDFALL : constant := 16#00000001#; CSCHED_M_CLUSTER : constant := 16#00000002#; CSCHED_M_DELPND : constant := 16#00000004#; CSCHED_M_MONDAY : constant := 16#00000001#; CSCHED_M_TUESDAY : constant := 16#00000002#; CSCHED_M_WEDNESDAY : constant := 16#00000004#; CSCHED_M_THURSDAY : constant := 16#00000008#; CSCHED_M_FRIDAY : constant := 16#00000010#; CSCHED_M_SATURDAY : constant := 16#00000020#; CSCHED_M_SUNDAY : constant := 16#00000040#; CSCHED_K_CLASS_NAME_POS : constant := 144; CSCHED_K_CLASS_RECORD : constant := 160; -- End of class record type CSCHED_UIC_TYPE is -- User's UIC value record MEM : UNSIGNED_WORD; -- Member number in UIC GRP : UNSIGNED_WORD; -- Group number in UIC end record; for CSCHED_UIC_TYPE use record MEM at 0 range 0 .. 15; GRP at 2 range 0 .. 15; end record; for CSCHED_UIC_TYPE'SIZE use 32; CSCHED_UIC_TYPE_INIT : constant CSCHED_UIC_TYPE := (MEM => 0, GRP => 0); type CSCHED_FLAGS_TYPE is -- Flags field record WINDFALL : BOOLEAN; -- Enable windfall if this bit is set CLUSTER : BOOLEAN; -- Class is valid cluster-wide DELPND : BOOLEAN; -- Class is being deleted FILLER_1 : UNSIGNED_29; end record; for CSCHED_FLAGS_TYPE use record WINDFALL at 0 range 0 .. 0; CLUSTER at 0 range 1 .. 1; DELPND at 0 range 2 .. 2; FILLER_1 at 0 range 3 .. 31; end record; for CSCHED_FLAGS_TYPE'SIZE use 32; CSCHED_FLAGS_TYPE_INIT : constant CSCHED_FLAGS_TYPE := (WINDFALL => FALSE, CLUSTER => FALSE, DELPND => FALSE, FILLER_1 => 0); type CSCHED_DAYS_TYPE is -- Days of the week that the class is valid record MONDAY : BOOLEAN; -- If bit is clear, day is a primary day. TUESDAY : BOOLEAN; -- Otherwise, it's a secondary day. WEDNESDAY : BOOLEAN; THURSDAY : BOOLEAN; FRIDAY : BOOLEAN; SATURDAY : BOOLEAN; SUNDAY : BOOLEAN; FILLER_1 : BOOLEAN; end record; for CSCHED_DAYS_TYPE use record MONDAY at 0 range 0 .. 0; TUESDAY at 0 range 1 .. 1; WEDNESDAY at 0 range 2 .. 2; THURSDAY at 0 range 3 .. 3; FRIDAY at 0 range 4 .. 4; SATURDAY at 0 range 5 .. 5; SUNDAY at 0 range 6 .. 6; FILLER_1 at 0 range 7 .. 7; end record; for CSCHED_DAYS_TYPE'SIZE use 8; CSCHED_DAYS_TYPE_INIT : constant CSCHED_DAYS_TYPE := (MONDAY => FALSE, TUESDAY => FALSE, WEDNESDAY => FALSE, THURSDAY => FALSE, FRIDAY => FALSE, SATURDAY => FALSE, SUNDAY => FALSE, FILLER_1 => FALSE); type CSCHED_TYPE is record RECORD_TYPE : UNSIGNED_WORD; -- Record type (class, user, account, or UIC) CLASS_NUMBER : UNSIGNED_WORD; -- Class number (values between 0 - 8191) NODE_NAME : STRING(1 .. 16); -- Node name USER_NAME : STRING(1 .. 32); -- User name ACCOUNT : STRING(1 .. 32); -- Account name (same as in the UAF file) UIC : CSCHED_UIC_TYPE; -- User's UIC value PRIMEDAY_CPULIMIT : UNSIGNED_BYTE_ARRAY (1 .. 24); -- Cpu limits per hour for primary days SECONDAY_CPULIMIT : UNSIGNED_BYTE_ARRAY (1 .. 24); -- Cpu limits per hour for secondary days FLAGS : CSCHED_FLAGS_TYPE; -- Flags field DAYS : CSCHED_DAYS_TYPE; -- Days of the week that the class is valid FILLER_1 : UNSIGNED_BYTE_ARRAY (1 .. 3); -- Get alignment back CLASS_NAME : STRING(1 .. 16); -- Name of scheduling class end record; for CSCHED_TYPE use record RECORD_TYPE at 0 range 0 .. 15; CLASS_NUMBER at 2 range 0 .. 15; NODE_NAME at 4 range 0 .. 127; USER_NAME at 20 range 0 .. 255; ACCOUNT at 52 range 0 .. 255; UIC at 84 range 0 .. 31; PRIMEDAY_CPULIMIT at 88 range 0 .. 191; SECONDAY_CPULIMIT at 112 range 0 .. 191; FLAGS at 136 range 0 .. 31; DAYS at 140 range 0 .. 7; FILLER_1 at 141 range 0 .. 23; CLASS_NAME at 144 range 0 .. 127; end record; for CSCHED_TYPE'SIZE use 1280; CSCHED_TYPE_INIT : constant CSCHED_TYPE := (RECORD_TYPE => 0, CLASS_NUMBER => 0, NODE_NAME => (others => ASCII.NUL), USER_NAME => (others => ASCII.NUL), ACCOUNT => (others => ASCII.NUL), UIC => CSCHED_UIC_TYPE_INIT, PRIMEDAY_CPULIMIT => (others => 0), SECONDAY_CPULIMIT => (others => 0), FLAGS => CSCHED_FLAGS_TYPE_INIT, DAYS => CSCHED_DAYS_TYPE_INIT, FILLER_1 => (others => 0), CLASS_NAME => (others => ASCII.NUL)); CSCHED_K_LENGTH : constant := 160; -- Length of structure -- Values for each Record type are: CSCHED_K_CLASS : constant := 1; CSCHED_K_USERNAME : constant := 2; CSCHED_K_UIC : constant := 3; CSCHED_K_ACCOUNT : constant := 4; CSCHED_K_NODE : constant := 5; -- Define a maximum number of classes. The class scheduler database file is -- designed to support an unlimited number of classes. However, we place a -- limit of the number of classes so that we can easily determine the size of -- the in-memory class scheduler arrays. -- CSCHED_K_MAX_SCHED_CLASSES : constant := 256; -- -- The following 2 constants define the actual size of the user name and account -- name fields. The size of these fields is tied to the size of these same -- fields in the sysuaf.dat file. The Authorize image limits these names to -- 12 and 8 bytes respectively despite the fact that uafdef.sdl reserves 32 -- bytes for each of these fields in the sysuaf.dat file. If Authorize ever -- increases the limit on these fields, then these constants should be adjusted -- to match the new limits. -- CSCHED_K_USERNAME_REAL_SIZE : constant := 12; CSCHED_K_ACCOUNT_REAL_SIZE : constant := 8; -- -- This is the class scheduler's work area. The memory for this work -- area is allocated/deallocated by the SMIserver and will be used by -- the SMI object routines. This work area holds the RMS data structures -- used when reading/writing to the class scheduler database file. -- SCHEDWA_K_LENGTH : constant := 1232; type SCHEDWA_TYPE is record FAB : UNSIGNED_BYTE_ARRAY (1 .. 80); -- FAB for database file RAB : UNSIGNED_BYTE_ARRAY (1 .. 144); -- RAB for database file CLASS_KEY0 : UNSIGNED_BYTE_ARRAY (1 .. 100); -- 6 XAB's to represent 6 different CLASS_KEY1 : UNSIGNED_BYTE_ARRAY (1 .. 100); -- index keys into database file. CLASS_KEY2 : UNSIGNED_BYTE_ARRAY (1 .. 100); CLASS_KEY3 : UNSIGNED_BYTE_ARRAY (1 .. 100); CLASS_KEY4 : UNSIGNED_BYTE_ARRAY (1 .. 100); CLASS_KEY5 : UNSIGNED_BYTE_ARRAY (1 .. 100); XABPRO : UNSIGNED_BYTE_ARRAY (1 .. 88); -- Protection XAB INPUT_BUF : UNSIGNED_BYTE_ARRAY (1 .. 160); -- Input buffer OUTPUT_BUF : UNSIGNED_BYTE_ARRAY (1 .. 160); -- Output buffer end record; for SCHEDWA_TYPE use record FAB at 0 range 0 .. 639; RAB at 80 range 0 .. 1151; CLASS_KEY0 at 224 range 0 .. 799; CLASS_KEY1 at 324 range 0 .. 799; CLASS_KEY2 at 424 range 0 .. 799; CLASS_KEY3 at 524 range 0 .. 799; CLASS_KEY4 at 624 range 0 .. 799; CLASS_KEY5 at 724 range 0 .. 799; XABPRO at 824 range 0 .. 703; INPUT_BUF at 912 range 0 .. 1279; OUTPUT_BUF at 1072 range 0 .. 1279; end record; for SCHEDWA_TYPE'SIZE use 9856; SCHEDWA_TYPE_INIT : constant SCHEDWA_TYPE := (FAB => (others => 0), RAB => (others => 0), CLASS_KEY0 => (others => 0), CLASS_KEY1 => (others => 0), CLASS_KEY2 => (others => 0), CLASS_KEY3 => (others => 0), CLASS_KEY4 => (others => 0), CLASS_KEY5 => (others => 0), XABPRO => (others => 0), INPUT_BUF => (others => 0), OUTPUT_BUF => (others => 0)); -- Bit definitions for the flags field passed between SYSMAN and the SMIserver -- for the ADD, DELETE, and SHOW commands. Since both these images include this -- file, it is an appropriate place to include them. CSCHED_K_ALL : constant := 0; -- flags for the SHOW command CSCHED_K_FULL : constant := 1; CSCHED_K_WINDFALL : constant := 0; -- flags for the ADD command and the cluster flag CSCHED_K_CLUSTER : constant := 1; -- is also valid for the DELETE command -- Values below represent the item codes for the item list which -- contains the user data for a scheduling class. These item codes are used for -- the ADD and MODIFY functions. The item list is passed from SYSMAN to the SMI -- class scheduler object routine. CSCHED_K_ADD_USER : constant := 1; CSCHED_K_ADD_ACCOUNT : constant := 2; CSCHED_K_ADD_UIC : constant := 3; CSCHED_K_REMOVE_USER : constant := 4; CSCHED_K_REMOVE_ACCOUNT : constant := 5; CSCHED_K_REMOVE_UIC : constant := 6; CSCHED_K_NUMBER_OF_ITEMCODES : constant := 7; end CSCHEDDEF;