X-Git-Url: https://hackdaworld.org/gitweb/?a=blobdiff_plain;f=hdw-sniff.c;h=d6f2b0c087b9bfb99a3882e3e5b91c45837b6ada;hb=6b943da1deb33efbbdcd649d92c6a369c317cfd5;hp=ddd212d7c7eb1e88d1e67ad1cb28fc77907e744d;hpb=df9e9e045ea3f15d2dc47f87b1fd9ae6215e3c25;p=my-code%2Fhdw-sniff.git diff --git a/hdw-sniff.c b/hdw-sniff.c index ddd212d..d6f2b0c 100644 --- a/hdw-sniff.c +++ b/hdw-sniff.c @@ -61,12 +61,14 @@ int main(int argc, char *argv[]) { } /* is ieee802.11 ? -- we assume yes :) */ - - + /* ... */ + + + /* ieee802.3 */ /* ethernet */ e_hdr=(struct ethhdr *)package; /* what types ? */ - printf("types = "); + printf("type = "); printf("%x ",ntohs(e_hdr->h_proto)); printf("dest_addr = "); for(i=0;iip_v)); - printf("header_length = %x ",ntohs(ip_hdr->ip_hl)); + printf("header_length = %x \n",ntohs(ip_hdr->ip_hl)); // i=0; //printf("service = %x ",*(ip_hdr->ip_tos)); //printf("total_length(dec.) = %hu \n",*(ip_hdr->ip_len)); - printf("ip_addresses: source = "); - for(i=0;i<4;i++) - printf("%x%s",*(ip_hdr->ip_src+i), - (i==3?"\n":".")); + //printf("ip_addresses: source = "); + //for(i=0;i<4;i++) + // printf("%x%s",ntohl(ip_hdr->ip_src), + // (i==3?"\n":".")); } @@ -96,6 +98,6 @@ int main(int argc, char *argv[]) { printf("\n"); } printf("\n"); - printf("just beacon frames, ha? - wake up early! :)\n"); + printf("wake up early! :)\n"); printf("\n"); }