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

« back to all changes in this revision

Viewing changes to source/libs/gdi/sge_gdi2.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_GDI2_H
 
2
#define __SGE_GDI2_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
#include "sgeobj/sge_conf.h"
 
36
#include "gdi/sge_gdi_ctx.h"
 
37
 
 
38
#ifdef  __cplusplus
 
39
extern "C" {
 
40
#endif
 
41
 
 
42
enum {
 
43
   TAG_NONE            = 0,     /* usable e.g. as delimiter in a tag array */
 
44
   TAG_OLD_REQUEST,
 
45
   TAG_GDI_REQUEST,
 
46
   TAG_ACK_REQUEST,
 
47
   TAG_REPORT_REQUEST,
 
48
   TAG_FINISH_REQUEST,
 
49
   TAG_JOB_EXECUTION,
 
50
   TAG_SLAVE_ALLOW,
 
51
   TAG_CHANGE_TICKET,
 
52
   TAG_SIGJOB,
 
53
   TAG_SIGQUEUE,
 
54
   TAG_KILL_EXECD,
 
55
   TAG_NEW_FEATURES,     /*12*/
 
56
   TAG_GET_NEW_CONF,
 
57
   TAG_JOB_REPORT,              /* cull based job reports */
 
58
   TAG_TASK_EXIT,
 
59
   TAG_TASK_TID,
 
60
   TAG_EVENT_CLIENT_EXIT,
 
61
   TAG_FULL_LOAD_REPORT
 
62
 
 
63
#ifdef KERBEROS
 
64
  ,TAG_AUTH_FAILURE
 
65
#endif
 
66
 
 
67
};
 
68
 
 
69
typedef struct {
 
70
   char snd_host[CL_MAXHOSTLEN]; /* sender hostname; NULL -> all              */
 
71
   char snd_name[CL_MAXHOSTLEN]; /* sender name (aka 'commproc'); NULL -> all */
 
72
   u_short snd_id;            /* sender identifier; 0 -> all               */
 
73
   int tag;                   /* message tag; TAG_NONE -> all              */
 
74
   u_long32 request_mid;      /* message id of request                     */
 
75
   sge_pack_buffer buf;       /* message buffer                            */
 
76
} struct_msg_t;
 
77
 
 
78
lList
 
79
*sge_gdi2(sge_gdi_ctx_class_t *ctx, u_long32 target, u_long32 cmd, 
 
80
          lList **lpp, lCondition *cp, lEnumeration *enp);
 
81
 
 
82
int
 
83
sge_gdi2_multi(sge_gdi_ctx_class_t *ctx, lList **alpp, int mode, 
 
84
               u_long32 target, u_long32 cmd, lList **lp, 
 
85
               lCondition *cp, lEnumeration *enp, state_gdi_multi *state, bool do_copy);
 
86
 
 
87
bool
 
88
sge_gdi2_is_done(sge_gdi_ctx_class_t* ctx, lList **alpp, state_gdi_multi *state);
 
89
 
 
90
bool 
 
91
sge_gdi2_wait(sge_gdi_ctx_class_t* ctx, lList **alpp, lList **malpp, 
 
92
              state_gdi_multi *state);
 
93
 
 
94
int sge_gdi2_get_any_request(sge_gdi_ctx_class_t *ctx, char *rhost, char *commproc, u_short *id, sge_pack_buffer *pb, 
 
95
                    int *tag, int synchron, u_long32 for_request_mid, u_long32* mid);
 
96
 
 
97
int sge_gdi2_send_any_request(sge_gdi_ctx_class_t *ctx, int synchron, u_long32 *mid,
 
98
                              const char *rhost, const char *commproc, int id,
 
99
                              sge_pack_buffer *pb, 
 
100
                              int tag, u_long32  response_id, lList **alpp);
 
101
 
 
102
lList *gdi2_kill(sge_gdi_ctx_class_t *thiz, lList *id_list, const char *cell, u_long32 option_flags, u_long32 action_flag);
 
103
lList *gdi2_tsm( sge_gdi_ctx_class_t *thiz, const char *schedd_name, const char *cell);
 
104
 
 
105
bool sge_gdi2_check_permission(sge_gdi_ctx_class_t *ctx, lList **alpp, int option);
 
106
bool sge_gdi2_get_mapping_name(sge_gdi_ctx_class_t *ctx, const char *requestedHost, 
 
107
                                 char *buf, int buflen);
 
108
 
 
109
int gdi2_send_message_pb(sge_gdi_ctx_class_t *ctx, 
 
110
                         int synchron, const char *tocomproc, int toid, 
 
111
                         const char *tohost, int tag, sge_pack_buffer *pb, 
 
112
                         u_long32 *mid);
 
113
 
 
114
int gdi2_receive_message(sge_gdi_ctx_class_t *ctx, 
 
115
                         char *fromcommproc, u_short *fromid, char *fromhost, 
 
116
                         int *tag, char **buffer, u_long32 *buflen, int synchron);
 
117
 
 
118
int gdi2_get_configuration(sge_gdi_ctx_class_t *ctx, const char *config_name, 
 
119
                           lListElem **gepp, lListElem **lepp );
 
120
 
 
121
int gdi2_get_merged_configuration(sge_gdi_ctx_class_t *ctx, 
 
122
                                  lList **conf_list);
 
123
 
 
124
int gdi2_wait_for_conf(sge_gdi_ctx_class_t *ctx, lList **conf_list);
 
125
                                
 
126
int report_list_send(sge_gdi_ctx_class_t *ctx,
 
127
                     const lList *rlp, const char *rhost,
 
128
                     const char *commproc, int id,
 
129
                     int synchron);
 
130
 
 
131
int sge_gdi2_shutdown(void **context);
 
132
 
 
133
/* 
 
134
** commlib handler functions 
 
135
*/                                
 
136
#include "comm/lists/cl_list_types.h"
 
137
 
 
138
const char* sge_dump_message_tag(unsigned long tag);
 
139
 
 
140
typedef enum sge_gdi_stored_com_error_type {
 
141
   SGE_COM_ACCESS_DENIED = 101,
 
142
   SGE_COM_ENDPOINT_NOT_UNIQUE,
 
143
   SGE_COM_WAS_COMMUNICATION_ERROR
 
144
} sge_gdi_stored_com_error_t;
 
145
bool sge_get_com_error_flag(u_long32 progid, sge_gdi_stored_com_error_t error_type);
 
146
 
 
147
void general_communication_error(const cl_application_error_list_elem_t* commlib_error);
 
148
int gdi_log_flush_func(cl_raw_list_t* list_p);
 
149
 
 
150
#ifdef DEBUG_CLIENT_SUPPORT
 
151
void gdi_rmon_print_callback_function(const char *progname,
 
152
                                      const char *message,
 
153
                                      unsigned long traceid,
 
154
                                      unsigned long pid,
 
155
                                      unsigned long thread_id);
 
156
#endif
 
157
 
 
158
bool gdi2_send_multi_sync(sge_gdi_ctx_class_t* ctx, lList **alpp,
 
159
                                 state_gdi_multi *state);
 
160
 
 
161
bool
 
162
sge_gdi_extract_answer(lList **alpp, u_long32 cmd, u_long32 target, int id,
 
163
                       lList *mal, lList **olpp);
 
164
 
 
165
 
 
166
void gdi2_default_exit_func(void **ref_ctx, int i); 
 
167
 
 
168
#ifdef  __cplusplus
 
169
}
 
170
#endif
 
171
 
 
172
#endif
 
173
 
 
174
 
 
175