Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding tcp_info to openbsd #3481

Merged
merged 1 commit into from Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions libc-test/semver/openbsd.txt
Expand Up @@ -808,6 +808,7 @@ ST_RDONLY
S_IEXEC
S_IREAD
S_IWRITE
TCP_INFO
TCP_MAXSEG
TCP_MD5SIG
TCP_NOPUSH
Expand Down Expand Up @@ -1014,6 +1015,7 @@ backtrace
backtrace_symbols
backtrace_symbols_fd
backtrace_symbols_fmt
basename
bsearch
caddr_t
calloc_conceal
Expand All @@ -1027,6 +1029,7 @@ cmsghdr
daemon
difftime
dirfd
dirname
dl_iterate_phdr
dl_phdr_info
drand48
Expand Down Expand Up @@ -1254,6 +1257,7 @@ strtonum
sync
syscall
sysctl
tcp_info
telldir
tmpfs_args
truncate
Expand All @@ -1269,5 +1273,3 @@ utmp
utrace
wait4
xucred
dirname
basename
2 changes: 2 additions & 0 deletions src/unix/bsd/netbsdlike/mod.rs
Expand Up @@ -650,6 +650,8 @@ pub const TIMER_ABSTIME: ::c_int = 1;

pub const RB_AUTOBOOT: ::c_int = 0;

pub const TCP_INFO: ::c_int = 9;

#[link(name = "util")]
extern "C" {
pub fn setgrent();
Expand Down
1 change: 0 additions & 1 deletion src/unix/bsd/netbsdlike/netbsd/mod.rs
Expand Up @@ -1549,7 +1549,6 @@ pub const TCP_KEEPIDLE: ::c_int = 3;
pub const TCP_KEEPINTVL: ::c_int = 5;
pub const TCP_KEEPCNT: ::c_int = 6;
pub const TCP_KEEPINIT: ::c_int = 7;
pub const TCP_INFO: ::c_int = 9;
pub const TCP_MD5SIG: ::c_int = 0x10;
pub const TCP_CONGCTL: ::c_int = 0x20;

Expand Down
62 changes: 62 additions & 0 deletions src/unix/bsd/netbsdlike/openbsd/mod.rs
Expand Up @@ -541,6 +541,68 @@ s! {
#[cfg(not(libc_union))]
pub ifr_ifru: ::sockaddr,
}

pub struct tcp_info {
pub tcpi_state: u8,
pub __tcpi_ca_state: u8,
pub __tcpi_retransmits: u8,
pub __tcpi_probes: u8,
pub __tcpi_backoff: u8,
pub tcpi_options: u8,
pub tcpi_snd_wscale: u8,
pub tcpi_rcv_wscale: u8,
pub tcpi_rto: u32,
pub __tcpi_ato: u32,
pub tcpi_snd_mss: u32,
pub tcpi_rcv_mss: u32,
pub __tcpi_unacked: u32,
pub __tcpi_sacked: u32,
pub __tcpi_lost: u32,
pub __tcpi_retrans: u32,
pub __tcpi_fackets: u32,
pub tcpi_last_data_sent: u32,
pub tcpi_last_ack_sent: u32,
pub tcpi_last_data_recv: u32,
pub tcpi_last_ack_recv: u32,
pub __tcpi_pmtu: u32,
pub __tcpi_rcv_ssthresh: u32,
pub tcpi_rtt: u32,
pub tcpi_rttvar: u32,
pub tcpi_snd_ssthresh: u32,
pub tcpi_snd_cwnd: u32,
pub __tcpi_advmss: u32,
pub __tcpi_reordering: u32,
pub __tcpi_rcv_rtt: u32,
pub tcpi_rcv_space: u32,
pub tcpi_snd_wnd: u32,
pub tcpi_snd_nxt: u32,
pub tcpi_rcv_nxt: u32,
pub tcpi_toe_tid: u32,
pub tcpi_snd_rexmitpack: u32,
pub tcpi_rcv_ooopack: u32,
pub tcpi_snd_zerowin: u32,
pub tcpi_rttmin: u32,
pub tcpi_max_sndwnd: u32,
pub tcpi_rcv_adv: u32,
pub tcpi_rcv_up: u32,
pub tcpi_snd_una: u32,
pub tcpi_snd_up: u32,
pub tcpi_snd_wl1: u32,
pub tcpi_snd_wl2: u32,
pub tcpi_snd_max: u32,
pub tcpi_ts_recent: u32,
pub tcpi_ts_recent_age: u32,
pub tcpi_rfbuf_cnt: u32,
pub tcpi_rfbuf_ts: u32,
pub tcpi_so_rcv_sb_cc: u32,
pub tcpi_so_rcv_sb_hiwat: u32,
pub tcpi_so_rcv_sb_lowat: u32,
pub tcpi_so_rcv_sb_wat: u32,
pub tcpi_so_snd_sb_cc: u32,
pub tcpi_so_snd_sb_hiwat: u32,
pub tcpi_so_snd_sb_lowat: u32,
pub tcpi_so_snd_sb_wat: u32,
}
}

impl siginfo_t {
Expand Down