diff --git a/SCTP_SocketAPI_Status.md b/SCTP_SocketAPI_Status.md index fddc354ebf6df319c804544a3188a8ffdcef68ac..a6aeec4be05404b347a6d54b3fe638320f789784 100644 --- a/SCTP_SocketAPI_Status.md +++ b/SCTP_SocketAPI_Status.md @@ -44,7 +44,7 @@ For Linux the following tables are based on [sctp.h](https://github.com/sctp/lks |`SCTP_DISABLE_FRAGMENTS` | [RFC6458](https://tools.ietf.org/html/rfc6458#section-8.1.11) | [RFC4960](https://tools.ietf.org/html/rfc4960) | TBD | supported | supported | |`SCTP_PEER_ADDR_PARAMS` | [RFC6458](https://tools.ietf.org/html/rfc6458#section-8.1.12) | [RFC4960](https://tools.ietf.org/html/rfc4960) | supported | old structure | supported | |`SCTP_DEFAULT_SEND_PARAM` | [RFC6458](https://tools.ietf.org/html/rfc6458#section-8.1.13) | [RFC4960](https://tools.ietf.org/html/rfc4960) | TBD | supported | supported | -|`SCTP_EVENTS` | [RFC6458](https://tools.ietf.org/html/rfc6458#section-8.1.14) | [RFC4960](https://tools.ietf.org/html/rfc4960) | TBD | supported | supported | +|`SCTP_EVENTS` | [RFC6458](https://tools.ietf.org/html/rfc6458#section-8.1.14) | [RFC4960](https://tools.ietf.org/html/rfc4960) | supported | supported | supported | |`SCTP_I_WANT_MAPPED_V4_ADDR` | [RFC6458](https://tools.ietf.org/html/rfc6458#section-8.1.15) | [RFC4960](https://tools.ietf.org/html/rfc4960) | TBD | supported | supported | |`SCTP_MAXSEG` | [RFC6458](https://tools.ietf.org/html/rfc6458#section-8.1.16) | [RFC4960](https://tools.ietf.org/html/rfc4960) | supported | Check structure | supported | |`SCTP_HMAC_IDENT` | [RFC6458](https://tools.ietf.org/html/rfc6458#section-8.1.17) | [RFC4895](https://tools.ietf.org/html/rfc4895) | unsupported | supported | supported | @@ -90,5 +90,5 @@ For Linux the following tables are based on [sctp.h](https://github.com/sctp/lks |`sctp_connectx()` | [RFC6458](https://tools.ietf.org/html/rfc6458#section-9.9) | [RFC4960](https://tools.ietf.org/html/rfc4960) | unsupported | supported | supported | |`sctp_send()` | [RFC6458](https://tools.ietf.org/html/rfc6458#section-9.10) | [RFC4960](https://tools.ietf.org/html/rfc4960) | unsupported | supported | supported | |`sctp_sendx()` | [RFC6458](https://tools.ietf.org/html/rfc6458#section-9.11) | [RFC4960](https://tools.ietf.org/html/rfc4960) | unsupported | supported | supported | -|`sctp_sendv()` | [RFC6458](https://tools.ietf.org/html/rfc6458#section-9.12) | [RFC4960](https://tools.ietf.org/html/rfc4960) | unsupported | unsupported | supported | -|`sctp_recvv()` | [RFC6458](https://tools.ietf.org/html/rfc6458#section-9.13) | [RFC4960](https://tools.ietf.org/html/rfc4960) | unsupported | unsupported | supported | +|`sctp_sendv()` | [RFC6458](https://tools.ietf.org/html/rfc6458#section-9.12) | [RFC4960](https://tools.ietf.org/html/rfc4960) | supported | unsupported | supported | +|`sctp_recvv()` | [RFC6458](https://tools.ietf.org/html/rfc6458#section-9.13) | [RFC4960](https://tools.ietf.org/html/rfc4960) | supported | unsupported | supported | diff --git a/gtests/net/packetdrill/run_system_call.c b/gtests/net/packetdrill/run_system_call.c index dcea3279ff696301b36357ea00eef321149834f3..a67b0e68636586f0d7bb0beea0cddb4a44bea019 100644 --- a/gtests/net/packetdrill/run_system_call.c +++ b/gtests/net/packetdrill/run_system_call.c @@ -49,7 +49,7 @@ static int to_live_fd(struct state *state, int script_fd, int *live_fd, char **error); -#if defined(__FreeBSD__) +#if defined(__FreeBSD__) || defined(linux) static int check_sctp_notification(struct iovec *iov, struct expression *iovec_expr, char **error); #endif @@ -1432,11 +1432,13 @@ static int syscall_recvmsg(struct state *state, struct syscall_spec *syscall, asprintf(error, "Expected msg_flags 0x%08X but got 0x%08X", expected_msg_flags, msg->msg_flags); goto error_out; - } else if (msg->msg_flags & MSG_NOTIFICATION) { + } +#if defined(__FreeBSD__) || defined(linux) + if (msg->msg_flags & MSG_NOTIFICATION) { if (check_sctp_notification(msg->msg_iov, msg_expression->value.msghdr->msg_iov, error)) goto error_out; } - +#endif status = STATUS_OK; error_out: @@ -3765,10 +3767,11 @@ static int check_sctp_nxtinfo(struct sctp_nxtinfo_expr *expr, } #endif -#if defined(__FreeBSD__) +#if defined(__FreeBSD__) || defined(linux) static int check_sctp_shutdown_event(struct sctp_shutdown_event_expr *expr, struct sctp_shutdown_event *sctp_event, char **error) { + if (check_u16_expr(expr->sse_type, sctp_event->sse_type, "sctp_shutdown_event.sse_type", error)) return STATUS_ERR; @@ -3823,6 +3826,57 @@ static int check_sctp_send_failed_event(struct sctp_send_failed_event_expr *expr return STATUS_ERR; if (expr->ssfe_info->type != EXPR_ELLIPSIS) { if (check_sctp_sndinfo(expr->ssfe_info->value.sctp_sndinfo, &sctp_event->ssfe_info, error)) +======= +#if defined(__FreeBSD__) || defined(linux) +static int check_sctp_sender_dry_event(struct sctp_sender_dry_event_expr *expr, + struct sctp_sender_dry_event *sctp_event, + char **error) { + if (expr->sender_dry_type->type != EXPR_ELLIPSIS) { + u16 sender_dry_type; + + if (get_u16(expr->sender_dry_type, &sender_dry_type, error)) { + return STATUS_ERR; + } + if (sctp_event->sender_dry_type != sender_dry_type) { + asprintf(error, "sctp_sender_dry_event.sender_dry_type: expected: %hu actual: %hu", + sender_dry_type, sctp_event->sender_dry_type); + return STATUS_ERR; + } + } + if (expr->sender_dry_flags->type != EXPR_ELLIPSIS) { + u16 sender_dry_flags; + + if (get_u16(expr->sender_dry_flags, &sender_dry_flags, error)) { + return STATUS_ERR; + } + if (sctp_event->sender_dry_flags != sender_dry_flags) { + asprintf(error, "sctp_sender_dry_event.sender_dry_flags: expected: %hu actual: %hu", + sender_dry_flags, sctp_event->sender_dry_flags); + return STATUS_ERR; + } + } + if (expr->sender_dry_type->type != EXPR_ELLIPSIS) { + u32 sender_dry_length; + + if (get_u32(expr->sender_dry_length, &sender_dry_length, error)) { + return STATUS_ERR; + } + if (sctp_event->sender_dry_length != sender_dry_length) { + asprintf(error, "sctp_sender_dry_event.sender_dry_length: expected: %u actual: %u", + sender_dry_length, sctp_event->sender_dry_length); + return STATUS_ERR; + } + } + if (expr->sender_dry_assoc_id->type != EXPR_ELLIPSIS) { + u32 sender_dry_assoc_id; + + if (get_u32(expr->sender_dry_assoc_id, &sender_dry_assoc_id, error)) { + return STATUS_ERR; + } + if (sctp_event->sender_dry_assoc_id != sender_dry_assoc_id) { + asprintf(error, "sctp_sender_dry_event.sender_dry_assoc_id: expected: %u actual: %u", + sender_dry_assoc_id, sctp_event->sender_dry_assoc_id); +>>>>>>> master return STATUS_ERR; } if (check_u32_expr(expr->ssfe_assoc_id, sctp_event->ssfe_assoc_id, @@ -3833,7 +3887,7 @@ static int check_sctp_send_failed_event(struct sctp_send_failed_event_expr *expr } #endif -#if defined(__FreeBSD__) +#if defined(__FreeBSD__) || defined(linux) static int check_sctp_notification(struct iovec *iov, struct expression *iovec_expr, char **error) { @@ -3872,7 +3926,7 @@ static int check_sctp_notification(struct iovec *iov, case EXPR_ELLIPSIS: break; default: - asprintf(error, "Bad type for iov_base. Can't check type %s", + asprintf(error, "Bad type for iov_base. Can't check type %s", expression_type_to_string(script_iov_base->type)); return STATUS_ERR; break; @@ -4041,11 +4095,11 @@ static int syscall_sctp_recvv(struct state *state, struct syscall_spec *syscall, goto error_out; } } - iovec_free(iov, script_iovec_list_len); + iovec_free(iov, script_iovec_list_len); return STATUS_OK; error_out: free(from); - iovec_free(iov, script_iovec_list_len); + iovec_free(iov, script_iovec_list_len); return STATUS_ERR; #else asprintf(error, "sctp_recvv is not supported");