"Fossies" - the Fresh Open Source Software Archive

Member "ident2-v1.07_FINAL/ident2.h" (22 Jul 2005, 2930 Bytes) of package /linux/privat/old/ident2-v1.07_FINAL.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "ident2.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  * Ident-2 - an Identity server for UNIX
    3  * Copyright (C) 1998-2001 Michael Bacarella
    4  * Copyright (C) 2003 Netgraft Corporation
    5  *
    6  * This program is free software; you can redistribute it and/or
    7  * modify it under the terms of the GNU General Public License
    8  * as published by the Free Software Foundation; either version 2
    9  * of the License, or (at your option) any later version.
   10  *
   11  * This program is distributed in the hope that it will be useful,
   12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   14  * GNU General Public License for more details.
   15  *
   16  * You should have received a copy of the GNU General Public License
   17  * along with this program; if not, write to the Free Software
   18  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
   19  *
   20  * Please view the file README for program information.
   21  *
   22  */
   23 
   24 #ifndef IDENT2_H_
   25 #define IDENT2_H_
   26 
   27 #define ID_VERSION  "1.05-FINAL"
   28 #define ID_MAINTAINER   "mike@bacarella.com"
   29 
   30 #define FALSE   0
   31 #define TRUE    1
   32 
   33 #define ID_BUF_SIZE 128
   34 
   35 #include <stdio.h>
   36 #include <stdlib.h>
   37 #include <string.h>
   38 #include <signal.h>
   39 #include <assert.h>
   40 #include <errno.h>
   41 #include <time.h>
   42 
   43 #include <unistd.h>
   44 #include <fcntl.h>
   45   
   46 #include <pwd.h>
   47 #include <syslog.h>
   48  
   49 #include <sys/types.h>
   50 #include <sys/socket.h>
   51 #include <sys/wait.h>
   52 #include <sys/time.h>
   53  
   54 #include <netinet/in.h>
   55 #include <arpa/inet.h>
   56 #include <netdb.h>
   57 
   58 #include "define.h"
   59 
   60 /*
   61  * ==================================================================
   62  * GLOBALS
   63  * ==================================================================
   64  */
   65 
   66 enum Service_Type {NO_TYPE, DAEMON, INETD};
   67 
   68 /* ------------ variables ---------- */
   69 
   70 size_t          Max_Connections;
   71 size_t          Client_Timeout;
   72 
   73 enum Service_Type   Service_Type;
   74 
   75 char            Dont_Change_Uid;
   76 char            Use_User_Ident;
   77 char            Allow_NOIDENT;
   78 char            *User_Ident_File;
   79 char            Reply_Always_Random;
   80 
   81 unsigned short      Ident_Port;
   82 
   83 /* ----------- handy init macro ---------- */
   84 
   85 #define INIT_GLOBALS()  {           \
   86     Dont_Change_Uid = FALSE;        \
   87     Reply_Always_Random = FALSE;        \
   88     Use_User_Ident = FALSE;         \
   89                         \
   90     Ident_Port = IDENT_PORT;        \
   91     Service_Type = NO_TYPE;         \
   92                         \
   93     User_Ident_File = USERCONF_FILE;    \
   94     Max_Connections = DEF_MAX_CONNECTIONS;  \
   95     Client_Timeout = DEF_CLIENT_TIMEOUT;    \
   96 }
   97     
   98                         /* #### DAEMON.C #### */
   99 void    daemon_service (void);
  100 
  101 
  102             /* #### MACHINE.C #### */
  103             /* ( M_<PLATFORM>.C ) */
  104 /**
  105  ** MACHINE DEPENDANT FUNCTIONS
  106  ** ports need only implement the functionality
  107  ** exported from these three functions
  108  **/
  109  
  110 int m_get_uid (struct in_addr *, u_short, struct in_addr *, u_short);
  111 int m_reduce_rights (void);     /* ..to minimize damage.. */
  112 int m_register_pid (void);      /* for service management purposes */
  113 
  114 
  115         /* #### COMMON.C #### */
  116 
  117 void    *xmalloc (size_t);  
  118 void    child_service (int, int);
  119 void    nexus (int, char *);
  120 
  121 #endif /* WHOLE FILE */
  122