Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

zapINetUtils Interface Reference
[ZAP NetUtils module]

import "zapINetUtils.idl";

List of all members.

Public Member Functions

zapIStunMessage createStunMessage ()
 Create an empty STUN message.
zapIStunMessage deserializeStunPacket (in ACString packet,[array, size_is(count)] out unsigned short unknownAttribs, out unsigned long count)
 Deserialize a STUN packet to a zapIStunMessage structure.
PRInt32 snoopStunPacket (in ACString buffer)
 Checks if the buffer contains a (possibly partial) STUN packet.
void resolveMappedAddress (in zapIStunAddressResolveListener listener, in ACString stunServer)
 Asynchronously resolve our mapped NAT address using the given stun server.
ACString getPrimaryHostAddress ()
 Returns the 'primary' ip address of the local host.


Member Function Documentation

zapIStunMessage zapINetUtils::createStunMessage  ) 
 

Create an empty STUN message.

zapIStunMessage zapINetUtils::deserializeStunPacket in ACString  packet,
[array, size_is(count)] out unsigned short  unknownAttribs,
out unsigned long  count
 

Deserialize a STUN packet to a zapIStunMessage structure.

If parsing of the packet succeeds, unknownAttribs will contain any attributes with values less than or equal to 0x7fff which were not understood.

ACString zapINetUtils::getPrimaryHostAddress  ) 
 

Returns the 'primary' ip address of the local host.

This will be the first ip address returned by the dns resolver for the current hostname, or if this fails on Linux, the address of interface 'eth0'. If no ip address can be inferred, 127.0.0.1 will be returned.

Note: This is a temporary method that will be replaced by a mechanism for querying all local ip addresses at some point.

void zapINetUtils::resolveMappedAddress in zapIStunAddressResolveListener  listener,
in ACString  stunServer
 

Asynchronously resolve our mapped NAT address using the given stun server.

'stunServer' can be a domain name or IP address, optionally postfixed with ':' and port number.

PRInt32 zapINetUtils::snoopStunPacket in ACString  buffer  ) 
 

Checks if the buffer contains a (possibly partial) STUN packet.

retval will be -2 if the buffer definitely isn't a STUN packet, -1 if the buffer might be a STUN message but the buffer doesn't contain enough bytes to be sure yet, 0 if the buffer appears to be a STUN message but the length can't be determined yet (because it only contains the first 2 bytes of the header), or n>20 (== the length of the STUN message including header) if the buffer appears to be a (possibly partial) STUN message and the length can be determined.


The documentation for this interface was generated from the following file:
Generated on Fri Nov 21 12:00:06 2008 for Mozilla ZAP by  doxygen 1.4.4