Finish installation proxy bindings

This commit is contained in:
Jackson Coxson
2025-04-07 09:44:11 -06:00
parent d39966dac9
commit 2859b691df
2 changed files with 432 additions and 6 deletions

View File

@@ -3,6 +3,7 @@
use std::{
ffi::c_int,
net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr},
os::raw::c_void,
};
use libc::{sockaddr_in, sockaddr_in6};
@@ -87,3 +88,12 @@ pub(crate) fn plist_to_libplist(v: &Value) -> *mut libc::c_void {
p.false_drop();
ptr
}
pub(crate) fn libplist_to_plist(v: *mut c_void) -> Value {
let v: plist_plus::Plist = v.into();
let v_string = v.to_string();
v.false_drop();
let reader = std::io::Cursor::new(v_string.as_bytes());
plist::from_reader(reader).unwrap()
}