summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorvenaas <venaas>2007-09-18 07:26:38 +0000
committervenaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf>2007-09-18 07:26:38 +0000
commita12bb1b93ca74059405087aac4e66386d21a5799 (patch)
tree86dd81a4c6ddccf2e891b331b2e6dee065c68d1a /util.c
parent1ca91fd315419052409fb9845247b7eb3ccdaf27 (diff)
certificate uri matching
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/branches/release-1.0@157 e88ac4ed-0b26-0410-9574-a7f39faa03bf
Diffstat (limited to 'util.c')
-rw-r--r--util.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/util.c b/util.c
index 4dabf47..1afc519 100644
--- a/util.c
+++ b/util.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Stig Venaas <venaas@uninett.no>
+ * Copyright (C) 2006, 2007 Stig Venaas <venaas@uninett.no>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -61,7 +61,17 @@ char *stringcopy(char *s, int len) {
r[len] = '\0';
return r;
}
-
+
+void printfchars(char *prefixfmt, char *prefix, char *charfmt, char *chars, int len) {
+ int i;
+ unsigned char *s = (unsigned char *)chars;
+ if (prefix)
+ printf(prefixfmt ? prefixfmt : "%s: ", prefix);
+ for (i = 0; i < len; i++)
+ printf(charfmt ? charfmt : "%c", s[i]);
+ printf("\n");
+}
+
char *addr2string(struct sockaddr *addr, socklen_t len) {
struct sockaddr_in6 *sa6;
struct sockaddr_in sa4;