@@ -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,63 @@ s! {
625
628
pub flag: * mut :: c_int,
626
629
pub val: :: c_int,
627
630
}
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
+ }
628
688
}
629
689
630
690
s_no_extra_traits ! {
@@ -1853,6 +1913,7 @@ pub const IPC_STAT: ::c_int = 2;
1853
1913
pub const IPC_INFO : :: c_int = 3 ;
1854
1914
pub const MSG_STAT : :: c_int = 11 ;
1855
1915
pub const MSG_INFO : :: c_int = 12 ;
1916
+ pub const MSG_NOTIFICATION : :: c_int = 0x8000 ;
1856
1917
1857
1918
pub const MSG_NOERROR : :: c_int = 0o10000 ;
1858
1919
pub const MSG_EXCEPT : :: c_int = 0o20000 ;
@@ -3651,6 +3712,82 @@ pub const J1939_EE_INFO_RX_ABORT: ::c_int = 4;
3651
3712
3652
3713
pub const J1939_FILTER_MAX : :: c_int = 512 ;
3653
3714
3715
+ // linux/sctp.h
3716
+ pub const SCTP_FUTURE_ASSOC : :: c_int = 0 ;
3717
+ pub const SCTP_CURRENT_ASSOC : :: c_int = 1 ;
3718
+ pub const SCTP_ALL_ASSOC : :: c_int = 2 ;
3719
+ pub const SCTP_RTOINFO : :: c_int = 0 ;
3720
+ pub const SCTP_ASSOCINFO : :: c_int = 1 ;
3721
+ pub const SCTP_INITMSG : :: c_int = 2 ;
3722
+ pub const SCTP_NODELAY : :: c_int = 3 ;
3723
+ pub const SCTP_AUTOCLOSE : :: c_int = 4 ;
3724
+ pub const SCTP_SET_PEER_PRIMARY_ADDR : :: c_int = 5 ;
3725
+ pub const SCTP_PRIMARY_ADDR : :: c_int = 6 ;
3726
+ pub const SCTP_ADAPTATION_LAYER : :: c_int = 7 ;
3727
+ pub const SCTP_DISABLE_FRAGMENTS : :: c_int = 8 ;
3728
+ pub const SCTP_PEER_ADDR_PARAMS : :: c_int = 9 ;
3729
+ pub const SCTP_DEFAULT_SEND_PARAM : :: c_int = 10 ;
3730
+ pub const SCTP_EVENTS : :: c_int = 11 ;
3731
+ pub const SCTP_I_WANT_MAPPED_V4_ADDR : :: c_int = 12 ;
3732
+ pub const SCTP_MAXSEG : :: c_int = 13 ;
3733
+ pub const SCTP_STATUS : :: c_int = 14 ;
3734
+ pub const SCTP_GET_PEER_ADDR_INFO : :: c_int = 15 ;
3735
+ pub const SCTP_DELAYED_ACK_TIME : :: c_int = 16 ;
3736
+ pub const SCTP_DELAYED_ACK : :: c_int = SCTP_DELAYED_ACK_TIME ;
3737
+ pub const SCTP_DELAYED_SACK : :: c_int = SCTP_DELAYED_ACK_TIME ;
3738
+ pub const SCTP_CONTEXT : :: c_int = 17 ;
3739
+ pub const SCTP_FRAGMENT_INTERLEAVE : :: c_int = 18 ;
3740
+ pub const SCTP_PARTIAL_DELIVERY_POINT : :: c_int = 19 ;
3741
+ pub const SCTP_MAX_BURST : :: c_int = 20 ;
3742
+ pub const SCTP_AUTH_CHUNK : :: c_int = 21 ;
3743
+ pub const SCTP_HMAC_IDENT : :: c_int = 22 ;
3744
+ pub const SCTP_AUTH_KEY : :: c_int = 23 ;
3745
+ pub const SCTP_AUTH_ACTIVE_KEY : :: c_int = 24 ;
3746
+ pub const SCTP_AUTH_DELETE_KEY : :: c_int = 25 ;
3747
+ pub const SCTP_PEER_AUTH_CHUNKS : :: c_int = 26 ;
3748
+ pub const SCTP_LOCAL_AUTH_CHUNKS : :: c_int = 27 ;
3749
+ pub const SCTP_GET_ASSOC_NUMBER : :: c_int = 28 ;
3750
+ pub const SCTP_GET_ASSOC_ID_LIST : :: c_int = 29 ;
3751
+ pub const SCTP_AUTO_ASCONF : :: c_int = 30 ;
3752
+ pub const SCTP_PEER_ADDR_THLDS : :: c_int = 31 ;
3753
+ pub const SCTP_RECVRCVINFO : :: c_int = 32 ;
3754
+ pub const SCTP_RECVNXTINFO : :: c_int = 33 ;
3755
+ pub const SCTP_DEFAULT_SNDINFO : :: c_int = 34 ;
3756
+ pub const SCTP_AUTH_DEACTIVATE_KEY : :: c_int = 35 ;
3757
+ pub const SCTP_REUSE_PORT : :: c_int = 36 ;
3758
+ pub const SCTP_PEER_ADDR_THLDS_V2 : :: c_int = 37 ;
3759
+ pub const SCTP_PR_SCTP_NONE : :: c_int = 0x0000 ;
3760
+ pub const SCTP_PR_SCTP_TTL : :: c_int = 0x0010 ;
3761
+ pub const SCTP_PR_SCTP_RTX : :: c_int = 0x0020 ;
3762
+ pub const SCTP_PR_SCTP_PRIO : :: c_int = 0x0030 ;
3763
+ pub const SCTP_PR_SCTP_MAX : :: c_int = SCTP_PR_SCTP_PRIO ;
3764
+ pub const SCTP_PR_SCTP_MASK : :: c_int = 0x0030 ;
3765
+ pub const SCTP_ENABLE_RESET_STREAM_REQ : :: c_int = 0x01 ;
3766
+ pub const SCTP_ENABLE_RESET_ASSOC_REQ : :: c_int = 0x02 ;
3767
+ pub const SCTP_ENABLE_CHANGE_ASSOC_REQ : :: c_int = 0x04 ;
3768
+ pub const SCTP_ENABLE_STRRESET_MASK : :: c_int = 0x07 ;
3769
+ pub const SCTP_STREAM_RESET_INCOMING : :: c_int = 0x01 ;
3770
+ pub const SCTP_STREAM_RESET_OUTGOING : :: c_int = 0x02 ;
3771
+
3772
+ pub const SCTP_INIT : :: c_int = 0 ;
3773
+ pub const SCTP_SNDRCV : :: c_int = 1 ;
3774
+ pub const SCTP_SNDINFO : :: c_int = 2 ;
3775
+ pub const SCTP_RCVINFO : :: c_int = 3 ;
3776
+ pub const SCTP_NXTINFO : :: c_int = 4 ;
3777
+ pub const SCTP_PRINFO : :: c_int = 5 ;
3778
+ pub const SCTP_AUTHINFO : :: c_int = 6 ;
3779
+ pub const SCTP_DSTADDRV4 : :: c_int = 7 ;
3780
+ pub const SCTP_DSTADDRV6 : :: c_int = 8 ;
3781
+
3782
+ pub const SCTP_UNORDERED : :: c_int = 1 << 0 ;
3783
+ pub const SCTP_ADDR_OVER : :: c_int = 1 << 1 ;
3784
+ pub const SCTP_ABORT : :: c_int = 1 << 2 ;
3785
+ pub const SCTP_SACK_IMMEDIATELY : :: c_int = 1 << 3 ;
3786
+ pub const SCTP_SENDALL : :: c_int = 1 << 6 ;
3787
+ pub const SCTP_PR_SCTP_ALL : :: c_int = 1 << 7 ;
3788
+ pub const SCTP_NOTIFICATION : :: c_int = MSG_NOTIFICATION ;
3789
+ pub const SCTP_EOF : :: c_int = :: MSG_FIN ;
3790
+
3654
3791
f ! {
3655
3792
pub fn NLA_ALIGN ( len: :: c_int) -> :: c_int {
3656
3793
return ( ( len) + NLA_ALIGNTO - 1 ) & !( NLA_ALIGNTO - 1 )
@@ -3726,6 +3863,20 @@ f! {
3726
3863
set1. bits == set2. bits
3727
3864
}
3728
3865
3866
+ pub fn SCTP_PR_INDEX ( policy: :: c_int) -> :: c_int {
3867
+ policy >> 4 - 1
3868
+ }
3869
+
3870
+ pub fn SCTP_PR_POLICY ( policy: :: c_int) -> :: c_int {
3871
+ policy & SCTP_PR_SCTP_MASK
3872
+ }
3873
+
3874
+ pub fn SCTP_PR_SET_POLICY ( flags: & mut :: c_int, policy: :: c_int) -> ( ) {
3875
+ * flags &= !SCTP_PR_SCTP_MASK ;
3876
+ * flags |= policy;
3877
+ ( )
3878
+ }
3879
+
3729
3880
pub fn major( dev: :: dev_t) -> :: c_uint {
3730
3881
let mut major = 0 ;
3731
3882
major |= ( dev & 0x00000000000fff00 ) >> 8 ;
@@ -3792,6 +3943,18 @@ safe_f! {
3792
3943
dev |= ( minor & 0xffffff00 ) << 12 ;
3793
3944
dev
3794
3945
}
3946
+
3947
+ pub { const } fn SCTP_PR_TTL_ENABLED ( policy: :: c_int) -> bool {
3948
+ policy == SCTP_PR_SCTP_TTL
3949
+ }
3950
+
3951
+ pub { const } fn SCTP_PR_RTX_ENABLED ( policy: :: c_int) -> bool {
3952
+ policy == SCTP_PR_SCTP_RTX
3953
+ }
3954
+
3955
+ pub { const } fn SCTP_PR_PRIO_ENABLED ( policy: :: c_int) -> bool {
3956
+ policy == SCTP_PR_SCTP_PRIO
3957
+ }
3795
3958
}
3796
3959
3797
3960
cfg_if ! {
0 commit comments