From owner-freebsd-net@freebsd.org Fri Jan 8 23:11:26 2016 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFBE2A68E6F for ; Fri, 8 Jan 2016 23:11:26 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pa0-x22a.google.com (mail-pa0-x22a.google.com [IPv6:2607:f8b0:400e:c03::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A23E1A23 for ; Fri, 8 Jan 2016 23:11:26 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: by mail-pa0-x22a.google.com with SMTP id cy9so289274861pac.0 for ; Fri, 08 Jan 2016 15:11:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=S5TtPVqN+9gH932VLVLMj1WUGqNLoaTi4kjlPCXxHPM=; b=Gw/V9up7U2ha6dCnTsdZxlfa4rd9nqdXzIewxNPsDvSZrcezAVQ5Rm92ZFMFV3vf1u 2O30AMzYRAn2OYAN/VzEQzBdkT92qkGe+P6qbRRDa3rb4MDxCzBODLKf/5ZMu/yPi0dl la7vW02o+6L2KwxTtB56QzOvjEDss+uiQh3iMLZiMusgBmqENG+n3hNKjKnpHs2sDrug a4eYTWuBHqEEwXfqjyi+FVpwTK1rQOG287FwI9p0nByf/GpHgPyU/L9K87K8Ge6+uRbs tjB6cwh46eTkq2IGGoRlRtxs7tHUIbA02JJHtolw9BY2tyey+s2Q/vi1ZmMJ+Jlb/+pH rjiQ== X-Received: by 10.66.237.102 with SMTP id vb6mr161919917pac.133.1452294686185; Fri, 08 Jan 2016 15:11:26 -0800 (PST) Received: from [10.192.166.0] (stargate.chelsio.com. [12.32.117.8]) by smtp.googlemail.com with ESMTPSA id w82sm1627369pfi.95.2016.01.08.15.11.24 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 08 Jan 2016 15:11:24 -0800 (PST) Subject: Re: ethernet header size To: Hadi Rezaee , freebsd-net@freebsd.org References: <56904059.4010806@ideatech.io> From: Navdeep Parhar Message-ID: <5690421C.7040609@gmail.com> Date: Fri, 8 Jan 2016 15:11:24 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <56904059.4010806@ideatech.io> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 23:11:26 -0000 sizeof(struct ether_header) On 01/08/2016 15:03, Hadi Rezaee wrote: > Hello there, > > In some part of my application I need to have the Ethernet header size > (ideally, using sizeof). > Well I guess 'ethhdr' is not exist on FreeBSD, correct ? > > According to Linux definition: > > struct ethhdr { > unsigned char h_dest[ETH_ALEN]; > unsigned char h_source[ETH_ALEN]; > unsigned short h_proto; > } __attribute__((packed)); > > So, assume the ethernet header size is equal to 14, is it going to work > ?! :) > and if there is already a definition somewhere in system header files, > so I don't have to define the size myself ? > > Thank you > > _______________________________________________ > freebsd-net@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" >