Skip to content

Commit 4bda84f

Browse files
committed
freebsd sctp support part 3
1 parent 35ad929 commit 4bda84f

File tree

3 files changed

+193
-1
lines changed

3 files changed

+193
-1
lines changed

libc-test/build.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2299,7 +2299,12 @@ fn test_freebsd(target: &str) {
22992299
"memory_type" => true,
23002300
"memory_type_list" => true,
23012301
"pidfh" => true,
2302-
"sctp_gen_error_cause" | "sctp_error_missing_param" => true,
2302+
"sctp_gen_error_cause"
2303+
| "sctp_error_missing_param"
2304+
| "sctp_remote_error"
2305+
| "sctp_assoc_change"
2306+
| "sctp_send_failed_event"
2307+
| "sctp_stream_reset_event" => true,
23032308

23042309
_ => false,
23052310
}

libc-test/semver/freebsd.txt

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,22 +1085,47 @@ SCHED_RR
10851085
SCM_CREDS
10861086
SCM_RIGHTS
10871087
SCM_TIMESTAMP
1088+
SCTP_ACTIVE
10881089
SCTP_ALL_ASSOC
10891090
SCTP_ADAPTATION_LAYER
10901091
SCTP_ADAPTION_LAYER
1092+
SCTP_ADDR_ADDED
1093+
SCTP_ADDR_AVAILABLE
1094+
SCTP_ADDR_CONFIRMED
1095+
SCTP_ADDR_MADE_PRIM
1096+
SCTP_ADDR_REMOVED
1097+
SCTP_ADDR_UNREACHABLE
10911098
SCTP_ADDR_OVER
10921099
SCTP_ASSOCINFO
1100+
SCTP_ASSOC_RESET_DENIED
1101+
SCTP_ASSOC_RESET_FAILED
1102+
SCTP_ASSOC_SUPPORTS_ASCONF
1103+
SCTP_ASSOC_SUPPORTS_AUTH
1104+
SCTP_ASSOC_SUPPORTS_INTERLEAVING
1105+
SCTP_ASSOC_SUPPORTS_MAX
1106+
SCTP_ASSOC_SUPPORTS_MULTIBUF
1107+
SCTP_ASSOC_SUPPORTS_PR
1108+
SCTP_ASSOC_SUPPORTS_RE_CONFIG
10931109
SCTP_AUTHINFO
10941110
SCTP_AUTH_CHUNK
10951111
SCTP_AUTH_ACTIVE_KEY
10961112
SCTP_AUTH_DEACTIVATE_KEY
10971113
SCTP_AUTH_DELETE_KEY
1114+
SCTP_AUTH_FREE_KEY
10981115
SCTP_AUTH_KEY
1116+
SCTP_AUTH_NEWKEY
1117+
SCTP_AUTH_NEW_KEY
1118+
SCTP_AUTH_NO_AUTH
10991119
SCTP_AUTOCLOSE
11001120
SCTP_AUTO_ASCONF
1121+
SCTP_CANT_STR_ASSOC
1122+
SCTP_COMM_LOST
1123+
SCTP_COMM_UP
11011124
SCTP_COMPLETE
11021125
SCTP_CONTEXT
11031126
SCTP_CURRENT_ASSOC
1127+
SCTP_DATA_SENT
1128+
SCTP_DATA_UNSENT
11041129
SCTP_DEFAULT_SEND_PARAM
11051130
SCTP_DELAYED_SACK
11061131
SCTP_DISABLE_FRAGMENTS
@@ -1114,6 +1139,7 @@ SCTP_EXTRCV
11141139
SCTP_FRAGMENT_INTERLEAVE
11151140
SCTP_FUTURE_ASSOC
11161141
SCTP_HMAC_IDENT
1142+
SCTP_INACTIVE
11171143
SCTP_INIT
11181144
SCTP_INITMSG
11191145
SCTP_I_WANT_MAPPED_V4_ADDR
@@ -1128,6 +1154,7 @@ SCTP_NODELAY
11281154
SCTP_NOTIFICATION
11291155
SCTP_NO_NEXT_MSG
11301156
SCTP_NXTINFO
1157+
SCTP_PARTIAL_DELIVERY_ABORTED
11311158
SCTP_PARTIAL_DELIVERY_POINT
11321159
SCTP_PEER_ADDR_PARAMS
11331160
SCTP_PRIMARY_ADDR
@@ -1138,6 +1165,7 @@ SCTP_PR_SCTP_NONE
11381165
SCTP_PR_SCTP_PRIO
11391166
SCTP_PR_SCTP_RTX
11401167
SCTP_PR_SCTP_TTL
1168+
SCTP_RESTART
11411169
SCTP_REUSE_PORT
11421170
SCTP_PRINFO
11431171
SCTP_RECVV_NOINFO
@@ -1156,8 +1184,16 @@ SCTP_SEND_AUTHINFO_VALID
11561184
SCTP_SEND_PRINFO_VALID
11571185
SCTP_SEND_SNDINFO_VALID
11581186
SCTP_SET_PEER_PRIMARY_ADDR
1187+
SCTP_SHUTDOWN_COMP
11591188
SCTP_SNDINFO
11601189
SCTP_SNDRCV
1190+
SCTP_STREAM_CHANGE_DENIED
1191+
SCTP_STREAM_CHANGE_FAILED
1192+
SCTP_STREAM_RESET_DENIED
1193+
SCTP_STREAM_RESET_FAILED
1194+
SCTP_STREAM_RESET_INCOMING_SSN
1195+
SCTP_STREAM_RESET_OUTGOING_SSN
1196+
SCTP_UNCONFIRMED
11611197
SCTP_UNORDERED
11621198
SCTP_USE_EXT_RCVINFO
11631199
SEEK_DATA
@@ -1968,6 +2004,8 @@ sched_rr_get_interval
19682004
sched_setparam
19692005
sched_setscheduler
19702006
sctphdr
2007+
sctp_adaptation_event
2008+
sctp_assoc_change
19712009
sctp_assoc_t
19722010
sctp_authinfo
19732011
sctp_bindx
@@ -1995,16 +2033,25 @@ sctp_gen_error_cause
19952033
sctp_initmsg
19962034
sctp_nxtinfo
19972035
sctp_opt_info
2036+
sctp_paddr_change
2037+
sctp_pdapi_event
19982038
sctp_peeloff
19992039
sctp_prinfo
20002040
sctp_rcvinfo
20012041
sctp_recvv_rn
2042+
sctp_remote_error
2043+
sctp_sender_dry_event
2044+
sctp_send_failed_event
20022045
sctp_sendv_spa
2046+
sctp_shutdown_event
20032047
sctp_sndinfo
20042048
sctp_sndrcvinfo
20052049
sctp_snd_all_completes
2050+
sctp_stream_change_event
2051+
sctp_stream_reset_event
20062052
sctp_paramhdr
20072053
sctp_pcbinfo
2054+
sctp_setadaptation
20082055
sctp_sockstat
20092056
sdallocx
20102057
seed48

src/unix/bsd/freebsdlike/freebsd/mod.rs

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,6 +1225,100 @@ s! {
12251225
pub ss_total_sndbuf: u32,
12261226
pub ss_total_recv_buf: u32,
12271227
}
1228+
1229+
pub struct sctp_assoc_change {
1230+
pub sac_type: u16,
1231+
pub sac_flags: u16,
1232+
pub sac_length: u32,
1233+
pub sac_state: u16,
1234+
pub sac_error: u16,
1235+
pub sac_outbound_streams: u16,
1236+
pub sac_inbound_streams: u16,
1237+
pub sac_assoc_id: ::sctp_assoc_t,
1238+
pub sac_info: [u8; 0],
1239+
}
1240+
1241+
pub struct sctp_paddr_change {
1242+
pub spc_type: u16,
1243+
pub spc_flags: u16,
1244+
pub spc_length: u32,
1245+
pub spc_aaddr: ::sockaddr_storage,
1246+
pub spc_state: u32,
1247+
pub spc_error: u32,
1248+
pub spc_assoc_id: ::sctp_assoc_t,
1249+
}
1250+
1251+
pub struct sctp_remote_error {
1252+
pub sre_type: u16,
1253+
pub sre_flags: u16,
1254+
pub sre_length: u32,
1255+
pub sre_error: u16,
1256+
pub sre_assoc_id: ::sctp_assoc_t,
1257+
pub sre_data: [u8; 0],
1258+
}
1259+
1260+
pub struct sctp_send_failed_event {
1261+
pub ssfe_type: u16,
1262+
pub ssfe_flags: u16,
1263+
pub ssfe_length: u32,
1264+
pub ssfe_error: u32,
1265+
pub ssfe_info: sctp_sndinfo,
1266+
pub ssfe_assoc_id: ::sctp_assoc_t,
1267+
pub ssfe_data: [u8; 0],
1268+
}
1269+
1270+
pub struct sctp_shutdown_event {
1271+
pub sse_type: u16,
1272+
pub sse_flags: u16,
1273+
pub sse_length: u32,
1274+
pub sse_assoc_id: ::sctp_assoc_t,
1275+
}
1276+
1277+
pub struct sctp_adaptation_event {
1278+
pub sai_type: u16,
1279+
pub sai_flags: u16,
1280+
pub sai_length: u32,
1281+
pub sai_adaptation_ind: u32,
1282+
pub sai_assoc_id: ::sctp_assoc_t,
1283+
}
1284+
1285+
pub struct sctp_setadaptation {
1286+
pub ssb_adaptation_ind: u32,
1287+
}
1288+
1289+
pub struct sctp_pdapi_event {
1290+
pub pdapi_type: u16,
1291+
pub pdapi_flags: u16,
1292+
pub pdapi_length: u32,
1293+
pub pdapi_indication: u32,
1294+
pub pdapi_stream: u16,
1295+
pub pdapi_seq: u16,
1296+
pub pdapi_assoc_id: ::sctp_assoc_t,
1297+
}
1298+
1299+
pub struct sctp_sender_dry_event {
1300+
pub sender_dry_type: u16,
1301+
pub sender_dry_flags: u16,
1302+
pub sender_dry_length: u32,
1303+
pub sender_dry_assoc_id: ::sctp_assoc_t,
1304+
}
1305+
1306+
pub struct sctp_stream_reset_event {
1307+
pub strreset_type: u16,
1308+
pub strreset_flags: u16,
1309+
pub strreset_length: u32,
1310+
pub strreset_assoc_id: ::sctp_assoc_t,
1311+
pub strreset_stream_list: [u16; 0],
1312+
}
1313+
1314+
pub struct sctp_stream_change_event {
1315+
pub strchange_type: u16,
1316+
pub strchange_flags: u16,
1317+
pub strchange_length: u32,
1318+
pub strchange_assoc_id: ::sctp_assoc_t,
1319+
pub strchange_instrms: u16,
1320+
pub strchange_outstrms: u16,
1321+
}
12281322
}
12291323

12301324
s_no_extra_traits! {
@@ -4493,6 +4587,52 @@ pub const SCTP_EXPLICIT_EOR: ::c_int = 0x00000001b;
44934587
pub const SCTP_REUSE_PORT: ::c_int = 0x00000001c;
44944588
pub const SCTP_AUTH_DEACTIVATE_KEY: ::c_int = 0x00000001d;
44954589

4590+
pub const SCTP_COMM_UP: ::c_int = 0x0001;
4591+
pub const SCTP_COMM_LOST: ::c_int = 0x0002;
4592+
pub const SCTP_RESTART: ::c_int = 0x0003;
4593+
pub const SCTP_SHUTDOWN_COMP: ::c_int = 0x0004;
4594+
pub const SCTP_CANT_STR_ASSOC: ::c_int = 0x0005;
4595+
4596+
pub const SCTP_ASSOC_SUPPORTS_PR: ::c_int = 0x01;
4597+
pub const SCTP_ASSOC_SUPPORTS_AUTH: ::c_int = 0x02;
4598+
pub const SCTP_ASSOC_SUPPORTS_ASCONF: ::c_int = 0x03;
4599+
pub const SCTP_ASSOC_SUPPORTS_MULTIBUF: ::c_int = 0x04;
4600+
pub const SCTP_ASSOC_SUPPORTS_RE_CONFIG: ::c_int = 0x05;
4601+
pub const SCTP_ASSOC_SUPPORTS_INTERLEAVING: ::c_int = 0x06;
4602+
pub const SCTP_ASSOC_SUPPORTS_MAX: ::c_int = 0x06;
4603+
4604+
pub const SCTP_ADDR_AVAILABLE: ::c_int = 0x0001;
4605+
pub const SCTP_ADDR_UNREACHABLE: ::c_int = 0x0002;
4606+
pub const SCTP_ADDR_REMOVED: ::c_int = 0x0003;
4607+
pub const SCTP_ADDR_ADDED: ::c_int = 0x0004;
4608+
pub const SCTP_ADDR_MADE_PRIM: ::c_int = 0x0005;
4609+
pub const SCTP_ADDR_CONFIRMED: ::c_int = 0x0006;
4610+
4611+
pub const SCTP_ACTIVE: ::c_int = 0x0001;
4612+
pub const SCTP_INACTIVE: ::c_int = 0x0002;
4613+
pub const SCTP_UNCONFIRMED: ::c_int = 0x0200;
4614+
4615+
pub const SCTP_DATA_UNSENT: ::c_int = 0x0001;
4616+
pub const SCTP_DATA_SENT: ::c_int = 0x0002;
4617+
4618+
pub const SCTP_PARTIAL_DELIVERY_ABORTED: ::c_int = 0x0001;
4619+
4620+
pub const SCTP_AUTH_NEW_KEY: ::c_int = 0x0001;
4621+
pub const SCTP_AUTH_NEWKEY: ::c_int = SCTP_AUTH_NEW_KEY;
4622+
pub const SCTP_AUTH_NO_AUTH: ::c_int = 0x0002;
4623+
pub const SCTP_AUTH_FREE_KEY: ::c_int = 0x0003;
4624+
4625+
pub const SCTP_STREAM_RESET_INCOMING_SSN: ::c_int = 0x0001;
4626+
pub const SCTP_STREAM_RESET_OUTGOING_SSN: ::c_int = 0x0002;
4627+
pub const SCTP_STREAM_RESET_DENIED: ::c_int = 0x0004;
4628+
pub const SCTP_STREAM_RESET_FAILED: ::c_int = 0x0008;
4629+
4630+
pub const SCTP_ASSOC_RESET_DENIED: ::c_int = 0x0004;
4631+
pub const SCTP_ASSOC_RESET_FAILED: ::c_int = 0x0008;
4632+
4633+
pub const SCTP_STREAM_CHANGE_DENIED: ::c_int = 0x0004;
4634+
pub const SCTP_STREAM_CHANGE_FAILED: ::c_int = 0x0008;
4635+
44964636
const_fn! {
44974637
{const} fn _ALIGN(p: usize) -> usize {
44984638
(p + _ALIGNBYTES) & !_ALIGNBYTES

0 commit comments

Comments
 (0)