summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/misc.c b/misc.c
index 919b04e6b..5f63090d9 100644
--- a/misc.c
+++ b/misc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: misc.c,v 1.84 2010/11/21 01:01:13 djm Exp $ */ 1/* $OpenBSD: misc.c,v 1.85 2011/03/29 18:54:17 stevesk Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * Copyright (c) 2005,2006 Damien Miller. All rights reserved. 4 * Copyright (c) 2005,2006 Damien Miller. All rights reserved.
@@ -985,6 +985,19 @@ parse_ipqos(const char *cp)
985 return val; 985 return val;
986} 986}
987 987
988const char *
989iptos2str(int iptos)
990{
991 int i;
992 static char iptos_str[sizeof "0xff"];
993
994 for (i = 0; ipqos[i].name != NULL; i++) {
995 if (ipqos[i].value == iptos)
996 return ipqos[i].name;
997 }
998 snprintf(iptos_str, sizeof iptos_str, "0x%02x", iptos);
999 return iptos_str;
1000}
988void 1001void
989sock_set_v6only(int s) 1002sock_set_v6only(int s)
990{ 1003{