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