Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Jul 2002 00:42:52 +0200
From:      "Daan Vreeken [PA4DAN]" <Danovitsch@Danovitsch.dnsq.org>
To:        FreeBSD-Questions@FreeBSD.org
Subject:   Re: ICMP
Message-ID:  <02070500425202.00991@FreeBSD.Danovitsch.LAN>

next in thread | raw e-mail | index | archive | help
On Thursday 04 July 2002 01:52, you wrote:
> Hi all
>
> The really should be a FreeBSD-Programmer@FreeBSD.org, but never mind
>
> :-)
>
> I have been playing with socket programming for some time now and have
> moved on to raw sockets. (I don't use libnet or libpcap, because I first
> want to learn it from the bottom).
> I know how to send ICMP packets, but how do I receive? I can "take over"
> the hole networkcard and read all packets, but I just want the ones for
> my connection. If I set up a raw socket and send an ICMP I can get the
> response (because the ICMP have an ID-feild?), but that if I have setup
> a SOCK_STREAM or SOCK_DGRAM? How can I then detect ICMP?

Have you looked at how they do it in the "ping" program?

( see /usr/src/sbin/ping/ping.c )

grtz,
Daan

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?02070500425202.00991>