From: Vlad Yasevich <vyasevich@gmail.com>
To: linux-sctp@vger.kernel.org
Subject: Re: how to use sctp_sendmsg to send ABORT chunk
Date: Mon, 26 Nov 2012 15:35:25 +0000 [thread overview]
Message-ID: <50B38C3D.5030307@gmail.com> (raw)
In-Reply-To: <20844e51.131ec.13b30c4ebec.Coremail.elliehct@163.com>
On 11/23/2012 11:55 PM, СºØ wrote:
> dear lksctp Project,
> i met a problem about sending abort chunk. if you have time, please help me. i'm using the lksctp to develop my function, which is for sending Abort chunk. platform of my development : Redhat centos 5.5 and verion of linux kernel is 2.18. according to "man sctp_sendmsg", just set flags to SCTP_ABORT. my partial code.--------------------------------------------------------------------------------------------------------------------------struct msghdr msg;struct cmsghdr cmsg; struct iovec iov; static char error_code= 12; iov.iov_base = &error_code; iov.iov_len = 1;cmsg.cmsg_level = IPPROTO_SCTP;cmsg.cmsg_type = SCTP_SNDRV;cmsg.cmsg_len = sizeof(struct cmsghdr);msg.msg_name = (SOCKADDR*)&serAddr; msg.msg_namelen = sizeof(serAddr); msg.msg_iov = &iov; msg.msg_iovlen = 1; msg.msg_control = &cmsg; msg.msg_controllen = sizeof(cmsg); ret = sctp_sendmsg(sock_fd, (void*)&msg, sizeof(msg), (SOCKADDR*)&serAddr, sizeo
f(serAddr),sri.sinfo_ppid, (SCTP_ABORT), sri.sinfo_stream, sri.sinfo_timetolive,sri.sinfo_context);--------------------------------------------------------------------------------------------------------------------but the ret < 0 and the errno is 22 that is invalid agument.please tell which argument is error and how to set cause of abort chunk into "struct msghdr" best regardsthank you fangmin.cao
First, the msg argument is just a buffer to send, not a msghdr. Second
the SCTP_ABORT is set in the flags parameter of sctp_sendmsg(). Third,
SCTP_ABORT is not supported on a SOCK_STREAM socket.
That should get you what you want.
-vlad
prev parent reply other threads:[~2012-11-26 15:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-24 4:55 how to use sctp_sendmsg to send ABORT chunk 小贺
2012-11-26 15:35 ` Vlad Yasevich [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50B38C3D.5030307@gmail.com \
--to=vyasevich@gmail.com \
--cc=linux-sctp@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).