Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/iscsi Drop conditional support for writing large num...



details:   https://anonhg.NetBSD.org/src/rev/71705075d337
branches:  trunk
changeset: 808380:71705075d337
user:      joerg <joerg%NetBSD.org@localhost>
date:      Fri May 15 16:25:50 2015 +0000

description:
Drop conditional support for writing large numbers as hex.

diffstat:

 sys/dev/iscsi/iscsi_text.c |  24 +-----------------------
 1 files changed, 1 insertions(+), 23 deletions(-)

diffs (54 lines):

diff -r ff3f09b96871 -r 71705075d337 sys/dev/iscsi/iscsi_text.c
--- a/sys/dev/iscsi/iscsi_text.c        Fri May 15 16:24:30 2015 +0000
+++ b/sys/dev/iscsi/iscsi_text.c        Fri May 15 16:25:50 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iscsi_text.c,v 1.7 2014/03/28 02:15:56 christos Exp $  */
+/*     $NetBSD: iscsi_text.c,v 1.8 2015/05/15 16:25:50 joerg Exp $     */
 
 /*-
  * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc.
@@ -34,9 +34,6 @@
 #include <sys/md5.h>
 #include <sys/cprng.h>
 
-/* define to send T_BIGNUM in hex format instead of base64 */
-/* #define ISCSI_HEXBIGNUMS */
-
 #define isdigit(x) ((x) >= '0' && (x) <= '9')
 #define toupper(x) ((x) & ~0x20)
 
@@ -639,22 +636,7 @@
 STATIC unsigned
 put_bignumval(negotiation_parameter_t *par, uint8_t *buf)
 {
-#ifdef ISCSI_HEXBIGNUMS
-       int k, c;
-
-       my_strcpy(buf, "0x");
-       for (k=0; k<par->list_num; ++k) {
-               c = par->val.sval[k] >> 4;
-               buf[2+2*k] = c < 10 ? '0' + c : 'a' + (c-10);
-               c = par->val.sval[k] & 0xf;
-               buf[2+2*k+1] = c < 10 ? '0' + c : 'a' + (c-10);
-       }
-       buf[2+2*k] = '\0';
-
-       return 2+2*par->list_num;
-#else
        return base64_encode(par->val.sval, par->list_num, buf);
-#endif
 }
 
 /*
@@ -835,11 +817,7 @@
 
                case T_BIGNUM:
                        /* list_num holds value size */
-#ifdef ISCSI_HEXBIGNUMS
-                       size += 2 + 2*par->list_num;
-#else
                        size += base64_enclen(par->list_num);
-#endif
                        i = par->list_num;
                        break;
 



Home | Main Index | Thread Index | Old Index