f875a3591d4b556017c40efaf35d48846afb193a
[openjpeg.git] / src / lib / openjpip / dec_clientmsg_handler.h
1 /*
2  * $Id$
3  *
4  * Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
5  * Copyright (c) 2002-2011, Professor Benoit Macq
6  * Copyright (c) 2010-2011, Kaori Hagihara 
7  * Copyright (c) 2011,      Lucian Corlaciu, GSoC
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  * 1. Redistributions of source code must retain the above copyright
14  *    notice, this list of conditions and the following disclaimer.
15  * 2. Redistributions in binary form must reproduce the above copyright
16  *    notice, this list of conditions and the following disclaimer in the
17  *    documentation and/or other materials provided with the distribution.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  */
31
32 #ifndef         DEC_CLIENTMSG_HANDLER_H_
33 # define        DEC_CLIENTMSG_HANDLER_H_
34
35 #include "imgsock_manager.h"
36 #include "cache_manager.h"
37 #include "byte_manager.h"
38 #include "msgqueue_manager.h"
39
40 /**
41  * handle JPT- JPP- stream message
42  *
43  * @param[in]     connected_socket socket descriptor
44  * @param[in]     cachelist        cache list pointer
45  * @param[in,out] jpipstream       address of JPT- JPP- stream pointer
46  * @param[in,out] streamlen        address of stream length
47  * @param[in,out] msgqueue         message queue pointer
48  */
49 void handle_JPIPstreamMSG( SOCKET connected_socket, cachelist_param_t *cachelist, Byte_t **jpipstream, OPJ_SIZE_T *streamlen, msgqueue_param_t *msgqueue);
50
51 /**
52  * handle PNM request message
53  *
54  * @param[in] connected_socket socket descriptor
55  * @param[in] jpipstream       jpipstream pointer
56  * @param[in] msgqueue         message queue pointer
57  * @param[in] cachelist        cache list pointer
58  */
59 void handle_PNMreqMSG( SOCKET connected_socket, Byte_t *jpipstream, msgqueue_param_t *msgqueue, cachelist_param_t *cachelist);
60
61 /**
62  * handle XML request message
63  *
64  * @param[in] connected_socket socket descriptor
65  * @param[in] jpipstream       address of caching jpipstream pointer
66  * @param[in] cachelist        cache list pointer
67  */
68 void handle_XMLreqMSG( SOCKET connected_socket, Byte_t *jpipstream, cachelist_param_t *cachelist);
69
70 /**
71  * handle TargetID request message
72  *
73  * @param[in] connected_socket socket descriptor
74  * @param[in] cachelist        cache list pointer
75  */
76 void handle_TIDreqMSG( SOCKET connected_socket, cachelist_param_t *cachelist);
77
78 /**
79  * handle ChannelID request message
80  *
81  * @param[in] connected_socket socket descriptor
82  * @param[in] cachelist        cache list pointer
83  */
84 void handle_CIDreqMSG( SOCKET connected_socket, cachelist_param_t *cachelist);
85
86 /**
87  * handle distroy ChannelID message
88  *
89  * @param[in]     connected_socket socket descriptor
90  * @param[in,out] cachelist        cache list pointer
91  */
92 void handle_dstCIDreqMSG( SOCKET connected_socket, cachelist_param_t *cachelist);
93
94 /**
95  * handle SIZ request message
96  *
97  * @param[in]     connected_socket socket descriptor
98  * @param[in] jpipstream       address of caching jpipstream pointer
99  * @param[in] msgqueue         message queue pointer
100  * @param[in,out] cachelist        cache list pointer
101  */
102 void handle_SIZreqMSG( SOCKET connected_socket, Byte_t *jpipstream, msgqueue_param_t *msgqueue, cachelist_param_t *cachelist);
103
104 /**
105  * handle saving JP2 file request message
106  *
107  * @param[in] connected_socket socket descriptor
108  * @param[in] cachelist        cache list pointer
109  * @param[in] msgqueue         message queue pointer
110  * @param[in] jpipstream       address of caching jpipstream pointer
111  */
112 void handle_JP2saveMSG( SOCKET connected_socket, cachelist_param_t *cachelist, msgqueue_param_t *msgqueue, Byte_t *jpipstream);
113
114
115 #endif      /* !DEC_CLIENTMSG_HANDLER_H_ */