00001 /* 00002 * anytun 00003 * 00004 * The secure anycast tunneling protocol (satp) defines a protocol used 00005 * for communication between any combination of unicast and anycast 00006 * tunnel endpoints. It has less protocol overhead than IPSec in Tunnel 00007 * mode and allows tunneling of every ETHER TYPE protocol (e.g. 00008 * ethernet, ip, arp ...). satp directly includes cryptography and 00009 * message authentication based on the methodes used by SRTP. It is 00010 * intended to deliver a generic, scaleable and secure solution for 00011 * tunneling and relaying of packets of any protocol. 00012 * 00013 * 00014 * Copyright (C) 2007 anytun.org <satp@wirdorange.org> 00015 * 00016 * This program is free software; you can redistribute it and/or modify 00017 * it under the terms of the GNU General Public License version 2 00018 * as published by the Free Software Foundation. 00019 * 00020 * This program is distributed in the hope that it will be useful, 00021 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00022 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00023 * GNU General Public License for more details. 00024 * 00025 * You should have received a copy of the GNU General Public License 00026 * along with this program (see the file COPYING included with this 00027 * distribution); if not, write to the Free Software Foundation, Inc., 00028 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00029 */ 00030 00031 #ifndef _DATATYPES_H_ 00032 #define _DATATYPES_H_ 00033 00034 typedef signed char int8_t; 00035 typedef unsigned char u_int8_t; 00036 00037 typedef signed short int16; 00038 typedef unsigned short u_int16_t; 00039 00040 typedef signed int int32; 00041 typedef unsigned int u_int32_t; 00042 00043 //typedef signed long long int64_t; 00044 //typedef unsigned long long u_int64_t; 00045 00046 typedef u_int32_t window_size_t; 00047 00048 typedef u_int32_t seq_nr_t; 00049 #define SEQ_NR_T_NTOH(a) ntohl(a) 00050 #define SEQ_NR_T_HTON(a) htonl(a) 00051 00052 typedef u_int16_t sender_id_t; 00053 #define SENDER_ID_T_NTOH(a) ntohs(a) 00054 #define SENDER_ID_T_HTON(a) htons(a) 00055 00056 typedef u_int16_t payload_type_t; 00057 #define PAYLOAD_TYPE_T_NTOH(a) ntohs(a) 00058 #define PAYLOAD_TYPE_T_HTON(a) htons(a) 00059 00060 typedef u_int32_t auth_tag_t; 00061 #define AUTH_TAG_T_NTOH(a) ntohl(a) 00062 #define AUTH_TAG_T_HTON(a) htonl(a) 00063 00064 #endif