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

« back to all changes in this revision

Viewing changes to source/daemons/qmaster/sge_c_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_C_GDI_H
 
2
#define __SGE_C_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
 
 
36
 
 
37
#ifndef __SGE_GDI_INTERN_H
 
38
#   include "sge_gdiP.h"
 
39
#endif
 
40
 
 
41
#include "uti/sge_monitor.h"
 
42
#include "cull.h"
 
43
#include "sgeobj/sge_object.h"
 
44
 
 
45
#include "gdi/sge_gdi_ctx.h"
 
46
#include "gdi/sge_gdi_packet.h"
 
47
 
 
48
typedef struct _gdi_object_t gdi_object_t;
 
49
 
 
50
typedef int (*modifier_func_t)(
 
51
   sge_gdi_ctx_class_t *ctx,
 
52
   lList **alpp,
 
53
   lListElem *new_cal,   /* destination */
 
54
   lListElem *cep,       /* reduced element */
 
55
   int add,              /* 1 for add/0 for mod */
 
56
   const char *ruser,
 
57
   const char *rhost,
 
58
   gdi_object_t *object, /* some kind of "this" */
 
59
   int sub_command,
 
60
   monitoring_t *monitor
 
61
);
 
62
 
 
63
typedef int (*writer_func_t)(
 
64
   sge_gdi_ctx_class_t *ctx,
 
65
   lList **alpp,
 
66
   lListElem *ep,      /* new modified element */
 
67
   gdi_object_t *this   /* some kind of "this" */
 
68
);
 
69
 
 
70
/* allows to retrieve a master list */
 
71
typedef lList ** (*getMasterList)(void);
 
72
 
 
73
typedef int (*on_success_func_t)(
 
74
   sge_gdi_ctx_class_t *ctx,
 
75
   lListElem *ep,       /* new modified and already spooled element */
 
76
   lListElem *old_ep,   /* old element is NULL in add case */
 
77
   gdi_object_t *this,  /* some kind of "this" */
 
78
   lList **ppList,       /* a list to pass back information for post processing */
 
79
   monitoring_t *monitor  /* monitoring structure */
 
80
);
 
81
 
 
82
struct _gdi_object_t {
 
83
   u_long32           target;          /* SGE_QUEUE_LIST */
 
84
   int                key_nm;          /* QU_qname */
 
85
   lDescr             *type;           /* QU_Type */
 
86
   char               *object_name;    /* "queue" */
 
87
   sge_object_type    list_type;       /* identifier to retrive the master list via object_type_get_master_list*/
 
88
   modifier_func_t    modifier;        /* responsible for validating each our attribute modifier */
 
89
   writer_func_t      writer;          /* function that spools our object */
 
90
   on_success_func_t  on_success;      /* do everything what has to be done on successful writing */
 
91
};
 
92
 
 
93
gdi_object_t *get_gdi_object(u_long32);
 
94
 
 
95
void  
 
96
sge_c_gdi(sge_gdi_ctx_class_t *ctx, sge_gdi_packet_class_t *packet, 
 
97
          sge_gdi_task_class_t *task, lList **answer_list, monitoring_t *monitor);
 
98
 
 
99
int 
 
100
sge_gdi_add_mod_generic(sge_gdi_ctx_class_t *ctx, 
 
101
                        lList **alpp, lListElem *instructions, int add, 
 
102
                        gdi_object_t *object, const char *ruser, 
 
103
                        const char *rhost, int sub_command, lList **ppList, 
 
104
                        monitoring_t *monitor);
 
105
 
 
106
void sge_clean_lists(void); 
 
107
 
 
108
/* EB: TODO: CLEANUP: should be replaced with sge_gdi_packet_verify_version() */
 
109
int verify_request_version(lList **alpp, u_long32 version, char *host, 
 
110
                           char *commproc, int id);
 
111
 
 
112
#endif /* __SGE_C_GDI_H */
 
113