Author Topic: sockets with c/c++  (Read 1163 times)

Stryker

  • VIP
  • Member
  • ***
  • Posts: 1,258
  • Kudos: 41
sockets with c/c++
« on: 23 December 2002, 13:44 »
Does anyone know of a good place to learn about socket programming with c or c++? I'm not looking for something simple like client/server applications. I'm wanting to do some things like send a broadcast packet to my network and close a socket being used by another process and read things like ethereal does. i'll be doing this on my redhat or debian box using gcc 2.95.2. thanks.

[edit]

Maybe calling it socket programming was a bad idea since i dont want to actually make a socket... but just work with tcp/ip, but you know what i mean.

[ December 23, 2002: Message edited by: Stryker ]


voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
sockets with c/c++
« Reply #1 on: 23 December 2002, 14:08 »
Ethereal doesn't send out any broadcasts. It just puts the interface into promiscuous mode and reads every packet on the wire (which isn't much on a switched network). If that's what you want to do why not just install the source for Ethereal and tcpdump. What better examples? Either that of pick up any root kit, they have small sniffers included which would be a good example.
Someone please remove this account. Thanks...

Stryker

  • VIP
  • Member
  • ***
  • Posts: 1,258
  • Kudos: 41
sockets with c/c++
« Reply #2 on: 23 December 2002, 14:37 »
quote:
Originally posted by void main:
Ethereal doesn't send out any broadcasts. It just puts the interface into promiscuous mode and reads every packet on the wire (which isn't much on a switched network). If that's what you want to do why not just install the source for Ethereal and tcpdump. What better examples? Either that of pick up any root kit, they have small sniffers included which would be a good example.


I wasn't suggesting that ethereal could send a broadcast. i was saying i'd like to make a program that could also listen to packets. and i'd like to learn how to send a broadcast (not on the same subject as ethereal). I've tried looking at the source code and i dont seem to follow it very well. What i'm mostly intrested in is terminating a socket's connection with a process (pending, of course, i own the process or am root). I'd also like to get into stuff like putting together a packet and sending it. filling it out manually instead of having it automatically fill out the source, destination, subnet, and all those goodies.

[edit]

finally reached 300 posts.  

[ December 23, 2002: Message edited by: Stryker ]