1 krisbash 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 krisbash 1.1 **==============================================================================
23 */
24
25 #ifndef _omi_multiplex_h
26 #define _omi_multiplex_h
27
28 #include <common.h>
29 #include <base/base.h>
30 #include <base/Strand.h>
31
32 /*
33 **==============================================================================
34 **
35 ** Multiplex
36 **
37 ** This file implements the germ of future multiplexer
38 **
39 ** (to be completed with flow control, etc.)
40 **
41 **==============================================================================
42 */
43 krisbash 1.1
44 typedef void (*OnCloseCallback)(
45 _In_ void* object); // object being closed (not used yet)
46
47 typedef struct _MuxIn
48 {
49 OpenCallback callback;
50 void* callbackData;
51 OnCloseCallback onCloseCallback;
52 MakeResultMessageCallback makeResultMessageCallback;
53 // nothing else for now
54 }
55 MuxIn;
56
57 MI_INLINE
58 MI_Result MuxIn_Init(
59 _Inout_ MuxIn* self,
60 _In_ OpenCallback callback,
61 _In_ void* callbackData,
62 _In_opt_ OnCloseCallback onCloseCallback,
63 _In_ MakeResultMessageCallback makeResultMessageCallback)
64 krisbash 1.1
65 {
66 self->callback = callback;
67 self->callbackData = callbackData;
68 self->onCloseCallback = onCloseCallback;
69 self->makeResultMessageCallback = makeResultMessageCallback;
70
71 return MI_RESULT_OK;
72 }
73
74 // Called to handle the opening of a new connection
75 // (and correspondinly opening new Interaction Interface)
76 void MuxIn_Open( _Inout_ InteractionOpenParams* params );
77
78 #endif /* _omi_multiplex_h */
79
|