Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Aug 2003 12:13:43 -0700
From:      Andrew Konstantinov <andrei@andruxa.sytes.net>
To:        freebsd-hackers@freebsd.org
Subject:   libpcap
Message-ID:  <20030803191343.GA1224@andruxa.sytes.net>

next in thread | raw e-mail | index | archive | help

--lrZ03NoBR/3+SXJZ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hello,

I am writing a program which takes advantage of libpcap but I've run into several problems with it:
1) Is there any way how I can specify in the filter description that it should match only incoming packets on some interface? inbound/outbound keywords work only for 'slip' (according to tcpdump man page). I could do that with 'not src host' and then put the local hostname after that, but is there a more general solution, without the need for local hostname or ip address?
2) I can't figure out how to setup a filter so it could match several ports at once. For example, I want the filter to only match 21-25 and 113 ports for incoming traffic. How do I do that? Right know I can see only two solutions. I could simply sniff all the traffic, and then filter out the interesting ports by myself, or I could setup several filters each of which would be responsible for a specific port. But both solutions seem to be inefficient. Is there a better way to accomplish this?
Any help will be greatly appriciated.

Thanks in advance.
Andrew

--lrZ03NoBR/3+SXJZ
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (FreeBSD)

iD8DBQE/LV7nttaE8kbpwrARAkcBAJ4l8ySo2vRGrjCA51uktzon3owQYwCcCkcL
LrxIUZOPTJfsZ3wSD9vmrz4=
=Z5DW
-----END PGP SIGNATURE-----

--lrZ03NoBR/3+SXJZ--



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