aboutsummaryrefslogtreecommitdiff
path: root/src/wrapacl.c
blob: de6c2dd4b284211ebbac5610d36de60a42d5eaa2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* This file is part of Ping903
Copyright (C) 2020 Sergey Poznyakoff
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
*/
#include <tcpd.h>
#include <microhttpd.h>

int
p903_httpd_acl(void *cls, const struct sockaddr *addr,  socklen_t addrlen)
{
	struct request_info req;
	request_init(&req,
		     RQ_DAEMON, "ping903",
		     RQ_CLIENT_SIN, addr,
		     RQ_SERVER_SIN, cls,
		     NULL);
	sock_methods(&req);
	return hosts_access(&req) ? MHD_YES : MHD_NO;
}

Return to:

Send suggestions and report system problems to the System administrator.