Skip to content

Instantly share code, notes, and snippets.

@smihir
Created January 30, 2015 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smihir/b67abc4299c888a31c34 to your computer and use it in GitHub Desktop.
Save smihir/b67abc4299c888a31c34 to your computer and use it in GitHub Desktop.
code to dump a skb, so that with minimum postprocessing it can be fed to text2pcap for converting into a pcap
// This code snippet can be used to dump a skb, so that with minimum postprocessing
// it can be fed to text2pcap for converting into a pcap file which can be analyzed
// in wireshark
do {
int i;
printk("\n");
printk("000000 ");
for (i = 0 ; i < skb->len; i++) {
printk("%02x ", ((u8*)skb->data)[i]);
if (15 == i%16)
printk("\n%06x ", (i + 1));
}
printk("\n");
}while(0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment