fixes init script for non ipv6 enabled systems #472755
[packages/xinetd.git] / xinetd / nvlists.c
1 /*
2  * (c) Copyright 1992 by Panagiotis Tsirigotis
3  * (c) Sections Copyright 1998-2001 by Rob Braun
4  * All rights reserved.  The file named COPYRIGHT specifies the terms 
5  * and conditions for redistribution.
6  */
7
8
9 #include "config.h"
10 #include <sys/types.h>
11 #include <sys/socket.h>
12 #include <syslog.h>
13
14 #include "nvlists.h"
15 #include "sconf.h"
16
17
18 /*
19  * A NULL value for the name field marks the end of the table
20  */
21
22 const struct name_value service_types[] =
23    {
24 #ifndef NO_RPC
25       { "RPC",                        ST_RPC                  },
26 #endif
27       { "INTERNAL",                   ST_INTERNAL             },
28       { "UNLISTED",                   ST_UNLISTED             },
29       { "SPECIAL",                    ST_SPECIAL              },
30       { "TCPMUX",                     ST_TCPMUX               },
31       { "TCPMUXPLUS",                 ST_TCPMUXPLUS           },
32       { CHAR_NULL,                    0                       }
33    } ;
34
35
36 /* REUSE is only used for backward compatibility.  All services are now reuse */
37 const struct name_value service_flags[] =
38    {
39       { "REUSE",                      SF_REUSE               },
40       { "INTERCEPT",                  SF_INTERCEPT           },
41       { "NORETRY",                    SF_NORETRY             },
42       { "IDONLY",                     SF_IDONLY              },
43       { "NAMEINARGS",                 SF_NAMEINARGS          },
44       { "NODELAY",                    SF_NODELAY             },
45       { "KEEPALIVE",                  SF_KEEPALIVE           },
46       { "NOLIBWRAP",                  SF_NOLIBWRAP           },
47       { "SENSOR",                     SF_SENSOR              },
48       { "IPv4",                       SF_IPV4                },
49       { "IPv6",                       SF_IPV6                },
50       { CHAR_NULL,                    0                      }
51    } ;
52
53
54 const struct name_value socket_types[] =
55    {
56       { "stream",                     SOCK_STREAM           },
57       { "dgram",                      SOCK_DGRAM            },
58       { "raw",                        SOCK_RAW              },
59       { "seqpacket",                  SOCK_SEQPACKET        },
60       { CHAR_NULL,                    1                     },
61       { "BAD SOCKET TYPE",            0                     }
62    } ;
63
64
65 const struct name_value success_log_options[] =
66    {
67       { "HOST",        LO_HOST     },
68       { "DURATION",    LO_DURATION },
69       { "EXIT",        LO_EXIT     },
70       { "PID",         LO_PID      },
71       { "USERID",      LO_USERID   },
72       { "TRAFFIC",     LO_TRAFFIC  },
73       { CHAR_NULL,     0           }
74    } ;
75
76
77 const struct name_value failure_log_options[] = 
78    {
79       { "HOST",        LO_HOST     },
80       { "ATTEMPT",     LO_ATTEMPT  },
81       { "USERID",      LO_USERID   },
82       { CHAR_NULL,     0           }
83    } ;
84
85
86
87 const struct name_value syslog_facilities[] =
88    {
89       { "daemon",         LOG_DAEMON      },
90       { "auth",           LOG_AUTH        },
91 #ifdef linux
92       { "authpriv",       LOG_AUTHPRIV    },
93 #endif
94       { "user",           LOG_USER        },
95 #ifdef LOG_MAIL
96       { "mail",           LOG_MAIL        },
97 #endif
98 #ifdef LOG_LPR
99       { "lpr",            LOG_LPR         },
100 #endif
101 #ifdef LOG_NEWS
102       { "news",           LOG_NEWS        },
103 #endif
104 #ifdef LOG_UUCP
105       { "uucp",           LOG_UUCP        },
106 #endif
107 #ifdef LOG_FTP
108       { "ftp",            LOG_FTP         },
109 #endif
110       { "local0",         LOG_LOCAL0      },
111       { "local1",         LOG_LOCAL1      },
112       { "local2",         LOG_LOCAL2      },
113       { "local3",         LOG_LOCAL3      },
114       { "local4",         LOG_LOCAL4      },
115       { "local5",         LOG_LOCAL5      },
116       { "local6",         LOG_LOCAL6      },
117       { "local7",         LOG_LOCAL7      },
118       { CHAR_NULL,        1               },
119       { "BAD FACILITY",   0               }
120    } ;
121
122
123 const struct name_value syslog_levels[] = 
124    {
125       { "emerg",         LOG_EMERG      },
126       { "alert",         LOG_ALERT      },
127       { "crit",          LOG_CRIT       },
128       { "err",           LOG_ERR        },
129       { "warning",       LOG_WARNING    },
130       { "notice",        LOG_NOTICE     },
131       { "info",          LOG_INFO       },
132       { "debug",         LOG_DEBUG      },
133       { CHAR_NULL,       1              },
134       { "BAD LEVEL",     0              }
135    } ;
136