00001 /* 00002 * Copyright 2012 Didier Barvaux 00003 * 00004 * This 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 * This 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 this library; if not, write to the Free Software 00016 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00017 */ 00018 00019 /** 00020 * @file udp.h 00021 * @brief Defines the UDP header 00022 * @author Didier Barvaux <didier@barvaux.org> 00023 * 00024 * This file mimics the udphdr struct defined by netinet/udp.h from the GNU C 00025 * library. It is defined here to be portable on all platforms, even the 00026 * platforms that miss the declarations or got different declarations, such as 00027 * Microsoft Windows or FreeBSD. The udphdr struct being trivial, the original 00028 * copyrights and licenses are not kept to simplify the library license. 00029 */ 00030 00031 #ifndef ROHC_PROTOCOLS_UDP_H 00032 #define ROHC_PROTOCOLS_UDP_H 00033 00034 #include <stdint.h> 00035 00036 00037 /** The UDP header */ 00038 struct udphdr 00039 { 00040 uint16_t source; /**< The source port of the UDP header */ 00041 uint16_t dest; /**< The destination port of the UDP header */ 00042 uint16_t len; /**< The length (in bytes) of the UDP packet (header + payload) */ 00043 uint16_t check; /**< The checksum over of the UDP header + pseudo IP header */ 00044 } __attribute__((packed)); 00045 00046 #endif 00047
1.6.1