1 mike 1.1 /*
2 **==============================================================================
3 **
4 ** Open Management Infrastructure (OMI)
5 **
6 ** Copyright (c) Microsoft Corporation
7 **
8 ** Licensed under the Apache License, Version 2.0 (the "License"); you may not
9 ** use this file except in compliance with the License. You may obtain a copy
10 ** of the License at
11 **
12 ** http://www.apache.org/licenses/LICENSE-2.0
13 **
14 ** THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 ** KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
16 ** WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
17 ** MERCHANTABLITY OR NON-INFRINGEMENT.
18 **
19 ** See the Apache 2 License for the specific language governing permissions
20 ** and limitations under the License.
21 **
22 mike 1.1 **==============================================================================
23 */
24
25 #ifndef _omi_agentmgr_h
26 #define _omi_agentmgr_h
27
28 #include <common.h>
29 #include <base/base.h>
30 #include <base/messages.h>
31 #include <provreg/provreg.h>
32 #include <provmgr/provmgr.h>
|
33 krisbash 1.4 #include <pal/thread.h>
34 #include <pal/lock.h>
|
35 mike 1.2 #include <sock/selector.h>
|
36 mike 1.1
|
37 krisbash 1.4 #if defined(CONFIG_ENABLE_PREEXEC)
38 # include "preexec.h"
39 #endif
40
|
41 mike 1.1 /*
42 **==============================================================================
43 **
44 ** AgentMgr
45 **
46 ** This type implements the CIM server agent manager module, which:
47 **
48 ** (1) Spawns new agent processes
49 **
50 ** (2) Keeps track of active agent processes
51 **
52 ** (3) Retires inatcive agent processes
53 **
54 ** (4) Coordinates shutdown procedure
55 **
56 **==============================================================================
57 */
58
59 typedef struct _AgentElem AgentElem;
60
61 typedef struct _AgentMgr
62 mike 1.1 {
|
63 krisbash 1.4 ProvMgr provmgr;
|
64 mike 1.1
65 /* Directories */
|
66 krisbash 1.4 char* home;
67 char* provDir;
|
68 mike 1.1
|
69 krisbash 1.4 Selector* selector;
|
70 mike 1.1
71 /* Linked list of indication provider contexts - one per ns/cn pair */
|
72 krisbash 1.4 ListElem* headAgents;
73 ListElem* tailAgents;
74
75 // To protect access to list on headAgents/tailAgents
76 ReadWriteLock lock;
|
77 mike 1.1
|
78 krisbash 1.4 #if defined(CONFIG_ENABLE_PREEXEC)
79 PreExec preexec;
80 #endif /* defined(CONFIG_ENABLE_PREEXEC) */
|
81 mike 1.1 }
82 AgentMgr;
83
84 MI_Result AgentMgr_Init(
85 AgentMgr* self,
86 Selector* selector);
87
88 MI_Result AgentMgr_Destroy(
89 AgentMgr* self);
90
|
91 krisbash 1.4 typedef struct _AgentMgr_OpenCallbackData
92 {
93 AgentMgr* self;
94 const ProvRegEntry* proventry;
95 } AgentMgr_OpenCallbackData;
96
97 void AgentMgr_OpenCallback(
98 _Inout_ InteractionOpenParams* params );
99
|
100 mike 1.1 MI_Result AgentMgr_HandleRequest(
|
101 krisbash 1.4 _In_ AgentMgr* self,
102 _Inout_ InteractionOpenParams* params,
103 _In_ const ProvRegEntry* proventry);
|
104 mike 1.1
105 #endif /* _omi_agentmgr_h */
|