How to prevent web browsing with WLAN programatically
Article Metadata
Code Example
Article
Introduction
With Symbian devices, we can connect to WLAN and browse internet without restriction. But if device management want to configure devices in such a way so that WLAN, BT, IRDA, GPRS etc can't be used in company devices for security reason. How we can stop WLAN from being used? In this article, we are examining how we can prevent WLAN to browse web programmatically.
We can monitor the publish and subscribe category (KPSUidWlan) to get notification about the status of the connection. When we get the value of key either EPSWlanIndicatorActive or EPSWlanIndicatorActiveSecure then we can disconnect the connection as shown in the following code.
void CWLANPubSub::RunL()
{
iWlanEngine->RefreshL();
TInt Val = -1;
iProperty.Get(Val);
if(iWlanStatusExpected == EFalse)
{
TInt Count = iWlanEngine->Count();
if((Val == EPSWlanIndicatorActive || Val == EPSWlanIndicatorActiveSecure) && Count > 0)
{
TBuf<100> bearerName(0);
for(TInt i = 0; i <Count; i++ )
{
bearerName.SetLength(0);
bearerName.FillZ();
TRAPD(tt, iWlanEngine->GetBearerL(i, bearerName));
if(bearerName.Compare(_L("WLAN")) == 0) // Check for other??
{
TRAPD(trert, iWlanEngine->StopConnectionL(i));
break;
}
}
}
}
RequestChange();
}
How to block IP packet with IPhook module based on IP address Removing send via Bluetooth from send menu How to prevent data sending over Infrared programatically
Code example
This code was tested with E90 (S60 3.1 platform) We need capability NetworkControl Example code be found from following link: File:Wlanonoff.zip


(no comments yet)