OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
xmpp_str.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3  */
4 
5 
6 #ifndef __XMPP_STR_H__
7 #define __XMPP_STR_H__
8 
9 
10 // STREAM strings
11 //
12 
13 #define sXMPP_STREAM_O "stream:stream"
14 #define sXMPP_STREAM_FEATURES_O "<stream:features>"
15 #define sXMPP_STREAM_FEATURES_C "</stream:features>"
16 #define sXMPP_STREAM_ERROR_O "<stream:error>"
17 #define sXMPP_STREAM_ERROR_C "</stream:error>"
18 #define sXMPP_IQ_KEY "iq"
19 #define sXMPP_IQ "<iq"
20 #define sXMPP_MESSAGE_KEY "message"
21 #define sXMPP_MESSAGE "<message"
22 #define sXMPP_STREAM_STARTTLS_O "<starttls"
23 #define sXMPP_STREAM_FAILURE_O "<failure"
24 #define sXMPP_STREAM_PROCEED_O "<proceed"
25 #define sXMPP_REQUIRED_O "<required"
26 
27 
28 #define sXMPP_VERSION_1_GLOBAL "<?xml version='1.0'?>"
29 #define sXMPP_VERSION_1 "version='1.0'"
30 #define sXMPP_JABBER_CLIENT "xmlns='jabber:client'"
31 #define sXMPP_JABBER_SERVER "xmlns='jabber:server'"
32 #define sXMPP_LANG_EN "xml:lang='en'"
33 #define sXMPP_STREAM_NS "xmlns:stream='http://etherx.jabber.org/streams'"
34 #define sXMPP_STREAM_NS_TLS "urn:ietf:params:xml:ns:xmpp-tls"
35 #define sXMPP_BIND_NS "<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/>"
36 #define sXMPP_STREAM_ERROR_NS "xmlns='urn:ietf:params:xml:ns:xmpp-streams'"
37 
38 
39 //Encoded stream messages
40 #define sXMPP_STREAM_OPEN "<?xml version='1.0'?><stream:stream from='dummycl' to='dummyserver' version='1.0' xml:lang='en' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'/>"
41 #define sXMPP_STREAM_RESP "<?xml version='1.0'?><stream:stream from='dummyserver' to='dummycl' id='++123' version='1.0' xml:lang='en' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'/>"
42 #define sXMPP_STREAM_FEATURE_TLS "<stream:features><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'><required/></starttls></stream:features>"
43 #define sXMPP_STREAM_START_TLS "<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>"
44 #define sXMPP_STREAM_PROCEED_TLS "<proceed xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>"
45 
46 #define sXMPP_WHITESPACE "Ȁ" //unicode U+0200 as whitespace
47 // Whitespace characters allowed as fillers between xmpp messages.
48 #define sXMPP_VALIDWS " \n\r\tȀ"
49 
50 #define sXMPP_CHAT_MSG "<message from='fake-from' to='fake-to' type='chat'> <body> msg </body> <subject> log </subject> </message>"
51 #define sXMPP_STREAM_START "<?xml version=\"1.0\"?><stream:stream"
52 #define sXMPP_STREAM_START_S "<stream:stream"
53 #define sXML_STREAM_C "/stream:stream"
54 
55 // Regexp
56 //#define rXMPP_MESSAGE "<.*[\\s\\n\\t\\r]"
57 #define rXMPP_MESSAGE "<(iq|message)"
58 #define rXMPP_STREAM_START "<?.*?>*[\\s\\n\\t\\r]*<stream:stream"
59 #define rXMPP_STREAM_END "http://etherx.jabber.org/streams[\"'][\\s\\t\\r\\n]*>"
60 #define rXMPP_STREAM_FEATURES "<stream:features"
61 #define rXMPP_STREAM_STARTTLS "<starttls"
62 #define rXMPP_STREAM_PROCEED "<proceed"
63 #define rXMPP_STREAM_STANZA_END "[\\s\\t\\r\\n]*/>"
64 
65 #define rXMPP_STREAM_START_FEATURES "<?.*?>*[\\s\\n\\t\\r]*<(stream:stream|stream:features)"
66 #endif // __XMPP_STR_H__