- ((w_hdr->frame_ctl & IEEE802_11_FTYPE_DATA)>0)) {
- printf("ethernet: (%d bytes)\n",e_o);
- e_hdr=(struct ethhdr *)(package+p_o+w_o);
- /* what types ? */
- printf("type = ");
- printf("%x ",ntohs(e_hdr->h_proto));
- printf("dest_addr = ");
- for(i=0;i<ETH_ALEN;i++)
- printf("%x%s",*(e_hdr->h_dest+i),((i==ETH_ALEN-1)?" ":":"));
- printf(" src_addr = ");
- for(i=0;i<ETH_ALEN;i++)
- printf("%x%s",*(e_hdr->h_source+i),((i==ETH_ALEN-1)?"\n":":"));
-
- /* IP ? */
- if(ntohs(e_hdr->h_proto)==ETH_P_IP) {
- printf("ip protocol: (%d bytes)\n",i_o);
- ip_hdr=(struct iphdr *)(package+p_o+w_o+e_o);
- printf("version = %x ",ntohs(ip_hdr->version));
- printf("header_length = %x \n",ntohs(ip_hdr->ihl));
- printf("service = %x ",ntohs(ip_hdr->tos));
- printf("total_length(dec.) = %d \n",ntohs(ip_hdr->tot_len));
- printf("source_ip: ");
- for(i=3;i>=0;--i) {
- printf("%d%s",
- ip_hdr->saddr&0xff<<i,
- (i==0?"\n":"."));
+ ((w_hdr->frame_ctl & IEEE802_11_FTYPE_DATA)==IEEE802_11_FTYPE_DATA)) {
+
+ if((strncmp(my_info_struct->dev,"eth",3)==0)) {
+ printf("ethernet: (%d bytes)\n",e_o);
+ e_hdr=(struct ethhdr *)(package+p_o+w_o);
+ /* what types ? */
+ printf("type = ");
+ printf("%x ",ntohs(e_hdr->h_proto));
+ printf("dest_addr = ");
+ for(i=0;i<ETH_ALEN;i++)
+ printf("%x%s",*(e_hdr->h_dest+i),((i==ETH_ALEN-1)?" ":":"));
+ printf(" src_addr = ");
+ for(i=0;i<ETH_ALEN;i++) printf("%x%s",*(e_hdr->h_source+i),
+ ((i==ETH_ALEN-1)?"\n":":"));
+ if((ntohs(e_hdr->h_proto)==ETH_P_IP))
+ parse_ip(package+p_o+w_o+e_o);
+ }
+ else {
+ snap_hdr=(struct snaphdr *)(package+p_o+w_o);
+ if((snap_hdr->snap[0]==0xaa) &
+ (snap_hdr->snap[1]==0xaa) &
+ (snap_hdr->snap[2]==0x03) &
+ (snap_hdr->snap[3]==0x00) &
+ (snap_hdr->snap[4]==0x00) &
+ (snap_hdr->snap[5]==0x00)) {
+ printf("- no encryption!\n");
+ if(snap_hdr->proto==ntohs(ETH_P_IP)) {
+ e_o=sizeof(struct snaphdr);
+ parse_ip(snap_hdr+e_o);
+ }
+