binder_rpc_unstable_bindgen/
lib.rs1#![allow(dead_code)]
20#![allow(non_camel_case_types)]
21#![allow(non_snake_case)]
22#![allow(non_upper_case_globals)]
23#![allow(clippy::missing_safety_doc)]
24
25use binder_ndk_sys::AIBinder;
32
33#[repr(C)]
34#[derive(Debug, Copy, Clone)]
35pub struct ARpcServer {
36 _unused: [u8; 0],
37}
38#[repr(C)]
39#[derive(Debug, Copy, Clone)]
40pub struct ARpcSession {
41 _unused: [u8; 0],
42}
43#[repr(i32)]
44#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
45pub enum ARpcSession_FileDescriptorTransportMode {
46 None = 0,
47 Unix = 1,
48 Trusty = 2,
49}
50unsafe extern "C" {
51 pub fn ARpcServer_newVsock(
52 service: *mut AIBinder,
53 cid: ::std::os::raw::c_uint,
54 port: ::std::os::raw::c_uint,
55 assignedPort: *mut ::std::os::raw::c_uint,
56 ) -> *mut ARpcServer;
57}
58unsafe extern "C" {
59 pub fn ARpcServer_newBoundSocket(
60 service: *mut AIBinder,
61 socketFd: ::std::os::raw::c_int,
62 ) -> *mut ARpcServer;
63}
64unsafe extern "C" {
65 pub fn ARpcServer_newUnixDomainBootstrap(
66 service: *mut AIBinder,
67 bootstrapFd: ::std::os::raw::c_int,
68 ) -> *mut ARpcServer;
69}
70unsafe extern "C" {
71 pub fn ARpcServer_newInet(
72 service: *mut AIBinder,
73 address: *const ::std::os::raw::c_char,
74 port: ::std::os::raw::c_uint,
75 ) -> *mut ARpcServer;
76}
77unsafe extern "C" {
78 pub fn ARpcServer_setSupportedFileDescriptorTransportModes(
79 handle: *mut ARpcServer,
80 modes: *const ARpcSession_FileDescriptorTransportMode,
81 modes_len: usize,
82 );
83}
84unsafe extern "C" {
85 pub fn ARpcServer_setMaxThreads(server: *mut ARpcServer, threads: usize);
86}
87unsafe extern "C" {
88 pub fn ARpcServer_start(server: *mut ARpcServer);
89}
90unsafe extern "C" {
91 pub fn ARpcServer_join(server: *mut ARpcServer);
92}
93unsafe extern "C" {
94 pub fn ARpcServer_shutdown(server: *mut ARpcServer) -> bool;
95}
96unsafe extern "C" {
97 pub fn ARpcServer_free(server: *mut ARpcServer);
98}
99unsafe extern "C" {
100 pub fn ARpcSession_new() -> *mut ARpcSession;
101}
102unsafe extern "C" {
103 pub fn ARpcSession_setupVsockClient(
104 session: *mut ARpcSession,
105 cid: ::std::os::raw::c_uint,
106 port: ::std::os::raw::c_uint,
107 ) -> *mut AIBinder;
108}
109unsafe extern "C" {
110 pub fn ARpcSession_setupUnixDomainClient(
111 session: *mut ARpcSession,
112 name: *const ::std::os::raw::c_char,
113 ) -> *mut AIBinder;
114}
115unsafe extern "C" {
116 pub fn ARpcSession_setupUnixDomainBootstrapClient(
117 session: *mut ARpcSession,
118 bootstrapFd: ::std::os::raw::c_int,
119 ) -> *mut AIBinder;
120}
121unsafe extern "C" {
122 pub fn ARpcSession_setupInet(
123 session: *mut ARpcSession,
124 address: *const ::std::os::raw::c_char,
125 port: ::std::os::raw::c_uint,
126 ) -> *mut AIBinder;
127}
128unsafe extern "C" {
129 pub fn ARpcSession_setupPreconnectedClient(
130 session: *mut ARpcSession,
131 requestFd: ::std::option::Option<
132 unsafe extern "C" fn(param: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int,
133 >,
134 param: *mut ::std::os::raw::c_void,
135 ) -> *mut AIBinder;
136}
137unsafe extern "C" {
138 pub fn ARpcSession_setFileDescriptorTransportMode(
139 session: *mut ARpcSession,
140 mode: ARpcSession_FileDescriptorTransportMode,
141 );
142}
143unsafe extern "C" {
144 pub fn ARpcSession_setMaxIncomingThreads(session: *mut ARpcSession, threads: usize);
145}
146unsafe extern "C" {
147 pub fn ARpcSession_setMaxOutgoingConnections(session: *mut ARpcSession, connections: usize);
148}
149unsafe extern "C" {
150 pub fn ARpcSession_free(session: *mut ARpcSession);
151}