ethernet.h

Go to the documentation of this file.
00001 /*
00002 ** ethernet.h for  in /home/anoman/work/lse/atomix/lseos-net/inet
00003 ** 
00004 ** Copyright (c)2004 Arthur Kopatsy
00005 ** Login   <kopats_a@epita.fr>
00006 ** 
00007 ** Started on  Wed Jun 23 16:40:33 2004 Arthur Kopatsy
00008 ** Last update Thu Dec  9 16:28:53 2004 Arthur Kopatsy
00009 */
00010 
00011 #ifndef ETHERNET_H_
00012 #define ETHERNET_H_
00013 
00014 struct s_ethernet_hdr
00015 {
00016   struct mac_addr       eth_dst;
00017   struct mac_addr       eth_src;
00018   u_int16_t             eth_type;
00019 } __attribute__ ((__packed__));
00020 
00021 #define ETHERNET_HEADER_LEN     sizeof (struct s_ethernet_hdr)
00022 
00023 #define ETHERNET_FRAME_SIZE_MIN 60
00024 
00025 /*
00026 ** Ethernet types  
00027 */
00028 #define ETHERNET_TYPE_IPV4         0x800
00029 #define ETHERNET_TYPE_ARP          0x806
00030 
00031 /* PROTO ethernet.c */
00032 #ifdef __INET__
00033 /* ethernet.c */
00034 void ethernet_dump(struct s_pkbuf *pk);
00035 int ethernet_build_header(struct s_pkbuf *pk, struct mac_addr *dst);
00036 int aa_ethernet_output(struct s_pkbuf *pk);
00037 void ethernet_output_broadcast(struct s_pkbuf *pk);
00038 int aa_ethernet_input(struct s_pkbuf *pk);
00039 #endif /* __INET__ */
00040 #endif

Generated on Wed May 24 23:05:52 2006 for LSE/OS by  doxygen 1.4.6