From 984f4ad69f9b7bad5dc54472dd374fd7edc5a5a9 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Sat, 29 Apr 2017 00:30:38 +0200 Subject: This project has been renamed to `pacredir`. Please... ... get it from https://github.com/eworm-de/pacredir#pacredir or https://git.eworm.de/cgit.cgi/pacredir/about/ --- pacredir.h | 141 ------------------------------------------------------------- 1 file changed, 141 deletions(-) delete mode 100644 pacredir.h (limited to 'pacredir.h') diff --git a/pacredir.h b/pacredir.h deleted file mode 100644 index 161845e..0000000 --- a/pacredir.h +++ /dev/null @@ -1,141 +0,0 @@ -/* - * (C) 2013-2017 by Christian Hesse - * - * This software may be used and distributed according to the terms - * of the GNU General Public License, incorporated herein by reference. - */ - -#ifndef _PACREDIR_H -#define _PACREDIR_H - -#define _GNU_SOURCE - -/* glibc headers */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* systemd headers */ -#include - -/* Avahi headers */ -#include -#include -#include - -/* various headers needing linker options */ -#include -#include -#include -#include - -/* compile time configuration */ -#include "arch.h" -#include "config.h" -#include "version.h" - -#define PROGNAME "pacredir" - -/* services */ -struct services { - /* network port */ - uint16_t port; - /* true if host/service is online */ - uint8_t online; - /* unix timestamp of last bad request */ - __time_t badtime; - /* count the number of bad requests */ - unsigned int badcount; -}; - -/* hosts */ -struct hosts { - /* host name */ - char * host; - /* online status and bad time for services */ - struct services pacserve; - struct services pacdbserve; - /* pointer to next struct element */ - struct hosts * next; -}; - -/* ignore interfaces */ -struct ignore_interfaces { - /* interface name */ - char * interface; - /* pointer to next struct element */ - struct ignore_interfaces * next; -}; - -/* request */ -struct request { - /* host name */ - const char * host; - /* pointer to service */ - struct services * service; - /* url */ - char * url; - /* HTTP status code */ - long http_code; - /* total connection time */ - double time_total; - /* last modified timestamp */ - long last_modified; -}; - -/* write_log */ -int write_log(FILE *stream, const char *format, ...); -/* get_fqdn */ -char * get_fqdn(const char * hostname, const char * domainname); -/* get_url */ -char * get_url(const char * hostname, const uint16_t port, const char * uri); - -/* add_host */ -int add_host(const char * host, const uint16_t port, const char * type); -/* remove_host */ -int remove_host(const char * host, const char * type); - -/* browse_callback */ -static void browse_callback(AvahiServiceBrowser *b, - AvahiIfIndex interface, - AvahiProtocol protocol, - AvahiBrowserEvent event, - const char *name, - const char *type, - const char *domain, - AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, - void* userdata); -/* client_callback */ -static void client_callback(AvahiClient *c, - AvahiClientState state, - AVAHI_GCC_UNUSED void * userdata); - -/* get_http_code */ -static void * get_http_code(void * data); -/* ahc_echo */ -static int ahc_echo(void * cls, - struct MHD_Connection * connection, - const char * uri, - const char * method, - const char * version, - const char * upload_data, - size_t * upload_data_size, - void ** ptr); - -/* sig_callback */ -void sig_callback(int signal); -/* sighup_callback */ -void sighup_callback(int signal); - -#endif /* _PACREDIR_H */ - -// vim: set syntax=c: -- cgit v1.2.3-54-g00ecf