jvm_rs/
jdwpTransport.rs

1#![allow(non_upper_case_globals)]
2#![allow(non_camel_case_types)]
3#![allow(non_snake_case)]
4#![allow(dead_code)]
5
6use crate::bitfield::__BindgenBitfieldUnit;
7use crate::jni::*;
8
9pub const JDWPTRANSPORT_VERSION_1_0: ::std::os::raw::c_uint = 65536;
10pub const JDWPTRANSPORT_VERSION_1_1: ::std::os::raw::c_uint = 65537;
11pub type jdwpTransportEnv = *const jdwpTransportNativeInterface_;
12pub const jdwpTransportError_JDWPTRANSPORT_ERROR_NONE: jdwpTransportError = 0;
13pub const jdwpTransportError_JDWPTRANSPORT_ERROR_ILLEGAL_ARGUMENT: jdwpTransportError = 103;
14pub const jdwpTransportError_JDWPTRANSPORT_ERROR_OUT_OF_MEMORY: jdwpTransportError = 110;
15pub const jdwpTransportError_JDWPTRANSPORT_ERROR_INTERNAL: jdwpTransportError = 113;
16pub const jdwpTransportError_JDWPTRANSPORT_ERROR_ILLEGAL_STATE: jdwpTransportError = 201;
17pub const jdwpTransportError_JDWPTRANSPORT_ERROR_IO_ERROR: jdwpTransportError = 202;
18pub const jdwpTransportError_JDWPTRANSPORT_ERROR_TIMEOUT: jdwpTransportError = 203;
19pub const jdwpTransportError_JDWPTRANSPORT_ERROR_MSG_NOT_AVAILABLE: jdwpTransportError = 204;
20pub type jdwpTransportError = ::std::os::raw::c_uint;
21#[repr(C)]
22#[repr(align(4))]
23#[derive(Debug, Copy, Clone)]
24pub struct JDWPTransportCapabilities {
25    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize], u8>,
26    pub __bindgen_padding_0: u16,
27}
28impl JDWPTransportCapabilities {
29    #[inline]
30    pub fn can_timeout_attach(&self) -> ::std::os::raw::c_uint {
31        unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) }
32    }
33    #[inline]
34    pub fn set_can_timeout_attach(&mut self, val: ::std::os::raw::c_uint) {
35        unsafe {
36            let val: u32 = ::std::mem::transmute(val);
37            self._bitfield_1.set(0usize, 1u8, val as u64)
38        }
39    }
40    #[inline]
41    pub fn can_timeout_accept(&self) -> ::std::os::raw::c_uint {
42        unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) }
43    }
44    #[inline]
45    pub fn set_can_timeout_accept(&mut self, val: ::std::os::raw::c_uint) {
46        unsafe {
47            let val: u32 = ::std::mem::transmute(val);
48            self._bitfield_1.set(1usize, 1u8, val as u64)
49        }
50    }
51    #[inline]
52    pub fn can_timeout_handshake(&self) -> ::std::os::raw::c_uint {
53        unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) }
54    }
55    #[inline]
56    pub fn set_can_timeout_handshake(&mut self, val: ::std::os::raw::c_uint) {
57        unsafe {
58            let val: u32 = ::std::mem::transmute(val);
59            self._bitfield_1.set(2usize, 1u8, val as u64)
60        }
61    }
62    #[inline]
63    pub fn reserved3(&self) -> ::std::os::raw::c_uint {
64        unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) }
65    }
66    #[inline]
67    pub fn set_reserved3(&mut self, val: ::std::os::raw::c_uint) {
68        unsafe {
69            let val: u32 = ::std::mem::transmute(val);
70            self._bitfield_1.set(3usize, 1u8, val as u64)
71        }
72    }
73    #[inline]
74    pub fn reserved4(&self) -> ::std::os::raw::c_uint {
75        unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) }
76    }
77    #[inline]
78    pub fn set_reserved4(&mut self, val: ::std::os::raw::c_uint) {
79        unsafe {
80            let val: u32 = ::std::mem::transmute(val);
81            self._bitfield_1.set(4usize, 1u8, val as u64)
82        }
83    }
84    #[inline]
85    pub fn reserved5(&self) -> ::std::os::raw::c_uint {
86        unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u32) }
87    }
88    #[inline]
89    pub fn set_reserved5(&mut self, val: ::std::os::raw::c_uint) {
90        unsafe {
91            let val: u32 = ::std::mem::transmute(val);
92            self._bitfield_1.set(5usize, 1u8, val as u64)
93        }
94    }
95    #[inline]
96    pub fn reserved6(&self) -> ::std::os::raw::c_uint {
97        unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u32) }
98    }
99    #[inline]
100    pub fn set_reserved6(&mut self, val: ::std::os::raw::c_uint) {
101        unsafe {
102            let val: u32 = ::std::mem::transmute(val);
103            self._bitfield_1.set(6usize, 1u8, val as u64)
104        }
105    }
106    #[inline]
107    pub fn reserved7(&self) -> ::std::os::raw::c_uint {
108        unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u32) }
109    }
110    #[inline]
111    pub fn set_reserved7(&mut self, val: ::std::os::raw::c_uint) {
112        unsafe {
113            let val: u32 = ::std::mem::transmute(val);
114            self._bitfield_1.set(7usize, 1u8, val as u64)
115        }
116    }
117    #[inline]
118    pub fn reserved8(&self) -> ::std::os::raw::c_uint {
119        unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u32) }
120    }
121    #[inline]
122    pub fn set_reserved8(&mut self, val: ::std::os::raw::c_uint) {
123        unsafe {
124            let val: u32 = ::std::mem::transmute(val);
125            self._bitfield_1.set(8usize, 1u8, val as u64)
126        }
127    }
128    #[inline]
129    pub fn reserved9(&self) -> ::std::os::raw::c_uint {
130        unsafe { ::std::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u32) }
131    }
132    #[inline]
133    pub fn set_reserved9(&mut self, val: ::std::os::raw::c_uint) {
134        unsafe {
135            let val: u32 = ::std::mem::transmute(val);
136            self._bitfield_1.set(9usize, 1u8, val as u64)
137        }
138    }
139    #[inline]
140    pub fn reserved10(&self) -> ::std::os::raw::c_uint {
141        unsafe { ::std::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u32) }
142    }
143    #[inline]
144    pub fn set_reserved10(&mut self, val: ::std::os::raw::c_uint) {
145        unsafe {
146            let val: u32 = ::std::mem::transmute(val);
147            self._bitfield_1.set(10usize, 1u8, val as u64)
148        }
149    }
150    #[inline]
151    pub fn reserved11(&self) -> ::std::os::raw::c_uint {
152        unsafe { ::std::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u32) }
153    }
154    #[inline]
155    pub fn set_reserved11(&mut self, val: ::std::os::raw::c_uint) {
156        unsafe {
157            let val: u32 = ::std::mem::transmute(val);
158            self._bitfield_1.set(11usize, 1u8, val as u64)
159        }
160    }
161    #[inline]
162    pub fn reserved12(&self) -> ::std::os::raw::c_uint {
163        unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u32) }
164    }
165    #[inline]
166    pub fn set_reserved12(&mut self, val: ::std::os::raw::c_uint) {
167        unsafe {
168            let val: u32 = ::std::mem::transmute(val);
169            self._bitfield_1.set(12usize, 1u8, val as u64)
170        }
171    }
172    #[inline]
173    pub fn reserved13(&self) -> ::std::os::raw::c_uint {
174        unsafe { ::std::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u32) }
175    }
176    #[inline]
177    pub fn set_reserved13(&mut self, val: ::std::os::raw::c_uint) {
178        unsafe {
179            let val: u32 = ::std::mem::transmute(val);
180            self._bitfield_1.set(13usize, 1u8, val as u64)
181        }
182    }
183    #[inline]
184    pub fn reserved14(&self) -> ::std::os::raw::c_uint {
185        unsafe { ::std::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u32) }
186    }
187    #[inline]
188    pub fn set_reserved14(&mut self, val: ::std::os::raw::c_uint) {
189        unsafe {
190            let val: u32 = ::std::mem::transmute(val);
191            self._bitfield_1.set(14usize, 1u8, val as u64)
192        }
193    }
194    #[inline]
195    pub fn reserved15(&self) -> ::std::os::raw::c_uint {
196        unsafe { ::std::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u32) }
197    }
198    #[inline]
199    pub fn set_reserved15(&mut self, val: ::std::os::raw::c_uint) {
200        unsafe {
201            let val: u32 = ::std::mem::transmute(val);
202            self._bitfield_1.set(15usize, 1u8, val as u64)
203        }
204    }
205    #[inline]
206    pub fn new_bitfield_1(
207        can_timeout_attach: ::std::os::raw::c_uint,
208        can_timeout_accept: ::std::os::raw::c_uint,
209        can_timeout_handshake: ::std::os::raw::c_uint,
210        reserved3: ::std::os::raw::c_uint,
211        reserved4: ::std::os::raw::c_uint,
212        reserved5: ::std::os::raw::c_uint,
213        reserved6: ::std::os::raw::c_uint,
214        reserved7: ::std::os::raw::c_uint,
215        reserved8: ::std::os::raw::c_uint,
216        reserved9: ::std::os::raw::c_uint,
217        reserved10: ::std::os::raw::c_uint,
218        reserved11: ::std::os::raw::c_uint,
219        reserved12: ::std::os::raw::c_uint,
220        reserved13: ::std::os::raw::c_uint,
221        reserved14: ::std::os::raw::c_uint,
222        reserved15: ::std::os::raw::c_uint,
223    ) -> __BindgenBitfieldUnit<[u8; 2usize], u8> {
224        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize], u8> =
225            Default::default();
226        __bindgen_bitfield_unit.set(0usize, 1u8, {
227            let can_timeout_attach: u32 = unsafe { ::std::mem::transmute(can_timeout_attach) };
228            can_timeout_attach as u64
229        });
230        __bindgen_bitfield_unit.set(1usize, 1u8, {
231            let can_timeout_accept: u32 = unsafe { ::std::mem::transmute(can_timeout_accept) };
232            can_timeout_accept as u64
233        });
234        __bindgen_bitfield_unit.set(2usize, 1u8, {
235            let can_timeout_handshake: u32 =
236                unsafe { ::std::mem::transmute(can_timeout_handshake) };
237            can_timeout_handshake as u64
238        });
239        __bindgen_bitfield_unit.set(3usize, 1u8, {
240            let reserved3: u32 = unsafe { ::std::mem::transmute(reserved3) };
241            reserved3 as u64
242        });
243        __bindgen_bitfield_unit.set(4usize, 1u8, {
244            let reserved4: u32 = unsafe { ::std::mem::transmute(reserved4) };
245            reserved4 as u64
246        });
247        __bindgen_bitfield_unit.set(5usize, 1u8, {
248            let reserved5: u32 = unsafe { ::std::mem::transmute(reserved5) };
249            reserved5 as u64
250        });
251        __bindgen_bitfield_unit.set(6usize, 1u8, {
252            let reserved6: u32 = unsafe { ::std::mem::transmute(reserved6) };
253            reserved6 as u64
254        });
255        __bindgen_bitfield_unit.set(7usize, 1u8, {
256            let reserved7: u32 = unsafe { ::std::mem::transmute(reserved7) };
257            reserved7 as u64
258        });
259        __bindgen_bitfield_unit.set(8usize, 1u8, {
260            let reserved8: u32 = unsafe { ::std::mem::transmute(reserved8) };
261            reserved8 as u64
262        });
263        __bindgen_bitfield_unit.set(9usize, 1u8, {
264            let reserved9: u32 = unsafe { ::std::mem::transmute(reserved9) };
265            reserved9 as u64
266        });
267        __bindgen_bitfield_unit.set(10usize, 1u8, {
268            let reserved10: u32 = unsafe { ::std::mem::transmute(reserved10) };
269            reserved10 as u64
270        });
271        __bindgen_bitfield_unit.set(11usize, 1u8, {
272            let reserved11: u32 = unsafe { ::std::mem::transmute(reserved11) };
273            reserved11 as u64
274        });
275        __bindgen_bitfield_unit.set(12usize, 1u8, {
276            let reserved12: u32 = unsafe { ::std::mem::transmute(reserved12) };
277            reserved12 as u64
278        });
279        __bindgen_bitfield_unit.set(13usize, 1u8, {
280            let reserved13: u32 = unsafe { ::std::mem::transmute(reserved13) };
281            reserved13 as u64
282        });
283        __bindgen_bitfield_unit.set(14usize, 1u8, {
284            let reserved14: u32 = unsafe { ::std::mem::transmute(reserved14) };
285            reserved14 as u64
286        });
287        __bindgen_bitfield_unit.set(15usize, 1u8, {
288            let reserved15: u32 = unsafe { ::std::mem::transmute(reserved15) };
289            reserved15 as u64
290        });
291        __bindgen_bitfield_unit
292    }
293}
294pub const JDWPTRANSPORT_FLAGS_NONE: ::std::os::raw::c_uint = 0;
295pub const JDWPTRANSPORT_FLAGS_REPLY: ::std::os::raw::c_uint = 128;
296#[repr(C)]
297#[derive(Debug, Copy, Clone)]
298pub struct jdwpCmdPacket {
299    pub len: jint,
300    pub id: jint,
301    pub flags: jbyte,
302    pub cmdSet: jbyte,
303    pub cmd: jbyte,
304    pub data: *mut jbyte,
305}
306#[repr(C)]
307#[derive(Debug, Copy, Clone)]
308pub struct jdwpReplyPacket {
309    pub len: jint,
310    pub id: jint,
311    pub flags: jbyte,
312    pub errorCode: jshort,
313    pub data: *mut jbyte,
314}
315#[repr(C)]
316#[derive(Copy, Clone)]
317pub struct jdwpPacket {
318    pub type_: jdwpPacket__bindgen_ty_1,
319}
320#[repr(C)]
321#[derive(Copy, Clone)]
322pub union jdwpPacket__bindgen_ty_1 {
323    pub cmd: jdwpCmdPacket,
324    pub reply: jdwpReplyPacket,
325    _bindgen_union_align: [u64; 3usize],
326}
327#[repr(C)]
328#[derive(Debug, Copy, Clone)]
329pub struct jdwpTransportCallback {
330    pub alloc:
331        ::std::option::Option<unsafe extern "C" fn(numBytes: jint) -> *mut ::std::os::raw::c_void>,
332    pub free: ::std::option::Option<unsafe extern "C" fn(buffer: *mut ::std::os::raw::c_void)>,
333}
334pub type jdwpTransport_OnLoad_t = ::std::option::Option<
335    unsafe extern "C" fn(
336        jvm: *mut JavaVM,
337        callback: *mut jdwpTransportCallback,
338        version: jint,
339        env: *mut *mut jdwpTransportEnv,
340    ) -> jint,
341>;
342#[repr(C)]
343#[derive(Debug, Copy, Clone)]
344pub struct jdwpTransportConfiguration {
345    pub allowed_peers: *const ::std::os::raw::c_char,
346}
347#[repr(C)]
348#[derive(Debug, Copy, Clone)]
349pub struct jdwpTransportNativeInterface_ {
350    pub reserved1: *mut ::std::os::raw::c_void,
351    pub GetCapabilities: ::std::option::Option<
352        unsafe extern "C" fn(
353            env: *mut jdwpTransportEnv,
354            capabilities_ptr: *mut JDWPTransportCapabilities,
355        ) -> jdwpTransportError,
356    >,
357    pub Attach: ::std::option::Option<
358        unsafe extern "C" fn(
359            env: *mut jdwpTransportEnv,
360            address: *const ::std::os::raw::c_char,
361            attach_timeout: jlong,
362            handshake_timeout: jlong,
363        ) -> jdwpTransportError,
364    >,
365    pub StartListening: ::std::option::Option<
366        unsafe extern "C" fn(
367            env: *mut jdwpTransportEnv,
368            address: *const ::std::os::raw::c_char,
369            actual_address: *mut *mut ::std::os::raw::c_char,
370        ) -> jdwpTransportError,
371    >,
372    pub StopListening: ::std::option::Option<
373        unsafe extern "C" fn(env: *mut jdwpTransportEnv) -> jdwpTransportError,
374    >,
375    pub Accept: ::std::option::Option<
376        unsafe extern "C" fn(
377            env: *mut jdwpTransportEnv,
378            accept_timeout: jlong,
379            handshake_timeout: jlong,
380        ) -> jdwpTransportError,
381    >,
382    pub IsOpen: ::std::option::Option<unsafe extern "C" fn(env: *mut jdwpTransportEnv) -> jboolean>,
383    pub Close: ::std::option::Option<
384        unsafe extern "C" fn(env: *mut jdwpTransportEnv) -> jdwpTransportError,
385    >,
386    pub ReadPacket: ::std::option::Option<
387        unsafe extern "C" fn(
388            env: *mut jdwpTransportEnv,
389            pkt: *mut jdwpPacket,
390        ) -> jdwpTransportError,
391    >,
392    pub WritePacket: ::std::option::Option<
393        unsafe extern "C" fn(
394            env: *mut jdwpTransportEnv,
395            pkt: *const jdwpPacket,
396        ) -> jdwpTransportError,
397    >,
398    pub GetLastError: ::std::option::Option<
399        unsafe extern "C" fn(
400            env: *mut jdwpTransportEnv,
401            error: *mut *mut ::std::os::raw::c_char,
402        ) -> jdwpTransportError,
403    >,
404    pub SetTransportConfiguration: ::std::option::Option<
405        unsafe extern "C" fn(
406            env: *mut jdwpTransportEnv,
407            config: *mut jdwpTransportConfiguration,
408        ) -> jdwpTransportError,
409    >,
410}
411#[repr(C)]
412#[derive(Debug, Copy, Clone)]
413pub struct _jdwpTransportEnv {
414    pub functions: *const jdwpTransportNativeInterface_,
415}