From owner-freebsd-net@FreeBSD.ORG Mon Dec 26 18:12:14 2011 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 2F588106564A for ; Mon, 26 Dec 2011 18:12:14 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id F2E798FC18 for ; Mon, 26 Dec 2011 18:12:13 +0000 (UTC) Received: from julian-mac.elischer.org (c-67-180-24-15.hsd1.ca.comcast.net [67.180.24.15]) (authenticated bits=0) by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id pBQICBY7038527 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 26 Dec 2011 10:12:12 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <4EF8B91F.5040807@freebsd.org> Date: Mon, 26 Dec 2011 10:12:47 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.25) Gecko/20111213 Thunderbird/3.1.17 MIME-Version: 1.0 To: Rajneesh Kumar References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org Subject: Re: Which function can allocate memory for a given structure type 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: Mon, 26 Dec 2011 18:12:14 -0000 On 12/26/11 8:44 AM, Rajneesh Kumar wrote: > Hello sir/madam, > > Please help! > I am trying to modify the ARP module. I want to know which function can > allocate memory for a given structure type and return me back the same? > e.g. I want to have declared a pointer of sockaddr_dl{} type. Now I want to > allocate memory to it. How can I do it? > > Thank You! for in-kernel resources, there is a special section (section 9) in the freeBSD man pages.. in this case start with man 9 malloc and fiollow teh "see also" links. here's a link to get you started. http://www.freebsd.org/cgi/man.cgi?query=malloc&sektion=9