


IO_PUSH(3)      PEKS 0.8.18 Programming Interface      IO_PUSH(3)


NNAAMMEE
       io_push,  io_pop,  io_enable, io_suspend - create a socket
       io replacement layer

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

       vvooiidd **iioo__ppuusshh ((uunnssiiggnneedd _f_d,, uunnssiiggnneedd _c_o_n_t_e_x_t___s_i_z_e,,
                      iinntt ((**_r_d_w_r___f_n))
                            ((vvooiidd **_c_o_n_t_e_x_t,,
                             cchhaarr **_d_a_t_a,, uunnssiiggnneedd _l_e_n,, iinntt _f_l_a_g_s)),,
                      iinntt ((**_i_o_c_t_l___f_n))
                            ((vvooiidd **_c_o_n_t_e_x_t,,
                             iioo__ccttrrll__rreeqquueesstt _r_e_q_u_e_s_t,, iinntt **_a_r_g)),,
                      vvooiidd ((**_d_e_s_t_r_o_y___f_n)) ((vvooiidd **_c_o_n_t_e_x_t)),,
                      uunnssiiggnneedd _h_o_w));;

       vvooiidd iioo__ppoopp ((uunnssiiggnneedd _f_d,, uunnssiiggnneedd _h_o_w));;

       vvooiidd iioo__eennaabbllee ((uunnssiiggnneedd _f_d,, uunnssiiggnneedd _h_o_w));;

       vvooiidd iioo__ssuussppeenndd ((uunnssiiggnneedd _f_d,, uunnssiiggnneedd _h_o_w));;

DDEESSCCRRIIPPTTIIOONN
       IIoo__ppuusshh(()) creates a new io data stream diversion  for  the
       open file descriptor fd according to the argument hhooww:

              0 divert incoming data stream (like stdin)
              1 divert outgoing data stream (like stdout).

       The  function  creates a data area of size contextsize and
       zero initialises it.  If also  registeres  the  call  back
       functions,  given  as  argument.   When  this  is  done, a
       pointer of the data area allocated is returned, or NULL if
       an  error  occurs while the variable errno is set, accord-
       ingly.

       If there has been a layer pushed on the  current  io  data
       stream,   already   it   is   replaced   unless  the  flag
       IIOO__PPUUSSHH__EEXXCCLLUUSSIIVVEELLYY is xored with the  argument  how.   In
       the latter case, an error is detected.

       IIoo__ppoopp(()) removes the diversion from the io data stream and
       calls

              ((**_d_e_s_t_r_o_y___f_n))((_d_e_s_c))

       where ddeesscc == ddeesscc ((ffdd,, hhooww)) is the data area also  pointed
       to  by  the  return  code of iioo__ppuusshh(()).  Finally, iioo__ppoopp(())
       frees ddeesscc.

       IIoo__ssuussppeenndd(()) disables a diversion from the io data  stream
       in  which  case  it  behaves  as if the diversion had been
       io_pop ()-ed.



PEKS CIPHER LAYER          Jan 21, 2001                         1





IO_PUSH(3)      PEKS 0.8.18 Programming Interface      IO_PUSH(3)


       IIoo__eennaabbllee(())  undoes  the  effect  of   iioo__ssuussppeenndd(()).    By
       default,   iioo__eennaabbllee(())   is   automatically  activated  by
       iioo__ppuusshh(()).

       It is save calling the functions iioo__ppoopp(()), iioo__eennaabbllee(()) and
       iioo__ssuussppeenndd(()) without having installed a data stream diver-
       sion using iioo__ppuusshh(()).

CCAAVVEEAATT
       The data area returned by iioo__ppuusshh(()) must never be  deallo-
       cated  using ffrreeee(()).  It should be initialized immediately
       after returned successfully by iioo__ppuusshh(()).

SSEEEE AALLSSOO
       iioossttrreeaamm(3), iioo__ccttrrll(3), iioo__sseenndd(3),

AAUUTTHHOORR
       The ppeekkss package where these functions belong to was writ-
       ten by Jordan Hrycaj <jordan@teddy-net.com>, originally to
       support the nneessssuuss security scanner.





































PEKS CIPHER LAYER          Jan 21, 2001                         2


