00001 #if !defined(_INTERNAL_H_)
00002 #define _INTERNAL_H_
00003
00004 #include <apr_network_io.h>
00005 #include <apr_thread_proc.h>
00006 #include <apr_uuid.h>
00007 #if 1
00008 #include <apr_thread_cond.h>
00009 #include <apr_thread_mutex.h>
00010 #endif
00011 #include "sumalib.h"
00012
00013 #define P2P_PORT 10001
00014 #define SUMA_CORE_PORT 0
00015
00016 #if !defined(XML_SETTINGS)
00017 #define P2P_INIT_CLIENT 1
00018 #define P2P_INIT_SERVER 2
00019 #define P2P_INIT_INSIDE_FIREWALL 4
00020 #endif
00021
00022 typedef struct p2p_connection_s p2p_connection_t;
00023
00024 typedef struct p2p_connection_link_s p2p_connection_link_t;
00025 struct p2p_connection_link_s {
00026 p2p_connection_t *prev;
00027 p2p_connection_t *next;
00028 };
00029
00030 struct p2p_connection_s {
00031 apr_socket_t *sock;
00032 apr_thread_t *reader;
00033 char peer_uuid[APR_UUID_FORMATTED_LENGTH + 1];
00034 char ipaddr[16];
00035 int port;
00036 int is_tunnel;
00037 #if !defined(PROHIBIT_LOCAL_CONNECTION)
00038 int is_local;
00039 #endif
00040 unsigned long r;
00041 p2p_connection_link_t link;
00042 };
00043
00044 #endif