Logo Search packages:      
Sourcecode: sofia-sip version File versions  Download package

stun.h File Reference

Detailed Description

Defined when <sofia-sip/stun.h> has been included. STUN module public interface

Martti Mela <Martti.Mela@nokia.com>

Tat Chan <Tat.Chan@nokia.com>

Pekka Pessi <Pekka.Pessi@nokia.com>

Kai Vehmanen <kai.vehmanen@nokia.com>

Definition in file stun.h.

#include <sofia-sip/su_wait.h>
#include <sofia-sip/su_tag.h>
#include "sofia-sip/stun_common.h"
#include <sofia-sip/su_localinfo.h>

Go to the source code of this file.


#define STUN_DISCOVERY_MAGIC_T   struct stun_discovery_magic_t
#define STUN_MAGIC_T   struct stun_magic_t


typedef enum stun_action_s stun_action_t
typedef void(* stun_discovery_f )(stun_discovery_magic_t *magic, stun_handle_t *sh, stun_discovery_t *sd, stun_action_t action, stun_state_t event)
typedef STUN_DISCOVERY_MAGIC_T stun_discovery_magic_t
typedef struct stun_discovery_s stun_discovery_t
typedef void(* stun_dns_lookup_f )(stun_dns_lookup_t *self, stun_magic_t *magic)
typedef struct stun_dns_lookup_s stun_dns_lookup_t
struct stun_handle_s 
typedef STUN_MAGIC_T stun_magic_t
typedef struct stun_mini_s stun_mini_t
typedef enum stun_nattype_e stun_nattype_t
typedef struct stun_request_s stun_request_t
typedef int(* stun_send_callback )(stun_magic_t *magic, stun_handle_t *sh, int socket, void *data, unsigned len, int only_a_keepalive)
typedef enum stun_state_e stun_state_t


enum  stun_action_s {
  stun_action_no_action = 1, stun_action_tls_query = 2, stun_action_binding_request = 4, stun_action_keepalive = 8,
  stun_action_test_nattype = 16, stun_action_test_lifetime = 32
enum  stun_nattype_e {
  stun_nat_unknown = 0, stun_open_internet, stun_udp_blocked, stun_sym_udp_fw,
  stun_nat_full_cone, stun_nat_res_cone, stun_nat_port_res_cone, stun_nat_ei_filt_ad_map,
  stun_nat_ad_filt_ad_map, stun_nat_adp_filt_ad_map
enum  stun_state_e {
  stun_no_assigned_event, stun_tls_connecting, stun_tls_ssl_connecting, stun_tls_writing,
  stun_tls_closing, stun_tls_reading, stun_tls_done, stun_discovery_done,
  stun_error, stun_tls_connection_timeout, stun_tls_connection_failed, stun_tls_ssl_connect_failed,
  stun_discovery_error, stun_discovery_timeout


SOFIAPUBFUN int stun_bind (stun_handle_t *sh, stun_discovery_f, stun_discovery_magic_t *magic, tag_type_t tag, tag_value_t value,...)
SOFIAPUBFUN int stun_discovery_get_address (stun_discovery_t *sd, void *addr, socklen_t *return_addrlen)
SOFIAPUBFUN su_socket_t stun_discovery_get_socket (stun_discovery_t *sd)
SOFIAPUBFUN int stun_discovery_release_socket (stun_discovery_t *sd)
SOFIAPUBFUN stun_dns_lookup_t * stun_dns_lookup (stun_magic_t *magic, su_root_t *root, stun_dns_lookup_f func, const char *domain)
SOFIAPUBFUN void stun_dns_lookup_destroy (stun_dns_lookup_t *self)
SOFIAPUBFUN int stun_dns_lookup_stp_addr (stun_dns_lookup_t *self, const char **target, uint16_t *port)
SOFIAPUBFUN int stun_dns_lookup_tcp_addr (stun_dns_lookup_t *self, const char **target, uint16_t *port)
SOFIAPUBFUN int stun_dns_lookup_udp_addr (stun_dns_lookup_t *, const char **target, uint16_t *port)
SOFIAPUBFUN void stun_handle_destroy (stun_handle_t *sh)
SOFIAPUBFUN stun_handle_t * stun_handle_init (su_root_t *root, tag_type_t, tag_value_t,...)
SOFIAPUBFUN int stun_is_requested (tag_type_t tag, tag_value_t value,...)
SOFIAPUBFUN int stun_keepalive (stun_handle_t *sh, su_sockaddr_t *sa, tag_type_t tag, tag_value_t value,...)
SOFIAPUBFUN int stun_keepalive_destroy (stun_handle_t *sh, su_socket_t s)
SOFIAPUBFUN int stun_lifetime (stun_discovery_t *sd)
SOFIAPUBFUN int stun_message_length (void *data, isize_t len, int end_of_message)
SOFIAPUBFUN int stun_mini_add_socket (stun_mini_t *server, su_socket_t socket)
SOFIAPUBFUN stun_mini_t * stun_mini_create (void)
SOFIAPUBFUN void stun_mini_destroy (stun_mini_t *)
SOFIAPUBFUN int stun_mini_remove_socket (stun_mini_t *server, su_socket_t socket)
SOFIAPUBFUN void stun_mini_request (stun_mini_t *server, su_socket_t socket, void *msg, ssize_t msglen, void *addr, socklen_t addrlen)
SOFIAPUBFUN int stun_msg_is_keepalive (uint16_t data)
SOFIAPUBFUN stun_nattype_t stun_nattype (stun_discovery_t *sd)
SOFIAPUBFUN char const * stun_nattype_str (stun_discovery_t *sd)
SOFIAPUBFUN int stun_obtain_shared_secret (stun_handle_t *sh, stun_discovery_f, stun_discovery_magic_t *magic, tag_type_t tag, tag_value_t value,...)
SOFIAPUBFUN int stun_process_message (stun_handle_t *sh, su_socket_t s, su_sockaddr_t *sa, socklen_t salen, void *data, isize_t len)
SOFIAPUBFUN int stun_process_request (su_socket_t s, stun_msg_t *req, int sid, su_sockaddr_t *from_addr, socklen_t from_len)
SOFIAPUBFUN su_root_tstun_root (stun_handle_t *sh)
SOFIAPUBFUN su_addrinfo_t const * stun_server_address (stun_handle_t *sh)
SOFIAPUBFUN int stun_set_uname_pwd (stun_handle_t *sh, const char *uname, isize_t len_uname, const char *pwd, isize_t len_pwd)
SOFIAPUBFUN char const * stun_str_state (stun_state_t state)
SOFIAPUBFUN int stun_test_lifetime (stun_handle_t *sh, stun_discovery_f, stun_discovery_magic_t *magic, tag_type_t tag, tag_value_t value,...)
SOFIAPUBFUN int stun_test_nattype (stun_handle_t *sh, stun_discovery_f, stun_discovery_magic_t *magic, tag_type_t tag, tag_value_t value,...)


SOFIAPUBVAR char const stun_version []

Generated by  Doxygen 1.6.0   Back to index