Re: raw socket programming SOLVED

2003-07-11 Thread Alin-Adrian Anton
Wes Peters wrote: On Saturday 05 July 2003 08:01 pm, Alin-Adrian Anton wrote: Yes, it works now, with these includes: --- #include sys/types.h #include sys/socket.h #include stdio.h #include string.h #include errno.h #include netinet/in_systm.h #include netinet/in.h

tcp raw socket programming recvfrom()

2003-07-10 Thread Alin-Adrian Anton
Hey folks, I wrote my piece of code to play with, and it uses raw sockets to send TCP packets. It sends packets okay, everything tested with a sniffer, everything is really really fine, but it seems I cannot recvfrom anything. I mean, it just keeps waiting and doesn't see the reply the server

Re: tcp raw socket programming recvfrom()

2003-07-10 Thread Kip Macy
Usually if your looking at raw packets you want to use BPF. -Kip On Wed, 9 Jul 2003, Alin-Adrian Anton wrote: Hey folks, I wrote my piece of code to play with, and it uses raw sockets to send TCP packets. It sends packets okay, everything tested with a sniffer,

Re: tcp raw socket programming recvfrom()

2003-07-10 Thread Alin-Adrian Anton
Kip Macy wrote: Usually if your looking at raw packets you want to use BPF. -Kip On Wed, 9 Jul 2003, Alin-Adrian Anton wrote: Hey folks, I wrote my piece of code to play with, and it uses raw sockets to send TCP packets. It sends packets okay, everything tested with a sniffer,

Re: tcp raw socket programming recvfrom()

2003-07-10 Thread Toni Andjelkovic
On Wed, Jul 09 2003 (12:45:14 +0300), Alin-Adrian Anton wrote: Usually? What does usually mean? I know I can use bpf. But is there another way to look at incoming TCP packet ? What I did is I sent a TCP SYN packet and the server answers with a TCP SYN_ACK packet. How can I look at the

Re: tcp raw socket programming recvfrom()

2003-07-10 Thread Alin-Adrian Anton
Toni Andjelkovic wrote: On Wed, Jul 09 2003 (12:45:14 +0300), Alin-Adrian Anton wrote: Usually? What does usually mean? I know I can use bpf. But is there another way to look at incoming TCP packet ? What I did is I sent a TCP SYN packet and the server answers with a TCP SYN_ACK packet. How

Re: raw socket programming SOLVED

2003-07-10 Thread Wes Peters
On Saturday 05 July 2003 08:01 pm, Alin-Adrian Anton wrote: Yes, it works now, with these includes: --- #include sys/types.h #include sys/socket.h #include stdio.h #include string.h #include errno.h #include netinet/in_systm.h #include netinet/in.h #include

Re: raw socket programming SOLVED

2003-07-08 Thread Terry Lambert
David A. Gobeille wrote: Shouldn't the #included files themselves #include headers they are dependant on? With the use of #ifndef and #define in the headers to keep them from being #included more than once? It seems silly(more work) for the programmer to have to arrange everything in a

RE: raw socket programming

2003-07-07 Thread Tom Servo
Off the top of my head this appears to be an include sequencing/circular include problem. Check the type that 'n_long' is being defined as and make sure that the proper includes that define the type are defined before the variable is defined and make sure that it is not getting run over. Is that

Re: raw socket programming

2003-07-07 Thread Alin-Adrian Anton
Tom Servo wrote: Off the top of my head this appears to be an include sequencing/circular include problem. Check the type that 'n_long' is being defined as and make sure that the proper includes that define the type are defined before the variable is defined and make sure that it is not getting

Re: raw socket programming

2003-07-07 Thread Stephen Montgomery-Smith
Alin-Adrian Anton wrote: Well, I don't wanna be idiot, perhaps I am too tired, but n_long appears in ip.h defined as : beast# grep ipt_time /usr/include/netinet/ip.h union ipt_timestamp { n_long ipt_time[1]; n_long ipt_time; } ipt_timestamp;

Re: raw socket programming

2003-07-07 Thread Harti Brandt
On Sun, 6 Jul 2003, Alin-Adrian Anton wrote: AAIn file included from raw.c:7: AA/usr/include/netinet/ip.h:156: syntax error before `n_long' AA/usr/include/netinet/ip.h:159: syntax error before `n_long' You may want to include netinet/in_systm.h harti -- harti brandt,

Re: raw socket programming

2003-07-07 Thread Stephen Montgomery-Smith
I did grep -R ipt_time /usr/include and got exactly the same output as you have above. It looks like ipt_time is not defined anywhere. It looks to me like netinet/ip.h is broken. What is it that you need netinet/ip.h for? Maybe there are some other include files that would work just as

Re: raw socket programming

2003-07-07 Thread Viktor Vasilev
Hi, On Sun, Jul 06, 2003 at 05:14:38AM +0300, Alin-Adrian Anton wrote: Well, I don't wanna be idiot, perhaps I am too tired, but n_long appears in ip.h defined as : beast# grep ipt_time /usr/include/netinet/ip.h union ipt_timestamp { n_long ipt_time[1];

Re: raw socket programming

2003-07-07 Thread Igor Pokrovsky
On Sun, Jul 06, 2003 at 05:14:38AM +0300, Alin-Adrian Anton wrote: Well, I don't wanna be idiot, perhaps I am too tired, but n_long appears in ip.h defined as : beast# grep ipt_time /usr/include/netinet/ip.h union ipt_timestamp { n_long ipt_time[1];

Re: raw socket programming

2003-07-07 Thread Alin-Adrian Anton
Harti Brandt wrote: On Sun, 6 Jul 2003, Alin-Adrian Anton wrote: AAIn file included from raw.c:7: AA/usr/include/netinet/ip.h:156: syntax error before `n_long' AA/usr/include/netinet/ip.h:159: syntax error before `n_long' You may want to include netinet/in_systm.h harti Yes, indeed this

Re: raw socket programming SOLVED

2003-07-07 Thread Alin-Adrian Anton
Harti Brandt wrote: On Sun, 6 Jul 2003, Alin-Adrian Anton wrote: AAHarti Brandt wrote: AA AAOn Sun, 6 Jul 2003, Alin-Adrian Anton wrote: AA In file included from raw.c:7: /usr/include/netinet/ip.h:156: syntax error before `n_long' /usr/include/netinet/ip.h:159: syntax error before

Re: raw socket programming SOLVED

2003-07-07 Thread David A. Gobeille
Alin-Adrian Anton wrote: Harti Brandt wrote: On Sun, 6 Jul 2003, Alin-Adrian Anton wrote: AAHarti Brandt wrote: AA AAOn Sun, 6 Jul 2003, Alin-Adrian Anton wrote: AA In file included from raw.c:7: /usr/include/netinet/ip.h:156: syntax error before `n_long'

Re: raw socket programming SOLVED

2003-07-07 Thread Peter Pentchev
On Mon, Jul 07, 2003 at 10:09:05AM -0500, David A. Gobeille wrote: [snip] Shouldn't the #included files themselves #include headers they are dependant on? With the use of #ifndef and #define in the headers to keep them from being #included more than once? It seems silly(more work) for