About conversion between iphdr->saddr and String-format IP Address
Hello everyone,
I am looking for some functions to convert ip address in string format into=
unsigned int and versa vice.
Does it have some function like 'inet_addr' inside kernel for that?=A0 Basi= cally what I want to do is conver iphdr->s_addr into a String type, which w= ould give me a readable ip address for debugging.
Any idea is well appreciated,
Thanks,
+Kunsheng
Quoted 9 lines · Kunsheng Chen
Hello everyone,
I am looking for some functions to convert ip address in string format into= unsigned int and versa vice.
Does it have some function like '
inet_addr' inside kernel for that?=A0 Basi= cally what I want to do is converiphdr->s_addrinto a String type, which w= ould give me a readable ip address for debugging.
printk(KERN_DEBUG "%pI6", &ih->saddr); /* 2.6.29+ */ printk(KERN_DEBUG NIP6_FMT, NIP6(ih->saddr)); /* older */