Commit 39c3ced9 authored by Martti Mela's avatar Martti Mela

more win32 defs, HAVE_OPENSSL defs for STUN

darcs-hash:20060311163409-1b897-23c24b475319b75da0d071da407b869417f3c272.gz
parent c5ceb2e7
......@@ -59,7 +59,7 @@
#include "sofia-sip/msg_mclass_hash.h"
#include "sofia-sip/msg_mime.h"
#if !defined(ENOBUFS) || defined(_WIN32)
#if !defined(ENOBUFS) && defined(_WIN32)
#define ENOBUFS WSAENOBUFS
#endif
......
......@@ -81,6 +81,14 @@ char const nta_version[] = VERSION;
#include "sofia-sip/nta_stateless.h"
#include "sofia-sip/url_tag.h"
#if !defined(random) && defined(_WIN32)
#define random rand
#endif
#if !defined(EMSGSIZE) && defined(_WIN32)
#define EMSGSIZE WSAEMSGSIZE
#endif
#if HAVE_FUNC
#elif HAVE_FUNCTION
#define __func__ __FUNCTION__
......
......@@ -40,9 +40,17 @@ char const name[] = "portbind";
#include <assert.h>
#include <unistd.h>
#if HAVE_SYS_SOCKET_T
#include <sys/socket.h>
#endif
#if HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#if HAVE_NETDB_H
#include <netdb.h>
#endif
#include "sofia-sip/su.h"
......
......@@ -53,6 +53,14 @@
#include <sofia-sip/string0.h>
#ifndef EALREADY && defined(_WIN32)
#define EALREADY WSAEALREADY
#endif
#ifndef EPROTO && defined(_WIN32)
#define EPROTO 127 /* XXX -- mela: wrong number? */
#endif
#define NONE ((void *)-1)
#define XXX assert(!"implemented")
......
......@@ -56,6 +56,10 @@
#include <openssl/opensslv.h>
#endif
#if !defined(ETIMEDOUT) && defined(_WIN32)
#define ETIMEDOUT WSAETIMEDOUT
#endif
/* Missing socket symbols */
#ifndef SOL_TCP
#define SOL_TCP IPPROTO_TCP
......@@ -1300,6 +1304,7 @@ void stun_tls_connect_timer_cb(su_root_magic_t *magic,
su_timer_t *t,
su_timer_arg_t *arg)
{
}
#endif /* HAVE_OPENSSL */
/** Compose a STUN message of the format defined by stun_msg_t
......
......@@ -454,7 +454,9 @@ int stun_encode_type_len(stun_attr_t *attr, uint16_t len) {
/** validate message integrity based on pwd
* received content is in msg->enc_buf
*/
int stun_validate_message_integrity(stun_msg_t *msg, stun_buffer_t *pwd) {
#if defined(HAVE_OPENSSL)
int stun_validate_message_integrity(stun_msg_t *msg, stun_buffer_t *pwd)
{
int padded_len, len;
size_t dig_len;
......@@ -494,6 +496,12 @@ int stun_validate_message_integrity(stun_msg_t *msg, stun_buffer_t *pwd) {
return 0;
}
#else
int stun_validate_message_integrity(stun_msg_t *msg, stun_buffer_t *pwd)
{
return -1;
}
#endif /* HAVE_OPENSSL */
void debug_print(stun_buffer_t *buf) {
int i;
......
......@@ -357,7 +357,9 @@ int torture_test_get_nattype(char *localaddr)
END();
}
#ifndef _WIN32
#include <poll.h>
#endif
/* XXX: Not used in the test set yet. */
#if 0
......
......@@ -50,6 +50,26 @@
#include <netinet/tcp.h>
#endif
#if !defined(EPROTONOSUPPORT) && defined(_WIN32)
#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
#endif
#if !defined(ENOBUFS) && defined(_WIN32)
#define ENOBUFS WSAENOBUFS
#endif
#ifndef EBADMSG
#define EBADMSG 117 /* XXX -- mela: number? */
#endif
#if !defined(EMSGSIZE) && defined(_WIN32)
#define EMSGSIZE WSAEMSGSIZE
#endif
#if !defined(random) && defined(_WIN32)
#define random rand
#endif
#ifndef SU_DEBUG
#define SU_DEBUG 3
#endif
......
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