Changeset f3482e3 in rtems


Ignore:
Timestamp:
Jul 3, 1999, 5:33:20 PM (21 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
bae90e1
Parents:
28807e7
Message:

Added documentation on "two new SOL_SOCKET level options for setsockopt and
getsockopt: SO_SNDWAKEUP and SO_RCVWAKEUP" from Ian Lance Taylor
<ian@…>.

Location:
doc/networking
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • doc/networking/Makefile

    r28807e7 rf3482e3  
    6363
    6464testing.texi: testing.t Makefile
    65         $(BMENU) -p "Network Statistics" \
     65        $(BMENU) -p "Socket Options" \
    6666           -u "Top" \
    6767           -n "Network Servers" ${*}.t
  • doc/networking/networkapp.t

    r28807e7 rf3482e3  
    232232
    233233
    234 @section Application code
     234@section Application Programming Interface
     235
    235236The RTEMS network package provides almost a complete set of BSD network
    236237services.  The network functions work like their BSD counterparts
     
    239240@itemize @bullet
    240241@item A given socket can be read or written by only one task at a time.
     242
    241243@item The @code{select} function only works for file descriptors associated
    242244with sockets.
     245
    243246@item You must call @code{openlog} before calling any of the @code{syslog} functions.
     247
    244248@item @b{Some of the network functions are not thread-safe.}
    245249For example the following functions return a pointer to a static
     
    252256(@code{inet_ntop} is thread-safe, though).
    253257@end table
     258
     259@item The RTEMS network package gathers statistics.
     260
     261@item Addition of a mechanism to "tap onto" an interface
     262and monitor every packet received and transmitted.
     263
     264@item Addition of @code{SO_SNDWAKEUP} and @code{SO_RCVWAKEUP} socket options.
     265
    254266@end itemize
    255267
     268Some of the new features are discussed in more detail in the following
     269sections.
     270
    256271@subsection Network Statistics
    257 There are a number of functions to print statistics gathered by the network stack.
     272
     273There are a number of functions to print statistics gathered by
     274the network stack.
    258275These function are declared in @code{rtems/rtems_bsdnet.h}.
     276
    259277@table @code
    260278@item rtems_bsdnet_show_if_stats
     
    281299@end table
    282300
    283 In addition, RTEMS add two new ioctls to the BSD networking code:
     301@subsection Tapping Into an Interface
     302
     303RTEMS add two new ioctls to the BSD networking code:
    284304SIOCSIFTAP and SIOCGIFTAP.  These may be used to set and get a
    285305@i{tap function}.  The tap function will be called for every
     
    308328itself.  It is safe to call other non-networking RTEMS functions.
    309329
     330@subsection Socket Options
     331
     332RTEMS adds two new @code{SOL_SOCKET} level options for @code{setsockopt} and
     333@code{getsockopt}: @code{SO_SNDWAKEUP} and @code{SO_RCVWAKEUP}.  For both, the
     334option value should point to a sockwakeup structure.  The sockwakeup
     335structure has the following fields:
     336
     337@example
     338@group
     339  void    (*sw_pfn) (struct socket *, caddr_t);
     340  caddr_t sw_arg;
     341@end group
     342@end example
     343
     344These options are used to set a function to be called when there is
     345data available from the socket (@code{SO_SNDWAKEUP}) and when there is space
     346available to accept data written to the socket (@code{SO_RCVWAKEUP}).
     347
     348If @code{setsockopt} is called with the @code{SO_SNDWAKEUP} option, and the
     349@code{sw_pfn} field is not zero, then when there is data
     350available to be read from
     351the socket, the function pointed to by the @code{sw_pfn} field will be
     352called.  A pointer to the socket structure will be passed as the first
     353argument to the function.  The @code{sw_arg} field
     354set by the @code{SO_SNDWAKEUP}
     355call will be passed as the second argument to the function.
     356
     357If @code{setsockopt} is called with the @code{SO_RCVWAKEUP}
     358function, and the @code{sw_pfn}
     359field is not zero, then when there is space available to accept data
     360written to the socket, the function pointed to by the @code{sw_pfn} field
     361will be called.  The arguments passed to the function will be as with
     362@code{SO_SNDWAKEUP}.
     363
     364When the function is called, the network semaphore will be locked.
     365The function must be careful not to call any networking functions.  It
     366is OK to call an RTEMS function; for example, it is OK to send an
     367RTEMS event.
     368
     369The purpose of these functions is to permit a more efficient
     370alternative to the select call when dealing with a large number of
     371sockets.
     372
     373
Note: See TracChangeset for help on using the changeset viewer.