1 /* 2 * libjingle 3 * Copyright 2004--2005, Google Inc. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright notice, 9 * this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright notice, 11 * this list of conditions and the following disclaimer in the documentation 12 * and/or other materials provided with the distribution. 13 * 3. The name of the author may not be used to endorse or promote products 14 * derived from this software without specific prior written permission. 15 * 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 19 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 */ 27 28 #include "talk/xmpp/constants.h" 29 30 #include <string> 31 32 #include "talk/base/basicdefs.h" 33 #include "talk/xmllite/xmlconstants.h" 34 #include "talk/xmllite/xmlelement.h" 35 #include "talk/xmllite/qname.h" 36 #include "talk/xmpp/jid.h" 37 38 namespace buzz { 39 40 // TODO: Remove static objects of complex types, particularly 41 // Jid and QName. 42 43 const char NS_CLIENT[] = "jabber:client"; 44 const char NS_SERVER[] = "jabber:server"; 45 const char NS_STREAM[] = "http://etherx.jabber.org/streams"; 46 const char NS_XSTREAM[] = "urn:ietf:params:xml:ns:xmpp-streams"; 47 const char NS_TLS[] = "urn:ietf:params:xml:ns:xmpp-tls"; 48 const char NS_SASL[] = "urn:ietf:params:xml:ns:xmpp-sasl"; 49 const char NS_BIND[] = "urn:ietf:params:xml:ns:xmpp-bind"; 50 const char NS_DIALBACK[] = "jabber:server:dialback"; 51 const char NS_SESSION[] = "urn:ietf:params:xml:ns:xmpp-session"; 52 const char NS_STANZA[] = "urn:ietf:params:xml:ns:xmpp-stanzas"; 53 const char NS_PRIVACY[] = "jabber:iq:privacy"; 54 const char NS_ROSTER[] = "jabber:iq:roster"; 55 const char NS_VCARD[] = "vcard-temp"; 56 const char NS_AVATAR_HASH[] = "google:avatar"; 57 const char NS_VCARD_UPDATE[] = "vcard-temp:x:update"; 58 const char STR_CLIENT[] = "client"; 59 const char STR_SERVER[] = "server"; 60 const char STR_STREAM[] = "stream"; 61 62 const char STR_GET[] = "get"; 63 const char STR_SET[] = "set"; 64 const char STR_RESULT[] = "result"; 65 const char STR_ERROR[] = "error"; 66 67 const char STR_FORM[] = "form"; 68 const char STR_SUBMIT[] = "submit"; 69 const char STR_TEXT_SINGLE[] = "text-single"; 70 const char STR_LIST_SINGLE[] = "list-single"; 71 const char STR_LIST_MULTI[] = "list-multi"; 72 const char STR_HIDDEN[] = "hidden"; 73 const char STR_FORM_TYPE[] = "FORM_TYPE"; 74 75 const char STR_FROM[] = "from"; 76 const char STR_TO[] = "to"; 77 const char STR_BOTH[] = "both"; 78 const char STR_REMOVE[] = "remove"; 79 const char STR_TRUE[] = "true"; 80 81 const char STR_TYPE[] = "type"; 82 const char STR_NAME[] = "name"; 83 const char STR_ID[] = "id"; 84 const char STR_JID[] = "jid"; 85 const char STR_SUBSCRIPTION[] = "subscription"; 86 const char STR_ASK[] = "ask"; 87 const char STR_X[] = "x"; 88 const char STR_GOOGLE_COM[] = "google.com"; 89 const char STR_GMAIL_COM[] = "gmail.com"; 90 const char STR_GOOGLEMAIL_COM[] = "googlemail.com"; 91 const char STR_DEFAULT_DOMAIN[] = "default.talk.google.com"; 92 const char STR_TALK_GOOGLE_COM[] = "talk.google.com"; 93 const char STR_TALKX_L_GOOGLE_COM[] = "talkx.l.google.com"; 94 const char STR_XMPP_GOOGLE_COM[] = "xmpp.google.com"; 95 const char STR_XMPPX_L_GOOGLE_COM[] = "xmppx.l.google.com"; 96 97 #ifdef FEATURE_ENABLE_VOICEMAIL 98 const char STR_VOICEMAIL[] = "voicemail"; 99 const char STR_OUTGOINGVOICEMAIL[] = "outgoingvoicemail"; 100 #endif 101 102 const char STR_UNAVAILABLE[] = "unavailable"; 103 104 const char NS_PING[] = "urn:xmpp:ping"; 105 const StaticQName QN_PING = { NS_PING, "ping" }; 106 107 const char NS_MUC_UNIQUE[] = "http://jabber.org/protocol/muc#unique"; 108 const StaticQName QN_MUC_UNIQUE_QUERY = { NS_MUC_UNIQUE, "unique" }; 109 const StaticQName QN_HANGOUT_ID = { STR_EMPTY, "hangout-id" }; 110 111 const char STR_GOOGLE_MUC_LOOKUP_JID[] = "lookup.groupchat.google.com"; 112 113 const char STR_MUC_ROOMCONFIG_ROOMNAME[] = "muc#roomconfig_roomname"; 114 const char STR_MUC_ROOMCONFIG_FEATURES[] = "muc#roomconfig_features"; 115 const char STR_MUC_ROOM_FEATURE_ENTERPRISE[] = "muc_enterprise"; 116 const char STR_MUC_ROOMCONFIG[] = "http://jabber.org/protocol/muc#roomconfig"; 117 const char STR_MUC_ROOM_FEATURE_HANGOUT[] = "muc_es"; 118 const char STR_MUC_ROOM_FEATURE_HANGOUT_LITE[] = "muc_lite"; 119 const char STR_MUC_ROOM_FEATURE_BROADCAST[] = "broadcast"; 120 const char STR_MUC_ROOM_FEATURE_MULTI_USER_VC[] = "muc_muvc"; 121 122 const char STR_ID_TYPE_CONVERSATION[] = "conversation"; 123 const char NS_GOOGLE_MUC_HANGOUT[] = "google:muc#hangout"; 124 const StaticQName QN_GOOGLE_MUC_HANGOUT_INVITE = 125 { NS_GOOGLE_MUC_HANGOUT, "invite" }; 126 const StaticQName QN_GOOGLE_MUC_HANGOUT_INVITE_TYPE = 127 { NS_GOOGLE_MUC_HANGOUT, "invite-type" }; 128 const StaticQName QN_ATTR_CREATE_ACTIVITY = 129 { STR_EMPTY, "create-activity" }; 130 const StaticQName QN_GOOGLE_MUC_HANGOUT_PUBLIC = 131 { NS_GOOGLE_MUC_HANGOUT, "public" }; 132 const StaticQName QN_GOOGLE_MUC_HANGOUT_INVITEE = 133 { NS_GOOGLE_MUC_HANGOUT, "invitee" }; 134 const StaticQName QN_GOOGLE_MUC_HANGOUT_NOTIFICATION_STATUS = 135 { NS_GOOGLE_MUC_HANGOUT, "notification-status" }; 136 const StaticQName QN_GOOGLE_MUC_HANGOUT_NOTIFICATION_TYPE = { 137 NS_GOOGLE_MUC_HANGOUT, "notification-type" }; 138 const StaticQName QN_GOOGLE_MUC_HANGOUT_HANGOUT_START_CONTEXT = { 139 NS_GOOGLE_MUC_HANGOUT, "hangout-start-context" }; 140 const StaticQName QN_GOOGLE_MUC_HANGOUT_CONVERSATION_ID = { 141 NS_GOOGLE_MUC_HANGOUT, "conversation-id" }; 142 143 const StaticQName QN_STREAM_STREAM = { NS_STREAM, STR_STREAM }; 144 const StaticQName QN_STREAM_FEATURES = { NS_STREAM, "features" }; 145 const StaticQName QN_STREAM_ERROR = { NS_STREAM, "error" }; 146 147 const StaticQName QN_XSTREAM_BAD_FORMAT = { NS_XSTREAM, "bad-format" }; 148 const StaticQName QN_XSTREAM_BAD_NAMESPACE_PREFIX = 149 { NS_XSTREAM, "bad-namespace-prefix" }; 150 const StaticQName QN_XSTREAM_CONFLICT = { NS_XSTREAM, "conflict" }; 151 const StaticQName QN_XSTREAM_CONNECTION_TIMEOUT = 152 { NS_XSTREAM, "connection-timeout" }; 153 const StaticQName QN_XSTREAM_HOST_GONE = { NS_XSTREAM, "host-gone" }; 154 const StaticQName QN_XSTREAM_HOST_UNKNOWN = { NS_XSTREAM, "host-unknown" }; 155 const StaticQName QN_XSTREAM_IMPROPER_ADDRESSIING = 156 { NS_XSTREAM, "improper-addressing" }; 157 const StaticQName QN_XSTREAM_INTERNAL_SERVER_ERROR = 158 { NS_XSTREAM, "internal-server-error" }; 159 const StaticQName QN_XSTREAM_INVALID_FROM = { NS_XSTREAM, "invalid-from" }; 160 const StaticQName QN_XSTREAM_INVALID_ID = { NS_XSTREAM, "invalid-id" }; 161 const StaticQName QN_XSTREAM_INVALID_NAMESPACE = 162 { NS_XSTREAM, "invalid-namespace" }; 163 const StaticQName QN_XSTREAM_INVALID_XML = { NS_XSTREAM, "invalid-xml" }; 164 const StaticQName QN_XSTREAM_NOT_AUTHORIZED = { NS_XSTREAM, "not-authorized" }; 165 const StaticQName QN_XSTREAM_POLICY_VIOLATION = 166 { NS_XSTREAM, "policy-violation" }; 167 const StaticQName QN_XSTREAM_REMOTE_CONNECTION_FAILED = 168 { NS_XSTREAM, "remote-connection-failed" }; 169 const StaticQName QN_XSTREAM_RESOURCE_CONSTRAINT = 170 { NS_XSTREAM, "resource-constraint" }; 171 const StaticQName QN_XSTREAM_RESTRICTED_XML = { NS_XSTREAM, "restricted-xml" }; 172 const StaticQName QN_XSTREAM_SEE_OTHER_HOST = { NS_XSTREAM, "see-other-host" }; 173 const StaticQName QN_XSTREAM_SYSTEM_SHUTDOWN = 174 { NS_XSTREAM, "system-shutdown" }; 175 const StaticQName QN_XSTREAM_UNDEFINED_CONDITION = 176 { NS_XSTREAM, "undefined-condition" }; 177 const StaticQName QN_XSTREAM_UNSUPPORTED_ENCODING = 178 { NS_XSTREAM, "unsupported-encoding" }; 179 const StaticQName QN_XSTREAM_UNSUPPORTED_STANZA_TYPE = 180 { NS_XSTREAM, "unsupported-stanza-type" }; 181 const StaticQName QN_XSTREAM_UNSUPPORTED_VERSION = 182 { NS_XSTREAM, "unsupported-version" }; 183 const StaticQName QN_XSTREAM_XML_NOT_WELL_FORMED = 184 { NS_XSTREAM, "xml-not-well-formed" }; 185 const StaticQName QN_XSTREAM_TEXT = { NS_XSTREAM, "text" }; 186 187 const StaticQName QN_TLS_STARTTLS = { NS_TLS, "starttls" }; 188 const StaticQName QN_TLS_REQUIRED = { NS_TLS, "required" }; 189 const StaticQName QN_TLS_PROCEED = { NS_TLS, "proceed" }; 190 const StaticQName QN_TLS_FAILURE = { NS_TLS, "failure" }; 191 192 const StaticQName QN_SASL_MECHANISMS = { NS_SASL, "mechanisms" }; 193 const StaticQName QN_SASL_MECHANISM = { NS_SASL, "mechanism" }; 194 const StaticQName QN_SASL_AUTH = { NS_SASL, "auth" }; 195 const StaticQName QN_SASL_CHALLENGE = { NS_SASL, "challenge" }; 196 const StaticQName QN_SASL_RESPONSE = { NS_SASL, "response" }; 197 const StaticQName QN_SASL_ABORT = { NS_SASL, "abort" }; 198 const StaticQName QN_SASL_SUCCESS = { NS_SASL, "success" }; 199 const StaticQName QN_SASL_FAILURE = { NS_SASL, "failure" }; 200 const StaticQName QN_SASL_ABORTED = { NS_SASL, "aborted" }; 201 const StaticQName QN_SASL_INCORRECT_ENCODING = 202 { NS_SASL, "incorrect-encoding" }; 203 const StaticQName QN_SASL_INVALID_AUTHZID = { NS_SASL, "invalid-authzid" }; 204 const StaticQName QN_SASL_INVALID_MECHANISM = { NS_SASL, "invalid-mechanism" }; 205 const StaticQName QN_SASL_MECHANISM_TOO_WEAK = 206 { NS_SASL, "mechanism-too-weak" }; 207 const StaticQName QN_SASL_NOT_AUTHORIZED = { NS_SASL, "not-authorized" }; 208 const StaticQName QN_SASL_TEMPORARY_AUTH_FAILURE = 209 { NS_SASL, "temporary-auth-failure" }; 210 211 // These are non-standard. 212 const char NS_GOOGLE_AUTH_PROTOCOL[] = 213 "http://www.google.com/talk/protocol/auth"; 214 const StaticQName QN_GOOGLE_AUTH_CLIENT_USES_FULL_BIND_RESULT = 215 { NS_GOOGLE_AUTH_PROTOCOL, "client-uses-full-bind-result" }; 216 const char NS_GOOGLE_AUTH_OLD[] = "google:auth"; 217 const StaticQName QN_GOOGLE_ALLOW_NON_GOOGLE_ID_XMPP_LOGIN = 218 { NS_GOOGLE_AUTH_PROTOCOL, "allow-non-google-login" }; 219 const StaticQName QN_GOOGLE_AUTH_SERVICE = 220 { NS_GOOGLE_AUTH_PROTOCOL, "service" }; 221 222 const StaticQName QN_DIALBACK_RESULT = { NS_DIALBACK, "result" }; 223 const StaticQName QN_DIALBACK_VERIFY = { NS_DIALBACK, "verify" }; 224 225 const StaticQName QN_STANZA_BAD_REQUEST = { NS_STANZA, "bad-request" }; 226 const StaticQName QN_STANZA_CONFLICT = { NS_STANZA, "conflict" }; 227 const StaticQName QN_STANZA_FEATURE_NOT_IMPLEMENTED = 228 { NS_STANZA, "feature-not-implemented" }; 229 const StaticQName QN_STANZA_FORBIDDEN = { NS_STANZA, "forbidden" }; 230 const StaticQName QN_STANZA_GONE = { NS_STANZA, "gone" }; 231 const StaticQName QN_STANZA_INTERNAL_SERVER_ERROR = 232 { NS_STANZA, "internal-server-error" }; 233 const StaticQName QN_STANZA_ITEM_NOT_FOUND = { NS_STANZA, "item-not-found" }; 234 const StaticQName QN_STANZA_JID_MALFORMED = { NS_STANZA, "jid-malformed" }; 235 const StaticQName QN_STANZA_NOT_ACCEPTABLE = { NS_STANZA, "not-acceptable" }; 236 const StaticQName QN_STANZA_NOT_ALLOWED = { NS_STANZA, "not-allowed" }; 237 const StaticQName QN_STANZA_PAYMENT_REQUIRED = 238 { NS_STANZA, "payment-required" }; 239 const StaticQName QN_STANZA_RECIPIENT_UNAVAILABLE = 240 { NS_STANZA, "recipient-unavailable" }; 241 const StaticQName QN_STANZA_REDIRECT = { NS_STANZA, "redirect" }; 242 const StaticQName QN_STANZA_REGISTRATION_REQUIRED = 243 { NS_STANZA, "registration-required" }; 244 const StaticQName QN_STANZA_REMOTE_SERVER_NOT_FOUND = 245 { NS_STANZA, "remote-server-not-found" }; 246 const StaticQName QN_STANZA_REMOTE_SERVER_TIMEOUT = 247 { NS_STANZA, "remote-server-timeout" }; 248 const StaticQName QN_STANZA_RESOURCE_CONSTRAINT = 249 { NS_STANZA, "resource-constraint" }; 250 const StaticQName QN_STANZA_SERVICE_UNAVAILABLE = 251 { NS_STANZA, "service-unavailable" }; 252 const StaticQName QN_STANZA_SUBSCRIPTION_REQUIRED = 253 { NS_STANZA, "subscription-required" }; 254 const StaticQName QN_STANZA_UNDEFINED_CONDITION = 255 { NS_STANZA, "undefined-condition" }; 256 const StaticQName QN_STANZA_UNEXPECTED_REQUEST = 257 { NS_STANZA, "unexpected-request" }; 258 const StaticQName QN_STANZA_TEXT = { NS_STANZA, "text" }; 259 260 const StaticQName QN_BIND_BIND = { NS_BIND, "bind" }; 261 const StaticQName QN_BIND_RESOURCE = { NS_BIND, "resource" }; 262 const StaticQName QN_BIND_JID = { NS_BIND, "jid" }; 263 264 const StaticQName QN_MESSAGE = { NS_CLIENT, "message" }; 265 const StaticQName QN_BODY = { NS_CLIENT, "body" }; 266 const StaticQName QN_SUBJECT = { NS_CLIENT, "subject" }; 267 const StaticQName QN_THREAD = { NS_CLIENT, "thread" }; 268 const StaticQName QN_PRESENCE = { NS_CLIENT, "presence" }; 269 const StaticQName QN_SHOW = { NS_CLIENT, "show" }; 270 const StaticQName QN_STATUS = { NS_CLIENT, "status" }; 271 const StaticQName QN_LANG = { NS_CLIENT, "lang" }; 272 const StaticQName QN_PRIORITY = { NS_CLIENT, "priority" }; 273 const StaticQName QN_IQ = { NS_CLIENT, "iq" }; 274 const StaticQName QN_ERROR = { NS_CLIENT, "error" }; 275 276 const StaticQName QN_SERVER_MESSAGE = { NS_SERVER, "message" }; 277 const StaticQName QN_SERVER_BODY = { NS_SERVER, "body" }; 278 const StaticQName QN_SERVER_SUBJECT = { NS_SERVER, "subject" }; 279 const StaticQName QN_SERVER_THREAD = { NS_SERVER, "thread" }; 280 const StaticQName QN_SERVER_PRESENCE = { NS_SERVER, "presence" }; 281 const StaticQName QN_SERVER_SHOW = { NS_SERVER, "show" }; 282 const StaticQName QN_SERVER_STATUS = { NS_SERVER, "status" }; 283 const StaticQName QN_SERVER_LANG = { NS_SERVER, "lang" }; 284 const StaticQName QN_SERVER_PRIORITY = { NS_SERVER, "priority" }; 285 const StaticQName QN_SERVER_IQ = { NS_SERVER, "iq" }; 286 const StaticQName QN_SERVER_ERROR = { NS_SERVER, "error" }; 287 288 const StaticQName QN_SESSION_SESSION = { NS_SESSION, "session" }; 289 290 const StaticQName QN_PRIVACY_QUERY = { NS_PRIVACY, "query" }; 291 const StaticQName QN_PRIVACY_ACTIVE = { NS_PRIVACY, "active" }; 292 const StaticQName QN_PRIVACY_DEFAULT = { NS_PRIVACY, "default" }; 293 const StaticQName QN_PRIVACY_LIST = { NS_PRIVACY, "list" }; 294 const StaticQName QN_PRIVACY_ITEM = { NS_PRIVACY, "item" }; 295 const StaticQName QN_PRIVACY_IQ = { NS_PRIVACY, "iq" }; 296 const StaticQName QN_PRIVACY_MESSAGE = { NS_PRIVACY, "message" }; 297 const StaticQName QN_PRIVACY_PRESENCE_IN = { NS_PRIVACY, "presence-in" }; 298 const StaticQName QN_PRIVACY_PRESENCE_OUT = { NS_PRIVACY, "presence-out" }; 299 300 const StaticQName QN_ROSTER_QUERY = { NS_ROSTER, "query" }; 301 const StaticQName QN_ROSTER_ITEM = { NS_ROSTER, "item" }; 302 const StaticQName QN_ROSTER_GROUP = { NS_ROSTER, "group" }; 303 304 const StaticQName QN_VCARD = { NS_VCARD, "vCard" }; 305 const StaticQName QN_VCARD_FN = { NS_VCARD, "FN" }; 306 const StaticQName QN_VCARD_PHOTO = { NS_VCARD, "PHOTO" }; 307 const StaticQName QN_VCARD_PHOTO_BINVAL = { NS_VCARD, "BINVAL" }; 308 const StaticQName QN_VCARD_AVATAR_HASH = { NS_AVATAR_HASH, "hash" }; 309 const StaticQName QN_VCARD_AVATAR_HASH_MODIFIED = 310 { NS_AVATAR_HASH, "modified" }; 311 312 const StaticQName QN_NAME = { STR_EMPTY, "name" }; 313 const StaticQName QN_AFFILIATION = { STR_EMPTY, "affiliation" }; 314 const StaticQName QN_ROLE = { STR_EMPTY, "role" }; 315 316 #if defined(FEATURE_ENABLE_PSTN) 317 const StaticQName QN_VCARD_TEL = { NS_VCARD, "TEL" }; 318 const StaticQName QN_VCARD_VOICE = { NS_VCARD, "VOICE" }; 319 const StaticQName QN_VCARD_HOME = { NS_VCARD, "HOME" }; 320 const StaticQName QN_VCARD_WORK = { NS_VCARD, "WORK" }; 321 const StaticQName QN_VCARD_CELL = { NS_VCARD, "CELL" }; 322 const StaticQName QN_VCARD_NUMBER = { NS_VCARD, "NUMBER" }; 323 #endif 324 325 const StaticQName QN_XML_LANG = { NS_XML, "lang" }; 326 327 const StaticQName QN_ENCODING = { STR_EMPTY, STR_ENCODING }; 328 const StaticQName QN_VERSION = { STR_EMPTY, STR_VERSION }; 329 const StaticQName QN_TO = { STR_EMPTY, "to" }; 330 const StaticQName QN_FROM = { STR_EMPTY, "from" }; 331 const StaticQName QN_TYPE = { STR_EMPTY, "type" }; 332 const StaticQName QN_ID = { STR_EMPTY, "id" }; 333 const StaticQName QN_CODE = { STR_EMPTY, "code" }; 334 335 const StaticQName QN_VALUE = { STR_EMPTY, "value" }; 336 const StaticQName QN_ACTION = { STR_EMPTY, "action" }; 337 const StaticQName QN_ORDER = { STR_EMPTY, "order" }; 338 const StaticQName QN_MECHANISM = { STR_EMPTY, "mechanism" }; 339 const StaticQName QN_ASK = { STR_EMPTY, "ask" }; 340 const StaticQName QN_JID = { STR_EMPTY, "jid" }; 341 const StaticQName QN_NICK = { STR_EMPTY, "nick" }; 342 const StaticQName QN_SUBSCRIPTION = { STR_EMPTY, "subscription" }; 343 const StaticQName QN_TITLE1 = { STR_EMPTY, "title1" }; 344 const StaticQName QN_TITLE2 = { STR_EMPTY, "title2" }; 345 const StaticQName QN_SOURCE = { STR_EMPTY, "source" }; 346 const StaticQName QN_TIME = { STR_EMPTY, "time" }; 347 348 const StaticQName QN_XMLNS_CLIENT = { NS_XMLNS, STR_CLIENT }; 349 const StaticQName QN_XMLNS_SERVER = { NS_XMLNS, STR_SERVER }; 350 const StaticQName QN_XMLNS_STREAM = { NS_XMLNS, STR_STREAM }; 351 352 353 // Presence 354 const char STR_SHOW_AWAY[] = "away"; 355 const char STR_SHOW_CHAT[] = "chat"; 356 const char STR_SHOW_DND[] = "dnd"; 357 const char STR_SHOW_XA[] = "xa"; 358 const char STR_SHOW_OFFLINE[] = "offline"; 359 360 const char NS_GOOGLE_PSTN_CONFERENCE[] = "http://www.google.com/pstn-conference"; 361 const StaticQName QN_GOOGLE_PSTN_CONFERENCE_STATUS = { NS_GOOGLE_PSTN_CONFERENCE, "status" }; 362 const StaticQName QN_ATTR_STATUS = { STR_EMPTY, "status" }; 363 364 // Presence connection status 365 const char STR_PSTN_CONFERENCE_STATUS_CONNECTING[] = "connecting"; 366 const char STR_PSTN_CONFERENCE_STATUS_CONNECTED[] = "connected"; 367 const char STR_PSTN_CONFERENCE_STATUS_HANGUP[] = "hangup"; 368 369 // Subscription 370 const char STR_SUBSCRIBE[] = "subscribe"; 371 const char STR_SUBSCRIBED[] = "subscribed"; 372 const char STR_UNSUBSCRIBE[] = "unsubscribe"; 373 const char STR_UNSUBSCRIBED[] = "unsubscribed"; 374 375 // Google Invite 376 const char NS_GOOGLE_SUBSCRIBE[] = "google:subscribe"; 377 const StaticQName QN_INVITATION = { NS_GOOGLE_SUBSCRIBE, "invitation" }; 378 const StaticQName QN_INVITE_NAME = { NS_GOOGLE_SUBSCRIBE, "name" }; 379 const StaticQName QN_INVITE_SUBJECT = { NS_GOOGLE_SUBSCRIBE, "subject" }; 380 const StaticQName QN_INVITE_MESSAGE = { NS_GOOGLE_SUBSCRIBE, "body" }; 381 382 // Kick 383 const char NS_GOOGLE_MUC_ADMIN[] = "google:muc#admin"; 384 const StaticQName QN_GOOGLE_MUC_ADMIN_QUERY = { NS_GOOGLE_MUC_ADMIN, "query" }; 385 const StaticQName QN_GOOGLE_MUC_ADMIN_QUERY_ITEM = 386 { NS_GOOGLE_MUC_ADMIN, "item" }; 387 const StaticQName QN_GOOGLE_MUC_ADMIN_QUERY_ITEM_REASON = 388 { NS_GOOGLE_MUC_ADMIN, "reason" }; 389 390 // PubSub: http://xmpp.org/extensions/xep-0060.html 391 const char NS_PUBSUB[] = "http://jabber.org/protocol/pubsub"; 392 const StaticQName QN_PUBSUB = { NS_PUBSUB, "pubsub" }; 393 const StaticQName QN_PUBSUB_ITEMS = { NS_PUBSUB, "items" }; 394 const StaticQName QN_PUBSUB_ITEM = { NS_PUBSUB, "item" }; 395 const StaticQName QN_PUBSUB_PUBLISH = { NS_PUBSUB, "publish" }; 396 const StaticQName QN_PUBSUB_RETRACT = { NS_PUBSUB, "retract" }; 397 const StaticQName QN_ATTR_PUBLISHER = { STR_EMPTY, "publisher" }; 398 399 const char NS_PUBSUB_EVENT[] = "http://jabber.org/protocol/pubsub#event"; 400 const StaticQName QN_NODE = { STR_EMPTY, "node" }; 401 const StaticQName QN_PUBSUB_EVENT = { NS_PUBSUB_EVENT, "event" }; 402 const StaticQName QN_PUBSUB_EVENT_ITEMS = { NS_PUBSUB_EVENT, "items" }; 403 const StaticQName QN_PUBSUB_EVENT_ITEM = { NS_PUBSUB_EVENT, "item" }; 404 const StaticQName QN_PUBSUB_EVENT_RETRACT = { NS_PUBSUB_EVENT, "retract" }; 405 const StaticQName QN_NOTIFY = { STR_EMPTY, "notify" }; 406 407 const char NS_PRESENTER[] = "google:presenter"; 408 const StaticQName QN_PRESENTER_PRESENTER = { NS_PRESENTER, "presenter" }; 409 const StaticQName QN_PRESENTER_PRESENTATION_ITEM = 410 { NS_PRESENTER, "presentation-item" }; 411 const StaticQName QN_PRESENTER_PRESENTATION_TYPE = 412 { NS_PRESENTER, "presentation-type" }; 413 const StaticQName QN_PRESENTER_PRESENTATION_ID = 414 { NS_PRESENTER, "presentation-id" }; 415 416 // JEP 0030 417 const StaticQName QN_CATEGORY = { STR_EMPTY, "category" }; 418 const StaticQName QN_VAR = { STR_EMPTY, "var" }; 419 const char NS_DISCO_INFO[] = "http://jabber.org/protocol/disco#info"; 420 const char NS_DISCO_ITEMS[] = "http://jabber.org/protocol/disco#items"; 421 const StaticQName QN_DISCO_INFO_QUERY = { NS_DISCO_INFO, "query" }; 422 const StaticQName QN_DISCO_IDENTITY = { NS_DISCO_INFO, "identity" }; 423 const StaticQName QN_DISCO_FEATURE = { NS_DISCO_INFO, "feature" }; 424 425 const StaticQName QN_DISCO_ITEMS_QUERY = { NS_DISCO_ITEMS, "query" }; 426 const StaticQName QN_DISCO_ITEM = { NS_DISCO_ITEMS, "item" }; 427 428 // JEP 0020 429 const char NS_FEATURE[] = "http://jabber.org/protocol/feature-neg"; 430 const StaticQName QN_FEATURE_FEATURE = { NS_FEATURE, "feature" }; 431 432 // JEP 0004 433 const char NS_XDATA[] = "jabber:x:data"; 434 const StaticQName QN_XDATA_X = { NS_XDATA, "x" }; 435 const StaticQName QN_XDATA_INSTRUCTIONS = { NS_XDATA, "instructions" }; 436 const StaticQName QN_XDATA_TITLE = { NS_XDATA, "title" }; 437 const StaticQName QN_XDATA_FIELD = { NS_XDATA, "field" }; 438 const StaticQName QN_XDATA_REPORTED = { NS_XDATA, "reported" }; 439 const StaticQName QN_XDATA_ITEM = { NS_XDATA, "item" }; 440 const StaticQName QN_XDATA_DESC = { NS_XDATA, "desc" }; 441 const StaticQName QN_XDATA_REQUIRED = { NS_XDATA, "required" }; 442 const StaticQName QN_XDATA_VALUE = { NS_XDATA, "value" }; 443 const StaticQName QN_XDATA_OPTION = { NS_XDATA, "option" }; 444 445 // JEP 0045 446 const char NS_MUC[] = "http://jabber.org/protocol/muc"; 447 const StaticQName QN_MUC_X = { NS_MUC, "x" }; 448 const StaticQName QN_MUC_ITEM = { NS_MUC, "item" }; 449 const StaticQName QN_MUC_AFFILIATION = { NS_MUC, "affiliation" }; 450 const StaticQName QN_MUC_ROLE = { NS_MUC, "role" }; 451 const char STR_AFFILIATION_NONE[] = "none"; 452 const char STR_ROLE_PARTICIPANT[] = "participant"; 453 454 const char NS_GOOGLE_SESSION[] = "http://www.google.com/session"; 455 const StaticQName QN_GOOGLE_CIRCLE_ID = { STR_EMPTY, "google-circle-id" }; 456 const StaticQName QN_GOOGLE_USER_ID = { STR_EMPTY, "google-user-id" }; 457 const StaticQName QN_GOOGLE_SESSION_BLOCKED = { NS_GOOGLE_SESSION, "blocked" }; 458 const StaticQName QN_GOOGLE_SESSION_BLOCKING = 459 { NS_GOOGLE_SESSION, "blocking" }; 460 461 const char NS_MUC_OWNER[] = "http://jabber.org/protocol/muc#owner"; 462 const StaticQName QN_MUC_OWNER_QUERY = { NS_MUC_OWNER, "query" }; 463 464 const char NS_MUC_USER[] = "http://jabber.org/protocol/muc#user"; 465 const StaticQName QN_MUC_USER_CONTINUE = { NS_MUC_USER, "continue" }; 466 const StaticQName QN_MUC_USER_X = { NS_MUC_USER, "x" }; 467 const StaticQName QN_MUC_USER_ITEM = { NS_MUC_USER, "item" }; 468 const StaticQName QN_MUC_USER_STATUS = { NS_MUC_USER, "status" }; 469 const StaticQName QN_MUC_USER_REASON = { NS_MUC_USER, "reason" }; 470 const StaticQName QN_MUC_USER_ABUSE_VIOLATION = { NS_MUC_USER, "abuse-violation" }; 471 472 // JEP 0055 - Jabber Search 473 const char NS_SEARCH[] = "jabber:iq:search"; 474 const StaticQName QN_SEARCH_QUERY = { NS_SEARCH, "query" }; 475 const StaticQName QN_SEARCH_ITEM = { NS_SEARCH, "item" }; 476 const StaticQName QN_SEARCH_ROOM_NAME = { NS_SEARCH, "room-name" }; 477 const StaticQName QN_SEARCH_ROOM_DOMAIN = { NS_SEARCH, "room-domain" }; 478 const StaticQName QN_SEARCH_ROOM_JID = { NS_SEARCH, "room-jid" }; 479 const StaticQName QN_SEARCH_HANGOUT_ID = { NS_SEARCH, "hangout-id" }; 480 const StaticQName QN_SEARCH_EXTERNAL_ID = { NS_SEARCH, "external-id" }; 481 482 // JEP 0115 483 const char NS_CAPS[] = "http://jabber.org/protocol/caps"; 484 const StaticQName QN_CAPS_C = { NS_CAPS, "c" }; 485 const StaticQName QN_VER = { STR_EMPTY, "ver" }; 486 const StaticQName QN_EXT = { STR_EMPTY, "ext" }; 487 488 // JEP 0153 489 const char kNSVCard[] = "vcard-temp:x:update"; 490 const StaticQName kQnVCardX = { kNSVCard, "x" }; 491 const StaticQName kQnVCardPhoto = { kNSVCard, "photo" }; 492 493 // JEP 0172 User Nickname 494 const char NS_NICKNAME[] = "http://jabber.org/protocol/nick"; 495 const StaticQName QN_NICKNAME = { NS_NICKNAME, "nick" }; 496 497 // JEP 0085 chat state 498 const char NS_CHATSTATE[] = "http://jabber.org/protocol/chatstates"; 499 const StaticQName QN_CS_ACTIVE = { NS_CHATSTATE, "active" }; 500 const StaticQName QN_CS_COMPOSING = { NS_CHATSTATE, "composing" }; 501 const StaticQName QN_CS_PAUSED = { NS_CHATSTATE, "paused" }; 502 const StaticQName QN_CS_INACTIVE = { NS_CHATSTATE, "inactive" }; 503 const StaticQName QN_CS_GONE = { NS_CHATSTATE, "gone" }; 504 505 // JEP 0091 Delayed Delivery 506 const char kNSDelay[] = "jabber:x:delay"; 507 const StaticQName kQnDelayX = { kNSDelay, "x" }; 508 const StaticQName kQnStamp = { STR_EMPTY, "stamp" }; 509 510 // Google time stamping (higher resolution) 511 const char kNSTimestamp[] = "google:timestamp"; 512 const StaticQName kQnTime = { kNSTimestamp, "time" }; 513 const StaticQName kQnMilliseconds = { STR_EMPTY, "ms" }; 514 515 // Jingle Info 516 const char NS_JINGLE_INFO[] = "google:jingleinfo"; 517 const StaticQName QN_JINGLE_INFO_QUERY = { NS_JINGLE_INFO, "query" }; 518 const StaticQName QN_JINGLE_INFO_STUN = { NS_JINGLE_INFO, "stun" }; 519 const StaticQName QN_JINGLE_INFO_RELAY = { NS_JINGLE_INFO, "relay" }; 520 const StaticQName QN_JINGLE_INFO_SERVER = { NS_JINGLE_INFO, "server" }; 521 const StaticQName QN_JINGLE_INFO_TOKEN = { NS_JINGLE_INFO, "token" }; 522 const StaticQName QN_JINGLE_INFO_HOST = { STR_EMPTY, "host" }; 523 const StaticQName QN_JINGLE_INFO_TCP = { STR_EMPTY, "tcp" }; 524 const StaticQName QN_JINGLE_INFO_UDP = { STR_EMPTY, "udp" }; 525 const StaticQName QN_JINGLE_INFO_TCPSSL = { STR_EMPTY, "tcpssl" }; 526 527 // Call Performance Logging 528 const char NS_GOOGLE_CALLPERF_STATS[] = "google:call-perf-stats"; 529 const StaticQName QN_CALLPERF_STATS = 530 { NS_GOOGLE_CALLPERF_STATS, "callPerfStats" }; 531 const StaticQName QN_CALLPERF_SESSIONID = { STR_EMPTY, "sessionId" }; 532 const StaticQName QN_CALLPERF_LOCALUSER = { STR_EMPTY, "localUser" }; 533 const StaticQName QN_CALLPERF_REMOTEUSER = { STR_EMPTY, "remoteUser" }; 534 const StaticQName QN_CALLPERF_STARTTIME = { STR_EMPTY, "startTime" }; 535 const StaticQName QN_CALLPERF_CALL_LENGTH = { STR_EMPTY, "callLength" }; 536 const StaticQName QN_CALLPERF_CALL_ACCEPTED = { STR_EMPTY, "callAccepted" }; 537 const StaticQName QN_CALLPERF_CALL_ERROR_CODE = { STR_EMPTY, "callErrorCode" }; 538 const StaticQName QN_CALLPERF_TERMINATE_CODE = { STR_EMPTY, "terminateCode" }; 539 const StaticQName QN_CALLPERF_DATAPOINT = 540 { NS_GOOGLE_CALLPERF_STATS, "dataPoint" }; 541 const StaticQName QN_CALLPERF_DATAPOINT_TIME = { STR_EMPTY, "timeStamp" }; 542 const StaticQName QN_CALLPERF_DATAPOINT_FRACTION_LOST = 543 { STR_EMPTY, "fraction_lost" }; 544 const StaticQName QN_CALLPERF_DATAPOINT_CUM_LOST = { STR_EMPTY, "cum_lost" }; 545 const StaticQName QN_CALLPERF_DATAPOINT_EXT_MAX = { STR_EMPTY, "ext_max" }; 546 const StaticQName QN_CALLPERF_DATAPOINT_JITTER = { STR_EMPTY, "jitter" }; 547 const StaticQName QN_CALLPERF_DATAPOINT_RTT = { STR_EMPTY, "RTT" }; 548 const StaticQName QN_CALLPERF_DATAPOINT_BYTES_R = 549 { STR_EMPTY, "bytesReceived" }; 550 const StaticQName QN_CALLPERF_DATAPOINT_PACKETS_R = 551 { STR_EMPTY, "packetsReceived" }; 552 const StaticQName QN_CALLPERF_DATAPOINT_BYTES_S = { STR_EMPTY, "bytesSent" }; 553 const StaticQName QN_CALLPERF_DATAPOINT_PACKETS_S = 554 { STR_EMPTY, "packetsSent" }; 555 const StaticQName QN_CALLPERF_DATAPOINT_PROCESS_CPU = 556 { STR_EMPTY, "processCpu" }; 557 const StaticQName QN_CALLPERF_DATAPOINT_SYSTEM_CPU = { STR_EMPTY, "systemCpu" }; 558 const StaticQName QN_CALLPERF_DATAPOINT_CPUS = { STR_EMPTY, "cpus" }; 559 const StaticQName QN_CALLPERF_CONNECTION = 560 { NS_GOOGLE_CALLPERF_STATS, "connection" }; 561 const StaticQName QN_CALLPERF_CONNECTION_LOCAL_ADDRESS = 562 { STR_EMPTY, "localAddress" }; 563 const StaticQName QN_CALLPERF_CONNECTION_REMOTE_ADDRESS = 564 { STR_EMPTY, "remoteAddress" }; 565 const StaticQName QN_CALLPERF_CONNECTION_FLAGS = { STR_EMPTY, "flags" }; 566 const StaticQName QN_CALLPERF_CONNECTION_RTT = { STR_EMPTY, "rtt" }; 567 const StaticQName QN_CALLPERF_CONNECTION_TOTAL_BYTES_S = 568 { STR_EMPTY, "totalBytesSent" }; 569 const StaticQName QN_CALLPERF_CONNECTION_BYTES_SECOND_S = 570 { STR_EMPTY, "bytesSecondSent" }; 571 const StaticQName QN_CALLPERF_CONNECTION_TOTAL_BYTES_R = 572 { STR_EMPTY, "totalBytesRecv" }; 573 const StaticQName QN_CALLPERF_CONNECTION_BYTES_SECOND_R = 574 { STR_EMPTY, "bytesSecondRecv" }; 575 const StaticQName QN_CALLPERF_CANDIDATE = 576 { NS_GOOGLE_CALLPERF_STATS, "candidate" }; 577 const StaticQName QN_CALLPERF_CANDIDATE_ENDPOINT = { STR_EMPTY, "endpoint" }; 578 const StaticQName QN_CALLPERF_CANDIDATE_PROTOCOL = { STR_EMPTY, "protocol" }; 579 const StaticQName QN_CALLPERF_CANDIDATE_ADDRESS = { STR_EMPTY, "address" }; 580 const StaticQName QN_CALLPERF_MEDIA = { NS_GOOGLE_CALLPERF_STATS, "media" }; 581 const StaticQName QN_CALLPERF_MEDIA_DIRECTION = { STR_EMPTY, "direction" }; 582 const StaticQName QN_CALLPERF_MEDIA_SSRC = { STR_EMPTY, "SSRC" }; 583 const StaticQName QN_CALLPERF_MEDIA_ENERGY = { STR_EMPTY, "energy" }; 584 const StaticQName QN_CALLPERF_MEDIA_FIR = { STR_EMPTY, "fir" }; 585 const StaticQName QN_CALLPERF_MEDIA_NACK = { STR_EMPTY, "nack" }; 586 const StaticQName QN_CALLPERF_MEDIA_FPS = { STR_EMPTY, "fps" }; 587 const StaticQName QN_CALLPERF_MEDIA_FPS_NETWORK = { STR_EMPTY, "fpsNetwork" }; 588 const StaticQName QN_CALLPERF_MEDIA_FPS_DECODED = { STR_EMPTY, "fpsDecoded" }; 589 const StaticQName QN_CALLPERF_MEDIA_JITTER_BUFFER_SIZE = 590 { STR_EMPTY, "jitterBufferSize" }; 591 const StaticQName QN_CALLPERF_MEDIA_PREFERRED_JITTER_BUFFER_SIZE = 592 { STR_EMPTY, "preferredJitterBufferSize" }; 593 const StaticQName QN_CALLPERF_MEDIA_TOTAL_PLAYOUT_DELAY = 594 { STR_EMPTY, "totalPlayoutDelay" }; 595 596 // Muc invites. 597 const StaticQName QN_MUC_USER_INVITE = { NS_MUC_USER, "invite" }; 598 599 // Multiway audio/video. 600 const char NS_GOOGLE_MUC_USER[] = "google:muc#user"; 601 const StaticQName QN_GOOGLE_MUC_USER_AVAILABLE_MEDIA = 602 { NS_GOOGLE_MUC_USER, "available-media" }; 603 const StaticQName QN_GOOGLE_MUC_USER_ENTRY = { NS_GOOGLE_MUC_USER, "entry" }; 604 const StaticQName QN_GOOGLE_MUC_USER_MEDIA = { NS_GOOGLE_MUC_USER, "media" }; 605 const StaticQName QN_GOOGLE_MUC_USER_TYPE = { NS_GOOGLE_MUC_USER, "type" }; 606 const StaticQName QN_GOOGLE_MUC_USER_SRC_ID = { NS_GOOGLE_MUC_USER, "src-id" }; 607 const StaticQName QN_GOOGLE_MUC_USER_STATUS = { NS_GOOGLE_MUC_USER, "status" }; 608 const StaticQName QN_CLIENT_VERSION = { NS_GOOGLE_MUC_USER, "client-version" }; 609 const StaticQName QN_LOCALE = { NS_GOOGLE_MUC_USER, "locale" }; 610 const StaticQName QN_LABEL = { STR_EMPTY, "label" }; 611 612 const char NS_GOOGLE_MUC_MEDIA[] = "google:muc#media"; 613 const StaticQName QN_GOOGLE_MUC_AUDIO_MUTE = 614 { NS_GOOGLE_MUC_MEDIA, "audio-mute" }; 615 const StaticQName QN_GOOGLE_MUC_VIDEO_MUTE = 616 { NS_GOOGLE_MUC_MEDIA, "video-mute" }; 617 const StaticQName QN_GOOGLE_MUC_VIDEO_PAUSE = 618 { NS_GOOGLE_MUC_MEDIA, "video-pause" }; 619 const StaticQName QN_GOOGLE_MUC_RECORDING = 620 { NS_GOOGLE_MUC_MEDIA, "recording" }; 621 const StaticQName QN_GOOGLE_MUC_MEDIA_BLOCK = { NS_GOOGLE_MUC_MEDIA, "block" }; 622 const StaticQName QN_STATE_ATTR = { STR_EMPTY, "state" }; 623 624 const char AUTH_MECHANISM_GOOGLE_COOKIE[] = "X-GOOGLE-COOKIE"; 625 const char AUTH_MECHANISM_GOOGLE_TOKEN[] = "X-GOOGLE-TOKEN"; 626 const char AUTH_MECHANISM_OAUTH2[] = "X-OAUTH2"; 627 const char AUTH_MECHANISM_PLAIN[] = "PLAIN"; 628 629 } // namespace buzz 630