Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 89e16f15 authored by kfcchen's avatar kfcchen Committed by Automerger Merge Worker
Browse files

Move rust files together to create the library for fuzzer. am: d4399c09

parents c0897308 d4399c09
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
@@ -381,3 +381,31 @@ rust_ffi_static {
    ],
    min_sdk_version: "29",
}

rust_ffi_static {
    // Combines libdoh_frontend_ffi and libdoh_ffi for fuzzing test.
    // Includes multiple static rust libraries will cause duplicate symbol error.
    name: "libdoh_fuzz_ffi",
    crate_name: "doh_fuzz_ffi",
    srcs: [
        "doh/doh_test_superset_for_fuzzer.rs",
    ],
    edition: "2018",

    rlibs: [
        "libandroid_logger",
        "libanyhow",
        "libbase64_rust",
        "libfutures",
        "liblazy_static",
        "liblibc",
        "liblog_rust",
        "libquiche_static",
        "libring",
        "libthiserror",
        "libtokio",
        "liburl",
    ],

    whole_static_libs: ["libunwind"],
}
+28 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2022, The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

//! It is only currently intended for fuzzing testing.

/// The Rust FFI bindings to C APIs for implementation of doh.
pub mod boot_time;
mod config;
mod connection;
mod dispatcher;
mod encoding;
mod ffi;
mod network;
/// The Rust FFI bindings to C APIs for implementation of doh frontend.
mod tests;
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ package {
rust_ffi_static {
    name: "libdoh_frontend_ffi",
    crate_name: "doh_frontend_ffi",
    srcs: ["src/lib.rs"],
    srcs: ["src/mod.rs"],
    edition: "2018",

    rlibs: [
+17 −20
Original line number Diff line number Diff line
@@ -2,7 +2,6 @@
//   cbindgen --config cbindgen.toml src/lib.rs -o include/lib.rs.h
// Don't modify manually.


#pragma once

/* Generated with cbindgen:0.24.2 */
@@ -50,9 +49,7 @@ extern "C" {
///
/// The parameters `addr`, `port`, `backend_addr`, and `backend_port` must all point to null
/// terminated UTF-8 encoded strings.
DohFrontend *frontend_new(const char *addr,
                          const char *port,
                          const char *backend_addr,
DohFrontend* frontend_new(const char* addr, const char* port, const char* backend_addr,
                          const char* backend_port);

/// Starts the `DohFrontend` worker thread. Returns true if the worker thread is spawned
Loading