Click here to Skip to main content
15,900,108 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralC++ Question. Pin
WREY26-Oct-03 2:54
WREY26-Oct-03 2:54 
GeneralRe: C++ Question. Pin
Andrew Walker26-Oct-03 3:31
Andrew Walker26-Oct-03 3:31 
GeneralRe: C++ Question. Pin
WREY26-Oct-03 4:51
WREY26-Oct-03 4:51 
GeneralRe: C++ Question. Pin
Gary R. Wheeler26-Oct-03 4:53
Gary R. Wheeler26-Oct-03 4:53 
GeneralRe: C++ Question. Pin
WREY26-Oct-03 11:25
WREY26-Oct-03 11:25 
GeneralRe: C++ Question. Pin
Ravi Bhavnani26-Oct-03 5:25
professionalRavi Bhavnani26-Oct-03 5:25 
GeneralCreate Snapshot for MS ACCESS Pin
Azghar Hussain26-Oct-03 2:23
professionalAzghar Hussain26-Oct-03 2:23 
GeneralWinsock layered service provider, getting remote ip in WSPRecvFrom() Pin
Kuniva26-Oct-03 2:09
Kuniva26-Oct-03 2:09 
Hi, i'm trying to write a winsock layered service provider that filters some UDP traffic and logs it to a file with the ip. The problem is i don't know how to get the ip from in there. I wrote this code but it always gives me 0.0.0.0 as the ip address:

struct sockaddr_in sin;
int err;
int inlen = sizeof(struct sockaddr_in);

if(WSPGetSockName(s, (SOCKADDR *)&sin, &inlen, &err)!=0)
    MessageBox(NULL,"Error","lsp",MB_ICONERROR);
char* address;
address = inet_ntoa(sin.sin_addr);
// Then code to log to file


It does not give me an error, it just logs it as 0.0.0.0 Frown | :(
The definition of WSPRecvFrom is as follows:
INT
WSPAPI
WSPRecvFrom(
    IN  SOCKET s,
    IN  LPWSABUF lpBuffers,
    IN  DWORD dwBufferCount,
    IN  LPDWORD lpNumberOfBytesRecvd,
    IN  OUT LPDWORD lpFlags,
    OUT struct sockaddr FAR *  lpFrom,
    IN  LPINT lpFromlen,
    IN  LPWSAOVERLAPPED lpOverlapped,
    IN  LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
    IN LPWSATHREADID lpThreadId,
    OUT INT FAR *lpErrno
    )


Any ideas?

Thanks

Kuniva
--------------------------------------------
GeneralCdatabase embedded in my View Pin
tlbrown26-Oct-03 2:01
tlbrown26-Oct-03 2:01 
QuestionHow to monitor the status of a process. Pin
George225-Oct-03 23:52
George225-Oct-03 23:52 
AnswerRe: How to monitor the status of a process. Pin
Jörgen Sigvardsson26-Oct-03 0:22
Jörgen Sigvardsson26-Oct-03 0:22 
GeneralRe: How to monitor the status of a process. Pin
George226-Oct-03 0:36
George226-Oct-03 0:36 
GeneralRe: How to monitor the status of a process. Pin
Jörgen Sigvardsson26-Oct-03 0:41
Jörgen Sigvardsson26-Oct-03 0:41 
GeneralRe: How to monitor the status of a process. Pin
George226-Oct-03 0:46
George226-Oct-03 0:46 
GeneralRe: How to monitor the status of a process. Pin
Jörgen Sigvardsson26-Oct-03 0:52
Jörgen Sigvardsson26-Oct-03 0:52 
GeneralRe: How to monitor the status of a process. Pin
George226-Oct-03 1:06
George226-Oct-03 1:06 
GeneralRe: How to monitor the status of a process. Pin
Jörgen Sigvardsson26-Oct-03 1:13
Jörgen Sigvardsson26-Oct-03 1:13 
GeneralRe: How to monitor the status of a process. Pin
George226-Oct-03 1:24
George226-Oct-03 1:24 
GeneralDial-Up Server programming for win98 Pin
Reza Azizi25-Oct-03 23:31
Reza Azizi25-Oct-03 23:31 
GeneralDLL problem Pin
Ghasrfakhri25-Oct-03 21:38
Ghasrfakhri25-Oct-03 21:38 
GeneralRe: DLL problem Pin
Jörgen Sigvardsson26-Oct-03 0:26
Jörgen Sigvardsson26-Oct-03 0:26 
GeneralATL collection and event firing Pin
Paul Farry25-Oct-03 19:45
professionalPaul Farry25-Oct-03 19:45 
GeneralRe: ATL collection and event firing Pin
Jörgen Sigvardsson26-Oct-03 0:34
Jörgen Sigvardsson26-Oct-03 0:34 
GeneralWhats the IP Mr. Winsock? (How can I find out a connected persons IP) Pin
STS_Secure_Telnet25-Oct-03 19:38
STS_Secure_Telnet25-Oct-03 19:38 
GeneralRe: Whats the IP Mr. Winsock? (How can I find out a connected persons IP) Pin
andyvinc25-Oct-03 21:35
andyvinc25-Oct-03 21:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.