This file is indexed.

/usr/include/ola/OlaCallbackClient.h is in libola-dev 0.9.8-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
/*
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 *
 * OlaCallbackClient.h
 * The legacy callback client.
 * Copyright (C) 2010 Simon Newton
 */

#ifndef OLA_OLACALLBACKCLIENT_H_
#define OLA_OLACALLBACKCLIENT_H_

#include <ola/Callback.h>
#include <ola/DmxBuffer.h>
#include <ola/OlaDevice.h>
#include <ola/client/Result.h>
#include <ola/base/Macro.h>
#include <ola/network/Socket.h>
#include <ola/plugin_id.h>
#include <ola/rdm/RDMAPIImplInterface.h>
#include <ola/rdm/RDMCommand.h>
#include <ola/rdm/UID.h>
#include <ola/rdm/UIDSet.h>
#include <ola/timecode/TimeCode.h>

#include <memory>
#include <string>
#include <vector>

/**
 * @file
 * @brief
 * @deprecated Include <ola/client/OlaClient.h> instead.
 */

namespace ola {

namespace client {
class OlaClientCore;
}

enum PatchAction {PATCH, UNPATCH};
enum RegisterAction {REGISTER, UNREGISTER};
enum PortDirection {INPUT_PORT, OUTPUT_PORT};

/**
 * @brief The legacy callback client.
 * @deprecated Use ola::client::OlaClient instead.
 */
class OlaCallbackClient: public ola::rdm::RDMAPIImplInterface {
 public:
    struct PluginState {
      std::string name;
      bool enabled;
      bool active;
      std::string preferences_source;
      std::vector<OlaPlugin> conflicting_plugins;
    };

    typedef SingleUseCallback2<void, const PluginState&, const std::string&>
      PluginStateCallback;

    typedef Callback3<void, unsigned int, const DmxBuffer&, const std::string&>
        DMXCallback;

    typedef Callback4<void, unsigned int, uint8_t, const DmxBuffer&,
                      const std::string&> DMXCallbackWithPriority;

    explicit OlaCallbackClient(ola::io::ConnectedDescriptor *descriptor);
    ~OlaCallbackClient();

    bool Setup();
    bool Stop();

    void SetCloseHandler(ola::SingleUseCallback0<void> *callback);

    // plugin methods
    bool FetchPluginList(
        SingleUseCallback2<void,
                           const std::vector<OlaPlugin>&,
                           const std::string&> *callback);

    bool FetchPluginDescription(
        ola_plugin_id plugin_id,
        SingleUseCallback2<void,
                           const std::string&,
                           const std::string&> *callback);

    bool FetchPluginState(ola_plugin_id plugin_id,
                          PluginStateCallback *callback);

    // device methods
    bool FetchDeviceInfo(
        ola_plugin_id filter,
        SingleUseCallback2<void,
                           const std::vector<OlaDevice>&,
                           const std::string&> *callback);

    bool FetchCandidatePorts(
        unsigned int universe_id,
        SingleUseCallback2<void,
                           const std::vector<OlaDevice>&,
                           const std::string&> *callback);

    bool FetchCandidatePorts(
        SingleUseCallback2<void,
                           const std::vector<OlaDevice>&,
                           const std::string&> *callback);

    bool ConfigureDevice(
        unsigned int device_alias,
        const std::string &msg,
        SingleUseCallback2<void, const std::string&,
                           const std::string&> *callback);

    // port methods
    bool SetPortPriorityInherit(
        unsigned int device_alias,
        unsigned int port,
        PortDirection port_direction,
        SingleUseCallback1<void, const std::string&> *callback);
    bool SetPortPriorityOverride(
        unsigned int device_alias,
        unsigned int port,
        PortDirection port_direction,
        uint8_t value,
        SingleUseCallback1<void, const std::string&> *callback);

    // universe methods
    bool FetchUniverseList(
        SingleUseCallback2<void,
                           const std::vector<OlaUniverse>&,
                           const std::string &> *callback);
    bool FetchUniverseInfo(
        unsigned int universe,
        SingleUseCallback2<void, OlaUniverse&, const std::string &> *callback);
    bool SetUniverseName(
        unsigned int uni,
        const std::string &name,
        SingleUseCallback1<void, const std::string&> *callback);
    bool SetUniverseMergeMode(
        unsigned int uni,
        OlaUniverse::merge_mode mode,
        SingleUseCallback1<void, const std::string&> *callback);

    // patching
    bool Patch(
        unsigned int device_alias,
        unsigned int port,
        ola::PortDirection port_direction,
        ola::PatchAction action,
        unsigned int uni,
        SingleUseCallback1<void, const std::string&> *callback);

    // DMX methods
    void SetDmxCallback(
        Callback3<void,
                  unsigned int,
                  const DmxBuffer&, const std::string&> *callback);

    // Similar to above, but this also passes the source priority.
    void SetDmxCallback(
        Callback4<void,
                  unsigned int,
                  uint8_t,
                  const DmxBuffer&, const std::string&> *callback);

    bool RegisterUniverse(
        unsigned int universe,
        ola::RegisterAction register_action,
        SingleUseCallback1<void, const std::string&> *callback);
    bool SendDmx(
        unsigned int universe,
        const DmxBuffer &data,
        SingleUseCallback1<void, const std::string&> *callback);
    bool SendDmx(
        unsigned int universe,
        const DmxBuffer &data,
        Callback1<void, const std::string&> *callback);
    // A version of SendDmx that doesn't wait for confirmation
    bool SendDmx(unsigned int universe, const DmxBuffer &data);

    bool FetchDmx(
        unsigned int universe,
        SingleUseCallback2<void, const DmxBuffer&,
                           const std::string&> *callback);

    // rdm methods
    bool FetchUIDList(
        unsigned int universe,
        SingleUseCallback2<void,
                           const ola::rdm::UIDSet&,
                           const std::string&> *callback);
    bool RunDiscovery(
        unsigned int universe,
        bool full,
        ola::SingleUseCallback2<void,
                                const ola::rdm::UIDSet&,
                                const std::string&> *callback);
    bool SetSourceUID(const ola::rdm::UID &uid,
                      ola::SingleUseCallback1<void,
                                              const std::string&> *callback);

    bool RDMGet(ola::rdm::RDMAPIImplInterface::rdm_callback *callback,
                unsigned int universe,
                const ola::rdm::UID &uid,
                uint16_t sub_device,
                uint16_t pid,
                const uint8_t *data,
                unsigned int data_length);
    bool RDMGet(ola::rdm::RDMAPIImplInterface::rdm_pid_callback *callback,
                unsigned int universe,
                const ola::rdm::UID &uid,
                uint16_t sub_device,
                uint16_t pid,
                const uint8_t *data,
                unsigned int data_length);
    bool RDMSet(ola::rdm::RDMAPIImplInterface::rdm_callback *callback,
                unsigned int universe,
                const ola::rdm::UID &uid,
                uint16_t sub_device,
                uint16_t pid,
                const uint8_t *data,
                unsigned int data_length);
    bool RDMSet(ola::rdm::RDMAPIImplInterface::rdm_pid_callback *callback,
                unsigned int universe,
                const ola::rdm::UID &uid,
                uint16_t sub_device,
                uint16_t pid,
                const uint8_t *data,
                unsigned int data_length);

    // timecode
    bool SendTimeCode(ola::SingleUseCallback1<void,
                                              const std::string&> *callback,
                      const ola::timecode::TimeCode &timecode);

 private:
    std::auto_ptr<client::OlaClientCore> m_core;
    std::auto_ptr<DMXCallback> m_dmx_callback;
    std::auto_ptr<DMXCallbackWithPriority> m_priority_dmx_callback;

    void HandlePluginList(
        SingleUseCallback2<void, const std::vector<OlaPlugin>&,
                           const std::string&> *callback,
        const client::Result &result,
        const std::vector<OlaPlugin> &plugins);

    void HandlePluginDescription(
        SingleUseCallback2<void,
                           const std::string&,
                           const std::string&> *callback,
        const client::Result &result,
        const std::string &description);

    void HandlePluginState(
        PluginStateCallback *callback,
        const client::Result &result,
        const client::PluginState &state);

    void HandleDeviceInfo(
        SingleUseCallback2<void,
                           const std::vector<OlaDevice>&,
                           const std::string&> *callback,
        const client::Result &result,
        const std::vector<OlaDevice> &devices);

    void HandleConfigureDevice(
        SingleUseCallback2<void,
                           const std::string&,
                           const std::string&> *callback,
        const client::Result &result,
        const std::string &reply);

    void HandleUniverseList(
        SingleUseCallback2<void, const std::vector<OlaUniverse>&,
                           const std::string &> *callback,
        const client::Result &result,
        const std::vector<OlaUniverse> &universes);

    void HandleUniverseInfo(
        SingleUseCallback2<void, OlaUniverse&, const std::string&> *callback,
        const client::Result &result,
        const OlaUniverse &universe);

    void HandleFetchDmx(
        SingleUseCallback2<void,
                           const DmxBuffer&,
                           const std::string&> *callback,
        const client::Result &result,
        const client::DMXMetadata &metadata,
        const DmxBuffer &data);

    void HandleDiscovery(
        ola::SingleUseCallback2<void,
                                const ola::rdm::UIDSet&,
                                const std::string&> *callback,
        const client::Result &result,
        const ola::rdm::UIDSet &uids);

    void HandleSetCallback(
        ola::SingleUseCallback1<void, const std::string&> *callback,
        const client::Result &result);

    void HandleRepeatableSetCallback(
        ola::Callback1<void, const std::string&> *callback,
        const client::Result &result);

    void HandleDMX(const client::DMXMetadata &metadata,
                   const DmxBuffer &data);

    void HandleRDMResponse(
        ola::rdm::RDMAPIImplInterface::rdm_callback *callback,
        const client::Result &result,
        const client::RDMMetadata &metadata,
        const ola::rdm::RDMResponse *response);

    void HandleRDMResponseWithPid(
        ola::rdm::RDMAPIImplInterface::rdm_pid_callback *callback,
        const client::Result &result,
        const client::RDMMetadata &metadata,
        const ola::rdm::RDMResponse *response);

    void GetResponseStatusAndData(
        const client::Result &result,
        ola::rdm::rdm_response_code response_code,
        const ola::rdm::RDMResponse *response,
        rdm::ResponseStatus *response_status,
        std::string *data);

    void GetParamFromReply(
        const std::string &message_type,
        const ola::rdm::RDMResponse *response,
        ola::rdm::ResponseStatus *new_status);

    DISALLOW_COPY_AND_ASSIGN(OlaCallbackClient);
};
}  // namespace ola
#endif  // OLA_OLACALLBACKCLIENT_H_