Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <systemd/sd-bus.h> |
| 4 | |
| 5 | // ABC for sdbus implementation. |
| 6 | namespace sdbusplus |
| 7 | { |
| 8 | |
| 9 | // A wrapper for interfacing or testing sd-bus. This will hold methods for |
| 10 | // buses, messages, etc. |
| 11 | class SdBusInterface |
| 12 | { |
| 13 | public: |
| 14 | virtual ~SdBusInterface() = default; |
| 15 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 16 | virtual int sd_bus_add_object_manager(sd_bus* bus, sd_bus_slot** slot, |
| 17 | const char* path) = 0; |
Patrick Venture | 248c990 | 2018-04-10 17:53:43 -0700 | [diff] [blame] | 18 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 19 | virtual int sd_bus_add_object_vtable(sd_bus* bus, sd_bus_slot** slot, |
| 20 | const char* path, |
| 21 | const char* interface, |
| 22 | const sd_bus_vtable* vtable, |
| 23 | void* userdata) = 0; |
Patrick Venture | 540946e | 2018-04-16 13:17:51 -0700 | [diff] [blame] | 24 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 25 | virtual int sd_bus_attach_event(sd_bus* bus, sd_event* e, int priority) = 0; |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 26 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 27 | virtual int sd_bus_call(sd_bus* bus, sd_bus_message* m, uint64_t usec, |
| 28 | sd_bus_error* ret_error, |
| 29 | sd_bus_message** reply) = 0; |
Patrick Venture | ff09568 | 2018-04-13 20:54:32 -0700 | [diff] [blame] | 30 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 31 | virtual int sd_bus_detach_event(sd_bus* bus) = 0; |
Patrick Venture | ff09568 | 2018-04-13 20:54:32 -0700 | [diff] [blame] | 32 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 33 | virtual int sd_bus_emit_interfaces_added_strv(sd_bus* bus, const char* path, |
| 34 | char** interfaces) = 0; |
| 35 | virtual int sd_bus_emit_interfaces_removed_strv(sd_bus* bus, |
| 36 | const char* path, |
| 37 | char** interfaces) = 0; |
| 38 | virtual int sd_bus_emit_object_added(sd_bus* bus, const char* path) = 0; |
| 39 | virtual int sd_bus_emit_object_removed(sd_bus* bus, const char* path) = 0; |
| 40 | virtual int sd_bus_emit_properties_changed_strv(sd_bus* bus, |
| 41 | const char* path, |
| 42 | const char* interface, |
| 43 | char** names) = 0; |
Patrick Venture | ff09568 | 2018-04-13 20:54:32 -0700 | [diff] [blame] | 44 | |
William A. Kennington III | 6565454 | 2018-10-11 15:17:31 -0700 | [diff] [blame] | 45 | virtual int sd_bus_error_set(sd_bus_error* e, const char* name, |
| 46 | const char* message) = 0; |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 47 | virtual int sd_bus_error_set_const(sd_bus_error* e, const char* name, |
| 48 | const char* message) = 0; |
| 49 | virtual int sd_bus_error_get_errno(const sd_bus_error* e) = 0; |
| 50 | virtual int sd_bus_error_set_errno(sd_bus_error* e, int error) = 0; |
| 51 | virtual int sd_bus_error_is_set(const sd_bus_error* e) = 0; |
| 52 | virtual void sd_bus_error_free(sd_bus_error* e) = 0; |
Patrick Venture | 263712f | 2018-04-16 14:19:08 -0700 | [diff] [blame] | 53 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 54 | virtual sd_event* sd_bus_get_event(sd_bus* bus) = 0; |
| 55 | virtual int sd_bus_get_fd(sd_bus* bus) = 0; |
| 56 | virtual int sd_bus_get_unique_name(sd_bus* bus, const char** unique) = 0; |
Patrick Venture | ff09568 | 2018-04-13 20:54:32 -0700 | [diff] [blame] | 57 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 58 | virtual int sd_bus_list_names(sd_bus* bus, char*** acquired, |
| 59 | char*** activatable) = 0; |
Patrick Venture | ff09568 | 2018-04-13 20:54:32 -0700 | [diff] [blame] | 60 | |
| 61 | // https://github.com/systemd/systemd/blob/master/src/systemd/sd-bus.h |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 62 | virtual int sd_bus_message_append_basic(sd_bus_message* message, char type, |
| 63 | const void* value) = 0; |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 64 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 65 | virtual int sd_bus_message_at_end(sd_bus_message* m, int complete) = 0; |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 66 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 67 | virtual int sd_bus_message_close_container(sd_bus_message* m) = 0; |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 68 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 69 | virtual int sd_bus_message_enter_container(sd_bus_message* m, char type, |
| 70 | const char* contents) = 0; |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 71 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 72 | virtual int sd_bus_message_exit_container(sd_bus_message* m) = 0; |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 73 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 74 | virtual sd_bus* sd_bus_message_get_bus(sd_bus_message* m) = 0; |
William A. Kennington III | 8e8d1a6 | 2018-10-14 23:24:25 -0700 | [diff] [blame] | 75 | virtual int sd_bus_message_get_type(sd_bus_message* m, uint8_t* type) = 0; |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 76 | virtual int sd_bus_message_get_cookie(sd_bus_message* m, |
| 77 | uint64_t* cookie) = 0; |
William A. Kennington III | 209dfc6 | 2018-10-14 23:26:18 -0700 | [diff] [blame] | 78 | virtual int sd_bus_message_get_reply_cookie(sd_bus_message* m, |
| 79 | uint64_t* cookie) = 0; |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 80 | virtual const char* sd_bus_message_get_destination(sd_bus_message* m) = 0; |
| 81 | virtual const char* sd_bus_message_get_interface(sd_bus_message* m) = 0; |
| 82 | virtual const char* sd_bus_message_get_member(sd_bus_message* m) = 0; |
| 83 | virtual const char* sd_bus_message_get_path(sd_bus_message* m) = 0; |
| 84 | virtual const char* sd_bus_message_get_sender(sd_bus_message* m) = 0; |
| 85 | virtual const char* sd_bus_message_get_signature(sd_bus_message* m, |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 86 | int complete) = 0; |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 87 | virtual int sd_bus_message_get_errno(sd_bus_message* m) = 0; |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 88 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 89 | virtual int sd_bus_message_is_method_call(sd_bus_message* m, |
| 90 | const char* interface, |
| 91 | const char* member) = 0; |
| 92 | virtual int sd_bus_message_is_method_error(sd_bus_message* m, |
| 93 | const char* name) = 0; |
| 94 | virtual int sd_bus_message_is_signal(sd_bus_message* m, |
| 95 | const char* interface, |
| 96 | const char* member) = 0; |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 97 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 98 | virtual int sd_bus_message_new_method_call(sd_bus* bus, sd_bus_message** m, |
| 99 | const char* destination, |
| 100 | const char* path, |
| 101 | const char* interface, |
| 102 | const char* member) = 0; |
Patrick Venture | ff09568 | 2018-04-13 20:54:32 -0700 | [diff] [blame] | 103 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 104 | virtual int sd_bus_message_new_method_return(sd_bus_message* call, |
| 105 | sd_bus_message** m) = 0; |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 106 | |
Vernon Mauery | 2b74e52 | 2018-10-02 14:55:39 -0700 | [diff] [blame] | 107 | virtual int sd_bus_message_new_method_errno(sd_bus_message* call, |
| 108 | sd_bus_message** m, int error, |
| 109 | const sd_bus_error* p) = 0; |
| 110 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 111 | virtual int sd_bus_message_new_signal(sd_bus* bus, sd_bus_message** m, |
| 112 | const char* path, |
| 113 | const char* interface, |
| 114 | const char* member) = 0; |
Patrick Venture | ff09568 | 2018-04-13 20:54:32 -0700 | [diff] [blame] | 115 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 116 | virtual int sd_bus_message_open_container(sd_bus_message* m, char type, |
| 117 | const char* contents) = 0; |
Patrick Venture | ff09568 | 2018-04-13 20:54:32 -0700 | [diff] [blame] | 118 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 119 | virtual int sd_bus_message_read_basic(sd_bus_message* m, char type, |
| 120 | void* p) = 0; |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 121 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 122 | virtual sd_bus_message* sd_bus_message_ref(sd_bus_message* m) = 0; |
Patrick Venture | ff09568 | 2018-04-13 20:54:32 -0700 | [diff] [blame] | 123 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 124 | virtual int sd_bus_message_skip(sd_bus_message* m, const char* types) = 0; |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 125 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 126 | virtual int sd_bus_message_verify_type(sd_bus_message* m, char type, |
| 127 | const char* contents) = 0; |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 128 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 129 | virtual int sd_bus_process(sd_bus* bus, sd_bus_message** r) = 0; |
Patrick Venture | ff09568 | 2018-04-13 20:54:32 -0700 | [diff] [blame] | 130 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 131 | virtual sd_bus* sd_bus_ref(sd_bus* bus) = 0; |
Patrick Venture | ff09568 | 2018-04-13 20:54:32 -0700 | [diff] [blame] | 132 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 133 | virtual int sd_bus_request_name(sd_bus* bus, const char* name, |
Patrick Venture | ff09568 | 2018-04-13 20:54:32 -0700 | [diff] [blame] | 134 | uint64_t flags) = 0; |
| 135 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 136 | virtual int sd_bus_send(sd_bus* bus, sd_bus_message* m, |
| 137 | uint64_t* cookie) = 0; |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 138 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 139 | virtual sd_bus* sd_bus_unref(sd_bus* bus) = 0; |
Brad Bishop | dfbff6f | 2018-12-05 19:46:20 -0500 | [diff] [blame] | 140 | virtual sd_bus* sd_bus_flush_close_unref(sd_bus* bus) = 0; |
Patrick Venture | ff09568 | 2018-04-13 20:54:32 -0700 | [diff] [blame] | 141 | |
William A. Kennington III | 42f6ad5 | 2018-12-19 17:32:30 -0800 | [diff] [blame^] | 142 | virtual int sd_bus_flush(sd_bus* bus) = 0; |
| 143 | virtual void sd_bus_close(sd_bus* bus) = 0; |
| 144 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 145 | virtual int sd_bus_wait(sd_bus* bus, uint64_t timeout_usec) = 0; |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 146 | }; |
| 147 | |
| 148 | class SdBusImpl : public SdBusInterface |
| 149 | { |
| 150 | public: |
| 151 | SdBusImpl() = default; |
| 152 | ~SdBusImpl() = default; |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 153 | SdBusImpl(const SdBusImpl&) = default; |
| 154 | SdBusImpl& operator=(const SdBusImpl&) = default; |
| 155 | SdBusImpl(SdBusImpl&&) = default; |
| 156 | SdBusImpl& operator=(SdBusImpl&&) = default; |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 157 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 158 | int sd_bus_add_object_manager(sd_bus* bus, sd_bus_slot** slot, |
| 159 | const char* path) override |
Patrick Venture | 248c990 | 2018-04-10 17:53:43 -0700 | [diff] [blame] | 160 | { |
| 161 | return ::sd_bus_add_object_manager(bus, slot, path); |
| 162 | } |
| 163 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 164 | int sd_bus_add_object_vtable(sd_bus* bus, sd_bus_slot** slot, |
| 165 | const char* path, const char* interface, |
| 166 | const sd_bus_vtable* vtable, |
| 167 | void* userdata) override |
Patrick Venture | 540946e | 2018-04-16 13:17:51 -0700 | [diff] [blame] | 168 | { |
| 169 | return ::sd_bus_add_object_vtable(bus, slot, path, interface, vtable, |
| 170 | userdata); |
| 171 | } |
| 172 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 173 | int sd_bus_attach_event(sd_bus* bus, sd_event* e, int priority) override |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 174 | { |
Patrick Venture | ff09568 | 2018-04-13 20:54:32 -0700 | [diff] [blame] | 175 | return ::sd_bus_attach_event(bus, e, priority); |
| 176 | } |
| 177 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 178 | int sd_bus_call(sd_bus* bus, sd_bus_message* m, uint64_t usec, |
| 179 | sd_bus_error* ret_error, sd_bus_message** reply) override |
Patrick Venture | ff09568 | 2018-04-13 20:54:32 -0700 | [diff] [blame] | 180 | { |
| 181 | return ::sd_bus_call(bus, m, usec, ret_error, reply); |
| 182 | } |
| 183 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 184 | int sd_bus_detach_event(sd_bus* bus) override |
Patrick Venture | ff09568 | 2018-04-13 20:54:32 -0700 | [diff] [blame] | 185 | { |
| 186 | return ::sd_bus_detach_event(bus); |
| 187 | } |
| 188 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 189 | int sd_bus_emit_interfaces_added_strv(sd_bus* bus, const char* path, |
| 190 | char** interfaces) override |
Patrick Venture | ff09568 | 2018-04-13 20:54:32 -0700 | [diff] [blame] | 191 | { |
| 192 | return ::sd_bus_emit_interfaces_added_strv(bus, path, interfaces); |
| 193 | } |
| 194 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 195 | int sd_bus_emit_interfaces_removed_strv(sd_bus* bus, const char* path, |
| 196 | char** interfaces) override |
Patrick Venture | ff09568 | 2018-04-13 20:54:32 -0700 | [diff] [blame] | 197 | { |
| 198 | return ::sd_bus_emit_interfaces_removed_strv(bus, path, interfaces); |
| 199 | } |
| 200 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 201 | int sd_bus_emit_object_added(sd_bus* bus, const char* path) override |
Patrick Venture | ff09568 | 2018-04-13 20:54:32 -0700 | [diff] [blame] | 202 | { |
| 203 | return ::sd_bus_emit_object_added(bus, path); |
| 204 | } |
| 205 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 206 | int sd_bus_emit_object_removed(sd_bus* bus, const char* path) override |
Patrick Venture | ff09568 | 2018-04-13 20:54:32 -0700 | [diff] [blame] | 207 | { |
| 208 | return ::sd_bus_emit_object_removed(bus, path); |
| 209 | } |
| 210 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 211 | int sd_bus_emit_properties_changed_strv(sd_bus* bus, const char* path, |
| 212 | const char* interface, |
| 213 | char** names) override |
Patrick Venture | 540946e | 2018-04-16 13:17:51 -0700 | [diff] [blame] | 214 | { |
| 215 | return ::sd_bus_emit_properties_changed_strv(bus, path, interface, |
| 216 | names); |
| 217 | } |
| 218 | |
William A. Kennington III | 6565454 | 2018-10-11 15:17:31 -0700 | [diff] [blame] | 219 | int sd_bus_error_set(sd_bus_error* e, const char* name, |
| 220 | const char* message) override |
| 221 | { |
| 222 | return ::sd_bus_error_set(e, name, message); |
| 223 | } |
| 224 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 225 | int sd_bus_error_set_const(sd_bus_error* e, const char* name, |
| 226 | const char* message) override |
Patrick Venture | 263712f | 2018-04-16 14:19:08 -0700 | [diff] [blame] | 227 | { |
| 228 | return ::sd_bus_error_set_const(e, name, message); |
| 229 | } |
| 230 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 231 | int sd_bus_error_get_errno(const sd_bus_error* e) override |
William A. Kennington III | 6e43390 | 2018-06-22 18:40:45 -0700 | [diff] [blame] | 232 | { |
| 233 | return ::sd_bus_error_get_errno(e); |
| 234 | } |
| 235 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 236 | int sd_bus_error_set_errno(sd_bus_error* e, int error) override |
William A. Kennington III | 6e43390 | 2018-06-22 18:40:45 -0700 | [diff] [blame] | 237 | { |
| 238 | return ::sd_bus_error_set_errno(e, error); |
| 239 | } |
| 240 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 241 | int sd_bus_error_is_set(const sd_bus_error* e) override |
William A. Kennington III | 6e43390 | 2018-06-22 18:40:45 -0700 | [diff] [blame] | 242 | { |
| 243 | return ::sd_bus_error_is_set(e); |
| 244 | } |
| 245 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 246 | void sd_bus_error_free(sd_bus_error* e) override |
William A. Kennington III | 6e43390 | 2018-06-22 18:40:45 -0700 | [diff] [blame] | 247 | { |
| 248 | return ::sd_bus_error_free(e); |
| 249 | } |
| 250 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 251 | sd_event* sd_bus_get_event(sd_bus* bus) override |
Patrick Venture | ff09568 | 2018-04-13 20:54:32 -0700 | [diff] [blame] | 252 | { |
| 253 | return ::sd_bus_get_event(bus); |
| 254 | } |
| 255 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 256 | int sd_bus_get_fd(sd_bus* bus) override |
William A. Kennington III | cb582e0 | 2018-06-28 18:01:01 -0700 | [diff] [blame] | 257 | { |
| 258 | return ::sd_bus_get_fd(bus); |
| 259 | } |
| 260 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 261 | int sd_bus_get_unique_name(sd_bus* bus, const char** unique) override |
Patrick Venture | ff09568 | 2018-04-13 20:54:32 -0700 | [diff] [blame] | 262 | { |
| 263 | return ::sd_bus_get_unique_name(bus, unique); |
| 264 | } |
| 265 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 266 | int sd_bus_list_names(sd_bus* bus, char*** acquired, |
| 267 | char*** activatable) override |
Patrick Venture | ff09568 | 2018-04-13 20:54:32 -0700 | [diff] [blame] | 268 | { |
| 269 | return ::sd_bus_list_names(bus, acquired, activatable); |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 270 | } |
| 271 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 272 | int sd_bus_message_append_basic(sd_bus_message* message, char type, |
| 273 | const void* value) override |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 274 | { |
| 275 | return ::sd_bus_message_append_basic(message, type, value); |
| 276 | } |
| 277 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 278 | int sd_bus_message_at_end(sd_bus_message* m, int complete) override |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 279 | { |
| 280 | return ::sd_bus_message_at_end(m, complete); |
| 281 | } |
| 282 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 283 | int sd_bus_message_close_container(sd_bus_message* m) override |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 284 | { |
| 285 | return ::sd_bus_message_close_container(m); |
| 286 | } |
| 287 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 288 | int sd_bus_message_enter_container(sd_bus_message* m, char type, |
| 289 | const char* contents) override |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 290 | { |
| 291 | return ::sd_bus_message_enter_container(m, type, contents); |
| 292 | } |
| 293 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 294 | int sd_bus_message_exit_container(sd_bus_message* m) override |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 295 | { |
| 296 | return ::sd_bus_message_exit_container(m); |
| 297 | } |
| 298 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 299 | sd_bus* sd_bus_message_get_bus(sd_bus_message* m) override |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 300 | { |
| 301 | return ::sd_bus_message_get_bus(m); |
| 302 | } |
| 303 | |
William A. Kennington III | 8e8d1a6 | 2018-10-14 23:24:25 -0700 | [diff] [blame] | 304 | int sd_bus_message_get_type(sd_bus_message* m, uint8_t* type) override |
| 305 | { |
| 306 | return ::sd_bus_message_get_type(m, type); |
| 307 | } |
| 308 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 309 | int sd_bus_message_get_cookie(sd_bus_message* m, uint64_t* cookie) override |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 310 | { |
| 311 | return ::sd_bus_message_get_cookie(m, cookie); |
| 312 | } |
| 313 | |
William A. Kennington III | 209dfc6 | 2018-10-14 23:26:18 -0700 | [diff] [blame] | 314 | int sd_bus_message_get_reply_cookie(sd_bus_message* m, |
| 315 | uint64_t* cookie) override |
| 316 | { |
| 317 | return ::sd_bus_message_get_reply_cookie(m, cookie); |
| 318 | } |
| 319 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 320 | const char* sd_bus_message_get_destination(sd_bus_message* m) override |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 321 | { |
| 322 | return ::sd_bus_message_get_destination(m); |
| 323 | } |
| 324 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 325 | const char* sd_bus_message_get_interface(sd_bus_message* m) override |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 326 | { |
| 327 | return ::sd_bus_message_get_interface(m); |
| 328 | } |
| 329 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 330 | const char* sd_bus_message_get_member(sd_bus_message* m) override |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 331 | { |
| 332 | return ::sd_bus_message_get_member(m); |
| 333 | } |
| 334 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 335 | const char* sd_bus_message_get_path(sd_bus_message* m) override |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 336 | { |
| 337 | return ::sd_bus_message_get_path(m); |
| 338 | } |
| 339 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 340 | const char* sd_bus_message_get_sender(sd_bus_message* m) override |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 341 | { |
| 342 | return ::sd_bus_message_get_sender(m); |
| 343 | } |
| 344 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 345 | const char* sd_bus_message_get_signature(sd_bus_message* m, |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 346 | int complete) override |
| 347 | { |
| 348 | return ::sd_bus_message_get_signature(m, complete); |
| 349 | } |
| 350 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 351 | int sd_bus_message_get_errno(sd_bus_message* m) override |
William A. Kennington III | cb582e0 | 2018-06-28 18:01:01 -0700 | [diff] [blame] | 352 | { |
| 353 | return ::sd_bus_message_get_errno(m); |
| 354 | } |
| 355 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 356 | int sd_bus_message_is_method_call(sd_bus_message* m, const char* interface, |
| 357 | const char* member) override |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 358 | { |
| 359 | return ::sd_bus_message_is_method_call(m, interface, member); |
| 360 | } |
| 361 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 362 | int sd_bus_message_is_method_error(sd_bus_message* m, |
| 363 | const char* name) override |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 364 | { |
| 365 | return ::sd_bus_message_is_method_error(m, name); |
| 366 | } |
| 367 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 368 | int sd_bus_message_is_signal(sd_bus_message* m, const char* interface, |
| 369 | const char* member) override |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 370 | { |
| 371 | return ::sd_bus_message_is_signal(m, interface, member); |
| 372 | } |
| 373 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 374 | int sd_bus_message_new_method_call(sd_bus* bus, sd_bus_message** m, |
| 375 | const char* destination, |
| 376 | const char* path, const char* interface, |
| 377 | const char* member) override |
Patrick Venture | ff09568 | 2018-04-13 20:54:32 -0700 | [diff] [blame] | 378 | { |
| 379 | return ::sd_bus_message_new_method_call(bus, m, destination, path, |
| 380 | interface, member); |
| 381 | } |
| 382 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 383 | int sd_bus_message_new_method_return(sd_bus_message* call, |
| 384 | sd_bus_message** m) override |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 385 | { |
| 386 | return ::sd_bus_message_new_method_return(call, m); |
| 387 | } |
| 388 | |
Vernon Mauery | 2b74e52 | 2018-10-02 14:55:39 -0700 | [diff] [blame] | 389 | int sd_bus_message_new_method_errno(sd_bus_message* call, |
| 390 | sd_bus_message** m, int error, |
| 391 | const sd_bus_error* p) override |
| 392 | { |
| 393 | return ::sd_bus_message_new_method_errno(call, m, error, p); |
| 394 | } |
| 395 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 396 | int sd_bus_message_new_signal(sd_bus* bus, sd_bus_message** m, |
| 397 | const char* path, const char* interface, |
| 398 | const char* member) override |
Patrick Venture | ff09568 | 2018-04-13 20:54:32 -0700 | [diff] [blame] | 399 | { |
| 400 | return ::sd_bus_message_new_signal(bus, m, path, interface, member); |
| 401 | } |
| 402 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 403 | int sd_bus_message_open_container(sd_bus_message* m, char type, |
| 404 | const char* contents) override |
Patrick Venture | ff09568 | 2018-04-13 20:54:32 -0700 | [diff] [blame] | 405 | { |
| 406 | return ::sd_bus_message_open_container(m, type, contents); |
| 407 | } |
| 408 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 409 | int sd_bus_message_read_basic(sd_bus_message* m, char type, |
| 410 | void* p) override |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 411 | { |
| 412 | return ::sd_bus_message_read_basic(m, type, p); |
| 413 | } |
| 414 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 415 | sd_bus_message* sd_bus_message_ref(sd_bus_message* m) override |
Patrick Venture | ff09568 | 2018-04-13 20:54:32 -0700 | [diff] [blame] | 416 | { |
| 417 | return ::sd_bus_message_ref(m); |
| 418 | } |
| 419 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 420 | int sd_bus_message_skip(sd_bus_message* m, const char* types) override |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 421 | { |
| 422 | return ::sd_bus_message_skip(m, types); |
| 423 | } |
| 424 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 425 | int sd_bus_message_verify_type(sd_bus_message* m, char type, |
| 426 | const char* contents) override |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 427 | { |
| 428 | return ::sd_bus_message_verify_type(m, type, contents); |
| 429 | } |
| 430 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 431 | int sd_bus_process(sd_bus* bus, sd_bus_message** r) override |
Patrick Venture | ff09568 | 2018-04-13 20:54:32 -0700 | [diff] [blame] | 432 | { |
| 433 | return ::sd_bus_process(bus, r); |
| 434 | } |
| 435 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 436 | sd_bus* sd_bus_ref(sd_bus* bus) override |
Patrick Venture | ff09568 | 2018-04-13 20:54:32 -0700 | [diff] [blame] | 437 | { |
| 438 | return ::sd_bus_ref(bus); |
| 439 | } |
| 440 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 441 | int sd_bus_request_name(sd_bus* bus, const char* name, |
Patrick Venture | ff09568 | 2018-04-13 20:54:32 -0700 | [diff] [blame] | 442 | uint64_t flags) override |
| 443 | { |
| 444 | return ::sd_bus_request_name(bus, name, flags); |
| 445 | } |
| 446 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 447 | int sd_bus_send(sd_bus* bus, sd_bus_message* m, uint64_t* cookie) override |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 448 | { |
| 449 | return ::sd_bus_send(bus, m, cookie); |
| 450 | } |
| 451 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 452 | sd_bus* sd_bus_unref(sd_bus* bus) override |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 453 | { |
Patrick Venture | ff09568 | 2018-04-13 20:54:32 -0700 | [diff] [blame] | 454 | return ::sd_bus_unref(bus); |
| 455 | } |
| 456 | |
Brad Bishop | dfbff6f | 2018-12-05 19:46:20 -0500 | [diff] [blame] | 457 | sd_bus* sd_bus_flush_close_unref(sd_bus* bus) override |
| 458 | { |
| 459 | return ::sd_bus_flush_close_unref(bus); |
| 460 | } |
| 461 | |
William A. Kennington III | 42f6ad5 | 2018-12-19 17:32:30 -0800 | [diff] [blame^] | 462 | int sd_bus_flush(sd_bus* bus) override |
| 463 | { |
| 464 | return ::sd_bus_flush(bus); |
| 465 | } |
| 466 | |
| 467 | void sd_bus_close(sd_bus* bus) override |
| 468 | { |
| 469 | ::sd_bus_close(bus); |
| 470 | } |
| 471 | |
William A. Kennington III | e0d6965 | 2018-08-31 13:09:47 -0700 | [diff] [blame] | 472 | int sd_bus_wait(sd_bus* bus, uint64_t timeout_usec) override |
Patrick Venture | ff09568 | 2018-04-13 20:54:32 -0700 | [diff] [blame] | 473 | { |
| 474 | return ::sd_bus_wait(bus, timeout_usec); |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 475 | } |
| 476 | }; |
| 477 | |
William A. Kennington III | 9ff25f7 | 2018-06-28 17:59:15 -0700 | [diff] [blame] | 478 | extern SdBusImpl sdbus_impl; |
| 479 | |
Patrick Venture | dba73d7 | 2018-04-12 14:14:42 -0700 | [diff] [blame] | 480 | } // namespace sdbusplus |