00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #include "nsISupports.idl"
00038
00042 [scriptable, uuid(a86483da-1baf-4417-a644-562e0c3ae87a)]
00043 interface zapIStunMessage : nsISupports
00044 {
00048 ACString serialize();
00049
00058 void deserialize(in ACString packet,
00059 [array, size_is(count)] out
00060 unsigned short unknownAttribs,
00061 out unsigned long count);
00062
00067 const unsigned short BINDING_REQUEST_MESSAGE = 0x0001;
00068 const unsigned short BINDING_RESPONSE_MESSAGE = 0x0101;
00069 const unsigned short BINDING_ERROR_RESPONSE_MESSAGE = 0x0111;
00070 const unsigned short SHARED_SECRET_REQUEST_MESSAGE = 0x0002;
00071 const unsigned short SHARED_SECRET_RESPONSE_MESSAGE = 0x0102;
00072 const unsigned short SHARED_SECRET_ERROR_RESPONSE_MESSAGE = 0x0112;
00079 attribute unsigned short messageType;
00080
00084 attribute ACString transactionID;
00085
00089 void initTransactionID();
00090
00097 attribute boolean hasMappedAddressAttrib;
00098 attribute unsigned short mappedAddressPort;
00105 attribute ACString mappedAddress;
00112 attribute boolean hasResponseAddressAttrib;
00113 attribute unsigned short responseAddressPort;
00120 attribute ACString responseAddress;
00127 attribute boolean hasChangeRequestAttrib;
00128 attribute boolean changeRequestChangeIP;
00129 attribute boolean changeRequestChangePort;
00136 attribute boolean hasSourceAddressAttrib;
00137 attribute unsigned short sourceAddressPort;
00144 attribute ACString sourceAddress;
00151 attribute boolean hasChangedAddressAttrib;
00152 attribute unsigned short changedAddressPort;
00159 attribute ACString changedAddress;
00166 attribute boolean hasUsernameAttrib;
00170 attribute ACString username;
00177 attribute boolean hasPasswordAttrib;
00181 attribute ACString password;
00188 attribute boolean hasMessageIntegrityAttrib;
00192 attribute ACString messageIntegrity;
00197 void generateMessageIntegrityAttrib(in ACString key);
00204 boolean checkMessageIntegrity(in ACString key);
00211 attribute boolean hasErrorCodeAttrib;
00215 attribute ACString errorCode;
00220 attribute ACString errorCodeReasonPhrase;
00227 attribute boolean hasUnknownAttributesAttrib;
00228 void getUnknownAttributes(out unsigned long count,
00229 [array, size_is(count), retval] out
00230 unsigned short attribs);
00231 void setUnknownAttributes([array, size_is(count)] in unsigned short attribs,
00232 in unsigned long count);
00239 attribute boolean hasReflectedFromAttrib;
00240 attribute unsigned short reflectedFromPort;
00247 attribute ACString reflectedFrom;
00254 attribute boolean hasXORMappedAddressAttrib;
00255 attribute unsigned short XORMappedAddressPort;
00263 attribute ACString XORMappedAddress;
00270 attribute boolean hasXOROnlyAttrib;
00277 attribute boolean hasServerAttrib;
00282 attribute ACString server;
00284 };
00285
00286 %{ C++
00287
00288
00289 #define ZAP_STUNMESSAGE_CID \
00290 { 0x90557418, 0x0ede, 0x4c40, { 0x8f, 0xb8, 0x13, 0xd0, 0x09, 0x88, 0x26, 0x46 } }
00291
00292 #define ZAP_STUNMESSAGE_CONTRACTID "@mozilla.org/zap/stun-message;1"
00293 %}