mirror of
https://github.com/jkcoxson/idevice.git
synced 2026-06-16 20:24:31 +00:00
* Initial rppairing support * Use idevice-srp crate * Add more debug logging to rppairing * Create pair_rsd_ios tool * Start work on iOS rppairing * Set RemoteXPC initial root ID to 0 * Send weird flags after opening reply stream * Allow rppairing with underlying RemoteXPC connection * fix(pair_rsd_ios): handle Linux mDNS link-local fallback (#73) * Implement CDTunnel via rppairing * Add example to rppair over CoreDeviceProxy * Implement shim and FFI for RSD services * Implement C++ RSD connect factories --------- Co-authored-by: se2crid <151872490+se2crid@users.noreply.github.com>
56 lines
1.8 KiB
C++
56 lines
1.8 KiB
C++
// Jackson Coxson
|
|
|
|
#pragma once
|
|
#include <idevice++/bindings.hpp>
|
|
#include <idevice++/ffi.hpp>
|
|
#include <idevice++/provider.hpp>
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
namespace IdeviceFFI {
|
|
|
|
using BtPacketLoggerPtr =
|
|
std::unique_ptr<BtPacketLoggerClientHandle,
|
|
FnDeleter<BtPacketLoggerClientHandle, bt_packet_logger_client_free>>;
|
|
|
|
struct BtPacket {
|
|
uint32_t length;
|
|
uint32_t ts_secs;
|
|
uint32_t ts_usecs;
|
|
uint8_t kind;
|
|
std::vector<uint8_t> h4_data;
|
|
};
|
|
|
|
class BtPacketLogger {
|
|
public:
|
|
// Factory: connect via Provider
|
|
static Result<BtPacketLogger, FfiError> connect(Provider& provider);
|
|
|
|
// Factory: connect via RSD tunnel
|
|
static Result<BtPacketLogger, FfiError> connect_rsd(AdapterHandle* adapter, RsdHandshakeHandle* handshake);
|
|
|
|
// Factory: wrap an existing Idevice socket (consumes it on success)
|
|
static Result<BtPacketLogger, FfiError> from_socket(Idevice&& socket);
|
|
|
|
// Ops
|
|
Result<Option<BtPacket>, FfiError> next_packet();
|
|
|
|
// RAII / moves
|
|
~BtPacketLogger() noexcept = default;
|
|
BtPacketLogger(BtPacketLogger&&) noexcept = default;
|
|
BtPacketLogger& operator=(BtPacketLogger&&) noexcept = default;
|
|
BtPacketLogger(const BtPacketLogger&) = delete;
|
|
BtPacketLogger& operator=(const BtPacketLogger&) = delete;
|
|
|
|
BtPacketLoggerClientHandle* raw() const noexcept { return handle_.get(); }
|
|
static BtPacketLogger adopt(BtPacketLoggerClientHandle* h) noexcept {
|
|
return BtPacketLogger(h);
|
|
}
|
|
|
|
private:
|
|
explicit BtPacketLogger(BtPacketLoggerClientHandle* h) noexcept : handle_(h) {}
|
|
BtPacketLoggerPtr handle_{};
|
|
};
|
|
|
|
} // namespace IdeviceFFI
|