struct frame { //ethernet frame // -------------------------------------------------- // | MAC destination | MAC source | Ethertype | // -------------------------------------------------- // | 48 bites | 48 bites | 16 bites | // -------------------------------------------------- // MAC destination unsigned short eth_mac_dst_1, eth_mac_dst_2, eth_mac_dst_3; // MAC source unsigned short eth_mac_src_1, eth_mac_src_2, eth_mac_src_3; //Ethertype unsigned short eth_type; //======================================================================================= //ipv6 packet // ------------------------------------------------------------------------------------------------------------------------------------------ // | Version | Traffic Class | Flow Label | Payload Length | Next Header | Hop Limit | Source Address | Destination Address | // ------------------------------------------------------------------------------------------------------------------------------------------ // | 4 bits | 2 bits | 20 bits | 16 bits | 8 bits | 8 bits | 182 bits | 182 bits | // ------------------------------------------------------------------------------------------------------------------------------------------ // Version, Traffic Class, Flow Label unsigned short ver_trf_flw_1, ver_trf_flw_2; // Payload Length unsigned short payload_length; // Next Header unsigned char next_header; // Hop Limit unsigned char hop_limit; // Source Address unsigned short ip6_src_1, ip6_src_2, ip6_src_3, ip6_src_4, ip6_src_5, ip6_src_6, ip6_src_7, ip6_src_8; // Destination Address unsigned short ip6_dst_1, ip6_dst_2, ip6_dst_3, ip6_dst_4, ip6_dst_5, ip6_dst_6, ip6_dst_7, ip6_dst_8; //======================================================================================= //icmp6 // ------------------------------------- // | Type | Code | Checksum | // ------------------------------------- // | 8 bits | 8 bits | 16 bits | // ------------------------------------- // Type unsigned char icmp_type; // Code unsigned char icmp_code; // Checksum unsigned short icmp_checksum; };