


IO_SEND(3)      PEKS 0.8.12 Programming Interface      IO_SEND(3)


NNAAMMEE
       io_send,  io_recv, io_shutdown, io_close - replacement for
       socket fuctions

SSYYNNOOPPSSIISS
       ##iinncclluuddee <<ppeekkss..hh>>

       iinntt iioo__sseenndd ((uunnssiiggnneedd _f_d,,
                    ccoonnsstt cchhaarr **_d_a_t_a,, uunnssiiggnneedd _l_e_n,, uunnssiiggnneedd _f_l_a_g_s));;

       iinntt iioo__rreeccvv ((uunnssiiggnneedd _f_d,,
                    cchhaarr **_b_u_f_f_e_r,, uunnssiiggnneedd _l_e_n,, uunnssiiggnneedd _f_l_a_g_s));;

       iinntt iioo__rreeccvv__ttmmoo ((uunnssiiggnneedd _f_d,, iinntt _t_i_m_e_o_u_t));;

       iinntt iioo__sshhuuttddoowwnn ((uunnssiiggnneedd _f_d,, uunnssiiggnneedd _h_o_w));;

       iinntt iioo__cclloossee ((uunnssiiggnneedd _f_d));;

       iinntt _i_o___r_e_c_v___t_i_m_e_o_u_t;;

DDEESSCCRRIIPPTTIIOONN
       These functions are replacements for the  standard  socket
       functions  sseenndd(2),  rreeccvv(2),  sshhuuttddoowwnn(2)  and   cclloossee(2)
       unless a data stream diversion has been installed  by  the
       function iioo__ppuusshh(()).

       Instead  of passing arguments and return codes to and from
       the socket  functions  sseenndd(()),  or  rreeccvv(())  the  following
       internal replacements take place:

           for the outgoing data stream

               sseenndd ((_f_d,,_b_u_f,,_l_e_n,,_f_l_g)) ::=

                       ((**_r_d_w_r___f_n)) ((_d_e_s_c,,_b_u_f,,_l_e_n,,_f_l_g))

           and for the incoming data stream

               rreeccvv ((_f_d,,_b_u_f,,_l_e_n,,_f_l_g)) ::=

                       ((**_r_d_w_r___f_n)) ((_d_e_s_c,,_b_u_f,,_l_e_n,,_f_l_g))

           where the symbol ddeesscc == ddeesscc ((ffdd,, hhooww)) is a pointer to
           the data area also returned by iioo__ppuusshh(()).

       The functions iioo__sshhuuttddoowwnn(()) and iioo__cclloossee(()) work  as  sshhuutt--
       ddoowwnn(()) and cclloossee(()) with an additional call of iioo__ppoopp(()).

       The  function  iioo__rreeccvv__ttmmoo(())  imposes  a  timeout  on  the
       receiver rreeccvv(()) of the input data stream  associated  with
       the  first argument.  So the iioo__rreeccvv(()) call will be thrown
       out of a blocking wait for input data.  In that case,  the
       global  variable eerrrrnnoo will be set to the value _E_I_N_T_R.  In



PEKS CIPHER LAYER          Jun 08, 2000                         1





IO_SEND(3)      PEKS 0.8.12 Programming Interface      IO_SEND(3)


       some cases, this is somewhat misleading as--implementation
       dependent--the  timeout  also  may  occur  from  a timeout
       detected after a call for sseelleecctt(()) or for ppoollll(())..

       Passing some positive second argument _n, a signal  SSIIGGAALLRRMM
       will  be  sent  to  iioo__rreeccvv(())  after  _n seconds idle time.
       Passing some negative value, the system waits at  most  _-_n
       seconds  _b_e_f_o_r_e data are available, but will not interrupt
       a pending rreeccvv(()) operation.  Passing a 0 value, the  time-
       out is disabled.

       Upon  return, the function returns the old timer value, or
       -1 if there was no input data associated  with  the  first
       argument.   As  a  consequence, when receiving a value -1,
       you can only detect an error by asking iioo__rreeccvv__ttmmoo(()) again
       (provided  the  first  timeout  arguent was different from
       -1.)

       By  setting  the  global  variable  _i_o___r_e_c_v___t_i_m_e_o_u_t,   the
       default  timeout (as changed with iioo__rreeccvv__ttmmoo(())) that con-
       trols the receiver rreeccvv(()) in iioo__rreeccvv(()) is set, default  is
       20 seconds.

       It  is  save  calling  the functions iioo__sseenndd(()), iioo__rreeccvv(()),
       iioo__cclloossee(()), and iioo__sshhuuttddoowwnn(()) without having  installed  a
       data stream diversion using iioo__ppuusshh(()).

SSEEEE AALLSSOO
       eerrrrnnoo(3),   iioossttrreeaamm(3),   iioo__ppuusshh(3),  sseenndd(2),  rreeccvv(2),
       ssoocckkeett(2), sshhuuttddoowwnn(2), cclloossee(2), ssiiggnnaall(5),

AAUUTTHHOORR
       The fBpeksfP package where these functions belong  to  was
       written  by  Jordan  Hrycaj <jordan@teddy-net.com>, origi-
       nally to support the fBnessusfP security scanner.






















PEKS CIPHER LAYER          Jun 08, 2000                         2


