From owner-freebsd-net@FreeBSD.ORG Wed Mar 17 21:13:53 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57854106564A for ; Wed, 17 Mar 2010 21:13:53 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-iw0-f196.google.com (mail-iw0-f196.google.com [209.85.223.196]) by mx1.freebsd.org (Postfix) with ESMTP id 2A8648FC17 for ; Wed, 17 Mar 2010 21:13:52 +0000 (UTC) Received: by iwn34 with SMTP id 34so1195638iwn.15 for ; Wed, 17 Mar 2010 14:13:52 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.231.167.204 with SMTP id r12mr1032756iby.31.1268860432379; Wed, 17 Mar 2010 14:13:52 -0700 (PDT) In-Reply-To: References: From: Juli Mallett Date: Wed, 17 Mar 2010 14:13:32 -0700 X-Google-Sender-Auth: e1b70aad3e9e5503 Message-ID: To: igeek Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Cc: freebsd-net@freebsd.org, serena zanetta Subject: Re: sscanf in kernel X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Mar 2010 21:13:53 -0000 On Wed, Mar 17, 2010 at 13:39, igeek wrote: > On Mar 17, 2010, at 2:12 PM, serena zanetta wrote: >> Hi, >> I need to convert an ascii string in its corresponding hex version (the >> same >> as sscanf(str,"%02x%02x...",...) does) in the kernel. FreeBSD has sscanf in the kernel. See . That said, sscanf is pretty evil =97 are you sure it's what you want? Are you sure you need to parse it in the kernel instead of in userland? > sscanf() has a kernel version declared in kernel.h. > http://www.gelato.unsw.edu.au/lxr/source/include/linux/kernel.h#L196 I believe you are confused. FreeBSD is not Linux.