-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> A pcap_t structure, as of 0.8, contains a list of function pointers for
> various libpcap operations; look for "Methods" in pcap-int.h.
> 
> You'd add a "direction_op" member, which would be a function with the
> same arguments as pcap_direction().  pcap_direction() would just call
> that function and return its return value.
> 
> Each pcap-*.c file for a particular platform would contain the
> appropriate function for that platform, e.g.
> "pcap_setdirection_linux()"; that would be a static function.  In the
> code to open a capture, the "direction_op" member of the pcap_t would be
> set to point to that function.
> 
> What needs to be determined is not the operating system, but the capture
> mechanism.  That's already done by the configure script - that's what
> determines which pcap-*.c file to compile, so doing it the way I
> describe above handles that for you.

That's great, I'll try to code this today.

> Should the function be called "pcap_direction()", "pcap_setdirection()",
> or something else?  "pcap_setdirection()" indicates that it sets
> something, but "direction" doesn't indicate which direction it's
> setting, so "pcap_direction()" might be sufficient.

Well I'm not good at naming things, but pcap_setdirection() sounds like
pcap_setfilter() function. This functions are quite related in
functionality, because they both set some start parameters. But I leave
that strategic decision to main pcap developers :)

Greetings,
Pawel Pokrywka
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iQD1AwUBQndbNwYJ6m8RUpKnAQI7AAb/aKPFjbUr8KU1B7OTX8cMvvOC1XKdFpq1
zQEI3nPrabDDzbQDlYm3KaZngK2f83OOcih0dwC7iSLGGZFErPG1CdPWNO/CrMQS
5+UYlbLNgolyXA/XvZr8rbtRXZlyjVcwZH7mP6Q44V+sTd9ZA0hlsyhVmwoxsSd1
McNaZRAjhsuYYwKy7VBUzLeS0l/7DqYHoLDtNAEof04Yuy5vi6LMqsXFEVJRV5Uy
TjYhPgiGyCXBmL4Cegk+CCIZS6J0eEFbvvYEs99Aeu6gq4Qfb4KvGQ2aIfsG8SL3
DQzy+VNhxjU=
=idSm
-----END PGP SIGNATURE-----
-
This is the tcpdump-workers list.
Visit https://lists.sandelman.ca/ to unsubscribe.

Reply via email to