pidgin  2.13.0
About: Pidgin is a chat program (multi-protocol instant messaging client) which lets you log in to accounts on multiple chat networks simultaneously (old name "gaim").
  Fossies Dox: pidgin-2.13.0.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

stun.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _PurpleStunNatDiscovery
 

STUN API

enum  PurpleStunStatus { PURPLE_STUN_STATUS_UNDISCOVERED = -1, PURPLE_STUN_STATUS_UNKNOWN, PURPLE_STUN_STATUS_DISCOVERING, PURPLE_STUN_STATUS_DISCOVERED }
 
enum  PurpleStunNatType {
  PURPLE_STUN_NAT_TYPE_PUBLIC_IP, PURPLE_STUN_NAT_TYPE_UNKNOWN_NAT, PURPLE_STUN_NAT_TYPE_FULL_CONE, PURPLE_STUN_NAT_TYPE_RESTRICTED_CONE,
  PURPLE_STUN_NAT_TYPE_PORT_RESTRICTED_CONE, PURPLE_STUN_NAT_TYPE_SYMMETRIC
}
 
typedef struct _PurpleStunNatDiscovery PurpleStunNatDiscovery
 
typedef void(* StunCallback) (PurpleStunNatDiscovery *)
 
PurpleStunNatDiscoverypurple_stun_discover (StunCallback cb)
 
void purple_stun_init (void)
 

Detailed Description

STUN API

Definition in file stun.h.

Typedef Documentation

◆ PurpleStunNatDiscovery

Definition at line 38 of file stun.h.

◆ StunCallback

typedef void(* StunCallback) (PurpleStunNatDiscovery *)

Definition at line 64 of file stun.h.

Enumeration Type Documentation

◆ PurpleStunNatType

Enumerator
PURPLE_STUN_NAT_TYPE_PUBLIC_IP 
PURPLE_STUN_NAT_TYPE_UNKNOWN_NAT 
PURPLE_STUN_NAT_TYPE_FULL_CONE 
PURPLE_STUN_NAT_TYPE_RESTRICTED_CONE 
PURPLE_STUN_NAT_TYPE_PORT_RESTRICTED_CONE 
PURPLE_STUN_NAT_TYPE_SYMMETRIC 

Definition at line 47 of file stun.h.

◆ PurpleStunStatus

Enumerator
PURPLE_STUN_STATUS_UNDISCOVERED 
PURPLE_STUN_STATUS_UNKNOWN 
PURPLE_STUN_STATUS_DISCOVERING 
PURPLE_STUN_STATUS_DISCOVERED 

Definition at line 40 of file stun.h.

Function Documentation

◆ purple_stun_discover()

PurpleStunNatDiscovery* purple_stun_discover ( StunCallback  cb)

Starts a NAT discovery. It returns a PurpleStunNatDiscovery if the discovery is already done. Otherwise the callback is called when the discovery is over and NULL is returned.

Parameters
cbThe callback to call when the STUN discovery is finished if the discovery would block. If the discovery is done, this is NOT called.
Returns
a PurpleStunNatDiscovery which includes the public IP and the type of NAT or NULL is discovery would block

Deal with the server name having changed since we did the lookup

Definition at line 385 of file stun.c.

References call_callback(), callbacks, do_test1(), FALSE, _PurpleStunNatDiscovery::lookup_time, nattype, NULL, _PurpleStunNatDiscovery::publicip, purple_debug_info(), purple_prefs_get_string(), purple_srv_resolve_account(), purple_strequal(), PURPLE_STUN_STATUS_DISCOVERED, PURPLE_STUN_STATUS_DISCOVERING, PURPLE_STUN_STATUS_UNDISCOVERED, PURPLE_STUN_STATUS_UNKNOWN, purple_timeout_add(), _PurpleStunNatDiscovery::servername, _PurpleStunNatDiscovery::status, time(), and TRUE.

Referenced by auto_ip_button_clicked_cb(), and purple_network_get_my_ip().

Here is the caller graph for this function:

◆ purple_stun_init()

void purple_stun_init ( void  )

Definition at line 440 of file stun.c.

References purple_prefs_add_string().

Referenced by purple_core_init().

Here is the caller graph for this function: