patch-tcpd_h 6.6 KB

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