Commit 494d8a0b authored by Youness Alaoui's avatar Youness Alaoui

Change includes to minimize non public API from being included

parent 3b935de9
......@@ -40,8 +40,9 @@ FIXXREF_OPTIONS=
HFILE_GLOB=$(DOC_SOURCE_DIR)/agent/agent.h $(DOC_SOURCE_DIR)/agent/address.h \
$(DOC_SOURCE_DIR)/agent/debug.h $(DOC_SOURCE_DIR)/agent/candidate.h \
$(DOC_SOURCE_DIR)/agent/interfaces.h \
$(DOC_SOURCE_DIR)/stun/stunmessage.h $(DOC_SOURCE_DIR)/stun/stun5389.h \
$(DOC_SOURCE_DIR)/stun/utils.h $(DOC_SOURCE_DIR)/stun/stunagent.h \
$(DOC_SOURCE_DIR)/stun/stunagent.h \
$(DOC_SOURCE_DIR)/stun/stunmessage.h
$(DOC_SOURCE_DIR)/stun/debug.h \
$(DOC_SOURCE_DIR)/stun/usages/bind.h \
$(DOC_SOURCE_DIR)/stun/usages/ice.h \
$(DOC_SOURCE_DIR)/stun/usages/timer.h \
......
......@@ -25,6 +25,7 @@ libstun_la_SOURCES = constants.h \
rand.c rand.h \
stunhmac.c stunhmac.h \
utils.c utils.h \
debug.c debug.h \
usages/ice.c usages/ice.h \
usages/bind.c usages/bind.h \
usages/turn.c usages/turn.h \
......
/*
* This file is part of the Nice GLib ICE library.
*
* (C) 2007 Nokia Corporation. All rights reserved.
* Contact: Rémi Denis-Courmont
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Nice GLib ICE library.
*
* The Initial Developers of the Original Code are Collabora Ltd and Nokia
* Corporation. All Rights Reserved.
*
* Contributors:
* Rémi Denis-Courmont, Nokia
*
* Alternatively, the contents of this file may be used under the terms of the
* the GNU Lesser General Public License Version 2.1 (the "LGPL"), in which
* case the provisions of LGPL are applicable instead of those above. If you
* wish to allow use of your version of this file only under the terms of the
* LGPL and not to allow others to use your version of this file under the
* MPL, indicate your decision by deleting the provisions above and replace
* them with the notice and other provisions required by the LGPL. If you do
* not delete the provisions above, a recipient may use your version of this
* file under either the MPL or the LGPL.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include "debug.h"
static int debug_enabled = 1;
void stun_debug_enable (void) {
debug_enabled = 1;
}
void stun_debug_disable (void) {
debug_enabled = 0;
}
void stun_debug (const char *fmt, ...)
{
va_list ap;
if (debug_enabled) {
va_start (ap, fmt);
vfprintf (stderr, fmt, ap);
va_end (ap);
}
}
void stun_debug_bytes (const void *data, size_t len)
{
size_t i;
stun_debug ("0x");
for (i = 0; i < len; i++)
stun_debug ("%02x", ((const unsigned char *)data)[i]);
}
/*
* This file is part of the Nice GLib ICE library.
*
* (C) 2007 Nokia Corporation. All rights reserved.
* Contact: Rémi Denis-Courmont
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Nice GLib ICE library.
*
* The Initial Developers of the Original Code are Collabora Ltd and Nokia
* Corporation. All Rights Reserved.
*
* Contributors:
* Rémi Denis-Courmont, Nokia
*
* Alternatively, the contents of this file may be used under the terms of the
* the GNU Lesser General Public License Version 2.1 (the "LGPL"), in which
* case the provisions of LGPL are applicable instead of those above. If you
* wish to allow use of your version of this file only under the terms of the
* LGPL and not to allow others to use your version of this file under the
* MPL, indicate your decision by deleting the provisions above and replace
* them with the notice and other provisions required by the LGPL. If you do
* not delete the provisions above, a recipient may use your version of this
* file under either the MPL or the LGPL.
*/
#ifndef STUN_DEBUG_H
#define STUN_DEBUG_H
#ifdef __cplusplus
extern "C" {
#endif
/**
* stun_debug_enable:
*
* Enable debug messages to stderr
*/
void stun_debug_enable (void);
/**
* stun_debug_disable:
*
* Disable debug messages to stderr
*/
void stun_debug_disable (void);
void stun_debug (const char *fmt, ...);
void stun_debug_bytes (const void *data, size_t len);
# ifdef __cplusplus
}
# endif
#endif /* STUN_DEBUG_H */
......@@ -49,6 +49,7 @@
#include <string.h>
#include <stdlib.h>
#include "stun5389.h"
#include "stuncrc32.h"
#include "stunmessage.h"
......
......@@ -48,7 +48,7 @@
#endif
# include <sys/types.h>
#include "stunmessage.h"
/*
* Computes the FINGERPRINT checksum of a STUN message.
* @param msg pointer to the STUN message
......
......@@ -39,6 +39,9 @@
#include "stunmessage.h"
#include "stunagent.h"
#include "stunhmac.h"
#include "stun5389.h"
#include "utils.h"
#include <string.h>
#include <stdlib.h>
......
......@@ -68,6 +68,7 @@
typedef struct stun_agent_t StunAgent;
#include "stunmessage.h"
#include "debug.h"
/**
* StunCompatibility:
......
......@@ -38,6 +38,7 @@
#endif
#include "stunmessage.h"
#include "utils.h"
#ifdef _WIN32
#include <winsock2.h>
......
......@@ -56,7 +56,6 @@
#endif
#include <sys/types.h>
#include "constants.h"
#ifdef _WIN32
#include <winsock2.h>
......@@ -66,6 +65,8 @@
#include <arpa/inet.h>
#endif
#include "constants.h"
typedef struct _StunMessage StunMessage;
/**
......@@ -440,10 +441,12 @@ typedef enum
} StunMessageReturn;
#include "stunagent.h"
#include "stunhmac.h"
#include "stuncrc32.h"
#include "utils.h"
#include "stun5389.h"
/**
* STUN_MAX_MESSAGE_SIZE:
* The Maximum size of a STUN message
*/
#define STUN_MAX_MESSAGE_SIZE 65552
/**
* StunMessage:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment