From: Perry Lorier Date: Sat, 16 Dec 2000 12:56:07 +0000 (+0000) Subject: Author: Isomer X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=30cecbdf7e6810db9c7204262ddff70755d761bb Author: Isomer Log message: Added TOS twiddling to Kev's "feature" subsystem. It compiles, who knows if it will run... git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@346 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ChangeLog b/ChangeLog index 0521a22..8d6597d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2000-12-17 Isomer + * ircd/listener.c: added support for TOS twiddling as a 'feature'. + 2000-12-17 Isomer * ircd/os_linux.c: add TOS stuffs diff --git a/Makefile.in b/Makefile.in index 38ec813..f511a01 100644 --- a/Makefile.in +++ b/Makefile.in @@ -29,7 +29,7 @@ AWK=@AWK@ all: build -.PHONY: server build depend install config update diff patch export +.PHONY: server build depend install config update diff patch export update # Some versions of make give a warning when this is empty: .SUFFIXES: .dummy @@ -122,3 +122,7 @@ indent: @test "`indent --version`" = "GNU indent 2.1.0" || \ (echo "You need GNU indent 2.1.0; See doc/readme.indent" && exit -1); VERSION_CONTROL=none indent include/*.h ircd/*.c + +# do a cvs update +update: + cvs -z9 update \ No newline at end of file diff --git a/include/ircd_features.h b/include/ircd_features.h index 2335fa6..e506df6 100644 --- a/include/ircd_features.h +++ b/include/ircd_features.h @@ -34,6 +34,8 @@ enum Feature { FEAT_SHOW_ALL_INVISIBLE_USERS, FEAT_UNLIMIT_OPER_QUERY, FEAT_LOCAL_KILL_ONLY, + FEAT_TOS_SERVER, + FEAT_TOS_CLIENT, FEAT_CONFIG_OPERCMDS, FEAT_OPER_KILL, diff --git a/ircd/ircd_features.c b/ircd/ircd_features.c index 7e6a62d..5b45b7d 100644 --- a/ircd/ircd_features.c +++ b/ircd/ircd_features.c @@ -227,6 +227,8 @@ static struct FeatureDesc { F_B(SHOW_ALL_INVISIBLE_USERS, 1), F_B(UNLIMIT_OPER_QUERY, 0), F_B(LOCAL_KILL_ONLY, 0), + F_B(TOS_SERVER,0x08), + F_B(TOS_CLIENT,0x08), F_B(CONFIG_OPERCMDS, 1), /* XXX change default before release */ F_B(OPER_KILL, 1), diff --git a/ircd/listener.c b/ircd/listener.c index fab2384..921678e 100644 --- a/ircd/listener.c +++ b/ircd/listener.c @@ -22,6 +22,7 @@ #include "client.h" #include "ircd.h" #include "ircd_alloc.h" +#include "ircd_features.h" #include "ircd_osdep.h" #include "ircd_reply.h" #include "ircd_string.h" @@ -47,9 +48,6 @@ #define INADDR_NONE ((unsigned int) 0xffffffff) #endif -int tos_server = 0x08; // Low delay -int tos_client = 0x08; // Low delay - struct Listener* ListenerPollList = 0; static struct Listener* make_listener(int port, struct in_addr addr) @@ -219,7 +217,7 @@ static int inetport(struct Listener* listener) /* * Set the TOS bits - this is nonfatal if it doesn't stick. */ - if (!os_set_tos(fd,(listener->server) ? tos_server : tos_client)) { + if (!os_set_tos(fd,feature_int((listener->server)?FEAT_TOS_SERVER : FEAT_TOS_CLIENT))) { report_error(TOS_ERROR_MSG, get_listener_name(listener), errno); } listener->fd = fd;