Skip to content
Snippets Groups Projects
Commit 3253eb74 authored by hoelscher's avatar hoelscher
Browse files

add support for socketoption sctp_default_send_param

parent 457d0e16
No related branches found
No related tags found
No related merge requests found
......@@ -3103,6 +3103,12 @@ static int syscall_getsockopt(struct state *state, struct syscall_spec *syscall,
}
break;
#endif
#ifdef SCTP_DEFAULT_SEND_PARAM
case EXPR_SCTP_SNDRCVINFO:
live_optval = malloc(sizeof(struct sctp_sndrcvinfo));
live_optlen = sizeof(struct sctp_sndrcvinfo);
break;
#endif
#ifdef SCTP_EVENTS
case EXPR_SCTP_EVENT_SUBSCRIBE:
live_optval = malloc(sizeof(struct sctp_event_subscribe));
......@@ -3242,6 +3248,11 @@ static int syscall_getsockopt(struct state *state, struct syscall_spec *syscall,
result = check_sctp_event(val_expression->value.sctp_event, live_optval, error);
break;
#endif
#ifdef SCTP_DEFAULT_SEND_PARAM
case EXPR_SCTP_SNDRCVINFO:
result = check_sctp_sndrcvinfo(val_expression->value.sctp_sndrcvinfo, live_optval, error);
break;
#endif
#ifdef SCTP_EVENTS
case EXPR_SCTP_EVENT_SUBSCRIBE:
result = check_sctp_event_subscribe(val_expression->value.sctp_event_subscribe, live_optval, error);
......@@ -3323,6 +3334,9 @@ static int syscall_setsockopt(struct state *state, struct syscall_spec *syscall,
#ifdef SCTP_EVENTS
struct sctp_event_subscribe event_subscribe;
#endif
#ifdef SCTP_DEFAULT_SEND_PARAM
struct sctp_sndrcvinfo sndrcvinfo;
#endif
#ifdef SCTP_DEFAULT_SNDINFO
struct sctp_sndinfo sndinfo;
#endif
......@@ -3574,6 +3588,14 @@ static int syscall_setsockopt(struct state *state, struct syscall_spec *syscall,
optval = &event_subscribe;
break;
#endif
#ifdef SCTP_DEFAULT_SEND_PARAM
case EXPR_SCTP_SNDRCVINFO:
if (parse_expression_to_sctp_sndrcvinfo(val_expression, &sndrcvinfo, true, error)) {
return STATUS_ERR;
}
optval = &sndrcvinfo;
break;
#endif
#ifdef SCTP_DEFAULT_SNDINFO
case EXPR_SCTP_SNDINFO:
if (get_u16(val_expression->value.sctp_sndinfo->snd_sid,
......
......@@ -88,6 +88,7 @@ struct int_symbol platform_symbols_table[] = {
{ SCTP_PRIMARY_ADDR, "SCTP_PRIMARY_ADDR" },
{ SCTP_ADAPTATION_LAYER, "SCTP_ADAPTATION_LAYER" },
{ SCTP_DISABLE_FRAGMENTS, "SCTP_DISABLE_FRAGMENTS" },
{ SCTP_DEFAULT_SEND_PARAM, "SCTP_DEFAULT_SEND_PARAM" },
{ SCTP_MAXSEG, "SCTP_MAXSEG" },
{ SCTP_AUTH_ACTIVE_KEY, "SCTP_AUTH_ACTIVE_KEY" },
{ SCTP_DELAYED_SACK, "SCTP_DELAYED_SACK" },
......
......@@ -10,6 +10,16 @@
+0 getsockopt(3, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
+0 getsockopt(3, IPPROTO_SCTP, SCTP_DEFAULT_SEND_PARAM, {sinfo_stream=0,
sinfo_ssn=0,
sinfo_flags=0,
sinfo_ppid=htonl(0),
sinfo_context=0,
sinfo_timetolive=0,
sinfo_tsn=0,
sinfo_cumtsn=0,
sinfo_assoc_id=0}, [128]) = 0
+0 setsockopt(3, IPPROTO_SCTP, SCTP_DEFAULT_SEND_PARAM, {sinfo_stream=0,
sinfo_ssn=1,
sinfo_flags=0,
......@@ -18,7 +28,8 @@
sinfo_timetolive=0,
sinfo_tsn=2,
sinfo_cumtsn=1,
sinfo_assoc_id=3}, 30) = 0
sinfo_assoc_id=3}, 128) = 0
+0 getsockopt(3, IPPROTO_SCTP, SCTP_DEFAULT_SEND_PARAM, {sinfo_stream=0,
sinfo_ssn=1,
sinfo_flags=0,
......@@ -27,7 +38,7 @@
sinfo_timetolive=0,
sinfo_tsn=2,
sinfo_cumtsn=1,
sinfo_assoc_id=3}, [30]) = 0
sinfo_assoc_id=3}, [128]) = 0
+0 setsockopt(3, IPPROTO_SCTP, SCTP_DEFAULT_SEND_PARAM, {sinfo_stream=0,
sinfo_ssn=1,
......@@ -36,7 +47,8 @@
sinfo_context=0,
sinfo_timetolive=0,
sinfo_tsn=2,
sinfo_cumtsn=1}, 30) = 0
sinfo_cumtsn=1}, 128) = 0
+0 getsockopt(3, IPPROTO_SCTP, SCTP_DEFAULT_SEND_PARAM, {sinfo_stream=0,
sinfo_ssn=1,
sinfo_flags=0,
......@@ -44,6 +56,6 @@
sinfo_context=0,
sinfo_timetolive=0,
sinfo_tsn=2,
sinfo_cumtsn=1}, [30]) = 0
sinfo_cumtsn=1}, [128]) = 0
+0 close(3) = 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment