@@ -21,6 +21,7 @@ pub type __u16 = ::c_ushort;
21
21
pub type __s16 = :: c_short ;
22
22
pub type __u32 = :: c_uint ;
23
23
pub type __s32 = :: c_int ;
24
+ pub type __be16 = :: __u16 ;
24
25
25
26
pub type Elf32_Half = u16 ;
26
27
pub type Elf32_Word = u32 ;
@@ -616,11 +617,11 @@ s! {
616
617
pub port: :: c_uchar,
617
618
}
618
619
619
- pub struct in6_ifreq {
620
- pub ifr6_addr: :: in6_addr,
621
- pub ifr6_prefixlen: u32 ,
622
- pub ifr6_ifindex: :: c_int,
623
- }
620
+ pub struct in6_ifreq {
621
+ pub ifr6_addr: :: in6_addr,
622
+ pub ifr6_prefixlen: u32 ,
623
+ pub ifr6_ifindex: :: c_int,
624
+ }
624
625
625
626
pub struct option {
626
627
pub name: * const :: c_char,
@@ -685,6 +686,132 @@ s! {
685
686
pub struct sctp_authinfo {
686
687
pub auth_keynumber: :: __u16,
687
688
}
689
+
690
+ pub struct sctp_assoc_change {
691
+ pub sac_type: :: __u16,
692
+ pub sac_flags: :: __u16,
693
+ pub sac_length: :: __u32,
694
+ pub sac_state: :: __u16,
695
+ pub sac_error: :: __u16,
696
+ pub sac_outbound_streams: :: __u16,
697
+ pub sac_inbound_streams: :: __u16,
698
+ pub sac_assoc_id: :: sctp_assoc_t,
699
+ pub sac_info: [ :: __u8; 0 ] ,
700
+ }
701
+
702
+ pub struct sctp_remote_error {
703
+ pub sre_type: :: __u16,
704
+ pub sre_flags: :: __u16,
705
+ pub sre_length: :: __u32,
706
+ pub sre_error: :: __be16,
707
+ pub sre_assoc_id: :: sctp_assoc_t,
708
+ pub sre_data: [ :: __u8; 0 ] ,
709
+ }
710
+
711
+ pub struct sctp_send_failed {
712
+ pub ssf_type: :: __u16,
713
+ pub ssf_flags: :: __u16,
714
+ pub ssf_length: :: __u32,
715
+ pub ssf_error: :: __u32,
716
+ pub ssf_info: sctp_sndrcvinfo,
717
+ pub ssf_assoc_id: :: sctp_assoc_t,
718
+ pub ssf_data: [ :: __u8; 0 ] ,
719
+ }
720
+
721
+ pub struct sctp_send_failed_event {
722
+ pub ssf_type: :: __u16,
723
+ pub ssf_flags: :: __u16,
724
+ pub ssf_length: :: __u32,
725
+ pub ssf_error: :: __u32,
726
+ pub ssfe_info: sctp_sndinfo,
727
+ pub ssf_assoc_id: :: sctp_assoc_t,
728
+ pub ssf_data: [ :: __u8; 0 ] ,
729
+ }
730
+
731
+ pub struct sctp_shutdown_event {
732
+ pub sse_type: :: __u16,
733
+ pub sse_flags: :: __u16,
734
+ pub sse_length: :: __u32,
735
+ pub sse_assoc_id: :: sctp_assoc_t,
736
+ }
737
+
738
+ pub struct sctp_adaptation_event {
739
+ pub sai_type: :: __u16,
740
+ pub sai_flags: :: __u16,
741
+ pub sai_length: :: __u32,
742
+ pub sai_adaptation_ind: :: __u32,
743
+ pub sai_assoc_id: :: sctp_assoc_t,
744
+ }
745
+
746
+ pub struct sctp_pdapi_event {
747
+ pub pdapi_type: :: __u16,
748
+ pub pdapi_flags: :: __u16,
749
+ pub pdapi_length: :: __u32,
750
+ pub pdapi_indication: :: __u32,
751
+ pub pdapi_assoc_id: :: sctp_assoc_t,
752
+ pub pdapi_stream: :: __u32,
753
+ pub pdapi_seq: :: __u32,
754
+ }
755
+
756
+ pub struct sctp_authkey_event {
757
+ pub auth_type: :: __u16,
758
+ pub auth_flags: :: __u16,
759
+ pub auth_length: :: __u32,
760
+ pub auth_keynumber: :: __u16,
761
+ pub auth_altkeynumber: :: __u16,
762
+ pub auth_indication: :: __u32,
763
+ pub auth_assoc_id: :: sctp_assoc_t,
764
+ }
765
+
766
+ pub struct sctp_sender_dry_event {
767
+ pub sender_dry_type: :: __u16,
768
+ pub sender_dry_flags: :: __u16,
769
+ pub sender_dry_length: :: __u32,
770
+ pub sender_dry_assoc_id: :: sctp_assoc_t,
771
+ }
772
+
773
+ pub struct sctp_stream_reset_event {
774
+ pub strreset_type: :: __u16,
775
+ pub strreset_flags: :: __u16,
776
+ pub strreset_length: :: __u32,
777
+ pub strreset_assoc_id: :: sctp_assoc_t,
778
+ pub strreset_stream_list: [ :: __u16; 0 ] ,
779
+ }
780
+
781
+ pub struct sctp_assoc_reset_event {
782
+ pub assocreset_type: :: __u16,
783
+ pub assocreset_flags: :: __u16,
784
+ pub assocreset_length: :: __u32,
785
+ pub assocreset_assoc_id: :: sctp_assoc_t,
786
+ pub assocreset_local_tsn: :: __u32,
787
+ pub assocreset_remote_tsn: :: __u32,
788
+ }
789
+
790
+ pub struct sctp_stream_change_event {
791
+ pub strchange_type: :: __u16,
792
+ pub strchange_flags: :: __u16,
793
+ pub strchange_length: :: __u32,
794
+ pub strchange_assoc_id: :: sctp_assoc_t,
795
+ pub strchange_instrms: :: __u16,
796
+ pub strchange_outstrms: :: __u16,
797
+ }
798
+
799
+ pub struct sctp_event_subscribe {
800
+ pub sctp_data_io_event: :: __u8,
801
+ pub sctp_association_event: :: __u8,
802
+ pub sctp_address_event: :: __u8,
803
+ pub sctp_send_failure_event: :: __u8,
804
+ pub sctp_peer_error_event: :: __u8,
805
+ pub sctp_shutdown_event: :: __u8,
806
+ pub sctp_partial_delivery_event: :: __u8,
807
+ pub sctp_adaptation_layer_event: :: __u8,
808
+ pub sctp_authentication_event: :: __u8,
809
+ pub sctp_sender_dry_event: :: __u8,
810
+ pub sctp_stream_reset_event: :: __u8,
811
+ pub sctp_assoc_reset_event: :: __u8,
812
+ pub sctp_stream_change_event: :: __u8,
813
+ pub sctp_send_failure_event_event: :: __u8,
814
+ }
688
815
}
689
816
690
817
s_no_extra_traits ! {
@@ -798,6 +925,17 @@ s_no_extra_traits! {
798
925
#[ cfg( not( libc_union) ) ]
799
926
pub ifr_ifru: :: sockaddr,
800
927
}
928
+
929
+ #[ cfg_attr( libc_packedN, repr( packed( 4 ) ) ) ]
930
+ pub struct sctp_paddr_change {
931
+ pub spc_type: :: __u16,
932
+ pub spc_flags: :: __u16,
933
+ pub spc_length: :: __u32,
934
+ pub spc_aaddr: :: sockaddr_storage,
935
+ pub spc_state: :: c_int,
936
+ pub spc_error: :: c_int,
937
+ pub spc_assoc_id: :: sctp_assoc_t,
938
+ }
801
939
}
802
940
803
941
s_no_extra_traits ! {
@@ -1221,6 +1359,18 @@ cfg_if! {
1221
1359
. finish( )
1222
1360
}
1223
1361
}
1362
+ impl :: fmt:: Debug for sctp_paddr_change {
1363
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
1364
+ f. debug_struct( "sctp_paddr_change" )
1365
+ . field( "spc_type" , & self . spc_type)
1366
+ . field( "spc_flags" , & self . spc_flags)
1367
+ . field( "spc_aaddr" , & self . spc_aaddr)
1368
+ . field( "spc_state" , & self . spc_state)
1369
+ . field( "spc_error" , & self . spc_error)
1370
+ . field( "spc_assoc_id" , & self . spc_assoc_id)
1371
+ . finish( )
1372
+ }
1373
+ }
1224
1374
}
1225
1375
}
1226
1376
@@ -3788,6 +3938,29 @@ pub const SCTP_PR_SCTP_ALL: ::c_int = 1 << 7;
3788
3938
pub const SCTP_NOTIFICATION : :: c_int = MSG_NOTIFICATION ;
3789
3939
pub const SCTP_EOF : :: c_int = :: MSG_FIN ;
3790
3940
3941
+ pub const SCTP_COMM_UP : :: c_int = 0 ;
3942
+ pub const SCTP_COMM_LOST : :: c_int = 1 ;
3943
+ pub const SCTP_RESTART : :: c_int = 2 ;
3944
+ pub const SCTP_SHUTDOWN_COMP : :: c_int = 3 ;
3945
+ pub const SCTP_CANT_STR_ASSOC : :: c_int = 4 ;
3946
+
3947
+ pub const SCTP_ADDR_AVAILABLE : :: c_int = 0 ;
3948
+ pub const SCTP_ADDR_UNREACHABLE : :: c_int = 1 ;
3949
+ pub const SCTP_ADDR_REMOVED : :: c_int = 2 ;
3950
+ pub const SCTP_ADDR_ADDED : :: c_int = 3 ;
3951
+ pub const SCTP_ADDR_MADE_PRIM : :: c_int = 4 ;
3952
+ pub const SCTP_ADDR_CONFIRMED : :: c_int = 5 ;
3953
+ pub const SCTP_ADDR_POTENTIALLY_FAILED : :: c_int = 6 ;
3954
+
3955
+ pub const SCTP_DATA_UNSENT : :: c_int = 0 ;
3956
+ pub const SCTP_DATA_SENT : :: c_int = 1 ;
3957
+
3958
+ pub const SCTP_PARTIAL_DELIVERY_ABORTED : :: c_int = 0 ;
3959
+
3960
+ pub const SCTP_AUTH_NEW_KEY : :: c_int = 0 ;
3961
+ pub const SCTP_AUTH_FREE_KEY : :: c_int = 1 ;
3962
+ pub const SCTP_AUTH_NO_AUTH : :: c_int = 2 ;
3963
+
3791
3964
f ! {
3792
3965
pub fn NLA_ALIGN ( len: :: c_int) -> :: c_int {
3793
3966
return ( ( len) + NLA_ALIGNTO - 1 ) & !( NLA_ALIGNTO - 1 )
@@ -4704,6 +4877,67 @@ extern "C" {
4704
4877
) -> :: c_int ;
4705
4878
}
4706
4879
4880
+ /*
4881
+ #[link(name = "sctp")]
4882
+ extern "C" {
4883
+ pub fn sctp_bindx(
4884
+ sd: ::c_int,
4885
+ addrs: *mut ::sockaddr,
4886
+ addrcnt: ::c_int,
4887
+ flags: ::c_int,
4888
+ ) -> ::c_int;
4889
+ pub fn sctp_connectx(
4890
+ sd: ::c_int,
4891
+ addrs: *mut ::sockaddr,
4892
+ addrcnt: ::c_int,
4893
+ id: *mut ::sctp_assoc_t,
4894
+ ) -> ::c_int;
4895
+ pub fn sctp_peeloff(sd: ::c_int, assoc_id: ::sctp_assoc_t) -> ::c_int;
4896
+ // FIXME: linkage issue albeit belonging to the same part.
4897
+ //pub fn sctp_peeloff_flags(sd: ::c_int, assoc_id: ::sctp_assoc_t, flags: ::c_uint) -> ::c_int;
4898
+ pub fn sctp_opt_info(
4899
+ sd: ::c_int,
4900
+ id: ::sctp_assoc_t,
4901
+ opt: ::c_int,
4902
+ arg: *mut ::c_void,
4903
+ size: *mut ::socklen_t,
4904
+ ) -> ::c_int;
4905
+ pub fn sctp_getpaddrs(sd: ::c_int, id: ::sctp_assoc_t, addrs: *mut *mut ::sockaddr) -> ::c_int;
4906
+ pub fn sctp_freepaddrs(addrs: *mut ::sockaddr) -> ::c_int;
4907
+ pub fn sctp_getladdrs(sd: ::c_int, id: ::sctp_assoc_t, addrs: *mut *mut ::sockaddr) -> ::c_int;
4908
+ pub fn sctp_freeladdrs(addrs: *mut ::sockaddr) -> ::c_int;
4909
+ pub fn sctp_send(
4910
+ s: ::c_int,
4911
+ msg: *const ::c_void,
4912
+ len: ::size_t,
4913
+ sinfo: *const ::sctp_sndrcvinfo,
4914
+ flags: ::c_int,
4915
+ ) -> ::c_int;
4916
+ pub fn sctp_sendmsg(
4917
+ s: ::c_int,
4918
+ msg: *const ::c_void,
4919
+ len: ::size_t,
4920
+ to: *mut ::sockaddr,
4921
+ tolen: ::socklen_t,
4922
+ ppid: u32,
4923
+ flags: u32,
4924
+ stream_no: u16,
4925
+ timetolive: u32,
4926
+ context: u32,
4927
+ ) -> ::c_int;
4928
+ pub fn sctp_recvmsg(
4929
+ s: ::c_int,
4930
+ msg: *mut ::c_void,
4931
+ len: ::size_t,
4932
+ from: *mut ::sockaddr,
4933
+ fromlen: *mut ::socklen_t,
4934
+ sinfo: *mut ::sctp_sndrcvinfo,
4935
+ msg_flags: *mut ::c_int,
4936
+ ) -> ::c_int;
4937
+ pub fn sctp_getaddrlen(family: ::sa_family_t) -> ::c_int;
4938
+ }
4939
+ */
4940
+
4707
4941
cfg_if ! {
4708
4942
if #[ cfg( target_env = "uclibc" ) ] {
4709
4943
mod uclibc;
0 commit comments