Re: Dotted decimal to long conversion?
Re: Dotted decimal to long conversion?
- Subject: Re: Dotted decimal to long conversion?
- From: Josh Graessley <email@hidden>
- Date: Thu, 11 Aug 2005 10:47:36 -0700
What Mike says is correct. Don't do something inside the kernel
unless you absolutely can't do it anywhere else.
Having said that, there is an inet_aton available in the kernel.
inet_ntop is also available.
-josh
On Aug 11, 2005, at 10:26 AM, Mike Smith wrote:
On Aug 10, 2005, at 6:23 PM, Allan Hoeltje wrote:
Sorry if this is a dumb question but why shouldn't I be doing
this in the
kernel? Can you be a little more specific?
There are lots of things that shouldn't be done in the kernel; as a
general
rule, anything that can be done outside the kernel should not be
done inside.
Any time you find yourself thinking "this would be so much easier
if I could read
or write a file, or use this library function, or run this other
program" you should
rethink whether you want to be doing what you're doing inside the
kernel at all.
My situation is I am examining SIP packets which contain an IP
address in
dotted decimal string form. I want to be able to now monitor IP
packets
that have that specific address in the source IP address field.
How else do
I get from dotted string to in_addr_t?
Is there any reason that you need to do this in the kernel? Why
not use
BPF for your filtering and do the rest of your work entirely in
user space?
= Mike
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40apple.com
This email sent to email@hidden
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden