Click here to Skip to main content
15,912,072 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
New thread started as the other one was getting messy.
I only want incoming packets sniffed. I am currently in promiscuous mode and would like to get only incomming. Trying to add IPLEVEL to this and getting the squiggly red lines on SIO_RCVALL_IPLEVEL. I have #include MSTcpIP.h. Using Window Sockets.

// Set socket to promiscuous mode
// setsockopt wont work ... dont even try it
if ( WSAIoctl( sniff_socket,
               SIO_RCVALL_IPLEVEL,
               &optval,
               sizeof(optval),
               NULL,
               0,
               &dwLen,
               NULL,
               NULL ) == SOCKET_ERROR )

 {
Posted
Updated 1-May-11 10:13am
v2
Comments
Albert Holguin 1-May-11 16:14pm    
edit: fixed pre tags
question: I thought you had this working? What squiggly red lines are you talking about? Maybe post a screen capture somewhere and link...
Member 7766180 1-May-11 16:51pm    
Oh Boy!, It was working and then bingo!
This is underlened with the red line....SIO_RCVALL_IPLEVEL, I opened the MSTcpIP.h file and IPLEVEL is in there as an ENum like you described earlier, perhaps I'm missing something?
DS
Member 7766180 1-May-11 16:53pm    
This is the Error....
1 IntelliSense: identifier "SIO_RCVALL_IPLEVEL" is undefined c:\fb\fbsniffers\lsniff\lsniff\lsniff_main.cpp 147 19 lsniff

1 solution

Alright... a few things:
1) Make sure that the file where you're making this call from has a direct link to mstcpip.h
(should have #include "mstcpip.h" or something similar)
2) Make sure that SIO_RCVALL_IPLEVEL is only defined once.

You're using Visual Studio? if so:
1) To make sure the linkage is there for #include, right click on the filename and open the file, if the compiler has a clear path to it, it will open, otherwise it will say file not found.
2) Do a solution level search for SIO_RCVALL_IPLEVEL definitions.
 
Share this answer
 
Comments
Member 7766180 1-May-11 17:15pm    
1) Have #include <<mstcpip.h>/>
2) Defined in the header file? Not sure about this one. This I have...

#ifndef SIO_RCVALL
# define SIO_RCVALL _WSAIOW(IOC_VENDOR,1)
#endif

1) Visual Studio 2010......It opens on right click.
2) It's listed under External Dependencies
Albert Holguin 1-May-11 17:18pm    
Try commenting out the code in the #ifndef all the way down to #endif
Member 7766180 1-May-11 17:43pm    
No, still didn't work. However when I debug with the code commented out it debugged without any errors.
Albert Holguin 1-May-11 17:52pm    
when you say "it didn't work", what do you mean? one thing is to get the error to compile without errors, another is for it to do what you expect.
Member 7766180 1-May-11 17:55pm    
Sorry Albert, The suiggy red lines appeared under SIO_RCVALL_IPLEVEL

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900