1 #ifndef fooprotocolnativehfoo
2 #define fooprotocolnativehfoo
5 This file is part of PulseAudio.
7 Copyright 2004-2006 Lennart Poettering
8 Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
10 PulseAudio is free software; you can redistribute it and/or modify
11 it under the terms of the GNU Lesser General Public License as published
12 by the Free Software Foundation; either version 2.1 of the License,
13 or (at your option) any later version.
15 PulseAudio is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 General Public License for more details.
20 You should have received a copy of the GNU Lesser General Public License
21 along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
24 #include <pulsecore/core.h>
25 #include <pulsecore/ipacl.h>
26 #include <pulsecore/auth-cookie.h>
27 #include <pulsecore/iochannel.h>
28 #include <pulsecore/module.h>
29 #include <pulsecore/modargs.h>
30 #include <pulsecore/strlist.h>
31 #include <pulsecore/hook-list.h>
32 #include <pulsecore/pstream.h>
33 #include <pulsecore/tagstruct.h>
35 typedef struct pa_native_protocol pa_native_protocol;
37 typedef struct pa_native_connection pa_native_connection;
39 typedef struct pa_native_options {
47 pa_ip_acl *auth_ip_acl;
48 pa_auth_cookie *auth_cookie;
51 typedef enum pa_native_hook {
52 PA_NATIVE_HOOK_SERVERS_CHANGED,
53 PA_NATIVE_HOOK_CONNECTION_PUT,
54 PA_NATIVE_HOOK_CONNECTION_UNLINK,
58 pa_native_protocol* pa_native_protocol_get(pa_core *core);
59 pa_native_protocol* pa_native_protocol_ref(pa_native_protocol *p);
60 void pa_native_protocol_unref(pa_native_protocol *p);
61 void pa_native_protocol_connect(pa_native_protocol *p, pa_iochannel *io, pa_native_options *a);
62 void pa_native_protocol_disconnect(pa_native_protocol *p, pa_module *m);
64 pa_hook *pa_native_protocol_hooks(pa_native_protocol *p);
66 void pa_native_protocol_add_server_string(pa_native_protocol *p, const char *name);
67 void pa_native_protocol_remove_server_string(pa_native_protocol *p, const char *name);
68 pa_strlist *pa_native_protocol_servers(pa_native_protocol *p);
70 typedef int (*pa_native_protocol_ext_cb_t)(
71 pa_native_protocol *p,
73 pa_native_connection *c,
77 int pa_native_protocol_install_ext(pa_native_protocol *p, pa_module *m, pa_native_protocol_ext_cb_t cb);
78 void pa_native_protocol_remove_ext(pa_native_protocol *p, pa_module *m);
80 pa_pstream* pa_native_connection_get_pstream(pa_native_connection *c);
81 pa_client* pa_native_connection_get_client(pa_native_connection *c);
83 pa_native_options* pa_native_options_new(void);
84 pa_native_options* pa_native_options_ref(pa_native_options *o);
85 void pa_native_options_unref(pa_native_options *o);
86 int pa_native_options_parse(pa_native_options *o, pa_core *c, pa_modargs *ma);
89 void pa_native_protocol_dump_connections(pa_native_protocol *p);