• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef fooprotocolnativehfoo
2 #define fooprotocolnativehfoo
3 
4 /***
5   This file is part of PulseAudio.
6 
7   Copyright 2004-2006 Lennart Poettering
8   Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
9 
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.
14 
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.
19 
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/>.
22 ***/
23 
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>
34 
35 typedef struct pa_native_protocol pa_native_protocol;
36 
37 typedef struct pa_native_connection pa_native_connection;
38 
39 typedef struct pa_native_options {
40     PA_REFCNT_DECLARE;
41 
42     pa_module *module;
43 
44     bool auth_anonymous;
45     bool srbchannel;
46     char *auth_group;
47     pa_ip_acl *auth_ip_acl;
48     pa_auth_cookie *auth_cookie;
49 } pa_native_options;
50 
51 typedef enum pa_native_hook {
52     PA_NATIVE_HOOK_SERVERS_CHANGED,
53     PA_NATIVE_HOOK_CONNECTION_PUT,
54     PA_NATIVE_HOOK_CONNECTION_UNLINK,
55     PA_NATIVE_HOOK_MAX
56 } pa_native_hook_t;
57 
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);
63 
64 pa_hook *pa_native_protocol_hooks(pa_native_protocol *p);
65 
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);
69 
70 typedef int (*pa_native_protocol_ext_cb_t)(
71         pa_native_protocol *p,
72         pa_module *m,
73         pa_native_connection *c,
74         uint32_t tag,
75         pa_tagstruct *t);
76 
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);
79 
80 pa_pstream* pa_native_connection_get_pstream(pa_native_connection *c);
81 pa_client* pa_native_connection_get_client(pa_native_connection *c);
82 
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);
87 
88 #endif
89