CIp6Hook problems...

Login to reply to this topic.
Wed, 2006-01-11 23:16
Joined: 2005-10-05
Forum posts: 16
Im trying to install a new hook into ip6.  It will be used to filter ip
packets based on user defined firewall settings (this is only the outbound
flow hook right now).  my problem is that i do not want to alter the
tcpip.esk file to ensure an easy uninstall process, and the docs say its not
good to alter this file due to the fact it is easy to kill the network with
an error in the file.  So i have a new .esk that tells the system about my
.prt

[sockman]
protocols= exaout

[exaout]
bindfrom= ip6
filename= exaout.prt
index= 1

Now when i load the files into the simulator (S60) i get the log statements
for the following functions in my .prt

11/01/2006 9:13:39 EXPORT_C CProtocolFamilyBase* Install() (OUT)
11/01/2006 9:13:39 CProtocolFamilyExaout::CProtocolFamilyExaout()
11/01/2006 9:13:39 CProtocolFamilyExaout::ProtocolList(TServerProtocolDesc
*& aProtocolList)
11/01/2006 9:13:39 CProtocolExaout::FillIdentification
11/01/2006 9:13:39 CProtocolFamilyExaout::~CProtocolFamilyExaout()

Now i can go to a test app i wrote and force a socket connection.  At this
point, i should get some callbacks into my hook.  I am not getting any
callbacks.  I can force it to give me callbacks to some methods when i alter
the tcpip.esk.  But even then after the BindL() call the app(test socket
app) and/or (depending on the tcpip.esk setup)  socketserver shuts down and
never sends out a packet with the socket.  Im clearly not altering the
tcpip.esk right, and this is why the docs say it is not good to do this.  I
want to make it so i can add and remove a .esk to install and uninstall the
hook, instead of altering a exsisting file.  Im looking for some help for
why this is not working.  Everything I have read, says im doing this right,
but I am clearly missing something here.  Im guessing its in the .esk or one
of the functions that does get called.  The poblem with that is there isnt
many options when it comes to this stuff, so I think i have tried
everything.  Any pointers would help.  Thanks in advance.

here is the methods that are getting called in my .prt (in the order they
are getting called)...

extern "C" { IMPORT_C CProtocolFamilyBase* Install(void); }
EXPORT_C CProtocolFamilyBase* Install()
{
     SMFirewall::Log(_L("EXPORT_C CProtocolFamilyBase* Install() (OUT)"));
     return new (ELeave) CProtocolFamilyExaout;
}

CProtocolFamilyExaout::CProtocolFamilyExaout()
{
     SMFirewall::Log(_L("CProtocolFamilyExaout::CProtocolFamilyExaout()"));
     __DECLARE_NAME(_S("CProtocolFamilyExaout"));
}

TUint CProtocolFamilyExaout::ProtocolList(TServerProtocolDesc *&
aProtocolList)
{
     SMFirewall::Log(_L("CProtocolFamilyExaout::ProtocolList(TServerProtocolDesc
*& aProtocolList)"));
     // This function should be a leaving fn
     // apparently it is OK for it to leave
     TServerProtocolDesc *p = new (ELeave) TServerProtocolDesc[1]; // Esock
catches this leave

     CProtocolExaout::FillIdentification(p[0]);
     aProtocolList = p;
     return 1;
}

void CProtocolExaout::FillIdentification(TServerProtocolDesc& anEntry)
{
 SMFirewall::Log(_L("CProtocolExaout::FillIdentification"));
 anEntry.iName=_S("exaout");
 anEntry.iAddrFamily=KAfInet; //KAfExaout;
 anEntry.iSockType=KSockDatagram;
 anEntry.iProtocol=KProtocolExaout;
 anEntry.iVersion=TVersion(1, 0, 0);
 anEntry.iByteOrder=EBigEndian;
 anEntry.iServiceInfo=KSIDatagram | KSIConnectionLess;
 anEntry.iNamingServices=0;
 anEntry.iSecurity=KSocketNoSecurity;
 anEntry.iMessageSize=0xffff;
 anEntry.iServiceTypeInfo=0;
 anEntry.iNumSockets=KUnlimitedSockets;
}

CProtocolFamilyExaout::~CProtocolFamilyExaout()
{
 SMFirewall::Log(_L("CProtocolFamilyExaout::~CProtocolFamilyExaout()"));
}


Fri, 2006-05-26 21:29
Joined: 2006-05-08
Forum posts: 162
Re: CIp6Hook problems...
Hi erickssm,

You don't need to fiddle around with tcpip.esk file. For you hook (i assume you are using the exaout sample from SDK Wink), you should provide a seperate esk file and it will be automatically loaded by the socketserver and the protocols inside loaded. Take a look at \epoc32\winscw\c\Private\101F7989\esock folder and you'll see what I mean.

  • Login to reply to this topic.