~ubuntu-branches/ubuntu/utopic/gridengine/utopic

« back to all changes in this revision

Viewing changes to source/libs/gdi/sge_gdi.h

  • Committer: Bazaar Package Importer
  • Author(s): Mark Hymers
  • Date: 2008-06-25 22:36:13 UTC
  • Revision ID: james.westby@ubuntu.com-20080625223613-tvd9xlhuoct9kyhm
Tags: upstream-6.2~beta2
Import upstream version 6.2~beta2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef __SGE_GDI_H
 
2
#define __SGE_GDI_H
 
3
/*___INFO__MARK_BEGIN__*/
 
4
/*************************************************************************
 
5
 * 
 
6
 *  The Contents of this file are made available subject to the terms of
 
7
 *  the Sun Industry Standards Source License Version 1.2
 
8
 * 
 
9
 *  Sun Microsystems Inc., March, 2001
 
10
 * 
 
11
 * 
 
12
 *  Sun Industry Standards Source License Version 1.2
 
13
 *  =================================================
 
14
 *  The contents of this file are subject to the Sun Industry Standards
 
15
 *  Source License Version 1.2 (the "License"); You may not use this file
 
16
 *  except in compliance with the License. You may obtain a copy of the
 
17
 *  License at http://gridengine.sunsource.net/Gridengine_SISSL_license.html
 
18
 * 
 
19
 *  Software provided under this License is provided on an "AS IS" basis,
 
20
 *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
 
21
 *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
 
22
 *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
 
23
 *  See the License for the specific provisions governing your rights and
 
24
 *  obligations concerning the Software.
 
25
 * 
 
26
 *   The Initial Developer of the Original Code is: Sun Microsystems, Inc.
 
27
 * 
 
28
 *   Copyright: 2001 by Sun Microsystems, Inc.
 
29
 * 
 
30
 *   All Rights Reserved.
 
31
 * 
 
32
 ************************************************************************/
 
33
/*___INFO__MARK_END__*/
 
34
 
 
35
/* may be this should be included by the gdi user */
 
36
#include "cull.h"
 
37
#include "sge_hostname.h"
 
38
 
 
39
#ifdef  __cplusplus
 
40
extern "C" {
 
41
#endif
 
42
 
 
43
/* 
 
44
 * allowed values for command field of a gdi request 
 
45
 * (see sge_gdi_packet_class_t and sge_gdi_task_class_t
 
46
 */
 
47
enum { 
 
48
   /* OPERATION -------------- */
 
49
   SGE_GDI_GET = 1, 
 
50
   SGE_GDI_ADD, 
 
51
   SGE_GDI_DEL, 
 
52
   SGE_GDI_MOD,
 
53
   SGE_GDI_TRIGGER,
 
54
   SGE_GDI_PERMCHECK,
 
55
   SGE_GDI_SPECIAL,
 
56
   SGE_GDI_COPY,
 
57
   SGE_GDI_REPLACE,
 
58
 
 
59
   /* SUB COMMAND  ----------- */
 
60
 
 
61
   /* for SGE_JOB_LIST => SGE_GDI_ADD */
 
62
   SGE_GDI_RETURN_NEW_VERSION = (1<<8),
 
63
 
 
64
   /* for SGE_JOB_LIST => SGE_GDI_DEL, SGE_GDI_MOD */
 
65
   SGE_GDI_ALL_JOBS  = (1<<9),
 
66
   SGE_GDI_ALL_USERS = (1<<10),
 
67
 
 
68
   /* for SGE_QUEUE_LIST, SGE_EXECHOST_LIST => SGE_GDI_MOD */
 
69
   SGE_GDI_SET     = 0,        /* overwrite the sublist with given values */
 
70
   SGE_GDI_CHANGE  = (1<<11),  /* change the given elements */
 
71
   SGE_GDI_APPEND  = (1<<12),  /* add some elements into a sublist */
 
72
   SGE_GDI_REMOVE  = (1<<13),  /* remove some elements from a sublist */
 
73
   SGE_GDI_SET_ALL = (1<<14),  /* 
 
74
                                * overwrite the sublist with given values
 
75
                                * and erase all domain/host specific values
 
76
                                * not given with the current request
 
77
                                */
 
78
   SGE_GDI_EXECD_RESTART = (1<<15)
 
79
};
 
80
 
 
81
#define SGE_GDI_OPERATION (0xFF)
 
82
#define SGE_GDI_SUBCOMMAND (~SGE_GDI_OPERATION)
 
83
 
 
84
#define SGE_GDI_GET_OPERATION(x) ((x)&SGE_GDI_OPERATION)
 
85
#define SGE_GDI_GET_SUBCOMMAND(x) ((x)&SGE_GDI_SUBCOMMAND)
 
86
#define SGE_GDI_IS_SUBCOMMAND_SET(x,y) ((x)&(y))
 
87
 
 
88
/* 
 
89
 * allowed values for target field of GDI request 
 
90
 * (see sge_gdi_packet_class_t and sge_gdi_task_class_t
 
91
 */
 
92
enum {
 
93
   SGE_ADMINHOST_LIST = 1,
 
94
   SGE_SUBMITHOST_LIST,
 
95
   SGE_EXECHOST_LIST,
 
96
   SGE_CQUEUE_LIST,
 
97
   SGE_JOB_LIST,
 
98
   SGE_EVENT_LIST,
 
99
   SGE_CENTRY_LIST,
 
100
   SGE_ORDER_LIST,
 
101
   SGE_MASTER_EVENT,
 
102
   SGE_CONFIG_LIST,
 
103
   SGE_MANAGER_LIST,
 
104
   SGE_OPERATOR_LIST,
 
105
   SGE_PE_LIST,
 
106
   SGE_SC_LIST,          /* schedconf list */
 
107
   SGE_USER_LIST,
 
108
   SGE_USERSET_LIST,
 
109
   SGE_PROJECT_LIST,
 
110
   SGE_SHARETREE_LIST,
 
111
   SGE_CKPT_LIST,
 
112
   SGE_CALENDAR_LIST,
 
113
   SGE_JOB_SCHEDD_INFO_LIST,
 
114
   SGE_ZOMBIE_LIST,
 
115
   SGE_USER_MAPPING_LIST,
 
116
   SGE_HGROUP_LIST,
 
117
   SGE_RQS_LIST,
 
118
   SGE_AR_LIST,
 
119
   SGE_DUMMY_LIST
 
120
};
 
121
 
 
122
/*
 
123
** Special target numbers for �complex requests� which shall be handled
 
124
** directly at the master in order to reduce network traffic and replication
 
125
** of master lists. They are only useful for SGE_GDI_GET requests
 
126
** ATTENTION: the numbers below must not collide with the numbers in the enum
 
127
**            directly above
 
128
*/
 
129
enum {
 
130
   SGE_QSTAT = 1024,
 
131
   SGE_QHOST
 
132
};
 
133
 
 
134
/* sge_gdi_multi enums */
 
135
enum {
 
136
   SGE_GDI_RECORD,
 
137
   SGE_GDI_SEND,
 
138
   SGE_GDI_SHOW
 
139
};
 
140
 
 
141
/* preserves state between multiple calls to sge_gdi_multi() */
 
142
typedef struct _state_gdi_multi state_gdi_multi;
 
143
 
 
144
struct _state_gdi_multi {
 
145
   void *packet; /* TODO: EB: this is a sge_gdi_packet_class_t pointer - fix includes */
 
146
   lList **malpp;
 
147
   state_gdi_multi *next;
 
148
};
 
149
 
 
150
/* to be used for initializing state_gdi_multi */
 
151
#define STATE_GDI_MULTI_INIT { NULL, NULL, NULL}
 
152
 
 
153
bool sge_gdi_extract_answer(lList **alpp, u_long32 cmd, u_long32 target, int id, lList *mal, lList **olpp);
 
154
 
 
155
/* from gdi_checkpermissions.h */
 
156
#define MANAGER_CHECK     (1<<0)
 
157
#define OPERATOR_CHECK    (1<<1)
 
158
/*
 
159
#define USER_CHECK        (1<<2)
 
160
#define SGE_USER_CHECK    (1<<3)
 
161
*/
 
162
 
 
163
/* from gdi_setup.h */
 
164
/* these values are standarized gdi return values */
 
165
enum {
 
166
   AE_ERROR = -1,
 
167
   AE_OK = 0,
 
168
   AE_ALREADY_SETUP,
 
169
   AE_UNKNOWN_PARAM,
 
170
   AE_QMASTER_DOWN
 
171
};
 
172
 
 
173
/* from gdi_tsm.h */
 
174
#define MASTER_KILL       (1<<0)
 
175
#define SCHEDD_KILL       (1<<1)
 
176
#define EXECD_KILL        (1<<2)
 
177
#define JOB_KILL          (1<<3)
 
178
#define EVENTCLIENT_KILL  (1<<4)
 
179
#define THREAD_START      (1<<5)
 
180
 
 
181
#ifdef  __cplusplus
 
182
}
 
183
#endif
 
184
 
 
185
#endif /* __SGE_GDI_H */