aboutsummaryrefslogtreecommitdiff
path: root/networking/inetd.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-04-10 12:26:47 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-04-10 12:26:47 +0000
commita4acf669f4b2c649c408633804d6f9333c8ed73e (patch)
tree262b3e08f518ca3f2980e99203a92b6ca3adf9ad /networking/inetd.c
parent3e72c5931c1f981b894bf3f1aed4852338904ffc (diff)
downloadbusybox-w32-a4acf669f4b2c649c408633804d6f9333c8ed73e.tar.gz
busybox-w32-a4acf669f4b2c649c408633804d6f9333c8ed73e.tar.bz2
busybox-w32-a4acf669f4b2c649c408633804d6f9333c8ed73e.zip
- typo: s/biltin/builtin/g
Diffstat (limited to '')
-rw-r--r--networking/inetd.c82
1 files changed, 41 insertions, 41 deletions
diff --git a/networking/inetd.c b/networking/inetd.c
index 931052a5a..cc700832c 100644
--- a/networking/inetd.c
+++ b/networking/inetd.c
@@ -155,11 +155,11 @@
155#include "busybox.h" 155#include "busybox.h"
156 156
157//#define CONFIG_FEATURE_INETD_RPC 157//#define CONFIG_FEATURE_INETD_RPC
158//#define CONFIG_FEATURE_INETD_SUPPORT_BILTIN_ECHO 158//#define CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO
159//#define CONFIG_FEATURE_INETD_SUPPORT_BILTIN_DISCARD 159//#define CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD
160//#define CONFIG_FEATURE_INETD_SUPPORT_BILTIN_TIME 160//#define CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME
161//#define CONFIG_FEATURE_INETD_SUPPORT_BILTIN_DAYTIME 161//#define CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME
162//#define CONFIG_FEATURE_INETD_SUPPORT_BILTIN_CHARGEN 162//#define CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN
163//#define CONFIG_FEATURE_IPV6 163//#define CONFIG_FEATURE_IPV6
164 164
165#ifdef CONFIG_FEATURE_INETD_RPC 165#ifdef CONFIG_FEATURE_INETD_RPC
@@ -191,17 +191,17 @@ static struct rlimit rlim_ofile;
191 191
192 192
193/* Check unsupporting builtin */ 193/* Check unsupporting builtin */
194#if defined CONFIG_FEATURE_INETD_SUPPORT_BILTIN_ECHO || \ 194#if defined CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO || \
195 defined CONFIG_FEATURE_INETD_SUPPORT_BILTIN_DISCARD || \ 195 defined CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD || \
196 defined CONFIG_FEATURE_INETD_SUPPORT_BILTIN_TIME || \ 196 defined CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME || \
197 defined CONFIG_FEATURE_INETD_SUPPORT_BILTIN_DAYTIME || \ 197 defined CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME || \
198 defined CONFIG_FEATURE_INETD_SUPPORT_BILTIN_CHARGEN 198 defined CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN
199# define INETD_FEATURE_ENABLED 199# define INETD_FEATURE_ENABLED
200#endif 200#endif
201 201
202#if defined CONFIG_FEATURE_INETD_SUPPORT_BILTIN_ECHO || \ 202#if defined CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO || \
203 defined CONFIG_FEATURE_INETD_SUPPORT_BILTIN_DISCARD || \ 203 defined CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD || \
204 defined CONFIG_FEATURE_INETD_SUPPORT_BILTIN_CHARGEN 204 defined CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN
205# define INETD_SETPROCTITLE 205# define INETD_SETPROCTITLE
206#endif 206#endif
207 207
@@ -225,7 +225,7 @@ typedef struct servtab
225 char *se_user; /* user name to run as */ 225 char *se_user; /* user name to run as */
226 char *se_group; /* group name to run as */ 226 char *se_group; /* group name to run as */
227#ifdef INETD_FEATURE_ENABLED 227#ifdef INETD_FEATURE_ENABLED
228 const struct biltin *se_bi; /* if built-in, description */ 228 const struct builtin *se_bi; /* if built-in, description */
229#endif 229#endif
230 char *se_server; /* server program */ 230 char *se_server; /* server program */
231#define MAXARGV 20 231#define MAXARGV 20
@@ -254,7 +254,7 @@ typedef struct servtab
254static servtab_t *servtab; 254static servtab_t *servtab;
255 255
256#ifdef INETD_FEATURE_ENABLED 256#ifdef INETD_FEATURE_ENABLED
257struct biltin 257struct builtin
258{ 258{
259 const char *bi_service; /* internally provided service name */ 259 const char *bi_service; /* internally provided service name */
260 int bi_socktype; /* type of socket supported */ 260 int bi_socktype; /* type of socket supported */
@@ -264,53 +264,53 @@ struct biltin
264}; 264};
265 265
266 /* Echo received data */ 266 /* Echo received data */
267#ifdef CONFIG_FEATURE_INETD_SUPPORT_BILTIN_ECHO 267#ifdef CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO
268static void echo_stream (int, servtab_t *); 268static void echo_stream (int, servtab_t *);
269static void echo_dg (int, servtab_t *); 269static void echo_dg (int, servtab_t *);
270#endif 270#endif
271 /* Internet /dev/null */ 271 /* Internet /dev/null */
272#ifdef CONFIG_FEATURE_INETD_SUPPORT_BILTIN_DISCARD 272#ifdef CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD
273static void discard_stream (int, servtab_t *); 273static void discard_stream (int, servtab_t *);
274static void discard_dg (int, servtab_t *); 274static void discard_dg (int, servtab_t *);
275#endif 275#endif
276 /* Return 32 bit time since 1900 */ 276 /* Return 32 bit time since 1900 */
277#ifdef CONFIG_FEATURE_INETD_SUPPORT_BILTIN_TIME 277#ifdef CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME
278static void machtime_stream (int, servtab_t *); 278static void machtime_stream (int, servtab_t *);
279static void machtime_dg (int, servtab_t *); 279static void machtime_dg (int, servtab_t *);
280#endif 280#endif
281 /* Return human-readable time */ 281 /* Return human-readable time */
282#ifdef CONFIG_FEATURE_INETD_SUPPORT_BILTIN_DAYTIME 282#ifdef CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME
283static void daytime_stream (int, servtab_t *); 283static void daytime_stream (int, servtab_t *);
284static void daytime_dg (int, servtab_t *); 284static void daytime_dg (int, servtab_t *);
285#endif 285#endif
286 /* Familiar character generator */ 286 /* Familiar character generator */
287#ifdef CONFIG_FEATURE_INETD_SUPPORT_BILTIN_CHARGEN 287#ifdef CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN
288static void chargen_stream (int, servtab_t *); 288static void chargen_stream (int, servtab_t *);
289static void chargen_dg (int, servtab_t *); 289static void chargen_dg (int, servtab_t *);
290#endif 290#endif
291 291
292static const struct biltin biltins[] = { 292static const struct builtin builtins[] = {
293#ifdef CONFIG_FEATURE_INETD_SUPPORT_BILTIN_ECHO 293#ifdef CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO
294 /* Echo received data */ 294 /* Echo received data */
295 {"echo", SOCK_STREAM, 1, 0, echo_stream,}, 295 {"echo", SOCK_STREAM, 1, 0, echo_stream,},
296 {"echo", SOCK_DGRAM, 0, 0, echo_dg,}, 296 {"echo", SOCK_DGRAM, 0, 0, echo_dg,},
297#endif 297#endif
298#ifdef CONFIG_FEATURE_INETD_SUPPORT_BILTIN_DISCARD 298#ifdef CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD
299 /* Internet /dev/null */ 299 /* Internet /dev/null */
300 {"discard", SOCK_STREAM, 1, 0, discard_stream,}, 300 {"discard", SOCK_STREAM, 1, 0, discard_stream,},
301 {"discard", SOCK_DGRAM, 0, 0, discard_dg,}, 301 {"discard", SOCK_DGRAM, 0, 0, discard_dg,},
302#endif 302#endif
303#ifdef CONFIG_FEATURE_INETD_SUPPORT_BILTIN_TIME 303#ifdef CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME
304 /* Return 32 bit time since 1900 */ 304 /* Return 32 bit time since 1900 */
305 {"time", SOCK_STREAM, 0, 0, machtime_stream,}, 305 {"time", SOCK_STREAM, 0, 0, machtime_stream,},
306 {"time", SOCK_DGRAM, 0, 0, machtime_dg,}, 306 {"time", SOCK_DGRAM, 0, 0, machtime_dg,},
307#endif 307#endif
308#ifdef CONFIG_FEATURE_INETD_SUPPORT_BILTIN_DAYTIME 308#ifdef CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME
309 /* Return human-readable time */ 309 /* Return human-readable time */
310 {"daytime", SOCK_STREAM, 0, 0, daytime_stream,}, 310 {"daytime", SOCK_STREAM, 0, 0, daytime_stream,},
311 {"daytime", SOCK_DGRAM, 0, 0, daytime_dg,}, 311 {"daytime", SOCK_DGRAM, 0, 0, daytime_dg,},
312#endif 312#endif
313#ifdef CONFIG_FEATURE_INETD_SUPPORT_BILTIN_CHARGEN 313#ifdef CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN
314 /* Familiar character generator */ 314 /* Familiar character generator */
315 {"chargen", SOCK_STREAM, 1, 0, chargen_stream,}, 315 {"chargen", SOCK_STREAM, 1, 0, chargen_stream,},
316 {"chargen", SOCK_DGRAM, 0, 0, chargen_dg,}, 316 {"chargen", SOCK_DGRAM, 0, 0, chargen_dg,},
@@ -744,9 +744,9 @@ more:
744 sep->se_server = newstr (skip (&cp)); 744 sep->se_server = newstr (skip (&cp));
745 if (strcmp (sep->se_server, "internal") == 0) { 745 if (strcmp (sep->se_server, "internal") == 0) {
746#ifdef INETD_FEATURE_ENABLED 746#ifdef INETD_FEATURE_ENABLED
747 const struct biltin *bi; 747 const struct builtin *bi;
748 748
749 for (bi = biltins; bi->bi_service; bi++) 749 for (bi = builtins; bi->bi_service; bi++)
750 if (bi->bi_socktype == sep->se_socktype && 750 if (bi->bi_socktype == sep->se_socktype &&
751 strcmp (bi->bi_service, sep->se_service) == 0) 751 strcmp (bi->bi_service, sep->se_service) == 0)
752 break; 752 break;
@@ -1549,9 +1549,9 @@ inetd_main (int argc, char *argv[])
1549 */ 1549 */
1550#define BUFSIZE 4096 1550#define BUFSIZE 4096
1551 1551
1552#if defined(CONFIG_FEATURE_INETD_SUPPORT_BILTIN_ECHO) || \ 1552#if defined(CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO) || \
1553 defined(CONFIG_FEATURE_INETD_SUPPORT_BILTIN_CHARGEN) || \ 1553 defined(CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN) || \
1554 defined(CONFIG_FEATURE_INETD_SUPPORT_BILTIN_DAYTIME) 1554 defined(CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME)
1555static int dg_badinput (struct sockaddr_in *dg_sin) 1555static int dg_badinput (struct sockaddr_in *dg_sin)
1556{ 1556{
1557 if (ntohs (dg_sin->sin_port) < IPPORT_RESERVED) 1557 if (ntohs (dg_sin->sin_port) < IPPORT_RESERVED)
@@ -1563,7 +1563,7 @@ static int dg_badinput (struct sockaddr_in *dg_sin)
1563} 1563}
1564#endif 1564#endif
1565 1565
1566#ifdef CONFIG_FEATURE_INETD_SUPPORT_BILTIN_ECHO 1566#ifdef CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO
1567/* Echo service -- echo data back */ 1567/* Echo service -- echo data back */
1568/* ARGSUSED */ 1568/* ARGSUSED */
1569static void 1569static void
@@ -1596,9 +1596,9 @@ echo_dg (int s, servtab_t *sep ATTRIBUTE_UNUSED)
1596 return; 1596 return;
1597 (void) sendto (s, buffer, i, 0, &sa, sizeof (sa)); 1597 (void) sendto (s, buffer, i, 0, &sa, sizeof (sa));
1598} 1598}
1599#endif /* CONFIG_FEATURE_INETD_SUPPORT_BILTIN_ECHO */ 1599#endif /* CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO */
1600 1600
1601#ifdef CONFIG_FEATURE_INETD_SUPPORT_BILTIN_DISCARD 1601#ifdef CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD
1602/* Discard service -- ignore data */ 1602/* Discard service -- ignore data */
1603/* ARGSUSED */ 1603/* ARGSUSED */
1604static void 1604static void
@@ -1621,10 +1621,10 @@ discard_dg (int s, servtab_t *sep ATTRIBUTE_UNUSED)
1621 1621
1622 (void) read (s, buffer, sizeof (buffer)); 1622 (void) read (s, buffer, sizeof (buffer));
1623} 1623}
1624#endif /* CONFIG_FEATURE_INETD_SUPPORT_BILTIN_DISCARD */ 1624#endif /* CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD */
1625 1625
1626 1626
1627#ifdef CONFIG_FEATURE_INETD_SUPPORT_BILTIN_CHARGEN 1627#ifdef CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN
1628#define LINESIZ 72 1628#define LINESIZ 72
1629static char ring[128]; 1629static char ring[128];
1630static char *endring; 1630static char *endring;
@@ -1709,10 +1709,10 @@ chargen_dg (int s, servtab_t *sep ATTRIBUTE_UNUSED)
1709 text[LINESIZ + 1] = '\n'; 1709 text[LINESIZ + 1] = '\n';
1710 (void) sendto (s, text, sizeof (text), 0, &sa, sizeof (sa)); 1710 (void) sendto (s, text, sizeof (text), 0, &sa, sizeof (sa));
1711} 1711}
1712#endif /* CONFIG_FEATURE_INETD_SUPPORT_BILTIN_CHARGEN */ 1712#endif /* CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN */
1713 1713
1714 1714
1715#ifdef CONFIG_FEATURE_INETD_SUPPORT_BILTIN_TIME 1715#ifdef CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME
1716/* 1716/*
1717 * Return a machine readable date and time, in the form of the 1717 * Return a machine readable date and time, in the form of the
1718 * number of seconds since midnight, Jan 1, 1900. Since gettimeofday 1718 * number of seconds since midnight, Jan 1, 1900. Since gettimeofday
@@ -1763,10 +1763,10 @@ machtime_dg (int s, servtab_t *sep ATTRIBUTE_UNUSED)
1763 result = machtime (); 1763 result = machtime ();
1764 (void) sendto (s, (char *) &result, sizeof (result), 0, &sa, sizeof (sa)); 1764 (void) sendto (s, (char *) &result, sizeof (result), 0, &sa, sizeof (sa));
1765} 1765}
1766#endif /* CONFIG_FEATURE_INETD_SUPPORT_BILTIN_TIME */ 1766#endif /* CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME */
1767 1767
1768 1768
1769#ifdef CONFIG_FEATURE_INETD_SUPPORT_BILTIN_DAYTIME 1769#ifdef CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME
1770/* Return human-readable time of day */ 1770/* Return human-readable time of day */
1771/* ARGSUSED */ 1771/* ARGSUSED */
1772static void daytime_stream (int s, servtab_t *sep ATTRIBUTE_UNUSED) 1772static void daytime_stream (int s, servtab_t *sep ATTRIBUTE_UNUSED)
@@ -1801,4 +1801,4 @@ daytime_dg (int s, servtab_t *sep ATTRIBUTE_UNUSED)
1801 (void) sprintf (buffer, "%.24s\r\n", ctime (&t)); 1801 (void) sprintf (buffer, "%.24s\r\n", ctime (&t));
1802 (void) sendto (s, buffer, strlen (buffer), 0, &sa, sizeof (sa)); 1802 (void) sendto (s, buffer, strlen (buffer), 0, &sa, sizeof (sa));
1803} 1803}
1804#endif /* CONFIG_FEATURE_INETD_SUPPORT_BILTIN_DAYTIME */ 1804#endif /* CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME */