1 /*
2  * mod_rayo for FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
3  * Copyright (C) 2013-2018, Grasshopper
4  *
5  * Version: MPL 1.1
6  *
7  * The contents of this file are subject to the Mozilla Public License Version
8  * 1.1 (the "License"); you may not use this file except in compliance with
9  * the License. You may obtain a copy of the License at
10  * http://www.mozilla.org/MPL/
11  *
12  * Software distributed under the License is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
14  * for the specific language governing rights and limitations under the
15  * License.
16  *
17  * The Original Code is mod_rayo for FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
18  *
19  * The Initial Developer of the Original Code is Grasshopper
20  * Portions created by the Initial Developer are Copyright (C)
21  * the Initial Developer. All Rights Reserved.
22  *
23  * Contributor(s):
24  * Chris Rienzo <chris.rienzo@grasshopper.com>
25  *
26  * xmpp_streams.h -- XMPP in/out s2s and in c2s streams
27  *
28  */
29 #ifndef XMPP_STREAMS_H
30 #define XMPP_STREAMS_H
31 
32 struct xmpp_stream;
33 struct xmpp_stream_context;
34 
35 typedef int (* xmpp_stream_bind_callback)(struct xmpp_stream *stream);
36 typedef int (* xmpp_stream_ready_callback)(struct xmpp_stream *stream);
37 typedef void (* xmpp_stream_recv_callback)(struct xmpp_stream *stream, iks *stanza);
38 typedef void (* xmpp_stream_destroy_callback)(struct xmpp_stream *stream);
39 
40 SWITCH_DECLARE(struct xmpp_stream_context *) xmpp_stream_context_create(const char *domain, const char *domain_secret, xmpp_stream_bind_callback bind_cb, xmpp_stream_ready_callback ready, xmpp_stream_recv_callback recv, xmpp_stream_destroy_callback destroy);
41 SWITCH_DECLARE(void) xmpp_stream_context_add_cert(struct xmpp_stream_context *context, const char *cert_pem_file);
42 SWITCH_DECLARE(void) xmpp_stream_context_add_key(struct xmpp_stream_context *context, const char *key_pem_file);
43 SWITCH_DECLARE(void) xmpp_stream_context_add_user(struct xmpp_stream_context *context, const char *user, const char *password);
44 SWITCH_DECLARE(void) xmpp_stream_context_dump(struct xmpp_stream_context *context, switch_stream_handle_t *stream);
45 SWITCH_DECLARE(void) xmpp_stream_context_destroy(struct xmpp_stream_context *context);
46 SWITCH_DECLARE(void) xmpp_stream_context_send(struct xmpp_stream_context *context, const char *jid, iks *stanza);
47 
48 SWITCH_DECLARE(switch_status_t) xmpp_stream_context_listen(struct xmpp_stream_context *context, const char *addr, int port, int is_s2s, const char *acl);
49 SWITCH_DECLARE(switch_status_t) xmpp_stream_context_connect(struct xmpp_stream_context *context, const char *peer_domain, const char *peer_address, int peer_port);
50 
51 SWITCH_DECLARE(int) xmpp_stream_is_s2s(struct xmpp_stream *stream);
52 SWITCH_DECLARE(int) xmpp_stream_is_incoming(struct xmpp_stream *stream);
53 SWITCH_DECLARE(const char *) xmpp_stream_get_jid(struct xmpp_stream *stream);
54 SWITCH_DECLARE(void) xmpp_stream_set_private(struct xmpp_stream *stream, void *user_private);
55 SWITCH_DECLARE(void *) xmpp_stream_get_private(struct xmpp_stream *stream);
56 
57 #endif
58 
59 /* For Emacs:
60  * Local Variables:
61  * mode:c
62  * indent-tabs-mode:t
63  * tab-width:4
64  * c-basic-offset:4
65  * End:
66  * For VIM:
67  * vim:set softtabstop=4 shiftwidth=4 tabstop=4 noet
68  */
69