home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / unix / volume26 / xinetd21 / part03 < prev    next >
Encoding:
Text File  |  1993-06-26  |  33.2 KB  |  1,262 lines

  1. Newsgroups: comp.sources.unix
  2. From: panos@cs.colorado.edu (Panos Tsirigotis)
  3. Subject: v26i247: xinetd-2.1.1 - inetd replacement with access control and logging, Part03/31
  4. Sender: unix-sources-moderator@gw.home.vix.com
  5. Approved: vixie@gw.home.vix.com
  6.  
  7. Submitted-By: panos@cs.colorado.edu (Panos Tsirigotis)
  8. Posting-Number: Volume 26, Issue 247
  9. Archive-Name: xinetd-2.1.1/part03
  10.  
  11. #! /bin/sh
  12. # This is a shell archive.  Remove anything before this line, then unpack
  13. # it by saving it into a file and typing "sh file".  To overwrite existing
  14. # files, type "sh file -c".  You can also feed this as standard input via
  15. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  16. # will see the following message at the end:
  17. #        "End of archive 3 (of 31)."
  18. # Contents:  libs/src/pq/hpq.h libs/src/pset/psi.3
  19. #   libs/src/sio/suite/README libs/src/str/ss_bmh.c
  20. #   libs/src/str/ss_sbm.c libs/src/str/strparse.h
  21. #   libs/src/timer/impl.h libs/src/timer/ostimer.h
  22. #   libs/src/timer/timer.h libs/src/xlog/xlog.h xinetd/attr.h
  23. #   xinetd/flags.c xinetd/int.h xinetd/state.h
  24. # Wrapped by panos@mystique on Mon Jun 21 14:51:20 1993
  25. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  26. if test -f 'libs/src/pq/hpq.h' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'libs/src/pq/hpq.h'\"
  28. else
  29. echo shar: Extracting \"'libs/src/pq/hpq.h'\" \(1635 characters\)
  30. sed "s/^X//" >'libs/src/pq/hpq.h' <<'END_OF_FILE'
  31. X/*
  32. X * (c) Copyright 1993 by Panagiotis Tsirigotis
  33. X * All rights reserved.  The file named COPYRIGHT specifies the terms 
  34. X * and conditions for redistribution.
  35. X */
  36. X
  37. X#ifndef __HPQ_H
  38. X#define __HPQ_H
  39. X
  40. X/*
  41. X * $Id: hpq.h,v 1.2 1993/04/01 02:15:32 panos Exp $
  42. X */
  43. X
  44. X/*
  45. X * Implementation of the PQ interface
  46. X */
  47. X
  48. X#define pq_create                __hpq_create
  49. X#define pq_destroy            __hpq_destroy
  50. X#define pq_insert                __hpq_insert
  51. X#define pq_delete                __hpq_delete
  52. X#define pq_head                __hpq_head
  53. X#define pq_extract_head        __hpq_extract_head
  54. X
  55. X/*
  56. X * The is_better function takes 2 arguments which are pointers to objects
  57. X * and returns:
  58. X *       1     if the first object is "better" than the second
  59. X *       0     otherwise
  60. X */
  61. X
  62. Xstruct __hpq_header
  63. X{
  64. X    int (*is_better)() ;
  65. X    int *errnop ;
  66. X    int flags ;
  67. X    pq_obj *objects ;            /* array of objects */
  68. X    unsigned cur_size ;        /* # of objects in array */
  69. X    unsigned max_size ;        /* max # of objects that can fit in array */
  70. X} ;
  71. X
  72. X
  73. X#ifndef __ARGS
  74. X#  ifdef PROTOTYPES
  75. X#     define __ARGS( s )               s
  76. X#  else
  77. X#     define __ARGS( s )               ()
  78. X#  endif
  79. X#endif
  80. X
  81. Xpq_h __hpq_create            __ARGS( ( int (*func)(), int flags, int *errnop ) ) ;
  82. Xvoid __hpq_destroy        __ARGS( ( pq_h handle ) ) ;
  83. Xint  __hpq_insert            __ARGS( ( pq_h handle, pq_obj object ) ) ;
  84. Xpq_obj __hpq_extract_head __ARGS( ( pq_h handle ) ) ;
  85. Xint  __hpq_delete         __ARGS( ( pq_h handle, pq_obj object ) ) ;
  86. X
  87. X#define __hpq_head( handle )                                                                \
  88. X                (                                                                                    \
  89. X                    ((struct __hpq_header *)(handle))->cur_size                        \
  90. X                            ? ((struct __hpq_header *)(handle))->objects[ 0 ]         \
  91. X                            : (pq_obj) 0                                                        \
  92. X                )
  93. X
  94. X#endif __HPQ_H
  95. X
  96. END_OF_FILE
  97. if test 1635 -ne `wc -c <'libs/src/pq/hpq.h'`; then
  98.     echo shar: \"'libs/src/pq/hpq.h'\" unpacked with wrong size!
  99. fi
  100. # end of 'libs/src/pq/hpq.h'
  101. fi
  102. if test -f 'libs/src/pset/psi.3' -a "${1}" != "-c" ; then 
  103.   echo shar: Will not clobber existing file \"'libs/src/pset/psi.3'\"
  104. else
  105. echo shar: Extracting \"'libs/src/pset/psi.3'\" \(1812 characters\)
  106. sed "s/^X//" >'libs/src/pset/psi.3' <<'END_OF_FILE'
  107. X.\"(c) Copyright 1992, 1993 by Panagiotis Tsirigotis
  108. X.\"All rights reserved.  The file named COPYRIGHT specifies the terms 
  109. X.\"and conditions for redistribution.
  110. X.\"
  111. X.\" $Id: psi.3,v 3.1 1993/03/06 18:46:38 panos Exp $
  112. X.TH PSET 3X "25 September 1992"
  113. X.SH NAME
  114. Xpsi_create, psi_destroy, psi_reset, psi_start, psi_next, psi_remove - pointer set iterator functions
  115. X.SH SYNOPSIS
  116. X.LP
  117. X.nf
  118. X.ft B
  119. X#include "pset.h"
  120. X.LP
  121. X.ft B
  122. Xpsi_h psi_create( pset )
  123. Xpset_h pset ;
  124. X.LP
  125. X.ft B
  126. Xvoid psi_destroy( iter )
  127. Xpsi_h iter ;
  128. X.LP
  129. X.ft B
  130. Xvoid psi_reset( iter, pset )
  131. Xpsi_h iter ;
  132. Xpset_h pset ;
  133. X.LP
  134. X.ft B
  135. Xvoid *psi_start( iter )
  136. Xpsi_h iter ;
  137. X.LP
  138. X.ft B
  139. Xvoid *psi_next( iter )
  140. Xpsi_h iter ;
  141. X.LP
  142. X.ft B
  143. Xvoid psi_remove( iter )
  144. Xpsi_h iter ;
  145. X.SH DESCRIPTION
  146. XThese functions provide a means to iterate over psets (pointer sets).
  147. X.LP
  148. X.B psi_create()
  149. Xcreates an iterator. The only operation that should be applied to
  150. Xan iterator after it is created is
  151. X.B psi_start().
  152. X.LP
  153. X.B psi_destroy()
  154. Xdestroys the iterator.
  155. X.LP
  156. X.B psi_reset()
  157. Xchanges the pset that is being iterated to
  158. X.I pset.
  159. X.LP
  160. X.B psi_start()
  161. Xstarts an iteration and returns the first pointer
  162. Xin the pointer set.
  163. X.LP
  164. X.B psi_next()
  165. Xreturns the next pointer in the set.
  166. X.LP
  167. X.B psi_remove()
  168. Xremoves the current pointer from the set. The current pointer is
  169. Xthe one returned most recently from either
  170. X.B psi_start()
  171. Xor
  172. X.B psi_next().
  173. X.SH "RETURN VALUES"
  174. X.LP
  175. X.B psi_create()
  176. Xreturns an iterator handle on success or
  177. X.SM NULL
  178. Xon failure.
  179. X.LP
  180. X.B psi_start()
  181. Xreturns the first pointer from the set or
  182. X.SM NULL
  183. Xif the set is empty.
  184. X.LP
  185. X.B psi_next()
  186. Xreturns a pointer or
  187. X.SM NULL
  188. Xif the end of the set is reached.
  189. X.SH WARNINGS
  190. X.B psi_create()
  191. Xis the only function in this library. The rest of the interface is macros.
  192. X.LP
  193. XThis interface may be eliminated in a future release of the
  194. X.I pset
  195. Xlibrary.
  196. END_OF_FILE
  197. if test 1812 -ne `wc -c <'libs/src/pset/psi.3'`; then
  198.     echo shar: \"'libs/src/pset/psi.3'\" unpacked with wrong size!
  199. fi
  200. # end of 'libs/src/pset/psi.3'
  201. fi
  202. if test -f 'libs/src/sio/suite/README' -a "${1}" != "-c" ; then 
  203.   echo shar: Will not clobber existing file \"'libs/src/sio/suite/README'\"
  204. else
  205. echo shar: Extracting \"'libs/src/sio/suite/README'\" \(1753 characters\)
  206. sed "s/^X//" >'libs/src/sio/suite/README' <<'END_OF_FILE'
  207. X
  208. XThe 'testlib' script will exercise most of the functions in the SIO
  209. Xlibrary.  It invokes the 'tester' script which does the real work.
  210. X'tester' is a Bourne shell script. However, it expects that the shell
  211. Xsupports functions and /bin/sh does not support functions on all
  212. Xoperating systems. Therefore, 'testlib' decides what shell to use to
  213. Xexecute 'tester'. On Suns, it uses /bin/sh. On DECstations, it uses
  214. X/usr/bin/ksh. The decision is made by checking the ARCH environment
  215. Xvariable.
  216. X
  217. XExercising some of the SIO functions in an automatic fashion is a
  218. Xdifficult task, so you will have to do it manually by visually
  219. Xinspecting the results of programs that exercise them.  The following
  220. Xis a list of functions and programs testing them (with a description of
  221. Xthe expected behavior):
  222. X
  223. X1. Sbuftype
  224. X
  225. X    PROGRAM: buftest.c
  226. X    DESCRIPTION:
  227. X        This program prints two groups of lines. The first group is printed
  228. X        using line-buffering while the second group is printed using
  229. X        full-buffering.
  230. X        The first group of lines should appear one line at a time every
  231. X        3 seconds. The second group of lines should appear all lines together
  232. X        after about 10 seconds.
  233. X
  234. X2. Stie, Suntie
  235. X    
  236. X    PROGRAM: tietest.c
  237. X    DESCRIPTION:
  238. X        This program ties stdin to stdout and then prompts for input.
  239. X        The prompts do *not* include a NEWLINE. Since the stdout is
  240. X        *line buffered* when connected to a terminal, the Stie call
  241. X        is what causes the prompt to appear.
  242. X        The first 2 prompts happen with tied stdin, stdout. For the
  243. X        3rd prompt, stdin is untied from stdout. This will cause
  244. X        the prompt to appear *after* you type something and hit RETURN.
  245. X
  246. X
  247. X
  248. XPS. If you can make testing of these functions automatic, please send
  249. X     me your code so that I can include in a future SIO distribution.
  250. X
  251. END_OF_FILE
  252. if test 1753 -ne `wc -c <'libs/src/sio/suite/README'`; then
  253.     echo shar: \"'libs/src/sio/suite/README'\" unpacked with wrong size!
  254. fi
  255. # end of 'libs/src/sio/suite/README'
  256. fi
  257. if test -f 'libs/src/str/ss_bmh.c' -a "${1}" != "-c" ; then 
  258.   echo shar: Will not clobber existing file \"'libs/src/str/ss_bmh.c'\"
  259. else
  260. echo shar: Extracting \"'libs/src/str/ss_bmh.c'\" \(1721 characters\)
  261. sed "s/^X//" >'libs/src/str/ss_bmh.c' <<'END_OF_FILE'
  262. X/*
  263. X * (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
  264. X * All rights reserved.  The file named COPYRIGHT specifies the terms 
  265. X * and conditions for redistribution.
  266. X */
  267. X
  268. Xstatic char RCSid[] = "$Id" ;
  269. X
  270. Xchar *malloc() ;
  271. X
  272. X#include "ss_impl.h"
  273. X
  274. XPRIVATE int bmh_setup() ;
  275. XPRIVATE char *bmh_match() ;
  276. XPRIVATE void bmh_done() ;
  277. X
  278. Xstruct ss_ops __strs_bmhops = { bmh_setup, bmh_match, bmh_done } ;
  279. X
  280. X
  281. XPRIVATE int bmh_setup( hp )
  282. X    header_s *hp ;
  283. X{
  284. X    register int    patlen    = SS_PATLEN( hp ) ;
  285. X    register int    limit        = patlen - 1 ;            /* patlen is > 0 */
  286. X    register char    *pattern = SS_PATTERN( hp ) ;
  287. X    register int    i ;
  288. X    shift_int        *shift ;
  289. X
  290. X    shift = (shift_int *) malloc( ALPHABET_SIZE * sizeof( shift_int ) ) ;
  291. X    if ( shift == (shift_int *)NULL )
  292. X        return( SS_ERR ) ;
  293. X
  294. X    for ( i = 0 ; i < ALPHABET_SIZE ; i++ )
  295. X        shift[ i ] = patlen ;
  296. X    
  297. X    for ( i = 0 ; i < limit ; i++ )
  298. X        shift[ (unsigned char) pattern[ i ] ] = limit - i ;
  299. X
  300. X    BMH_HEADER( hp )->shift = shift ;
  301. X    return( SS_OK ) ;
  302. X}
  303. X
  304. X
  305. XPRIVATE char *bmh_match( hp, str, len )
  306. X    header_s            *hp ;
  307. X    register char    *str ;
  308. X    int                len ;
  309. X{
  310. X    register int    i ;
  311. X    int                patlen    = SS_PATLEN( hp ) ;
  312. X    char                *pattern = SS_PATTERN( hp ) ;
  313. X    register char    lpc        = pattern[ patlen-1 ] ;    /* last pattern character */
  314. X    shift_int        *shift    = BMH_HEADER( hp )->shift ;
  315. X
  316. X    i = patlen - 1 ;
  317. X    while ( i < len )
  318. X    {
  319. X        char c = SS_MAP( hp, str[ i ] ) ;
  320. X
  321. X        if ( c == lpc )
  322. X        {
  323. X            int j, k ;
  324. X
  325. X            for ( j = patlen-1, k = i ;; )
  326. X            {
  327. X                if ( j == 0 )
  328. X                    return( &str[ k ] ) ;
  329. X                j--, k-- ;
  330. X                if ( pattern[ j ] != SS_MAP( hp, str[ k ] ) )
  331. X                    break ;
  332. X            }
  333. X        }
  334. X        i += shift[ (unsigned char) c ] ;
  335. X    }
  336. X    return( CHAR_NULL ) ;
  337. X}
  338. X
  339. X
  340. XPRIVATE void bmh_done( hp )
  341. X    header_s *hp ;
  342. X{
  343. X    (void) free( (char *)BMH_HEADER( hp )->shift ) ;
  344. X}
  345. X
  346. END_OF_FILE
  347. if test 1721 -ne `wc -c <'libs/src/str/ss_bmh.c'`; then
  348.     echo shar: \"'libs/src/str/ss_bmh.c'\" unpacked with wrong size!
  349. fi
  350. # end of 'libs/src/str/ss_bmh.c'
  351. fi
  352. if test -f 'libs/src/str/ss_sbm.c' -a "${1}" != "-c" ; then 
  353.   echo shar: Will not clobber existing file \"'libs/src/str/ss_sbm.c'\"
  354. else
  355. echo shar: Extracting \"'libs/src/str/ss_sbm.c'\" \(1825 characters\)
  356. sed "s/^X//" >'libs/src/str/ss_sbm.c' <<'END_OF_FILE'
  357. X/*
  358. X * (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
  359. X * All rights reserved.  The file named COPYRIGHT specifies the terms 
  360. X * and conditions for redistribution.
  361. X */
  362. X
  363. Xstatic char RCSid[] = "$Id: ss_sbm.c,v 3.1 1993/06/13 02:45:45 panos Exp $" ;
  364. X
  365. Xchar *malloc() ;
  366. X
  367. X#include "ss_impl.h"
  368. X#include "ss_sbm.h"
  369. X
  370. XPRIVATE int sbm_setup() ;
  371. XPRIVATE char *sbm_match() ;
  372. XPRIVATE void sbm_done() ;
  373. X
  374. X
  375. Xstruct ss_ops __strs_sbmops = { sbm_setup, sbm_match, sbm_done } ;
  376. X
  377. X
  378. XPRIVATE int sbm_setup( hp )
  379. X    header_s *hp ;
  380. X{
  381. X    last_int            *last_occurrence ;
  382. X    register int    i ;
  383. X    int                patlen    = SS_PATLEN( hp ) ;
  384. X    char                *pattern = SS_PATTERN( hp ) ;
  385. X
  386. X    last_occurrence = (last_int *) malloc( ALPHABET_SIZE * sizeof( last_int ) ) ;
  387. X    if ( last_occurrence == (last_int *)0 )
  388. X        return( SS_ERR ) ;
  389. X    
  390. X    for ( i = 0 ; i < ALPHABET_SIZE ; i++ )
  391. X        last_occurrence[ i ] = -1 ;
  392. X    for ( i = 0 ; i < patlen ; i++ )
  393. X        last_occurrence[ (unsigned char) pattern[ i ] ] = i ;
  394. X
  395. X    SBM_HEADER( hp )->last_occurrence = last_occurrence ;
  396. X    return( SS_OK ) ;
  397. X}
  398. X
  399. X
  400. X
  401. XPRIVATE char *sbm_match( hp, str, len )
  402. X    header_s        *hp ;
  403. X    char            *str ;
  404. X    int            len ;
  405. X{
  406. X    register int    j ;
  407. X    register int    s                        = 0 ;
  408. X    char                *pattern                = SS_PATTERN( hp ) ;
  409. X    int                patlen                = SS_PATLEN( hp ) ;
  410. X    last_int            *last_occurrence    = SBM_HEADER( hp )->last_occurrence ;
  411. X
  412. X    while ( s <= len - patlen )
  413. X    {
  414. X        register char c ;
  415. X        last_int lo ;
  416. X
  417. X        /*
  418. X         * Try matching pattern right-to-left
  419. X         */
  420. X        for ( j = patlen-1 ;; )
  421. X        {
  422. X            c = SS_MAP( hp, str[ s+j ] ) ;
  423. X            if ( pattern[ j ] == c )
  424. X                if ( j )
  425. X                    j-- ;
  426. X                else
  427. X                    return( &str[ s ] ) ;
  428. X            else
  429. X                break ;
  430. X        }
  431. X        lo = last_occurrence[ (unsigned char) c ] ;
  432. X        if ( j > lo )
  433. X            s += j - lo ;
  434. X        else
  435. X            s++ ;
  436. X    }
  437. X    return( CHAR_NULL ) ;
  438. X}
  439. X
  440. X
  441. XPRIVATE void sbm_done( hp )
  442. X    header_s *hp ;
  443. X{
  444. X    (void) free( (char *) SBM_HEADER( hp )->last_occurrence ) ;
  445. X}
  446. X
  447. END_OF_FILE
  448. if test 1825 -ne `wc -c <'libs/src/str/ss_sbm.c'`; then
  449.     echo shar: \"'libs/src/str/ss_sbm.c'\" unpacked with wrong size!
  450. fi
  451. # end of 'libs/src/str/ss_sbm.c'
  452. fi
  453. if test -f 'libs/src/str/strparse.h' -a "${1}" != "-c" ; then 
  454.   echo shar: Will not clobber existing file \"'libs/src/str/strparse.h'\"
  455. else
  456. echo shar: Extracting \"'libs/src/str/strparse.h'\" \(1514 characters\)
  457. sed "s/^X//" >'libs/src/str/strparse.h' <<'END_OF_FILE'
  458. X/*
  459. X * (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
  460. X * All rights reserved.  The file named COPYRIGHT specifies the terms 
  461. X * and conditions for redistribution.
  462. X */
  463. X
  464. X
  465. X/*
  466. X * $Id: strparse.h,v 3.1 1993/06/13 02:48:35 panos Exp $
  467. X */
  468. X
  469. Xstruct str_handle
  470. X{
  471. X   char *string ;
  472. X   char *separator ;
  473. X   char *pos ;
  474. X   int flags ;
  475. X   int *errnop ;
  476. X   int no_more ;
  477. X} ;
  478. X
  479. Xint str_errno ;
  480. X
  481. X#ifndef NULL
  482. X#define NULL         0
  483. X#endif
  484. X
  485. X#ifndef FALSE
  486. X#define FALSE        0
  487. X#define TRUE         1
  488. X#endif
  489. X
  490. X#define PRIVATE        static
  491. X
  492. X#define TERMINATE( msg )   {                                         \
  493. X                              char *s = msg ;                        \
  494. X                                                                     \
  495. X                              (void) write( 2, s, strlen( s ) ) ;    \
  496. X                              (void) abort() ;                       \
  497. X                              _exit( 1 ) ;                           \
  498. X                              /* NOTREACHED */                       \
  499. X                           }
  500. X
  501. X
  502. X#define HANDLE_ERROR( flags, retval, errp, errval, msg )    \
  503. X            if ( flags & STR_RETURN_ERROR )                 \
  504. X            {                                               \
  505. X               *errp = errval ;                             \
  506. X               return( retval ) ;                           \
  507. X            }                                               \
  508. X            else                                            \
  509. X               TERMINATE( msg )
  510. X
  511. X
  512. END_OF_FILE
  513. if test 1514 -ne `wc -c <'libs/src/str/strparse.h'`; then
  514.     echo shar: \"'libs/src/str/strparse.h'\" unpacked with wrong size!
  515. fi
  516. # end of 'libs/src/str/strparse.h'
  517. fi
  518. if test -f 'libs/src/timer/impl.h' -a "${1}" != "-c" ; then 
  519.   echo shar: Will not clobber existing file \"'libs/src/timer/impl.h'\"
  520. else
  521. echo shar: Extracting \"'libs/src/timer/impl.h'\" \(1738 characters\)
  522. sed "s/^X//" >'libs/src/timer/impl.h' <<'END_OF_FILE'
  523. X/*
  524. X * (c) Copyright 1993 by Panagiotis Tsirigotis
  525. X * All rights reserved.  The file named COPYRIGHT specifies the terms 
  526. X * and conditions for redistribution.
  527. X */
  528. X
  529. X#ifndef IMPL_H
  530. X#define IMPL_H
  531. X
  532. X/*
  533. X * $Id: impl.h,v 4.2 1993/05/06 06:47:03 panos Exp $
  534. X */
  535. X
  536. X#include <sys/time.h>
  537. X#include <setjmp.h>
  538. X
  539. X#include "pq.h"
  540. X#include "timer.h"
  541. X#include "ostimer.h"
  542. X
  543. Xenum timer_state { INACTIVE, TICKING, DESTROYED } ;  
  544. Xenum action_state { IDLE, PENDING, SCHEDULED, INVOKED } ;
  545. X
  546. X
  547. Xstruct timer
  548. X{
  549. X    enum timer_state         t_state ;
  550. X    enum action_state     t_act ;
  551. X    int                        t_blocked ;
  552. X
  553. X    int                         t_flags ;
  554. X    int                        *t_errnop ;
  555. X    struct os_timer        *t_ostimer ;
  556. X    struct timer_action    t_action ;
  557. X
  558. X    /*
  559. X     * The following fields are managed by the ostimer code.
  560. X     * t_expiration is the (absolute) time when the timer will expire.
  561. X     * t_interval is the repeat interval for the timer.
  562. X     * t_expirations is the number of expirations of the timer when
  563. X     * the function associated with the timer is invoked.
  564. X     * t_count is the number of times that the timer has expired before
  565. X     * the function was invoked.
  566. X     */
  567. X    struct timeval            t_expiration ;
  568. X    struct timeval            t_interval ;
  569. X    unsigned                    t_count ;
  570. X    unsigned                    t_expirations ;
  571. X} ;
  572. X
  573. Xtypedef struct timer timer_s ;
  574. X
  575. X#define TP( p )                ( (struct timer *) (p) )
  576. X
  577. Xchar *malloc() ;
  578. X
  579. X#define TIMER_ALLOC()        TP( malloc( sizeof( timer_s ) ) )
  580. X#define TIMER_FREE( tp )    (void) free( (char *)(tp) )
  581. X
  582. X/*
  583. X * The following are masks for the expected flags of timer_create and
  584. X * timer_start
  585. X */
  586. X#define TIMER_CREATE_FLAGS        TIMER_RETURN_ERROR
  587. X#define TIMER_START_FLAGS        \
  588. X            ( TIMER_INC_VAR + TIMER_BLOCK_SAME + TIMER_BLOCK_ALL + TIMER_LONGJMP )
  589. X
  590. X
  591. Xenum timer_state __timer_invoke() ;
  592. Xvoid __timer_terminate() ;
  593. X
  594. X#endif    /* IMPL_H */
  595. X
  596. END_OF_FILE
  597. if test 1738 -ne `wc -c <'libs/src/timer/impl.h'`; then
  598.     echo shar: \"'libs/src/timer/impl.h'\" unpacked with wrong size!
  599. fi
  600. # end of 'libs/src/timer/impl.h'
  601. fi
  602. if test -f 'libs/src/timer/ostimer.h' -a "${1}" != "-c" ; then 
  603.   echo shar: Will not clobber existing file \"'libs/src/timer/ostimer.h'\"
  604. else
  605. echo shar: Extracting \"'libs/src/timer/ostimer.h'\" \(1998 characters\)
  606. sed "s/^X//" >'libs/src/timer/ostimer.h' <<'END_OF_FILE'
  607. X/*
  608. X * (c) Copyright 1993 by Panagiotis Tsirigotis
  609. X * All rights reserved.  The file named COPYRIGHT specifies the terms 
  610. X * and conditions for redistribution.
  611. X */
  612. X
  613. X#ifndef OSTIMER_H
  614. X#define OSTIMER_H
  615. X
  616. X/*
  617. X * Include signal.h to get sigset_t
  618. X */
  619. X#ifndef NO_POSIX_SIGS
  620. X#include <signal.h>
  621. X#endif
  622. X
  623. X#include "pq.h"
  624. X
  625. X/*
  626. X * Holds a list of timers ordered by expiration time (the one at the
  627. X * head of the list is the one that will expire first).
  628. X */
  629. Xstruct timer_q
  630. X{
  631. X    pq_h    tq_handle ;
  632. X    int    tq_errno ;
  633. X} ;
  634. X
  635. X/*
  636. X * Macros to handle the priority queue
  637. X */
  638. X#define timer_pq_insert( tpq, tp )     pq_insert( tpq, (char *) tp )
  639. X#define timer_pq_head( tpq )           (struct timer *) pq_head( tpq )
  640. X#define timer_pq_extract_head( tpq )   (struct timer *) pq_extract_head( tpq )
  641. X#define timer_pq_delete( tpq, tp )     pq_delete( tpq, (char *) tp )
  642. X
  643. X
  644. Xtypedef enum { AVAILABLE, UNAVAILABLE } availability_e ;
  645. X
  646. X/*
  647. X * Description of a timer provided by the operating system
  648. X */
  649. Xstruct os_timer
  650. X{
  651. X    availability_e        ost_availability ;
  652. X    int                    ost_systype ;            /* e.g. ITIMER_REAL                         */
  653. X    enum timer_types    ost_timertype ;        /* e.g. TIMER_REAL                        */
  654. X    int                    ost_signal ;            /* what signal is generated             */
  655. X                                                        /* upon expiration                        */
  656. X    void                    (*ost_handler)() ;    /* what function to invoke                */
  657. X    void                    (*ost_get_current_time)() ;
  658. X                                                    /* how to find the current time            */
  659. X    struct timer_q        ost_timerq ;            /* list of timers of this type        */
  660. X#ifndef NO_POSIX_SIGS
  661. X    sigset_t                ost_block_mask ;        /* signal mask to blocks this timer */
  662. X#else
  663. X    int                     ost_block_mask ;
  664. X#endif
  665. X} ;
  666. X
  667. Xtypedef struct os_timer ostimer_s ;
  668. X
  669. X#define OSTIMER_NULL                    ((ostimer_s *)0)
  670. X
  671. X#define SIGSET_NULL                    ((sigset_t *)0)
  672. X
  673. X/*
  674. X * Public functions
  675. X */
  676. Xostimer_s    *__ostimer_init() ;
  677. Xint            __ostimer_newtimer() ;
  678. Xint            __ostimer_add() ;
  679. Xvoid            __ostimer_interrupt() ;
  680. Xvoid            __ostimer_remove() ;
  681. Xvoid            __ostimer_blockall() ;
  682. Xvoid            __ostimer_unblockall() ;
  683. Xvoid            __ostimer_unblockall_except() ;
  684. X
  685. X#endif    /* OSTIMER_H */
  686. X
  687. END_OF_FILE
  688. if test 1998 -ne `wc -c <'libs/src/timer/ostimer.h'`; then
  689.     echo shar: \"'libs/src/timer/ostimer.h'\" unpacked with wrong size!
  690. fi
  691. # end of 'libs/src/timer/ostimer.h'
  692. fi
  693. if test -f 'libs/src/timer/timer.h' -a "${1}" != "-c" ; then 
  694.   echo shar: Will not clobber existing file \"'libs/src/timer/timer.h'\"
  695. else
  696. echo shar: Extracting \"'libs/src/timer/timer.h'\" \(1983 characters\)
  697. sed "s/^X//" >'libs/src/timer/timer.h' <<'END_OF_FILE'
  698. X/*
  699. X * (c) Copyright 1993 by Panagiotis Tsirigotis
  700. X * All rights reserved.  The file named COPYRIGHT specifies the terms 
  701. X * and conditions for redistribution.
  702. X */
  703. X
  704. X#ifndef __TIMER_H
  705. X#define __TIMER_H
  706. X
  707. X/*
  708. X * $Id: timer.h,v 4.2 1993/05/06 06:43:55 panos Exp $
  709. X */
  710. X
  711. X#include <sys/time.h>
  712. X#include <setjmp.h>
  713. X
  714. X/*
  715. X * Return values
  716. X */
  717. X#define TIMER_OK            0
  718. X#define TIMER_ERR            (-1)
  719. X
  720. X/*
  721. X * errno values
  722. X */
  723. X#define TIMER_ENOMEM                1
  724. X#define TIMER_EBADTYPE            2
  725. X#define TIMER_EBADSTATE            3
  726. X#define TIMER_EBADTIME            4
  727. X#define TIMER_ESIGPROBLEM        5
  728. X#define TIMER_ECANTINSERT        6
  729. X#define TIMER_ENOTAVAILABLE    7
  730. X
  731. X/*
  732. X * flags
  733. X */
  734. X#define TIMER_NOFLAGS                0x0
  735. X#define TIMER_RETURN_ERROR            0x1
  736. X#define TIMER_INC_VAR                0x2
  737. X#define TIMER_BLOCK_SAME            0x4
  738. X#define TIMER_BLOCK_ALL                0x8
  739. X#define TIMER_LONGJMP                0x10
  740. X
  741. Xenum timer_types { TIMER_REAL, TIMER_VIRTUAL, TIMER_PROF } ;
  742. Xenum timer_timetypes { TIMER_ABSOLUTE, TIMER_RELATIVE } ;
  743. X
  744. Xstruct timer_action
  745. X{
  746. X    int        ta_flags ;
  747. X    void        (*ta_func)() ;
  748. X    void        *ta_arg ;
  749. X    jmp_buf    ta_env ;
  750. X} ;
  751. X
  752. X#ifdef __ARGS
  753. X#undef __ARGS
  754. X#endif
  755. X
  756. X#ifdef PROTOTYPES
  757. X#   define __ARGS( s )           s
  758. X#else
  759. X#   define __ARGS( s )           ()
  760. X#endif
  761. X
  762. Xtypedef void *timer_h ;
  763. X
  764. Xtimer_h timer_create        __ARGS( ( 
  765. X                                            enum timer_types type,
  766. X                                            int flags,
  767. X                                            int *errnop
  768. X                                        ) ) ;
  769. Xvoid timer_destroy         __ARGS( ( timer_h handle ) ) ;
  770. X
  771. Xint timer_start             __ARGS( (
  772. X                                            timer_h handle,
  773. X                                            struct itimerval *itvp,
  774. X                                            enum timer_times time_type,
  775. X                                            struct timer_action *ap 
  776. X                                        ) ) ;
  777. Xvoid timer_stop             __ARGS( ( timer_h handle ) ) ;
  778. X
  779. Xvoid timer_block             __ARGS( ( timer_h handle ) ) ;
  780. Xvoid timer_unblock         __ARGS( ( timer_h handle ) ) ;
  781. X
  782. Xunsigned timer_expirations __ARGS( ( timer_h handle ) ) ;
  783. X
  784. Xvoid timer_block_all        __ARGS( ( enum timer_types type ) ) ;
  785. Xvoid timer_unblock_all    __ARGS( ( enum timer_types type ) ) ;
  786. X
  787. Xchar *timer_strerr        __ARGS( ( timer_h handle ) ) ;
  788. X
  789. Xextern int timer_errno ;
  790. X
  791. X#endif    /* __TIMER_H */
  792. X
  793. END_OF_FILE
  794. if test 1983 -ne `wc -c <'libs/src/timer/timer.h'`; then
  795.     echo shar: \"'libs/src/timer/timer.h'\" unpacked with wrong size!
  796. fi
  797. # end of 'libs/src/timer/timer.h'
  798. fi
  799. if test -f 'libs/src/xlog/xlog.h' -a "${1}" != "-c" ; then 
  800.   echo shar: Will not clobber existing file \"'libs/src/xlog/xlog.h'\"
  801. else
  802. echo shar: Extracting \"'libs/src/xlog/xlog.h'\" \(1967 characters\)
  803. sed "s/^X//" >'libs/src/xlog/xlog.h' <<'END_OF_FILE'
  804. X/*
  805. X * (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
  806. X * All rights reserved.  The file named COPYRIGHT specifies the terms 
  807. X * and conditions for redistribution.
  808. X */
  809. X
  810. X#ifndef __XLOG_H
  811. X#define __XLOG_H
  812. X
  813. X/*
  814. X * $Id: xlog.h,v 2.2 1993/06/15 18:07:48 panos Exp $
  815. X */
  816. X
  817. X/*
  818. X * Flags
  819. X */
  820. X#define XLOG_NOFLAGS                    0x0
  821. X#define XLOG_SET_LEVEL                0x1
  822. X#define XLOG_NO_SIZECHECK            0x2
  823. X#define XLOG_NO_ERRNO                0x4
  824. X/* #define XLOG_PRINT_TIMESTAMP        0x8 */
  825. X#define XLOG_PRINT_ID                0x10
  826. X#define XLOG_PRINT_PID                0x20
  827. X
  828. X/*
  829. X * Errors
  830. X */
  831. X#define XLOG_ENOERROR                0
  832. X#define XLOG_ESIZE                    1
  833. X#define XLOG_EOPEN                    2
  834. X#define XLOG_EFSTAT                    3
  835. X#define XLOG_ENOMEM                    4
  836. X#define XLOG_EBADOP                    5
  837. X
  838. X/*
  839. X * Interface
  840. X */
  841. X
  842. X#ifdef __ARGS
  843. X#undef __ARGS
  844. X#endif
  845. X
  846. X#ifdef PROTOTYPES
  847. X#  define __ARGS( s )               s
  848. X#else
  849. X#  define __ARGS( s )               ()
  850. X#endif
  851. X
  852. Xtypedef enum { XLOG_SYSLOG, XLOG_FILELOG } xlog_e ;
  853. X
  854. Xtypedef enum
  855. X    {
  856. X        XLOG_LINK,                /* generic: link this log to another log             */
  857. X        XLOG_CALLBACK,            /* generic: call this function in case of error */
  858. X        XLOG_GETFLAG,            /* generic:    get value of specified flag            */
  859. X        XLOG_SETFLAG,            /* generic:    set value of specified flag            */
  860. X        XLOG_LEVEL,                /* syslog:  set the default syslog level            */
  861. X        XLOG_FACILITY,            /* syslog:  set the default syslog facility        */
  862. X        XLOG_PREEXEC,            /* syslog:    prepare the log for an exec(2)        */
  863. X        XLOG_POSTEXEC,            /* syslog:    exec(2) failed                                */
  864. X        XLOG_SIZECHECK,        /* filelog: check file size                             */
  865. X        XLOG_GETFD,                /* filelog: get file descriptor of log file        */
  866. X        XLOG_LIMITS             /* filelog: set (new) soft/hard limits                */
  867. X    } xlog_cmd_e ;
  868. X
  869. Xtypedef void *xlog_h ;
  870. X
  871. Xxlog_h xlog_create    __ARGS( ( xlog_e type, char *id, int flags, ... ) ) ;
  872. Xvoid xlog_destroy        __ARGS( ( xlog_h ) ) ;
  873. Xvoid xlog_write        __ARGS( ( xlog_h, char *buf, int len, int flags, ... ) ) ;
  874. Xint xlog_control        __ARGS( ( xlog_h, xlog_cmd_e, ... ) ) ;
  875. Xint xlog_parms            __ARGS( ( xlog_e type, ... ) ) ;
  876. X
  877. X#endif    /* __XLOG_H */
  878. END_OF_FILE
  879. if test 1967 -ne `wc -c <'libs/src/xlog/xlog.h'`; then
  880.     echo shar: \"'libs/src/xlog/xlog.h'\" unpacked with wrong size!
  881. fi
  882. # end of 'libs/src/xlog/xlog.h'
  883. fi
  884. if test -f 'xinetd/attr.h' -a "${1}" != "-c" ; then 
  885.   echo shar: Will not clobber existing file \"'xinetd/attr.h'\"
  886. else
  887. echo shar: Extracting \"'xinetd/attr.h'\" \(1594 characters\)
  888. sed "s/^X//" >'xinetd/attr.h' <<'END_OF_FILE'
  889. X/*
  890. X * (c) Copyright 1992 by Panagiotis Tsirigotis
  891. X * All rights reserved.  The file named COPYRIGHT specifies the terms 
  892. X * and conditions for redistribution.
  893. X */
  894. X
  895. X#ifndef ATTR_H
  896. X#define ATTR_H
  897. X
  898. X/*
  899. X * $Id: attr.h,v 6.2 1993/04/22 23:27:03 panos Exp $
  900. X */
  901. X
  902. X/*
  903. X * Attribute IDs
  904. X */
  905. X#define A_NONE             0
  906. X#define A_WAIT             1
  907. X#define A_SOCKET_TYPE      2
  908. X#define A_PROTOCOL         3
  909. X#define A_USER             4
  910. X#define A_GROUP            5
  911. X#define A_SERVER           6
  912. X#define A_SERVER_ARGS      7
  913. X#define A_INSTANCES        8
  914. X#define A_ID                    9
  915. X#define A_ONLY_FROM        10
  916. X#define A_ACCESS_TIMES     11
  917. X#define A_RPC_VERSION        12
  918. X#define A_LOG_TYPE            13
  919. X#define A_NO_ACCESS            14
  920. X#define A_TYPE                    15
  921. X#define A_LOG_ON_FAILURE    16
  922. X#define A_LOG_ON_SUCCESS    17
  923. X#define A_ENV                    18
  924. X#define A_PORT                    19
  925. X#define A_PASSENV                20
  926. X#define A_FLAGS                21
  927. X#define A_RPC_NUMBER            22
  928. X#define A_NICE                    23
  929. X
  930. X/*
  931. X * SERVICE_ATTRIBUTES is the number of service attributes and also
  932. X * the number from which defaults-only attributes start.
  933. X */
  934. X#define SERVICE_ATTRIBUTES        ( A_NICE + 1 )
  935. X
  936. X#define A_DISABLED            ( SERVICE_ATTRIBUTES )
  937. X
  938. X
  939. X/*
  940. X * Mask of attributes that must be specified.
  941. X */
  942. X#define NECESSARY_ATTRS                 ( MASK( A_SOCKET_TYPE ) + MASK( A_WAIT ) )
  943. X
  944. X#define NECESSARY_ATTRS_EXTERNAL            MASK( A_SERVER )
  945. X#define NECESSARY_ATTRS_RPC_LISTED        MASK( A_PROTOCOL )
  946. X#define NECESSARY_ATTRS_RPC_UNLISTED    MASK( A_PROTOCOL ) + MASK( A_RPC_NUMBER )
  947. X#define NECESSARY_ATTRS_LISTED            MASK( A_USER )
  948. X#define NECESSARY_ATTRS_UNLISTED          ( MASK( A_PROTOCOL ) + MASK( A_PORT ) )
  949. X
  950. X#endif    /* ATTR_H */
  951. END_OF_FILE
  952. if test 1594 -ne `wc -c <'xinetd/attr.h'`; then
  953.     echo shar: \"'xinetd/attr.h'\" unpacked with wrong size!
  954. fi
  955. # end of 'xinetd/attr.h'
  956. fi
  957. if test -f 'xinetd/flags.c' -a "${1}" != "-c" ; then 
  958.   echo shar: Will not clobber existing file \"'xinetd/flags.c'\"
  959. else
  960. echo shar: Extracting \"'xinetd/flags.c'\" \(1985 characters\)
  961. sed "s/^X//" >'xinetd/flags.c' <<'END_OF_FILE'
  962. X/*
  963. X * (c) Copyright 1992 by Panagiotis Tsirigotis
  964. X * All rights reserved.  The file named COPYRIGHT specifies the terms 
  965. X * and conditions for redistribution.
  966. X */
  967. X
  968. Xstatic char RCSid[] = "$Id: flags.c,v 6.3 1993/06/15 23:25:57 panos Exp $" ;
  969. X
  970. X#include "flags.h"
  971. X#include "state.h"
  972. X#include "defs.h"
  973. X
  974. X/*
  975. X * Control flags
  976. X *
  977. X *        NOENV means that the setjmp buffer should be disabled while the
  978. X *        flag action is running (so if something goes wrong in the flag
  979. X *        action the program will be terminated).
  980. X */
  981. X#define CF_NONE                        0x0
  982. X#define CF_NOENV                        0x1
  983. X
  984. Xstruct flag_action
  985. X{
  986. X    int             fa_value ;
  987. X    voidfunc     fa_action ;
  988. X    int             fa_control_flags ;
  989. X} ;
  990. X
  991. X
  992. Xvoid soft_reconfig() ;
  993. Xvoid hard_reconfig() ;
  994. Xvoid dump_internal_state() ;
  995. Xvoid periodic_check() ;
  996. Xvoid user_requested_check() ;
  997. Xvoid child_exit() ;
  998. Xvoid server_retry() ;
  999. Xvoid quit_program() ;
  1000. Xvoid terminate_program() ;
  1001. X
  1002. X
  1003. Xstatic struct flag_action flag_actions[] =
  1004. X{
  1005. X    { SOFT_RECONFIG_FLAG,        soft_reconfig,                CF_NOENV        },
  1006. X    { HARD_RECONFIG_FLAG,        hard_reconfig,                CF_NOENV        },
  1007. X    { RETRY_FLAG,                    server_retry,                CF_NONE        },
  1008. X    { DUMP_FLAG,                    dump_internal_state,        CF_NONE         },
  1009. X    { TERMINATE_FLAG,                terminate_program,        CF_NONE        },
  1010. X    { CONSISTENCY_FLAG,            user_requested_check,    CF_NONE        },
  1011. X    { CHILD_FLAG,                    child_exit,                    CF_NONE        },
  1012. X    { QUIT_FLAG,                    quit_program,                CF_NONE        },
  1013. X    { PERIODIC_CHECK_FLAG,        periodic_check,            CF_NONE        },
  1014. X    { 0,                                0,                                0                }
  1015. X} ;
  1016. X
  1017. X
  1018. X/*
  1019. X * Returns after all flags are clear
  1020. X */
  1021. Xvoid check_flags()
  1022. X{
  1023. X    bool_int valid_env = ps.rws.env_is_valid ;
  1024. X
  1025. X    while ( ! M_ARE_ALL_CLEAR( ps.flags ) )
  1026. X    {
  1027. X        register struct flag_action *fap ;
  1028. X
  1029. X        for ( fap = flag_actions ; fap->fa_value != 0 ; fap++ )
  1030. X            if ( M_IS_SET( ps.flags, fap->fa_value ) )
  1031. X            {
  1032. X                M_CLEAR( ps.flags, fap->fa_value ) ;
  1033. X
  1034. X                if ( fap->fa_control_flags & CF_NOENV )
  1035. X                    ps.rws.env_is_valid = FALSE ;
  1036. X                else
  1037. X                    ps.rws.env_is_valid = valid_env ;
  1038. X
  1039. X                (*fap->fa_action)() ;
  1040. X
  1041. X                break ;
  1042. X            }
  1043. X    }
  1044. X
  1045. X    ps.rws.env_is_valid = valid_env ;
  1046. X}
  1047. X
  1048. X
  1049. END_OF_FILE
  1050. if test 1985 -ne `wc -c <'xinetd/flags.c'`; then
  1051.     echo shar: \"'xinetd/flags.c'\" unpacked with wrong size!
  1052. fi
  1053. # end of 'xinetd/flags.c'
  1054. fi
  1055. if test -f 'xinetd/int.h' -a "${1}" != "-c" ; then 
  1056.   echo shar: Will not clobber existing file \"'xinetd/int.h'\"
  1057. else
  1058. echo shar: Extracting \"'xinetd/int.h'\" \(1858 characters\)
  1059. sed "s/^X//" >'xinetd/int.h' <<'END_OF_FILE'
  1060. X/*
  1061. X * (c) Copyright 1992 by Panagiotis Tsirigotis
  1062. X * All rights reserved.  The file named COPYRIGHT specifies the terms 
  1063. X * and conditions for redistribution.
  1064. X */
  1065. X
  1066. X#ifndef INT_H
  1067. X#define INT_H
  1068. X
  1069. X/*
  1070. X * $Id: int.h,v 6.5 1993/06/06 00:06:43 panos Exp $
  1071. X */
  1072. X
  1073. X#include <sys/types.h>
  1074. X#include <netinet/in.h>
  1075. X
  1076. X#include "pset.h"
  1077. X
  1078. X#include "defs.h"
  1079. X#include "server.h"
  1080. X
  1081. Xtypedef enum { GOOD_CHANNEL, BAD_CHANNEL } channel_state_e ;
  1082. X
  1083. Xstruct channel
  1084. X{
  1085. X    channel_state_e        ch_state ;
  1086. X    struct sockaddr_in    ch_from ;
  1087. X    int                        ch_local_socket ;
  1088. X    int                        ch_remote_socket ;
  1089. X} ;
  1090. X
  1091. Xtypedef struct channel channel_s ;
  1092. X
  1093. X#define CHP( p )                  ((struct channel *)(p))
  1094. X
  1095. X#define CHANNEL_NULL                    CHP( NULL )
  1096. X
  1097. Xchar *malloc() ;
  1098. X
  1099. X#define NEW_CHANNEL()            NEW( channel_s )
  1100. X#define FREE_CHANNEL( chp )      FREE( chp )
  1101. X
  1102. X
  1103. Xchannel_s *int_lookupconn() ;
  1104. Xchannel_s *int_newconn() ;
  1105. X
  1106. X
  1107. Xstruct intercept_common
  1108. X{
  1109. X    bool_int                    ic_intercept ;
  1110. X    int                        ic_remote_socket ;
  1111. X    struct sockaddr_in    ic_local_addr ;
  1112. X    pset_h                     ic_connections ;
  1113. X    struct server            ic_server ;
  1114. X} ;
  1115. X
  1116. X
  1117. Xstruct intercept_ops
  1118. X{
  1119. X    void (*mux)() ;
  1120. X    void (*exit)() ;
  1121. X} ;
  1122. X
  1123. X
  1124. Xstruct intercept
  1125. X{
  1126. X    int                                 int_socket_type ;
  1127. X    struct intercept_common     int_common ;
  1128. X    void                                 *int_priv ;
  1129. X    struct intercept_ops         *int_ops ;
  1130. X} ;
  1131. X
  1132. X#define INT_TYPE( p )                    ((p)->int_socket_type)
  1133. X#define INT_SERVER( p )                    (&(p)->int_common.ic_server)
  1134. X#define INT_LOCALADDR( p )                (&(p)->int_common.ic_local_addr)
  1135. X#define INT_REMOTE( p )                    ((p)->int_common.ic_remote_socket)
  1136. X#define INT_ALLOCATOR( p )                ((p)->int_common.ic_channel_allocator)
  1137. X#define INT_CONNECTIONS( p )            ((p)->int_common.ic_connections)
  1138. X#define INTERCEPT( p )                    ((p)->int_common.ic_intercept)
  1139. X
  1140. Xvoid                int_fail() ;
  1141. Xint                int_select() ;
  1142. Xvoid                int_exit() ;
  1143. Xvoid                int_init() ;
  1144. Xchannel_s        *int_newconn() ;
  1145. Xchannel_s        *int_lookupconn() ;
  1146. X
  1147. X#endif    /* INT_H */
  1148. END_OF_FILE
  1149. if test 1858 -ne `wc -c <'xinetd/int.h'`; then
  1150.     echo shar: \"'xinetd/int.h'\" unpacked with wrong size!
  1151. fi
  1152. # end of 'xinetd/int.h'
  1153. fi
  1154. if test -f 'xinetd/state.h' -a "${1}" != "-c" ; then 
  1155.   echo shar: Will not clobber existing file \"'xinetd/state.h'\"
  1156. else
  1157. echo shar: Extracting \"'xinetd/state.h'\" \(1988 characters\)
  1158. sed "s/^X//" >'xinetd/state.h' <<'END_OF_FILE'
  1159. X/*
  1160. X * (c) Copyright 1992 by Panagiotis Tsirigotis
  1161. X * All rights reserved.  The file named COPYRIGHT specifies the terms 
  1162. X * and conditions for redistribution.
  1163. X */
  1164. X
  1165. X#ifndef STATE_H
  1166. X#define STATE_H
  1167. X
  1168. X/*
  1169. X * $Id: state.h,v 6.2 1993/06/04 23:23:47 panos Exp $
  1170. X */
  1171. X
  1172. X#include <setjmp.h>
  1173. X
  1174. X#include "pset.h"
  1175. X#include "xlog.h"
  1176. X
  1177. X#include "mask.h"
  1178. X#include "service.h"
  1179. X
  1180. Xstruct read_only_state
  1181. X{
  1182. X    int        orig_max_descriptors ;    /* before we change the resource limit */
  1183. X    int        max_descriptors ;            /* as returned by getdtablesize()         */
  1184. X    int        process_limit ;            /* if 0, there is no limit                 */
  1185. X    unsigned loop_rate ;
  1186. X    char        *config_file ;
  1187. X    int        is_superuser ;
  1188. X    char        **Argv ;
  1189. X    int        Argc ;
  1190. X} ;
  1191. X
  1192. X
  1193. Xstruct defaults
  1194. X{
  1195. X    struct service_config     *def_settings ;
  1196. X   xlog_h                        def_log ;
  1197. X   bool_int                        def_log_creation_failed ;
  1198. X} ;
  1199. X
  1200. X
  1201. Xstruct read_write_state
  1202. X{
  1203. X    int                     descriptors_free ;
  1204. X    int                     available_services ;        /* # of available services         */
  1205. X    int                     active_services ;            /* services with descriptors set */
  1206. X                                                            /* in socket mask                        */
  1207. X    fd_set                 socket_mask ;
  1208. X    int                     mask_max ;
  1209. X    pset_h                 servers ;                    /* table of running servers        */
  1210. X    pset_h                 retries ;                    /* table of servers to retry        */
  1211. X    pset_h                 services ;                    /* table of services                    */
  1212. X    struct service        *logging ;
  1213. X    struct service        *shutdown ;
  1214. X    struct defaults     defs ;
  1215. X    xlog_h                program_log ;
  1216. X    jmp_buf                env ;
  1217. X    bool_int                env_is_valid ;
  1218. X} ;
  1219. X
  1220. Xstruct program_state
  1221. X{
  1222. X    mask_t                        flags ;
  1223. X    struct read_only_state    ros ;
  1224. X    struct read_write_state rws ;
  1225. X} ;
  1226. X
  1227. X#define DEFAULTS( ps )                        (ps).rws.defs.def_settings
  1228. X#define DEFAULT_LOG( ps )                    (ps).rws.defs.def_log
  1229. X#define DEFAULT_LOG_ERROR( ps )            (ps).rws.defs.def_log_creation_failed
  1230. X#define LOG_SERVICE( ps )                    (ps).rws.logging
  1231. X#define SHUTDOWN_SERVICE( ps )            (ps).rws.shutdown
  1232. X#define SERVICES( ps )                        (ps).rws.services
  1233. X#define SERVERS( ps )                        (ps).rws.servers
  1234. X#define RETRIES( ps )                        (ps).rws.retries
  1235. X
  1236. Xextern struct program_state ps ;
  1237. X
  1238. X#endif    /* STATE_H */
  1239. END_OF_FILE
  1240. if test 1988 -ne `wc -c <'xinetd/state.h'`; then
  1241.     echo shar: \"'xinetd/state.h'\" unpacked with wrong size!
  1242. fi
  1243. # end of 'xinetd/state.h'
  1244. fi
  1245. echo shar: End of archive 3 \(of 31\).
  1246. cp /dev/null ark3isdone
  1247. MISSING=""
  1248. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 ; do
  1249.     if test ! -f ark${I}isdone ; then
  1250.     MISSING="${MISSING} ${I}"
  1251.     fi
  1252. done
  1253. if test "${MISSING}" = "" ; then
  1254.     echo You have unpacked all 31 archives.
  1255.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1256. else
  1257.     echo You still need to unpack the following archives:
  1258.     echo "        " ${MISSING}
  1259. fi
  1260. ##  End of shell archive.
  1261. exit 0
  1262.