ethernet header size

Navdeep Parhar nparhar at gmail.com
Fri Jan 8 23:11:26 UTC 2016


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 at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"
>



More information about the freebsd-net mailing list