libUPnP
1.6.17
|
00001 #ifndef MINISERVER_H 00002 #define MINISERVER_H 00003 00004 /************************************************************************** 00005 * 00006 * Copyright (c) 2000-2003 Intel Corporation 00007 * All rights reserved. 00008 * 00009 * Redistribution and use in source and binary forms, with or without 00010 * modification, are permitted provided that the following conditions are met: 00011 * 00012 * - Redistributions of source code must retain the above copyright notice, 00013 * this list of conditions and the following disclaimer. 00014 * - Redistributions in binary form must reproduce the above copyright notice, 00015 * this list of conditions and the following disclaimer in the documentation 00016 * and/or other materials provided with the distribution. 00017 * - Neither name of Intel Corporation nor the names of its contributors 00018 * may be used to endorse or promote products derived from this software 00019 * without specific prior written permission. 00020 * 00021 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00022 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00023 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00024 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR 00025 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00026 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00027 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00028 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 00029 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00030 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00031 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00032 * 00033 **************************************************************************/ 00034 00039 #include "sock.h" 00040 #include "httpparser.h" 00041 #include "UpnpStdInt.h" 00042 00043 extern SOCKET gMiniServerStopSock; 00044 00045 typedef struct MServerSockArray { 00047 SOCKET miniServerSock4; 00049 SOCKET miniServerSock6; 00051 SOCKET miniServerStopSock; 00053 SOCKET ssdpSock4; 00055 SOCKET ssdpSock6; 00057 SOCKET ssdpSock6UlaGua; 00058 /* ! . */ 00059 uint16_t stopPort; 00060 /* ! . */ 00061 uint16_t miniServerPort4; 00062 /* ! . */ 00063 uint16_t miniServerPort6; 00064 #ifdef INCLUDE_CLIENT_APIS 00065 00067 SOCKET ssdpReqSock4; 00070 SOCKET ssdpReqSock6; 00071 #endif /* INCLUDE_CLIENT_APIS */ 00072 } MiniServerSockArray; 00073 00075 typedef void (*MiniServerCallback) ( 00076 /* ! . */ 00077 IN http_parser_t * parser, 00078 /* ! . */ 00079 IN http_message_t * request, 00080 /* ! . */ 00081 IN SOCKINFO * info); 00082 00083 #ifdef __cplusplus 00084 extern "C" { 00085 #endif 00086 00090 void SetHTTPGetCallback( 00092 MiniServerCallback callback); 00093 00097 #ifdef INCLUDE_DEVICE_APIS 00098 void SetSoapCallback( 00100 MiniServerCallback callback); 00101 #else /* INCLUDE_DEVICE_APIS */ 00102 static UPNP_INLINE void SetSoapCallback(MiniServerCallback callback) {} 00103 #endif /* INCLUDE_DEVICE_APIS */ 00104 00107 void SetGenaCallback( 00109 MiniServerCallback callback); 00110 00126 int StartMiniServer( 00129 uint16_t *listen_port4, 00132 uint16_t *listen_port6); 00133 00139 int StopMiniServer(); 00140 00141 #ifdef __cplusplus 00142 } /* extern C */ 00143 #endif 00144 00145 #endif /* MINISERVER_H */