]> git.ozlabs.org Git - ppp.git/commitdiff
make Octets-Direction flag accept value=4.
authorAlexandr D. Kanevskiy <kad@blackcatlinux.com>
Mon, 15 Jul 2002 11:04:18 +0000 (11:04 +0000)
committerAlexandr D. Kanevskiy <kad@blackcatlinux.com>
Mon, 15 Jul 2002 11:04:18 +0000 (11:04 +0000)
For NAS - it same as Octets-Direction = Maximum (3)
but on radius side maximum can be computed as
maximum in/out overal or per session/day/month/year...

pppd/auth.c
pppd/plugins/radius/radius.c
pppd/pppd.h

index a1e9fd26a8ff8e2293a065b329d46482338b44a3..1e2602bf7d5702b784868ab1093a7a4b794f9e15 100644 (file)
@@ -32,7 +32,7 @@
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
-#define RCSID  "$Id: auth.c,v 1.78 2002/07/13 06:24:36 kad Exp $"
+#define RCSID  "$Id: auth.c,v 1.79 2002/07/15 11:04:18 kad Exp $"
 
 #include <stdio.h>
 #include <stddef.h>
@@ -894,6 +894,7 @@ check_maxoctets(arg)
            used = link_stats.bytes_out;
            break;
        case PPP_OCTETS_DIRECTION_MAX:
+       case PPP_OCTETS_DIRECTION_MAX2:
            used = (link_stats.bytes_in > link_stats.bytes_out) ? link_stats.bytes_in : link_stats.bytes_out;
            break;
        default:
index 29b283610d7c139b0ba8569fd6d4206f7db5b6ca..389dff9152bc5510332e5c5bd760daffcdbce6a4 100644 (file)
@@ -24,7 +24,7 @@
 *
 ***********************************************************************/
 static char const RCSID[] =
-"$Id: radius.c,v 1.10 2002/07/13 06:24:36 kad Exp $";
+"$Id: radius.c,v 1.11 2002/07/15 11:04:18 kad Exp $";
 
 #include "pppd.h"
 #include "chap.h"
@@ -511,7 +511,7 @@ radius_setparams(chap_state *cstate, VALUE_PAIR *vp, char *msg,
                break;
            case PW_OCTETS_DIRECTION:
                /* Session traffic limit direction check */
-               maxoctets_dir = vp->lvalue & 3;
+               maxoctets_dir = ( vp->lvalue > 4 ) 0 : vp->lvalue ;
                break;
 #endif         
            case PW_FRAMED_IP_ADDRESS:
index 2ccdfa64a002418abe22b1490f2942ccfd7dcaf4..2d1cd17c5124e275d7378d3f5b23b5160d1c8299 100644 (file)
@@ -16,7 +16,7 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $Id: pppd.h,v 1.69 2002/07/13 06:24:36 kad Exp $
+ * $Id: pppd.h,v 1.70 2002/07/15 11:04:18 kad Exp $
  */
 
 /*
@@ -295,10 +295,12 @@ extern int       maxoctets_dir;      /* Direction :
                                      2 - out
                                      3 - max(in,out) */
 extern int       maxoctets_timeout;  /* Timeout for check of octets limit */
-#define PPP_OCTETS_DIRECTION_SUM 0
-#define PPP_OCTETS_DIRECTION_IN  1
-#define PPP_OCTETS_DIRECTION_OUT 2
-#define PPP_OCTETS_DIRECTION_MAX 3
+#define PPP_OCTETS_DIRECTION_SUM       0
+#define PPP_OCTETS_DIRECTION_IN        1
+#define PPP_OCTETS_DIRECTION_OUT       2
+#define PPP_OCTETS_DIRECTION_MAX       3
+/* same as previos, but little different on RADIUS side */
+#define PPP_OCTETS_DIRECTION_MAX2      4       
 #endif
 
 #ifdef PPP_FILTER