Remove compilation of stun trans
[sipe-libnice.git] / stun / utils.h
blobf0f6c08481b04e2d813ba1b4d42a454fac3f001b
1 /*
2 * This file is part of the Nice GLib ICE library.
4 * (C) 2007 Nokia Corporation. All rights reserved.
5 * Contact: Rémi Denis-Courmont
7 * The contents of this file are subject to the Mozilla Public License Version
8 * 1.1 (the "License"); you may not use this file except in compliance with
9 * the License. You may obtain a copy of the License at
10 * http://www.mozilla.org/MPL/
12 * Software distributed under the License is distributed on an "AS IS" basis,
13 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
14 * for the specific language governing rights and limitations under the
15 * License.
17 * The Original Code is the Nice GLib ICE library.
19 * The Initial Developers of the Original Code are Collabora Ltd and Nokia
20 * Corporation. All Rights Reserved.
22 * Contributors:
23 * Rémi Denis-Courmont, Nokia
25 * Alternatively, the contents of this file may be used under the terms of the
26 * the GNU Lesser General Public License Version 2.1 (the "LGPL"), in which
27 * case the provisions of LGPL are applicable instead of those above. If you
28 * wish to allow use of your version of this file only under the terms of the
29 * LGPL and not to allow others to use your version of this file under the
30 * MPL, indicate your decision by deleting the provisions above and replace
31 * them with the notice and other provisions required by the LGPL. If you do
32 * not delete the provisions above, a recipient may use your version of this
33 * file under either the MPL or the LGPL.
36 #ifndef STUN_UTILS_H
37 # define STUN_UTILS_H 1
39 /**
40 * @file utils.h
41 * @brief STUN client generic utility functions
44 #include "stunmessage.h"
46 #ifdef _WIN32
47 #include <winsock2.h>
48 #include <ws2tcpip.h>
49 #else
50 #include <sys/types.h>
51 #include <sys/socket.h>
52 #endif
54 # ifdef __cplusplus
55 extern "C" {
56 # endif
59 bool stun_optional (uint16_t t);
61 size_t stun_padding (size_t l);
63 size_t stun_align (size_t l);
65 uint16_t stun_getw (const uint8_t *ptr);
67 void stun_debug_enable (void);
68 void stun_debug_disable (void);
69 void stun_debug (const char *fmt, ...);
70 void stun_debug_bytes (const void *data, size_t len);
72 StunMessageReturn stun_xor_address (const StunMessage *msg,
73 struct sockaddr *addr, socklen_t addrlen,
74 uint32_t magic_cookie);
76 void *stun_setw (uint8_t *ptr, uint16_t value);
78 void stun_set_type (uint8_t *h, StunClass c, StunMethod m);
80 const char *stun_strerror (StunError code);
82 # ifdef __cplusplus
84 # endif
86 #endif /* !STUN_UTILS_H */