Skip to content

Commit

Permalink
Merge pull request #5 from hax0r31337/master
Browse files Browse the repository at this point in the history
API Improvements
  • Loading branch information
hussein-aitlahcen authored Oct 15, 2024
2 parents cb722f5 + a38765f commit 863e2dd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion gns/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ where
}

#[inline]
pub fn flags(&self) -> u32 {
pub fn flags(&self) -> i32 {
unsafe { (*self.0).m_nFlags as _ }
}

Expand Down Expand Up @@ -436,6 +436,13 @@ impl GnsConnectionInfo {
self.0.m_eEndReason as u32
}

#[inline]
pub fn end_debug(&self) -> &str {
unsafe { CStr::from_ptr(self.0.m_szEndDebug.as_ptr()) }
.to_str()
.unwrap_or("")
}

#[inline]
pub fn remote_address(&self) -> Ipv6Addr {
Ipv6Addr::from(unsafe { self.0.m_addrRemote.__bindgen_anon_1.m_ipv6 })
Expand Down

0 comments on commit 863e2dd

Please sign in to comment.