1 /* ------------------------------------------------------------------ 2 * Copyright (C) 1998-2009 PacketVideo 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 * express or implied. 14 * See the License for the specific language governing permissions 15 * and limitations under the License. 16 * ------------------------------------------------------------------- 17 */ 18 19 #ifndef OSCL_DNS_REQUEST_H_INCLUDED 20 #define OSCL_DNS_REQUEST_H_INCLUDED 21 22 #include "oscl_dns_tuneables.h" 23 #if PV_DNS_SERVER 24 25 #include "oscl_namestring.h" 26 #include "oscl_dns.h" 27 #include "oscl_socket_types.h" 28 #include "oscl_dns_tuneables.h" 29 30 #if PV_DNS_IS_THREAD 31 #include "oscl_thread.h" 32 #include "oscl_mutex.h" 33 #endif 34 35 class DNSRequestParam; 36 class OsclDNSRequestAO; 37 38 /** This class defines the interface to the dns 39 implementation threads. 40 */ 41 class OsclDNSRequest 42 { 43 public: OsclDNSRequest()44 OsclDNSRequest() 45 : iDNSRequestAO(NULL) 46 , iDNSRequestParam(NULL) 47 , iActive(false) 48 { 49 } ~OsclDNSRequest()50 ~OsclDNSRequest() 51 { 52 } 53 54 OsclDNSRequestAO *iDNSRequestAO;//the AO that is waiting on completion. 55 DNSRequestParam *iDNSRequestParam; 56 bool iActive; 57 58 #if PV_DNS_IS_THREAD 59 static TOsclThreadFuncRet OSCL_THREAD_DECL ThreadFunc(TOsclThreadFuncArg arg); 60 #endif 61 62 void CancelRequest(); 63 void Complete(bool, int32 aStatus, int32 aSockErr); 64 void Activate(DNSRequestParam *iParam, OsclDNSRequestAO &a); 65 }; 66 67 #endif 68 69 70 #endif 71 72