PipeWire  1.4.5
security-context.h
Go to the documentation of this file.
1 /* PipeWire */
2 /* SPDX-FileCopyrightText: Copyright © 2019 Wim Taymans */
3 /* SPDX-License-Identifier: MIT */
4 
5 #ifndef PIPEWIRE_EXT_SECURITY_CONTEXT_H
6 #define PIPEWIRE_EXT_SECURITY_CONTEXT_H
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 #include <spa/utils/defs.h>
13 
22 #define PW_TYPE_INTERFACE_SecurityContext PW_TYPE_INFO_INTERFACE_BASE "SecurityContext"
23 
24 #define PW_SECURITY_CONTEXT_PERM_MASK PW_PERM_RWX
25 
26 #define PW_VERSION_SECURITY_CONTEXT 3
28 
29 #ifndef PW_API_SECURITY_CONTEXT
30 #define PW_API_SECURITY_CONTEXT static inline
31 #endif
32 
33 #define PW_EXTENSION_MODULE_SECURITY_CONTEXT PIPEWIRE_MODULE_PREFIX "module-security-context"
34 
35 #define PW_SECURITY_CONTEXT_EVENT_NUM 0
36 
37 
40 #define PW_VERSION_SECURITY_CONTEXT_EVENTS 0
41  uint32_t version;
42 };
43 
44 #define PW_SECURITY_CONTEXT_METHOD_ADD_LISTENER 0
45 #define PW_SECURITY_CONTEXT_METHOD_CREATE 1
46 #define PW_SECURITY_CONTEXT_METHOD_NUM 2
47 
50 #define PW_VERSION_SECURITY_CONTEXT_METHODS 0
51  uint32_t version;
52 
53  int (*add_listener) (void *object,
54  struct spa_hook *listener,
55  const struct pw_security_context_events *events,
56  void *data);
57 
95  int (*create) (void *object,
96  int listen_fd,
97  int close_fd,
98  const struct spa_dict *props);
99 };
100 
104  struct spa_hook *listener,
105  const struct pw_security_context_events *events,
106  void *data)
107 {
108  return spa_api_method_r(int, -ENOTSUP,
109  pw_security_context, (struct spa_interface*)object, add_listener, 0,
110  listener, events, data);
111 }
112 
116  int listen_fd, int close_fd, const struct spa_dict *props)
117 {
118  return spa_api_method_r(int, -ENOTSUP,
119  pw_security_context, (struct spa_interface*)object, create, 0,
120  listen_fd, close_fd, props);
121 }
122 
127 #ifdef __cplusplus
128 } /* extern "C" */
129 #endif
130 
131 #endif /* PIPEWIRE_EXT_SECURITY_CONTEXT_H */
spa/utils/defs.h
PW_API_SECURITY_CONTEXT int pw_security_context_create(struct pw_security_context *object, int listen_fd, int close_fd, const struct spa_dict *props)
Create a new security context.
Definition: security-context.h:131
#define PW_API_SECURITY_CONTEXT
Definition: security-context.h:39
PW_API_SECURITY_CONTEXT int pw_security_context_add_listener(struct pw_security_context *object, struct spa_hook *listener, const struct pw_security_context_events *events, void *data)
Definition: security-context.h:119
#define spa_api_method_r(rtype, def, type, o, method, version,...)
Definition: hook.h:291
Security Context events
Definition: security-context.h:50
uint32_t version
Definition: security-context.h:53
Security Context methods
Definition: security-context.h:64
uint32_t version
Definition: security-context.h:67
int(* add_listener)(void *object, struct spa_hook *listener, const struct pw_security_context_events *events, void *data)
Definition: security-context.h:69
int(* create)(void *object, int listen_fd, int close_fd, const struct spa_dict *props)
Create a new security context.
Definition: security-context.h:111
Definition: dict.h:51
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:427
Definition: hook.h:148