Log message:
Beginning of support for setting the Type Of Service bits - by default
ircu traffic is now set to 'low delay' (no lag! no lag!) which may help.
Network admins can then adjust their network to let traffic with various
ToS's do various things. If I could figure out how Kev's "feature" subsystem
worked then I'd make it configurable via that.
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@345
c9e4aea6-c8fd-4c43-8297-
357d70d61c8c
+2000-12-17 Isomer <Isomer@coders.net>
+ * ircd/os_linux.c: add TOS stuffs
+
+ * ircd/listener.c: add TOS stuffs
+
2000-12-16 Kevin L. Mitchell <klmitch@mit.edu>
* ircd/whocmds.c (do_who): use HasPriv to determine whether or not
extern int os_set_nonblocking(int fd);
extern int os_set_reuseaddr(int fd);
extern int os_set_sockbufs(int fd, unsigned int size);
+extern int os_set_tos(int fd,int tos);
#endif /* INCLUDED_ircd_osdep_h */
extern const char* const SELECT_ERROR_MSG;
extern const char* const CONNECT_ERROR_MSG;
extern const char* const SETBUFS_ERROR_MSG;
+extern const char* const TOS_ERROR_MSG;
extern int HighestFd;
#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)
close(fd);
return 0;
}
+ /*
+ * Set the TOS bits - this is nonfatal if it doesn't stick.
+ */
+ if (!os_set_tos(fd,(listener->server) ? tos_server : tos_client)) {
+ report_error(TOS_ERROR_MSG, get_listener_name(listener), errno);
+ }
listener->fd = fd;
return 1;
0 == setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &opt, sizeof(opt)));
}
+int os_set_tos(int fd,int tos)
+{
+ unsigned int opt = tos;
+ return (0 == setsockopt(fd, SOL_IP, IP_TOS, &opt, sizeof(opt)));
+}
+
int os_disable_options(int fd)
{
return (0 == setsockopt(fd, IPPROTO_IP, IP_OPTIONS, NULL, 0));
const char* const SELECT_ERROR_MSG = "select error for %s: %s";
const char* const SETBUFS_ERROR_MSG = "error setting buffer size for %s: %s";
const char* const SOCKET_ERROR_MSG = "error creating socket for %s: %s";
+const char* const TOS_ERROR_MSG = "error setting TOS for %s: %s";
#ifdef GODMODE