2 This file is part of GNUnet.
3 Copyright (C) 2009, 2015 GNUnet e.V.
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
22 * Testcase for STUN server resolution
24 * @file nat/nat_stun.h
25 * @brief Testcase for STUN library
26 * @author Bruno Souza Cabral
27 * @autor Mark Spencer (Original code borrowed from Asterisk)
32 #define STUN_IGNORE (0)
33 #define STUN_ACCEPT (1)
35 #define STUN_MAGIC_COOKIE 0x2112A442
37 typedef struct { uint32_t id[3]; } GNUNET_PACKED stun_trans_id;
54 * The format normally used for addresses carried by STUN messages.
66 /* STUN message classes */
69 STUN_REQUEST = 0x0000,
70 STUN_INDICATION = 0x0001,
71 STUN_RESPONSE = 0x0002,
72 STUN_ERROR_RESPONSE = 0x0003
77 STUN_BINDING = 0x0001,
78 STUN_SHARED_SECRET = 0x0002,
79 STUN_ALLOCATE = 0x0003,
80 STUN_REFRESH = 0x0004,
83 STUN_CREATE_PERMISSION = 0x0008,
84 STUN_CHANNEL_BIND = 0x0009
87 /* Basic attribute types in stun messages.
88 * Messages can also contain custom attributes (codes above 0x7fff)
91 STUN_MAPPED_ADDRESS = 0x0001,
92 STUN_RESPONSE_ADDRESS = 0x0002,
93 STUN_CHANGE_ADDRESS = 0x0003,
94 STUN_SOURCE_ADDRESS = 0x0004,
95 STUN_CHANGED_ADDRESS = 0x0005,
96 STUN_USERNAME = 0x0006,
97 STUN_PASSWORD = 0x0007,
98 STUN_MESSAGE_INTEGRITY = 0x0008,
99 STUN_ERROR_CODE = 0x0009,
100 STUN_UNKNOWN_ATTRIBUTES = 0x000a,
101 STUN_REFLECTED_FROM = 0x000b,
104 STUN_XOR_MAPPED_ADDRESS = 0x0020,
105 STUN_MS_VERSION = 0x8008,
106 STUN_MS_XOR_MAPPED_ADDRESS = 0x8020,
107 STUN_SOFTWARE = 0x8022,
108 STUN_ALTERNATE_SERVER = 0x8023,
109 STUN_FINGERPRINT = 0x8028