From ab4e5809809cd08d6d8bf71f1f0c9f3c8a72f8cb Mon Sep 17 00:00:00 2001 From: Arran Cudbard-Bell Date: Mon, 17 Oct 2011 17:35:07 +0200 Subject: [PATCH] Add one char expansion for RADIUS request ID --- doc/variables.rst | 2 ++ src/main/xlat.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/doc/variables.rst b/doc/variables.rst index 1db65a0e8b8..b07ef46d15c 100644 --- a/doc/variables.rst +++ b/doc/variables.rst @@ -95,6 +95,8 @@ release. They also do NOT permit the use of conditional syntax +-----------+---------------------------+-----------------------+ |%i |Calling Station ID |%{Calling-Station-Id} | +-----------+---------------------------+-----------------------+ +|%I |request ID | | ++-----------+---------------------------+-----------------------+ |%l |request timestamp | | +-----------+---------------------------+-----------------------+ |%m |request month (MM) | | diff --git a/src/main/xlat.c b/src/main/xlat.c index 51f68326c24..518b2b380ea 100644 --- a/src/main/xlat.c +++ b/src/main/xlat.c @@ -1287,6 +1287,12 @@ int radius_xlat(char *out, int outlen, const char *fmt, q += valuepair2str(q,freespace,pairfind(request->reply->vps,PW_FRAMED_IP_ADDRESS, 0),PW_TYPE_IPADDR, func); p++; break; + case 'I': /* Request ID */ + snprintf(tmpdt, sizeof(tmpdt), "%i", request->packet->id); + strlcpy(q, tmpdt, freespace); + q += strlen(q); + p++; + break; case 'i': /* Calling station ID */ q += valuepair2str(q,freespace,pairfind(request->packet->vps,PW_CALLING_STATION_ID, 0),PW_TYPE_STRING, func); p++; -- 2.47.3