ROHC compression/decompression library
|
00001 /* Copyright (C) 1991-1993,1995-2000,2009,2010 Free Software Foundation, Inc. 00002 This file is part of the GNU C Library. 00003 00004 The GNU C Library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Lesser General Public 00006 License as published by the Free Software Foundation; either 00007 version 2.1 of the License, or (at your option) any later version. 00008 00009 The GNU C Library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Lesser General Public License for more details. 00013 00014 You should have received a copy of the GNU Lesser General Public 00015 License along with the GNU C Library; if not, write to the Free 00016 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00017 02110-1301 USA. */ 00018 00019 /** 00020 * @file ipv4.h 00021 * @brief Defines the IPv4 header 00022 * @author Free Software Foundation, Inc 00023 * 00024 * This file contains a part of netinet/ip.h from the GNU C library. It is 00025 * copied here to be portable on all platforms, even the platforms that miss 00026 * the declarations or got different declarations, such as Microsoft Windows 00027 * or FreeBSD. 00028 */ 00029 00030 #ifndef ROHC_PROTOCOLS_IPV4_H 00031 #define ROHC_PROTOCOLS_IPV4_H 00032 00033 #include <stdint.h> 00034 00035 #ifdef __KERNEL__ 00036 # include <endian.h> 00037 #else 00038 # include "config.h" /* for WORDS_BIGENDIAN */ 00039 #endif 00040 00041 00042 /** 00043 * @brief The IPv4 header 00044 */ 00045 struct ipv4_hdr 00046 { 00047 #if WORDS_BIGENDIAN == 1 00048 uint8_t version:4; 00049 uint8_t ihl:4; 00050 #else 00051 uint8_t ihl:4; 00052 uint8_t version:4; 00053 #endif 00054 uint8_t tos; 00055 uint16_t tot_len; 00056 uint16_t id; 00057 uint16_t frag_off; 00058 #define IP_RF 0x8000 /* reserved fragment flag */ 00059 #define IP_DF 0x4000 /* dont fragment flag */ 00060 #define IP_MF 0x2000 /* more fragments flag */ 00061 #define IP_OFFMASK 0x1fff /* mask for fragmenting bits */ 00062 uint8_t ttl; 00063 uint8_t protocol; 00064 uint16_t check; 00065 uint32_t saddr; 00066 uint32_t daddr; 00067 /* The options start here. */ 00068 } __attribute__((packed)); 00069 00070 #endif