From owner-freebsd-net@FreeBSD.ORG Sun Mar 2 23:47:09 2008 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 3FDFC1065677 for ; Sun, 2 Mar 2008 23:47:09 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by mx1.freebsd.org (Postfix) with ESMTP id DBF758FC17 for ; Sun, 2 Mar 2008 23:47:08 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from compute2.internal (compute2.internal [10.202.2.42]) by out1.messagingengine.com (Postfix) with ESMTP id 01C0EAC7EB; Sun, 2 Mar 2008 18:47:08 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Sun, 02 Mar 2008 18:47:08 -0500 X-Sasl-enc: MIIiAEeF9gEozgmVqGTmP4Ka/SXoqpB8fVP2pwgu3srj 1204501627 Received: from empiric.lon.incunabulum.net (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id 70A2917E90; Sun, 2 Mar 2008 18:47:07 -0500 (EST) Message-ID: <47CB3C7A.2000809@FreeBSD.org> Date: Sun, 02 Mar 2008 23:47:06 +0000 From: "Bruce M. Simpson" User-Agent: Thunderbird 2.0.0.9 (X11/20080207) MIME-Version: 1.0 To: zDen References: <15784710.post@talk.nabble.com> In-Reply-To: <15784710.post@talk.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org Subject: Re: Looking for a guide to extend|adapting the socket framework for NFCIP-1 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: Sun, 02 Mar 2008 23:47:09 -0000 Hi, I had to use a search engine to figure out what the acronym NFC was, and I assume you mean this: http://en.wikipedia.org/wiki/Near_Field_Communication It helps if you give more background information when asking a more general audience for feedback. zDen wrote: > 1) As the NFC device is attached to the USB or UART port, how and where in > the source code can I change the output of the byte-stream packet to the > proper physical port? i.e where is the part of the source code that is > physical device dependent when doing the I/O calls? > You really need to roll your own driver framework for this. Whilst the Bluetooth support sounds like it's the right place to start to look for ideas, you're going to have to write your own layering. I know off the top of my head that the Bluetooth support is able to add its own TTY disciplines to serial devices but I couldn't tell you specifics, as it's not something I meddle with unless I need to. > 2) As the protocol family (PF_xx) and address family (AF_xx) of NFC is not > define in the socket library, how can I define them and let the default > socket() call return a socket with the customized structure? I can see that > I may need to use SOCK_RAW as the basic socket framework or any others > recommendation? > To learn about adding a new socket family to the system, you really need to pick up a copy of TCP/IP Illustrated Volume 2 and read Chapter 15 onwards. It sounds like you have a fairly involved and challenging software project on your hands. I hope you're being funded by someone to do it, it doesn't sound like something a hobbyist would pick up just for the hell of it if it's going to be done properly, i.e. beyond a quick hack for demonstration purposes. cheers BMS