mirror of
https://github.com/adulau/ssldump.git
synced 2024-12-22 07:55:57 +00:00
Merge pull request #92 from wllm-rbnt/dbg
Set packet type for RAW PCAPs
This commit is contained in:
commit
d1037f8308
1 changed files with 12 additions and 0 deletions
|
@ -205,6 +205,18 @@ void pcap_cb(u_char *ptr, const struct pcap_pkthdr *hdr, const u_char *data) {
|
|||
|
||||
switch(pcap_if_type) {
|
||||
case DLT_RAW:
|
||||
switch(((u_int8_t)*data) >> 4) {
|
||||
case 4:
|
||||
type = ETHERTYPE_IP;
|
||||
break;
|
||||
case 6:
|
||||
type = ETHERTYPE_IPV6;
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "Unknown packet type, skipping ...\n");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
#ifdef DLT_LOOP
|
||||
case DLT_LOOP:
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue