diff options
Diffstat (limited to 'functions.h')
-rw-r--r-- | functions.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/functions.h b/functions.h index ff9d656..72a2129 100644 --- a/functions.h +++ b/functions.h @@ -28,6 +28,7 @@ #include <netinet/in.h> #include <sys/socket.h> #include <arpa/inet.h> +#include <resolv.h> #include <sys/select.h> #include <stdarg.h> #include <limits.h> @@ -52,6 +53,8 @@ #define MAXCLIENTS 32 // Maximum number of clients that can connect to the bouncer at a time #define MAXCHANNELS 1024 // Let's assume 1024 is reasonable for now (it's configured per IRCd) #define MAXRFCNICKLEN 9 // From RFC 1459 +#define MAXDNSTXTLEN 2048 // Maximum size to store in a DNS TXT record response +#define VERSIONTXTNAME "version.blabouncer.blatech.net" // DNS name of blabouncer latest version check TXT record #define MAXTOKENS 100 // For strsep string splitting @@ -220,4 +223,14 @@ void stripprefixesfromnick(char *nick); // Convert the given 'string' into lowercase void strlower(char *string); + +// Gets a single TXT record from DNS for "dnsname" and stores the result in "record" +// Returns 1 on success or 0 on failure +// TODO: If this is ever used for more than just version checks, then it needs to do more than a single record. +int gettxtrecordsingle(char *dnsname, char *record); + +// Gets the latest blabouncer version string from DNS and stores it in "version" +// Ignores the Git version portion (everything after the first '-') of VERSION, if present +// Returns 1 if local VERSION is current, -1 if local VERSION is not current, or 0 on failure +int checkversion(char *version); #endif |