[tcpdump-workers] Linux system headers 2.6.36 and pcap/bpf.h

2011-01-12 Thread Tim Sammut
Hello.

I have an odd problem and I am hoping you all can help.

It appears that starting in the Linux system headers around version
2.6.36 [1], /usr/include/linux/if_tun.h began including
/usr/include/linux/filter.h [2]. filter.h however, defines
BPF_MAJOR_VERSION which ends up excluding the entire contents of
pcap/bpf.h [3] via the leading #ifndef BPF_MAJOR_VERSION.

The end result is pcap.h must be included before linux/if_tun.h. This
causes this program it fail to compile:

#include 
#include 

int main(){
struct bpf_program p;
printf("size = %lu\n", sizeof(p));
}

producing this error message:

test.c: In function ‘main’:
test.c:5: error: storage size of ‘p’ isn’t known

But, allows this one to compile correctly:

#include 
#include 

int main(){
struct bpf_program p;
printf("size = %lu\n", sizeof(p));
}

Is this a known issue, or is there a more correct workaround?

thanks and hope all is well
tim


[1]
http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.36.y.git;a=commit;h=99405162598176e830d17ae6d4f3d9e070ad900c
[2]
http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.36.y.git;a=blob;f=include/linux/filter.h
[3]
https://github.com/mcr/libpcap/blob/028204e0f99f0bad5dfd01add364ebd4f4befabb/pcap/bpf.h
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


[tcpdump-workers] pcap_inject and 802.1q subinterfaces on Solaris?

2011-05-19 Thread Tim Sammut
Hi, everyone.

I have a small tool that uses pcap_inject to send ethernet frames on
specific host interfaces. When injecting on a 802.1q virtual interface
on Solaris the frame is ultimately transmitted without the 802.1q header
that should have been add by the host OS. This is Solaris 10 on SPARC
with libpcap 1.1.1, and the same scenario works perfectly on Linux.

Is this something that should work on Solaris too?

Thanks for your help!

hope all is well
tim
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Re: [tcpdump-workers] pcap_inject and 802.1q subinterfaces on Solaris?

2011-05-23 Thread Tim Sammut
On 05/20/2011 04:08 PM, Darren Reed wrote:
> 

Hi, Darren, thanks for the note.

> Are you using a virtual interface such as vnic0?
> Or does it have another name?

The virtual interfaces appear as ce101002 and ce102002; the physical
interface is ce2. We're using the instructions at [1] to setup the
Solaris machine.

> Which Solaris 10 update?
> 

Looks to be "Solaris 10 9/10".

Any thoughts or pointers would be much appreciated. Thanks!

hope all is well
tim

[1] http://download.oracle.com/docs/cd/E19253-01/816-4554/fpdga/index.html
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.