Changeset f3482e3 in rtems

Jul 3, 1999, 5:33:20 PM (22 years ago)
Joel Sherrill <joel.sherrill@…>
4.10, 4.11, 4.8, 4.9, 5, master

Added documentation on "two new SOL_SOCKET level options for setsockopt and
getsockopt: SO_SNDWAKEUP and SO_RCVWAKEUP" from Ian Lance Taylor

2 edited


  • doc/networking/Makefile

    r28807e7 rf3482e3  
    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  
    234 @section Application code
     234@section Application Programming Interface
    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.
    241243@item The @code{select} function only works for file descriptors associated
    242244with sockets.
    243246@item You must call @code{openlog} before calling any of the @code{syslog} functions.
    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
     259@item The RTEMS network package gathers statistics.
     261@item Addition of a mechanism to "tap onto" an interface
     262and monitor every packet received and transmitted.
     264@item Addition of @code{SO_SNDWAKEUP} and @code{SO_RCVWAKEUP} socket options.
    254266@end itemize
     268Some of the new features are discussed in more detail in the following
    256271@subsection Network Statistics
    257 There are a number of functions to print statistics gathered by the network stack.
     273There are a number of functions to print statistics gathered by
     274the network stack.
    258275These function are declared in @code{rtems/rtems_bsdnet.h}.
    259277@table @code
    260278@item rtems_bsdnet_show_if_stats
    281299@end table
    283 In addition, RTEMS add two new ioctls to the BSD networking code:
     301@subsection Tapping Into an Interface
     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.
     330@subsection Socket Options
     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:
     339  void    (*sw_pfn) (struct socket *, caddr_t);
     340  caddr_t sw_arg;
     341@end group
     342@end example
     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}).
     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.
     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
     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.
     369The purpose of these functions is to permit a more efficient
     370alternative to the select call when dealing with a large number of
Note: See TracChangeset for help on using the changeset viewer.