Hi,
I am working with the packet inspection example in the DDK. I want to be able to allow disallow packets based on local port number. I have put in a simple rules table, and want to be able to compare each packet against the table.
The code is in place, but I not working. I have put some debugging statements in the code to see what local port each packet has.
I am getting some really wacky port numbers so just wanted to check my logic.
DbgPrint (“The local port is %hi \n”,packet->localPort);
The local port is declared as
union
{
UINT16 localPort;
UINT16 icmpType;
};
union
{
UINT16 remotePort;
UINT16 icmpCode;
};
in the stucture so I guess am dealing with UINT16
Now my rules table has the port numbers declared as int.
Firstly, what is the correct formatting string to use with DbgPrint to check the value out to the DebugView window.
Secondly, is there a cast I need to do before comparing a UINT16 with an int?
Thanks in advance