@@ -48,6 +48,9 @@ pub type name_t = u64;
4848
4949pub type iconv_t = * mut :: c_void ;
5050
51+ // linux/sctp.h
52+ pub type sctp_assoc_t = :: __s32 ;
53+
5154#[ cfg_attr( feature = "extra_traits" , derive( Debug ) ) ]
5255pub enum fpos64_t { } // FIXME: fill this out with a struct
5356impl :: Copy for fpos64_t { }
@@ -625,6 +628,63 @@ s! {
625628 pub flag: * mut :: c_int,
626629 pub val: :: c_int,
627630 }
631+
632+ // linux/sctp.h
633+
634+ pub struct sctp_initmsg {
635+ pub sinit_num_ostreams: :: __u16,
636+ pub sinit_max_instreams: :: __u16,
637+ pub sinit_max_attempts: :: __u16,
638+ pub sinit_max_init_timeo: :: __u16,
639+ }
640+
641+ pub struct sctp_sndrcvinfo {
642+ pub sinfo_stream: :: __u16,
643+ pub sinfo_ssn: :: __u16,
644+ pub sinfo_flags: :: __u16,
645+ pub sinfo_ppid: :: __u32,
646+ pub sinfo_context: :: __u32,
647+ pub sinfo_timetolive: :: __u32,
648+ pub sinfo_tsn: :: __u32,
649+ pub sinfo_cumtsn: :: __u32,
650+ pub sinfo_assoc_id: :: sctp_assoc_t,
651+ }
652+
653+ pub struct sctp_sndinfo {
654+ pub snd_sid: :: __u16,
655+ pub snd_flags: :: __u16,
656+ pub snd_ppid: :: __u32,
657+ pub snd_context: :: __u32,
658+ pub snd_assoc_id: :: sctp_assoc_t,
659+ }
660+
661+ pub struct sctp_rcvinfo {
662+ pub rcv_sid: :: __u16,
663+ pub rcv_ssn: :: __u16,
664+ pub rcv_flags: :: __u16,
665+ pub rcv_ppid: :: __u32,
666+ pub rcv_tsn: :: __u32,
667+ pub rcv_cumtsn: :: __u32,
668+ pub rcv_context: :: __u32,
669+ pub rcv_assoc_id: :: sctp_assoc_t,
670+ }
671+
672+ pub struct sctp_nxtinfo {
673+ pub nxt_sid: :: __u16,
674+ pub nxt_flags: :: __u16,
675+ pub nxt_ppid: :: __u32,
676+ pub nxt_length: :: __u32,
677+ pub nxt_assoc_id: :: sctp_assoc_t,
678+ }
679+
680+ pub struct sctp_prinfo {
681+ pub pr_policy: :: __u16,
682+ pub pr_value: :: __u32,
683+ }
684+
685+ pub struct sctp_authinfo {
686+ pub auth_keynumber: :: __u16,
687+ }
628688}
629689
630690s_no_extra_traits ! {
@@ -1853,6 +1913,7 @@ pub const IPC_STAT: ::c_int = 2;
18531913pub const IPC_INFO : :: c_int = 3 ;
18541914pub const MSG_STAT : :: c_int = 11 ;
18551915pub const MSG_INFO : :: c_int = 12 ;
1916+ pub const MSG_NOTIFICATION : :: c_int = 0x8000 ;
18561917
18571918pub const MSG_NOERROR : :: c_int = 0o10000 ;
18581919pub const MSG_EXCEPT : :: c_int = 0o20000 ;
@@ -3630,6 +3691,82 @@ pub const J1939_EE_INFO_RX_ABORT: ::c_int = 4;
36303691
36313692pub const J1939_FILTER_MAX : :: c_int = 512 ;
36323693
3694+ // linux/sctp.h
3695+ pub const SCTP_FUTURE_ASSOC : :: c_int = 0 ;
3696+ pub const SCTP_CURRENT_ASSOC : :: c_int = 1 ;
3697+ pub const SCTP_ALL_ASSOC : :: c_int = 2 ;
3698+ pub const SCTP_RTOINFO : :: c_int = 0 ;
3699+ pub const SCTP_ASSOCINFO : :: c_int = 1 ;
3700+ pub const SCTP_INITMSG : :: c_int = 2 ;
3701+ pub const SCTP_NODELAY : :: c_int = 3 ;
3702+ pub const SCTP_AUTOCLOSE : :: c_int = 4 ;
3703+ pub const SCTP_SET_PEER_PRIMARY_ADDR : :: c_int = 5 ;
3704+ pub const SCTP_PRIMARY_ADDR : :: c_int = 6 ;
3705+ pub const SCTP_ADAPTATION_LAYER : :: c_int = 7 ;
3706+ pub const SCTP_DISABLE_FRAGMENTS : :: c_int = 8 ;
3707+ pub const SCTP_PEER_ADDR_PARAMS : :: c_int = 9 ;
3708+ pub const SCTP_DEFAULT_SEND_PARAM : :: c_int = 10 ;
3709+ pub const SCTP_EVENTS : :: c_int = 11 ;
3710+ pub const SCTP_I_WANT_MAPPED_V4_ADDR : :: c_int = 12 ;
3711+ pub const SCTP_MAXSEG : :: c_int = 13 ;
3712+ pub const SCTP_STATUS : :: c_int = 14 ;
3713+ pub const SCTP_GET_PEER_ADDR_INFO : :: c_int = 15 ;
3714+ pub const SCTP_DELAYED_ACK_TIME : :: c_int = 16 ;
3715+ pub const SCTP_DELAYED_ACK : :: c_int = SCTP_DELAYED_ACK_TIME ;
3716+ pub const SCTP_DELAYED_SACK : :: c_int = SCTP_DELAYED_ACK_TIME ;
3717+ pub const SCTP_CONTEXT : :: c_int = 17 ;
3718+ pub const SCTP_FRAGMENT_INTERLEAVE : :: c_int = 18 ;
3719+ pub const SCTP_PARTIAL_DELIVERY_POINT : :: c_int = 19 ;
3720+ pub const SCTP_MAX_BURST : :: c_int = 20 ;
3721+ pub const SCTP_AUTH_CHUNK : :: c_int = 21 ;
3722+ pub const SCTP_HMAC_IDENT : :: c_int = 22 ;
3723+ pub const SCTP_AUTH_KEY : :: c_int = 23 ;
3724+ pub const SCTP_AUTH_ACTIVE_KEY : :: c_int = 24 ;
3725+ pub const SCTP_AUTH_DELETE_KEY : :: c_int = 25 ;
3726+ pub const SCTP_PEER_AUTH_CHUNKS : :: c_int = 26 ;
3727+ pub const SCTP_LOCAL_AUTH_CHUNKS : :: c_int = 27 ;
3728+ pub const SCTP_GET_ASSOC_NUMBER : :: c_int = 28 ;
3729+ pub const SCTP_GET_ASSOC_ID_LIST : :: c_int = 29 ;
3730+ pub const SCTP_AUTO_ASCONF : :: c_int = 30 ;
3731+ pub const SCTP_PEER_ADDR_THLDS : :: c_int = 31 ;
3732+ pub const SCTP_RECVRCVINFO : :: c_int = 32 ;
3733+ pub const SCTP_RECVNXTINFO : :: c_int = 33 ;
3734+ pub const SCTP_DEFAULT_SNDINFO : :: c_int = 34 ;
3735+ pub const SCTP_AUTH_DEACTIVATE_KEY : :: c_int = 35 ;
3736+ pub const SCTP_REUSE_PORT : :: c_int = 36 ;
3737+ pub const SCTP_PEER_ADDR_THLDS_V2 : :: c_int = 37 ;
3738+ pub const SCTP_PR_SCTP_NONE : :: c_int = 0x0000 ;
3739+ pub const SCTP_PR_SCTP_TTL : :: c_int = 0x0010 ;
3740+ pub const SCTP_PR_SCTP_RTX : :: c_int = 0x0020 ;
3741+ pub const SCTP_PR_SCTP_PRIO : :: c_int = 0x0030 ;
3742+ pub const SCTP_PR_SCTP_MAX : :: c_int = SCTP_PR_SCTP_PRIO ;
3743+ pub const SCTP_PR_SCTP_MASK : :: c_int = 0x0030 ;
3744+ pub const SCTP_ENABLE_RESET_STREAM_REQ : :: c_int = 0x01 ;
3745+ pub const SCTP_ENABLE_RESET_ASSOC_REQ : :: c_int = 0x02 ;
3746+ pub const SCTP_ENABLE_CHANGE_ASSOC_REQ : :: c_int = 0x04 ;
3747+ pub const SCTP_ENABLE_STRRESET_MASK : :: c_int = 0x07 ;
3748+ pub const SCTP_STREAM_RESET_INCOMING : :: c_int = 0x01 ;
3749+ pub const SCTP_STREAM_RESET_OUTGOING : :: c_int = 0x02 ;
3750+
3751+ pub const SCTP_INIT : :: c_int = 0 ;
3752+ pub const SCTP_SNDRCV : :: c_int = 1 ;
3753+ pub const SCTP_SNDINFO : :: c_int = 2 ;
3754+ pub const SCTP_RCVINFO : :: c_int = 3 ;
3755+ pub const SCTP_NXTINFO : :: c_int = 4 ;
3756+ pub const SCTP_PRINFO : :: c_int = 5 ;
3757+ pub const SCTP_AUTHINFO : :: c_int = 6 ;
3758+ pub const SCTP_DSTADDRV4 : :: c_int = 7 ;
3759+ pub const SCTP_DSTADDRV6 : :: c_int = 8 ;
3760+
3761+ pub const SCTP_UNORDERED : :: c_int = 1 << 0 ;
3762+ pub const SCTP_ADDR_OVER : :: c_int = 1 << 1 ;
3763+ pub const SCTP_ABORT : :: c_int = 1 << 2 ;
3764+ pub const SCTP_SACK_IMMEDIATELY : :: c_int = 1 << 3 ;
3765+ pub const SCTP_SENDALL : :: c_int = 1 << 6 ;
3766+ pub const SCTP_PR_SCTP_ALL : :: c_int = 1 << 7 ;
3767+ pub const SCTP_NOTIFICATION : :: c_int = MSG_NOTIFICATION ;
3768+ pub const SCTP_EOF : :: c_int = :: MSG_FIN ;
3769+
36333770f ! {
36343771 pub fn NLA_ALIGN ( len: :: c_int) -> :: c_int {
36353772 return ( ( len) + NLA_ALIGNTO - 1 ) & !( NLA_ALIGNTO - 1 )
@@ -3705,6 +3842,20 @@ f! {
37053842 set1. bits == set2. bits
37063843 }
37073844
3845+ pub fn SCTP_PR_INDEX ( policy: :: c_int) -> :: c_int {
3846+ policy >> 4 - 1
3847+ }
3848+
3849+ pub fn SCTP_PR_POLICY ( policy: :: c_int) -> :: c_int {
3850+ policy & SCTP_PR_SCTP_MASK
3851+ }
3852+
3853+ pub fn SCTP_PR_SET_POLICY ( flags: & mut :: c_int, policy: :: c_int) -> ( ) {
3854+ * flags &= !SCTP_PR_SCTP_MASK ;
3855+ * flags |= policy;
3856+ ( )
3857+ }
3858+
37083859 pub fn major( dev: :: dev_t) -> :: c_uint {
37093860 let mut major = 0 ;
37103861 major |= ( dev & 0x00000000000fff00 ) >> 8 ;
@@ -3771,6 +3922,18 @@ safe_f! {
37713922 dev |= ( minor & 0xffffff00 ) << 12 ;
37723923 dev
37733924 }
3925+
3926+ pub { const } fn SCTP_PR_TTL_ENABLED ( policy: :: c_int) -> bool {
3927+ policy == SCTP_PR_SCTP_TTL
3928+ }
3929+
3930+ pub { const } fn SCTP_PR_RTX_ENABLED ( policy: :: c_int) -> bool {
3931+ policy == SCTP_PR_SCTP_RTX
3932+ }
3933+
3934+ pub { const } fn SCTP_PR_PRIO_ENABLED ( policy: :: c_int) -> bool {
3935+ policy == SCTP_PR_SCTP_PRIO
3936+ }
37743937}
37753938
37763939cfg_if ! {
0 commit comments