sctp_sys/common.rs
1// Copyright 2019 sctp-sys Developers
2//
3// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
4// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
5// http://opensource.org/licenses/MIT>, at your option. This file may not be
6// copied, modified, or distributed except according to those terms.
7
8use libc::{c_int, c_uint};
9
10pub const SOL_SCTP: c_int = 132;
11pub const IPPROTO_SCTP: c_int = 132;
12pub const SOCK_SEQPACKET: c_int = 5;
13
14#[allow(non_camel_case_types)]
15pub type sctp_assoc_t = c_uint;
16
17#[derive(Debug, Copy, Clone)]
18#[repr(C)]
19pub struct sctp_sndrcvinfo {
20 /// Stream sending to
21 pub sinfo_stream: u16,
22 /// Valid for recv only
23 pub sinfo_ssn: u16,
24 /// Flags to control sending
25 pub sinfo_flags: u16,
26 /// ppid field
27 pub sinfo_ppid: u32,
28 /// context field
29 pub sinfo_context: u32,
30 /// timetolive for PR-SCTP
31 pub sinfo_timetolive: u32,
32 /// valid for recv only
33 pub sinfo_tsn: u32,
34 /// valid for recv only
35 pub sinfo_cumtsn: u32,
36 /// The association id
37 pub sinfo_assoc_id: sctp_assoc_t,
38}