From: Alan T. DeKok Date: Tue, 16 Aug 2011 12:14:46 +0000 (-0400) Subject: Add support for "signed", just like integer64 X-Git-Tag: release_3_0_0_beta0~672 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12c0d7f699b9cb99f63e4bba53fda3c87687e824;p=thirdparty%2Ffreeradius-server.git Add support for "signed", just like integer64 --- diff --git a/src/main/modcall.c b/src/main/modcall.c index 6ab092c81a9..d9a04407b2a 100644 --- a/src/main/modcall.c +++ b/src/main/modcall.c @@ -1499,6 +1499,7 @@ static modcallable *do_compile_modupdate(modcallable *parent, if ((vp->type != PW_TYPE_BYTE) && (vp->type != PW_TYPE_SHORT) && (vp->type != PW_TYPE_INTEGER) && + (vp->type != PW_TYPE_SIGNED) && (vp->type != PW_TYPE_INTEGER64)) { pairfree(&head); pairfree(&vp); diff --git a/src/main/valuepair.c b/src/main/valuepair.c index b644fd75834..8e48f1f0b75 100644 --- a/src/main/valuepair.c +++ b/src/main/valuepair.c @@ -242,6 +242,15 @@ int radius_compare_vps(REQUEST *request, VALUE_PAIR *check, VALUE_PAIR *vp) ret = 0; } break; + case PW_TYPE_SIGNED: + if (vp->vp_signed < check->vp_signed) { + ret = -1; + } else if (vp->vp_signed > check->vp_signed) { + ret = +1; + } else { + ret = 0; + } + break; case PW_TYPE_DATE: ret = vp->vp_date - check->vp_date; break; diff --git a/src/main/xlat.c b/src/main/xlat.c index 73c1127b929..51f68326c24 100644 --- a/src/main/xlat.c +++ b/src/main/xlat.c @@ -91,7 +91,8 @@ static int valuepair2str(char * out,int outlen,VALUE_PAIR * pair, strlcpy(out,"_",outlen); break; case PW_TYPE_INTEGER64: - case PW_TYPE_INTEGER : + case PW_TYPE_SIGNED: + case PW_TYPE_INTEGER: strlcpy(out,"0",outlen); break; case PW_TYPE_IPADDR : @@ -214,6 +215,10 @@ static size_t xlat_packet(void *instance, REQUEST *request, snprintf(out, outlen, "%u", vp->lvalue); return strlen(out); + case PW_TYPE_SIGNED: + snprintf(out, outlen, "%d", vp->vp_signed); + return strlen(out); + case PW_TYPE_INTEGER64: snprintf(out, outlen, "%llu", vp->vp_integer64); return strlen(out);