3
/*___INFO__MARK_BEGIN__*/
4
/*************************************************************************
6
* The Contents of this file are made available subject to the terms of
7
* the Sun Industry Standards Source License Version 1.2
9
* Sun Microsystems Inc., March, 2001
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
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.
26
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
28
* Copyright: 2001 by Sun Microsystems, Inc.
30
* All Rights Reserved.
32
************************************************************************/
33
/*___INFO__MARK_END__*/
35
#include "basis_types.h"
41
#define GDI_PACKET_MUTEX "gdi_pack_mutex"
43
typedef struct _sge_gdi_task_class_t sge_gdi_task_class_t;
45
typedef struct _sge_gdi_packet_class_t sge_gdi_packet_class_t;
47
struct _sge_gdi_task_class_t {
49
* id identifying the GDI packet uniquely within the
50
* context of a GDI client
55
* common parts of a GDI request
61
lCondition *condition;
62
lEnumeration *enumeration;
65
* This flag is used in qmaster to identify if a special
66
* optimization can be done. This optimization can only be
67
* done for GDI GET requests where the client is
68
* an external GDI client (no thread using GDI).
70
* In that case it is possible that the lSelectHashPack()
71
* function is called with a packbuffer so that the function
72
* directly packs into this packbuffer.
74
* This avoids a copy operation
76
bool do_select_pack_simultaneous;
79
* pointer to the next task in a multi GDI request
81
sge_gdi_task_class_t *next;
84
struct _sge_gdi_packet_class_t {
86
* mutex to gard the "is_handled" flag of this structure
88
pthread_mutex_t mutex;
91
* condition used for synchronisation of multiple threads
92
* which want to access this structure
97
* true if the worker thread does not need to access this
98
* structure anymore. Guarded with "mutex" part of this
104
* true if this structure was created by a qmaster
105
* internal thread (scheduler, JVM...)
107
bool is_intern_request;
110
* true if the packet contains a GDI request otherwise
111
* is containes a report request
116
* unique id identifying this packet uniquely in the context
117
* of the creating process/thread
122
* set in qmaster to identify the source for this GDI packet.
123
* qmaster will use that information to send a response
124
* to the correct external communication partner using the
125
* commlib infrastructure
130
u_long32 response_id;
133
* GDI version of this structure
138
* pointers to the first and last task part of a multi
139
* GDI request. This list contains at least one element
141
sge_gdi_task_class_t *first_task;
142
sge_gdi_task_class_t *last_task;
145
* encrypted authenitication information. This information will
146
* be decrypted to the field "uid", "gid", "user" and "group"
147
* part of this structure
149
* EB: TODO: Cleanup: remove "auth_info" from sge_gdi_packet_class_t
151
* authinfo is not needed in this structure because the
152
* same information is stored in "uid", "gid", "user" and "group"
153
* If these elements are initialized during unpacking a packet
154
* and if the GDI functions don't want to access auth_info
155
* anymore then we can remove that field from this structure.
160
* User/group information of that user which used GDI functionality.
161
* Used in qmasters GDI handling code to identify if that
162
* user has the allowance to do the requested GDI activities.
170
* Packbuffer used for GDI GET requests to directly store the
171
* result of lSelectHashPack()
173
* EB: TODO: Cleanup: eleminate "pb" from sge_gdi_packet_class_t
175
* We might eleminate this member as soon as pure GDI GET
176
* requests are handled by some kind of read only thread.
177
* in qmaster. Write requests don't need the packbuffer.
178
* Due to that fact we could create and release the packbuffer
179
* in the the listener thread and use cull lists (part
180
* of the task sublist) to transfer GDI result information
181
* from the worker to the listener then we are able to
187
* if this packet is part of a packet queue then this
188
* pointer might point to the next packet in the queue
190
sge_gdi_packet_class_t *next;
193
sge_gdi_packet_class_t *
194
sge_gdi_packet_create_base(lList **answer_list);
196
sge_gdi_packet_class_t *
197
sge_gdi_packet_create(sge_gdi_ctx_class_t *ctx, lList **answer_list);
200
sge_gdi_packet_free(sge_gdi_packet_class_t **packet_handle);
203
sge_gdi_packet_append_task(sge_gdi_packet_class_t *packet, lList **answer_list,
204
u_long32 target, u_long32 command, lList **lp, lList **a_list,
205
lCondition **condition, lEnumeration **enumeration,
206
bool do_copy, bool do_verify);
209
sge_gdi_packet_get_last_task_id(sge_gdi_packet_class_t *packet);
212
sge_gdi_packet_verify_version(sge_gdi_packet_class_t *packet, lList **alpp);
215
sge_gdi_task_get_operation_name(sge_gdi_task_class_t *task);