Re: Dotted decimal to long conversion?
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Regards.....Peter On Aug 10, 2005, at 9:23 PM, Allan Hoeltje wrote: -Allan "Mike Smith" <drivers@mu.org> wrote on 8/10/05 5:16 PM: You might also consider ascii2addr() In any case, you don't want to be doing this inside the kernel. Prepare a sockaddr_t or similar in userland; this allows you to support resolution by name as well as address, which is a highly preferable behaviour. = Mike _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... I suspect that he really meant that it would be better not to do it in the kernel if it can be avoided. Obviously, sometimes you can't avoid it. In the kernel you have to be a lot more careful about validating the input characters and length etc etc etc. So, avoid it if you can and be extra careful if you can't. 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? 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? This email sent to site_archiver@lists.apple.com
participants (1)
-
Peter Lovell