diff options
author | brueffer <brueffer@FreeBSD.org> | 2007-06-18 10:20:32 +0000 |
---|---|---|
committer | brueffer <brueffer@FreeBSD.org> | 2007-06-18 10:20:32 +0000 |
commit | 0414524f6c1fd8f30bcce5d8652612eae18b5472 (patch) | |
tree | 8c9b6239ccd43a7b121879c7736ab65c1f17cbc6 /lib/libc/net/sctp_recvmsg.3 | |
parent | a362498f2ee574f0c8ad52434857803559f450cd (diff) | |
download | FreeBSD-src-0414524f6c1fd8f30bcce5d8652612eae18b5472.zip FreeBSD-src-0414524f6c1fd8f30bcce5d8652612eae18b5472.tar.gz |
Major cleanup: mdoc macros, style, typos etc.
Diffstat (limited to 'lib/libc/net/sctp_recvmsg.3')
-rw-r--r-- | lib/libc/net/sctp_recvmsg.3 | 118 |
1 files changed, 69 insertions, 49 deletions
diff --git a/lib/libc/net/sctp_recvmsg.3 b/lib/libc/net/sctp_recvmsg.3 index 4a085da..b929c9c 100644 --- a/lib/libc/net/sctp_recvmsg.3 +++ b/lib/libc/net/sctp_recvmsg.3 @@ -44,47 +44,50 @@ .In sys/socket.h .In netinet/sctp.h .Ft ssize_t -.Ft ssize_t -.Fn sctp_recvmsg "int s" "void *msg" "size_t len" "struct sockaddr * restrict from" "socklen_t * restrict fromlen" "struct sctp_sndrcvinfo *sinfo" "int *flags" +.Fo sctp_recvmsg +.Fa "int s" "void *msg" "size_t len" "struct sockaddr * restrict from" +.Fa "socklen_t * restrict fromlen" "struct sctp_sndrcvinfo *sinfo" "int *flags" +.Fc .Sh DESCRIPTION The .Fn sctp_recvmsg -system calls +system call is used to receive a message from another SCTP endpoint. The .Fn sctp_recvmsg call is used by one-to-one (SOCK_STREAM) type sockets after a -sucessful -.Fn connect 2 +successful +.Fn connect call or after the application has performed a .Fn listen followed by a sucessful -.Fn accept 2 -For a one-to-many (SOCK_SEQPACKET)type socket, an endpoint may call +.Fn accept +For a one-to-many (SOCK_SEQPACKET) type socket, an endpoint may call .Fn sctp_recvmsg after having implicitly started an association via one of the send calls including -.Fn sctp_sendmsg 2 -.Fn sendto 2 +.Fn sctp_sendmsg +.Fn sendto and -.Fn sendmsg 2 +.Fn sendmsg . Or, an application may also receive a message after having called -.Fn listen 2 +.Fn listen with a postive backlog to enable the reception of new associations. .Pp -.Pp The address of the sender is held in the .Fa from argument with .Fa fromlen -specifying its size. At the completion of a sucessful +specifying its size. +At the completion of a successful .Fn sctp_recvmsg call .Fa from will hold the address of the peer and .Fa fromlen -will hold the length of that address. Note that +will hold the length of that address. +Note that the address is bounded by the inital value of .Fa fromlen which is used as an in/out variable. @@ -93,36 +96,47 @@ The length of the message .Fa msg to be received is bounded by .Fa len . -If the message is to long to fit in the users +If the message is too long to fit in the users receive buffer, then the .Fa flags -argument will NOT have the MSG_EOF flag -applied. If the message is a complete message then +argument will NOT have the +.Dv MSG_EOF +flag applied. +If the message is a complete message then the .Fa flags -argument will have MSG_EOF set. Locally detected errors are -indicated by a return value of -1 with errno set accordingly. +argument will have +.Dv MSG_EOF +set. +Locally detected errors are +indicated by a return value of -1 with +.Va errno +set accordingly. The .Fa flags -argument may also hold the value MSG_NOTIFICATION. When this +argument may also hold the value +.Dv MSG_NOTIFICATION . +When this occurs this indicates that the message received is NOT from the peer endpoint, but instead is a notification from the SCTP stack (see -.Fn sctp 4 -for more details). Note that no notifications are ever +.Xr sctp 4 +for more details). +Note that no notifications are ever given unless the user subscribes to such notifications using -the SCTP_EVENTS socket option. +the +.Dv SCTP_EVENTS +socket option. .Pp -If no messages is available at the socket then +If no messages are available at the socket then .Fn sctp_recvmsg -normally blocks on the reception of a message or NOTIFICATION, unless the socket has been placed in -non-blocking I/O mode. +normally blocks on the reception of a message or NOTIFICATION, unless the +socket has been placed in non-blocking I/O mode. The .Xr select 2 system call may be used to determine when it is possible to receive a message. .Pp - The .Fa sinfo argument is defined as follows. @@ -139,7 +153,7 @@ struct sctp_sndrcvinfo { sctp_assoc_t sinfo_assoc_id; /* The association id of the peer */ }; .Ed - +.Pp The .Fa sinfo->sinfo_ppid is an opaque 32 bit value that is passed transparently @@ -158,7 +172,8 @@ The .Dv SCTP_UNORDERED flag is used to specify that the message arrived with no specific order and was delivered to the peer application -as soon as possible. When this flag is absent the message +as soon as possible. +When this flag is absent the message was delivered in order within the stream it was received. .Pp .Fa sinfo->sinfo_stream @@ -166,10 +181,12 @@ is the SCTP stream that the message was received on. Streams in SCTP are reliable (or partially reliable) flows of ordered messages. .Pp - The +The .Fa sinfo->sinfo_context -field is used only if the local application set a association level -context with the SCTP_CONTEXT socket option. +field is used only if the local application set an association level +context with the +.Dv SCTP_CONTEXT +socket option. Optionally a user process can use this value to index some application specific data structure for all data coming from a specific association. @@ -183,7 +200,8 @@ For unordered messages this field holds an undefined value. The .Fa sinfo->sinfo_tsn holds a transport sequence number (TSN) that was assigned -to this message by the peer endpoint. For messages that fit in or less +to this message by the peer endpoint. +For messages that fit in or less than the path MTU this will be the only TSN assigned. Note that for messages that span multiple TSN's this value will be one of the TSN's that was used on the @@ -192,22 +210,25 @@ message. The .Fa sinfo->sinfo_cumtsn holds the current cumulative acknowledgment point of -the transport association. Note that this may be larger +the transport association. +Note that this may be larger or smaller than the TSN assigned to the message itself. .Pp The -sinfo->sinfo_assoc_id +.Fa sinfo->sinfo_assoc_id is the unique association identification that was assigned -to the association. For one-to-many (SOCK_SEQPACKET) type +to the association. +For one-to-many (SOCK_SEQPACKET) type sockets this value can be used to send data to the peer without -the use of an address field. It is also quite useful in +the use of an address field. +It is also quite useful in setting various socket options on the specific association (see -.Fn sctp 4 +.Xr sctp 4 ). .Pp The -sinfo->info_timetolive +.Fa sinfo->info_timetolive field is not used by .Fa sctp_recvmsg . .Sh RETURN VALUES @@ -217,7 +238,7 @@ if an error occurred. The .Fn sctp_recvmsg system call -fail if: +fails if: .Bl -tag -width Er .It Bq Er EBADF An invalid descriptor was specified. @@ -243,7 +264,7 @@ but may be caused by transient congestion. .It Bq Er EHOSTUNREACH The remote host was unreachable. .It Bq Er ENOTCON -On a one to one style socket no association exists. +On a one-to-one style socket no association exists. .It Bq Er ECONNRESET An abort was received by the stack while the user was attempting to send data to the peer. @@ -259,14 +280,13 @@ This typically means that the socket is not connected and is a one-to-one style socket. .El .Sh SEE ALSO -.Xr sctp 4 , -.Xr sendmsg 3 , -.Xr sctp_sendmsg 3 , -.Xr sctp_send 3 , -.Xr getsockopt 2 , -.Xr setsockopt 2 , .Xr recv 2 , .Xr select 2 , .Xr socket 2 , -.Xr write 2 - +.Xr write 2 , +.Xr getsockopt 2 , +.Xr setsockopt 2 , +.Xr sctp_send 3 , +.Xr sctp_sendmsg 3 , +.Xr sendmsg 3 , +.Xr sctp 4 |