We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef64ace commit 871790fCopy full SHA for 871790f
squid2radius.py
@@ -2,6 +2,7 @@
2
3
import sys
4
import argparse
5
+import time
6
from subprocess import call
7
import pyrad.packet
8
from pyrad.client import Client
@@ -48,9 +49,12 @@
48
49
sys.stdout.write(username + ' ' + str(total_bytes))
50
sys.stdout.write('.')
51
52
+ session_id = time.time()
53
+
54
req = srv.CreateAcctPacket()
55
req['User-Name'] = username
56
req['NAS-Identifier'] = args.radius_nasid
57
+ req['Acct-Session-Id'] = session_id
58
req['Acct-Status-Type'] = 1 # Start
59
60
reply = srv.SendPacket(req)
@@ -62,6 +66,7 @@
62
66
63
67
64
68
69
65
70
req['Acct-Status-Type'] = 2 # Stop
71
req['Acct-Output-Octets'] = total_bytes
72
0 commit comments