1
0

patch-tcpd_h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. --- tcp_wrappers_7.6.orig/tcpd.h 1996-03-19 16:22:25.000000000 +0100
  2. +++ tcp_wrappers_7.6/tcpd.h 2013-12-22 16:52:10.000000000 +0100
  3. @@ -4,6 +4,24 @@
  4. * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
  5. */
  6. +#ifndef _TCPWRAPPERS_TCPD_H
  7. +#define _TCPWRAPPERS_TCPD_H
  8. +
  9. +/* someone else may have defined this */
  10. +#undef __P
  11. +
  12. +/* use prototypes if we have an ANSI C compiler or are using C++ */
  13. +#if defined(__STDC__) || defined(__cplusplus)
  14. +#define __P(args) args
  15. +#else
  16. +#define __P(args) ()
  17. +#endif
  18. +
  19. +/* Need definitions of struct sockaddr_in and FILE. */
  20. +#include <netinet/in.h>
  21. +#include <stdio.h>
  22. +
  23. +
  24. /* Structure to describe one communications endpoint. */
  25. #define STRING_LENGTH 128 /* hosts, users, processes */
  26. @@ -25,10 +43,10 @@ struct request_info {
  27. char pid[10]; /* access via eval_pid(request) */
  28. struct host_info client[1]; /* client endpoint info */
  29. struct host_info server[1]; /* server endpoint info */
  30. - void (*sink) (); /* datagram sink function or 0 */
  31. - void (*hostname) (); /* address to printable hostname */
  32. - void (*hostaddr) (); /* address to printable address */
  33. - void (*cleanup) (); /* cleanup function or 0 */
  34. + void (*sink) __P((int)); /* datagram sink function or 0 */
  35. + void (*hostname) __P((struct host_info *)); /* address to printable hostname */
  36. + void (*hostaddr) __P((struct host_info *)); /* address to printable address */
  37. + void (*cleanup) __P((struct request_info *)); /* cleanup function or 0 */
  38. struct netconfig *config; /* netdir handle */
  39. };
  40. @@ -61,25 +79,30 @@ extern char paranoid[];
  41. /* Global functions. */
  42. #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
  43. -extern void fromhost(); /* get/validate client host info */
  44. +extern void fromhost __P((struct request_info *)); /* get/validate client host info */
  45. #else
  46. #define fromhost sock_host /* no TLI support needed */
  47. #endif
  48. -extern int hosts_access(); /* access control */
  49. -extern void shell_cmd(); /* execute shell command */
  50. -extern char *percent_x(); /* do %<char> expansion */
  51. -extern void rfc931(); /* client name from RFC 931 daemon */
  52. -extern void clean_exit(); /* clean up and exit */
  53. -extern void refuse(); /* clean up and exit */
  54. -extern char *xgets(); /* fgets() on steroids */
  55. -extern char *split_at(); /* strchr() and split */
  56. -extern unsigned long dot_quad_addr(); /* restricted inet_addr() */
  57. +extern void shell_cmd __P((char *)); /* execute shell command */
  58. +extern char *percent_x __P((char *, int, char *, struct request_info *)); /* do %<char> expansion */
  59. +extern void rfc931 __P((struct sockaddr_in *, struct sockaddr_in *, char *)); /* client name from RFC 931 daemon */
  60. +extern void clean_exit __P((struct request_info *)); /* clean up and exit */
  61. +extern void refuse __P((struct request_info *)); /* clean up and exit */
  62. +extern char *xgets __P((char *, int, FILE *)); /* fgets() on steroids */
  63. +extern char *split_at __P((char *, int)); /* strchr() and split */
  64. +extern unsigned long dot_quad_addr __P((char *)); /* restricted inet_addr() */
  65. /* Global variables. */
  66. +#ifdef HAVE_WEAKSYMS
  67. +extern int allow_severity __attribute__ ((weak)); /* for connection logging */
  68. +extern int deny_severity __attribute__ ((weak)); /* for connection logging */
  69. +#else
  70. extern int allow_severity; /* for connection logging */
  71. extern int deny_severity; /* for connection logging */
  72. +#endif
  73. +
  74. extern char *hosts_allow_table; /* for verification mode redirection */
  75. extern char *hosts_deny_table; /* for verification mode redirection */
  76. extern int hosts_access_verbose; /* for verbose matching mode */
  77. @@ -92,9 +115,14 @@ extern int resident; /* > 0 if residen
  78. */
  79. #ifdef __STDC__
  80. +extern int hosts_access(struct request_info *request);
  81. +extern int hosts_ctl(char *daemon, char *client_name, char *client_addr,
  82. + char *client_user);
  83. extern struct request_info *request_init(struct request_info *,...);
  84. extern struct request_info *request_set(struct request_info *,...);
  85. #else
  86. +extern int hosts_access();
  87. +extern int hosts_ctl();
  88. extern struct request_info *request_init(); /* initialize request */
  89. extern struct request_info *request_set(); /* update request structure */
  90. #endif
  91. @@ -117,27 +145,31 @@ extern struct request_info *request_set(
  92. * host_info structures serve as caches for the lookup results.
  93. */
  94. -extern char *eval_user(); /* client user */
  95. -extern char *eval_hostname(); /* printable hostname */
  96. -extern char *eval_hostaddr(); /* printable host address */
  97. -extern char *eval_hostinfo(); /* host name or address */
  98. -extern char *eval_client(); /* whatever is available */
  99. -extern char *eval_server(); /* whatever is available */
  100. +extern char *eval_user __P((struct request_info *)); /* client user */
  101. +extern char *eval_hostname __P((struct host_info *)); /* printable hostname */
  102. +extern char *eval_hostaddr __P((struct host_info *)); /* printable host address */
  103. +extern char *eval_hostinfo __P((struct host_info *)); /* host name or address */
  104. +extern char *eval_client __P((struct request_info *)); /* whatever is available */
  105. +extern char *eval_server __P((struct request_info *)); /* whatever is available */
  106. #define eval_daemon(r) ((r)->daemon) /* daemon process name */
  107. #define eval_pid(r) ((r)->pid) /* process id */
  108. /* Socket-specific methods, including DNS hostname lookups. */
  109. -extern void sock_host(); /* look up endpoint addresses */
  110. -extern void sock_hostname(); /* translate address to hostname */
  111. -extern void sock_hostaddr(); /* address to printable address */
  112. +/* look up endpoint addresses */
  113. +extern void sock_host __P((struct request_info *));
  114. +/* translate address to hostname */
  115. +extern void sock_hostname __P((struct host_info *));
  116. +/* address to printable address */
  117. +extern void sock_hostaddr __P((struct host_info *));
  118. +
  119. #define sock_methods(r) \
  120. { (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; }
  121. /* The System V Transport-Level Interface (TLI) interface. */
  122. #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
  123. -extern void tli_host(); /* look up endpoint addresses etc. */
  124. +extern void tli_host __P((struct request_info *)); /* look up endpoint addresses etc. */
  125. #endif
  126. /*
  127. @@ -178,7 +210,7 @@ extern struct tcpd_context tcpd_context;
  128. * behavior.
  129. */
  130. -extern void process_options(); /* execute options */
  131. +extern void process_options __P((char *, struct request_info *)); /* execute options */
  132. extern int dry_run; /* verification flag */
  133. /* Bug workarounds. */
  134. @@ -217,3 +249,5 @@ extern char *fix_strtok();
  135. #define strtok my_strtok
  136. extern char *my_strtok();
  137. #endif
  138. +
  139. +#endif /* tcpd.h */