| 1 |
/* |
| 2 |
Copyright (C) 2001-2026 Free Software Foundation, Inc. |
| 3 |
|
| 4 |
This file is part of GNU Inetutils. |
| 5 |
|
| 6 |
GNU Inetutils is free software: you can redistribute it and/or modify |
| 7 |
it under the terms of the GNU General Public License as published by |
| 8 |
the Free Software Foundation, either version 3 of the License, or (at |
| 9 |
your option) any later version. |
| 10 |
|
| 11 |
GNU Inetutils is distributed in the hope that it will be useful, but |
| 12 |
WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 |
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, see `http://www.gnu.org/licenses/'. */ |
| 18 |
|
| 19 |
#include <sys/param.h> |
| 20 |
#include <sys/stat.h> |
| 21 |
#include <sys/socket.h> |
| 22 |
#include <netinet/in.h> |
| 23 |
#include <arpa/inet.h> |
| 24 |
#include <protocols/talkd.h> |
| 25 |
#include <netdb.h> |
| 26 |
#include <syslog.h> |
| 27 |
#include <stdio.h> |
| 28 |
#include <stdlib.h> |
| 29 |
#include <string.h> |
| 30 |
#include <time.h> |
| 31 |
#include <sys/time.h> |
| 32 |
#include <unistd.h> |
| 33 |
#include <errno.h> |
| 34 |
|
| 35 |
#ifndef INADDR_NONE |
| 36 |
# define INADDR_NONE -1 |
| 37 |
#endif |
| 38 |
|
| 39 |
#define USER_ACL_NAME ".talkrc" |
| 40 |
|
| 41 |
#define ACL_ALLOW 0 |
| 42 |
#define ACL_DENY 1 |
| 43 |
|
| 44 |
extern int debug; |
| 45 |
extern int logging; |
| 46 |
extern int strict_policy; |
| 47 |
extern unsigned int timeout; |
| 48 |
extern time_t max_idle_time; |
| 49 |
extern time_t max_request_ttl; |
| 50 |
extern char *hostname; |
| 51 |
|
| 52 |
#define os2sin_addr(cp) (((struct sockaddr_in *)&(cp))->sin_addr) |
| 53 |
|
| 54 |
extern CTL_MSG *find_request (CTL_MSG * request); |
| 55 |
extern CTL_MSG *find_match (CTL_MSG * request); |
| 56 |
extern int process_request (CTL_MSG * mp, struct sockaddr_in *sa_in, |
| 57 |
CTL_RESPONSE * rp); |
| 58 |
|
| 59 |
extern int print_request (const char *cp, CTL_MSG * mp); |
| 60 |
extern int print_response (const char *cp, CTL_RESPONSE * rp); |
| 61 |
|
| 62 |
extern int insert_table (CTL_MSG * request, CTL_RESPONSE * response); |
| 63 |
extern int delete_invite (unsigned long id_num); |
| 64 |
extern int new_id (void); |
| 65 |
extern void read_acl (char *config_file, int system); |
| 66 |
extern int acl_match (CTL_MSG * msg, struct sockaddr_in *sa_in); |
| 67 |
extern int announce (CTL_MSG * request, char *remote_machine); |