networkprotocols/dnsproxy/dnsproxyserver/inc/dnsproxypolicy.h
changeset 0 af10295192d8
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/networkprotocols/dnsproxy/dnsproxyserver/inc/dnsproxypolicy.h	Tue Jan 26 15:23:49 2010 +0200
@@ -0,0 +1,74 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Definitions header file for DNS Proxy Server Security Policies
+//
+
+
+
+/**
+ @file
+ @internalComponent
+*/
+
+#include "dnsproxyclientconfigparams.h"
+
+const TInt CDnsProxyServer::PolicyRanges[] =
+    {  
+    EProxyConfigure,
+    EProxyAddDb,
+    EProxyRemoveDb,
+    EProxyUpdateDomainName,
+    EProxyConfigureUplink,
+    ENotSupported
+    };
+
+//No of elements in the array
+const TUint CDnsProxyServer::PolicyRangeCount = (sizeof(PolicyRanges) / sizeof(PolicyRanges[0]));
+
+// Index numbers into CDnsProxyServer[]
+
+const TInt policyNetwork = 0;
+const TInt policyAlwaysPass = 1;
+
+// Mapping of IPCs to policy elements
+
+const TUint8 CDnsProxyServer::PolicyElementsIndex[PolicyRangeCount] =
+	{
+	1,								//EProxyConfigure
+	2,								//EProxyAddDb
+	2,								//EProxyRemoveDb
+	2,								//EProxyUpdateDomainName							
+	1,    							//EProxyConfigureUplink                          
+	CPolicyServer::ENotSupported 	//EProxyConfigureUplink + 1	
+	};
+
+// Individual policy elements
+
+const CPolicyServer::TPolicyElement CDnsProxyServer::PolicyElements[] =
+	{
+	{ _INIT_SECURITY_POLICY_PASS },
+	{ _INIT_SECURITY_POLICY_C2(ECapabilityNetworkControl ,ECapabilityNetworkServices), CPolicyServer::EFailClient },
+	{ _INIT_SECURITY_POLICY_C1(ECapabilityReadDeviceData), CPolicyServer::EFailClient },
+	};
+
+// Main policy
+
+const CPolicyServer::TPolicy CDnsProxyServer::Policy =
+	{
+	policyNetwork, 	//specifies all connect attempts should use policy 0 from CDnsProxyServer::PolicyElements
+	PolicyRangeCount,
+	PolicyRanges,
+	PolicyElementsIndex,
+	PolicyElements,
+	};