/home/tomh/openhip/hip-0.5/src/include/hip/hip_stun.h File Reference

#include <time.h>
#include "hip_stun_udp.h"

Go to the source code of this file.

Classes

struct  UInt128
struct  StunMsgHdr
struct  StunAtrHdr
struct  StunAddress4
struct  StunAtrAddress4
struct  StunAtrChangeRequest
struct  StunAtrError
struct  StunAtrUnknown
struct  StunAtrString
struct  StunAtrIntegrity
struct  StunMessage
struct  StunMediaRelay
struct  StunServerInfo

Defines

#define TRUE   1
#define FALSE   0
#define STUN_VERSION   "0.96"
#define STUN_MAX_STRING   256
#define STUN_MAX_UNKNOWN_ATTRIBUTES   8
#define STUN_MAX_MESSAGE_SIZE   2048
#define STUN_PORT   3478
#define MAX_MEDIA_RELAYS   500
#define MAX_RTP_MSG_SIZE   1500
#define MEDIA_RELAY_TIMEOUT   3*60

Typedefs

typedef unsigned char UInt8
typedef unsigned short UInt16
typedef unsigned int UInt32
typedef unsigned long long UInt64

Enumerations

enum  StunHmacStatus {
  HmacUnkown = 0, HmacOK, HmacBadUserName, HmacUnkownUserName,
  HmacFailed
}
enum  NatType {
  StunTypeUnknown = 0, StunTypeFailure, StunTypeOpen, StunTypeBlocked,
  StunTypeIndependentFilter, StunTypeDependentFilter, StunTypePortDependedFilter, StunTypeDependentMapping,
  StunTypeFirewall
}

Functions

int stunParseMessage (char *buf, unsigned int bufLen, StunMessage *message, int verbose)
void stunBuildReqSimple (StunMessage *msg, const StunAtrString *username, int changePort, int changeIp, unsigned int id)
unsigned int stunEncodeMessage (const StunMessage *message, char *buf, unsigned int bufLen, const StunAtrString *password, int verbose)
void stunCreateUserName (const StunAddress4 *addr, StunAtrString *username)
void stunGetUserNameAndPassword (const StunAddress4 *dest, StunAtrString *username, StunAtrString *password)
void stunCreatePassword (const StunAtrString *username, StunAtrString *password)
void printIPv4Addr (StunAddress4 *ad)
void printUInt128 (UInt128 r)
int stunRand ()
UInt64 stunGetSystemTimeSecs ()
int stunParseServerName (char *serverName, StunAddress4 *stunServerAddr)
int stunParseHostName (char *peerName, UInt32 *ip, UInt16 *portVal, UInt16 defaultPort)
int stunInitServer (StunServerInfo *info, const StunAddress4 *myAddr, const StunAddress4 *altAddr, int startMediaPort, int verbose)
void stunStopServer (StunServerInfo *info)
int stunServerProcess (StunServerInfo *info, int verbose)
int stunFindLocalInterfaces (UInt32 *addresses, int maxSize)
void stunTest (StunAddress4 *dest, int testNum, int verbose, StunAddress4 *srcAddr)
NatType stunNatType (StunAddress4 *dest, int verbose, int *preservePort, int *hairpin, int port, StunAddress4 *sAddr)
int stunServerProcessMsg (char *buf, unsigned int bufLen, StunAddress4 *from, StunAddress4 *secondary, StunAddress4 *myAddr, StunAddress4 *altAddr, StunMessage *resp, StunAddress4 *destination, StunAtrString *hmacPassword, int *changePort, int *changeIp, int verbose)
int stunOpenSocket (StunAddress4 *dest, StunAddress4 *mappedAddr, int port, StunAddress4 *srcAddr, int verbose)
int stunOpenSocketPair (StunAddress4 *dest, StunAddress4 *mappedAddr, int *fd1, int *fd2, int srcPort, StunAddress4 *srcAddr, int verbose)
int stunRandomPort ()

Variables

UInt8 IPv4Family
UInt8 IPv6Family
UInt32 ChangeIpFlag
UInt32 ChangePortFlag
UInt16 MappedAddress
UInt16 ResponseAddress
UInt16 ChangeRequest
UInt16 SourceAddress
UInt16 ChangedAddress
UInt16 Username
UInt16 Password
UInt16 MessageIntegrity
UInt16 ErrorCode
UInt16 UnknownAttribute
UInt16 ReflectedFrom
UInt16 XorMappedAddress
UInt16 XorOnly
UInt16 ServerName
UInt16 SecondaryAddress
UInt16 BindRequestMsg
UInt16 BindResponseMsg
UInt16 BindErrorResponseMsg
UInt16 SharedSecretRequestMsg
UInt16 SharedSecretResponseMsg
UInt16 SharedSecretErrorResponseMsg


Define Documentation

#define FALSE   0

#define MAX_MEDIA_RELAYS   500

#define MAX_RTP_MSG_SIZE   1500

#define MEDIA_RELAY_TIMEOUT   3*60

#define STUN_MAX_MESSAGE_SIZE   2048

#define STUN_MAX_STRING   256

#define STUN_MAX_UNKNOWN_ATTRIBUTES   8

#define STUN_PORT   3478

#define STUN_VERSION   "0.96"

#define TRUE   1


Typedef Documentation

typedef unsigned short UInt16

typedef unsigned int UInt32

typedef unsigned long long UInt64

typedef unsigned char UInt8


Enumeration Type Documentation

enum NatType

Enumerator:
StunTypeUnknown 
StunTypeFailure 
StunTypeOpen 
StunTypeBlocked 
StunTypeIndependentFilter 
StunTypeDependentFilter 
StunTypePortDependedFilter 
StunTypeDependentMapping 
StunTypeFirewall 

enum StunHmacStatus

Enumerator:
HmacUnkown 
HmacOK 
HmacBadUserName 
HmacUnkownUserName 
HmacFailed 


Function Documentation

void printIPv4Addr ( StunAddress4 ad  ) 

void printUInt128 ( UInt128  r  ) 

void stunBuildReqSimple ( StunMessage msg,
const StunAtrString username,
int  changePort,
int  changeIp,
unsigned int  id 
)

void stunCreatePassword ( const StunAtrString username,
StunAtrString password 
)

void stunCreateUserName ( const StunAddress4 addr,
StunAtrString username 
)

unsigned int stunEncodeMessage ( const StunMessage message,
char *  buf,
unsigned int  bufLen,
const StunAtrString password,
int  verbose 
)

int stunFindLocalInterfaces ( UInt32 addresses,
int  maxSize 
)

UInt64 stunGetSystemTimeSecs (  ) 

void stunGetUserNameAndPassword ( const StunAddress4 dest,
StunAtrString username,
StunAtrString password 
)

int stunInitServer ( StunServerInfo info,
const StunAddress4 myAddr,
const StunAddress4 altAddr,
int  startMediaPort,
int  verbose 
)

NatType stunNatType ( StunAddress4 dest,
int  verbose,
int *  preservePort,
int *  hairpin,
int  port,
StunAddress4 sAddr 
)

int stunOpenSocket ( StunAddress4 dest,
StunAddress4 mappedAddr,
int  port,
StunAddress4 srcAddr,
int  verbose 
)

int stunOpenSocketPair ( StunAddress4 dest,
StunAddress4 mappedAddr,
int *  fd1,
int *  fd2,
int  srcPort,
StunAddress4 srcAddr,
int  verbose 
)

int stunParseHostName ( char *  peerName,
UInt32 ip,
UInt16 portVal,
UInt16  defaultPort 
)

int stunParseMessage ( char *  buf,
unsigned int  bufLen,
StunMessage message,
int  verbose 
)

int stunParseServerName ( char *  serverName,
StunAddress4 stunServerAddr 
)

int stunRand (  ) 

int stunRandomPort (  ) 

int stunServerProcess ( StunServerInfo info,
int  verbose 
)

int stunServerProcessMsg ( char *  buf,
unsigned int  bufLen,
StunAddress4 from,
StunAddress4 secondary,
StunAddress4 myAddr,
StunAddress4 altAddr,
StunMessage resp,
StunAddress4 destination,
StunAtrString hmacPassword,
int *  changePort,
int *  changeIp,
int  verbose 
)

void stunStopServer ( StunServerInfo info  ) 

void stunTest ( StunAddress4 dest,
int  testNum,
int  verbose,
StunAddress4 srcAddr 
)


Variable Documentation

UInt16 BindErrorResponseMsg

UInt16 BindRequestMsg

UInt16 BindResponseMsg

UInt16 ChangedAddress

UInt32 ChangeIpFlag

UInt32 ChangePortFlag

UInt16 ChangeRequest

UInt16 ErrorCode

UInt8 IPv4Family

UInt8 IPv6Family

UInt16 MappedAddress

UInt16 MessageIntegrity

UInt16 Password

UInt16 ReflectedFrom

UInt16 ResponseAddress

UInt16 SecondaryAddress

UInt16 ServerName

UInt16 SharedSecretErrorResponseMsg

UInt16 SharedSecretRequestMsg

UInt16 SharedSecretResponseMsg

UInt16 SourceAddress

UInt16 UnknownAttribute

UInt16 Username

UInt16 XorMappedAddress

UInt16 XorOnly


Generated on Mon Oct 22 11:43:43 2007 for OpenHIP by  doxygen 1.5.1