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