diff options
author | Damien Miller <djm@mindrot.org> | 2011-05-05 14:14:34 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2011-05-05 14:14:34 +1000 |
commit | 91475865997f16a728ae1dc3a98dda957c997a5d (patch) | |
tree | 696fda1bb4daa024fa0176dc998c2a67beecc160 /misc.c | |
parent | 044f4a6cc39d1c3d109c143c162c4c00fc4df0aa (diff) |
- stevesk@cvs.openbsd.org 2011/03/29 18:54:17
[misc.c misc.h servconf.c]
print ipqos friendly string for sshd -T; ok markus
# sshd -Tf sshd_config|grep ipqos
ipqos lowdelay throughput
Diffstat (limited to 'misc.c')
-rw-r--r-- | misc.c | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.84 2010/11/21 01:01:13 djm Exp $ */ +/* $OpenBSD: misc.c,v 1.85 2011/03/29 18:54:17 stevesk Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * Copyright (c) 2005,2006 Damien Miller. All rights reserved. @@ -985,6 +985,19 @@ parse_ipqos(const char *cp) return val; } +const char * +iptos2str(int iptos) +{ + int i; + static char iptos_str[sizeof "0xff"]; + + for (i = 0; ipqos[i].name != NULL; i++) { + if (ipqos[i].value == iptos) + return ipqos[i].name; + } + snprintf(iptos_str, sizeof iptos_str, "0x%02x", iptos); + return iptos_str; +} void sock_set_v6only(int s) { |