I noticed that accounting packets have a gigaword option, but I don't know how to apply this to limits sent to the AP during login, for example if I try to set a 5G limit, the 32bit field truncate the value.
I had this problem also, but managed it on a higher level: the session are still limited to 4G but the user can reconnect.
The problem is that this setting is quite a standard one.
I would suggest adding 32 more bits attribute like in the accounting, but that one would be optionnal and default to 0.
I really can't win, I finally built a package that seems to work, but other things like chilli_query list doesn't work any more and I'm tearing my hair out here :/
Well the patch will depend on what's deemed acceptible, for me rounding off to the nearest megabyte is acceptable, for others a more complicated solution involving 2 attributes would be the only way to go, similar to how gigawords work.
I've been racking my brains out trying to build a replacement package but it's not easy when some of the files to build replacement packages aren't in svn etc, the coding was the simple part, just change int/long int to unsigned long long int, modify sent_env, and the values returned from radius get multipled by 1024*1024 (1M).
So instead of having a 2 or 4GB (signed or unsigned) limit, we get a 2 or 4PB limit which should be good enough for the foreseeable future imho ;)
Re: ChilliSpot-Max-Input-Octets 32bit integer
I had this problem also, but managed it on a higher level: the session are still limited to 4G but the user can reconnect.
The problem is that this setting is quite a standard one.
I would suggest adding 32 more bits attribute like in the accounting, but that one would be optionnal and default to 0.
Re: ChilliSpot-Max-Input-Octets 32bit integer
I tried to attach the patch and it wouldn't let me, so sorry for the ugly formatting, not my fault...
diff -ur chillispot-1.0-coova.4/src/chilli.c coova-chilli-1.0-coova.4/src/chilli.c
--- chillispot-1.0-coova.4/src/chilli.c 2007-02-01 02:19:38.000000000 +1100
+++ coova-chilli-1.0-coova.4/src/chilli.c 2007-03-21 14:35:56.000000000 +1100
@@ -193,6 +193,7 @@
int runscript(struct app_conn_t *appconn, char* script) {
long int l;
+ char m[25];
int status;
if ((status = fork()) < 0) {
@@ -225,7 +226,8 @@
set_env("STATE", (char*) appconn->statebuf, appconn->statelen, NULL, NULL, NULL);
set_env("CLASS", (char*) appconn->classbuf, appconn->classlen, NULL, NULL, NULL);
set_env("SESSION_TIMEOUT", NULL, 0, NULL, NULL, &appconn->params.sessiontimeout);
- set_env("IDLE_TIMEOUT", NULL, 0, NULL, NULL, &appconn->params.idletimeout);
+ l = appconn->params.idletimeout;
+ set_env("IDLE_TIMEOUT", NULL, 0, NULL, NULL, &l);
set_env("CALLING_STATION_ID", NULL, 0, NULL, appconn->hismac, NULL);
set_env("CALLED_STATION_ID", NULL, 0, NULL, appconn->ourmac, NULL);
set_env("NAS_ID", options.radiusnasid, 0, NULL, NULL, NULL);
@@ -241,12 +243,12 @@
set_env("WISPR_BANDWIDTH_MAX_DOWN", NULL, 0, NULL, NULL, &l);
/*set_env("WISPR-SESSION_TERMINATE_TIME", appconn->sessionterminatetime, 0,
NULL, NULL, NULL);*/
- l = appconn->params.maxinputoctets;
- set_env("CHILLISPOT_MAX_INPUT_OCTETS", NULL, 0, NULL, NULL, &l);
- l = appconn->params.maxoutputoctets;
- set_env("CHILLISPOT_MAX_OUTPUT_OCTETS", NULL, 0, NULL, NULL, &l);
- l = appconn->params.maxtotaloctets;
- set_env("CHILLISPOT_MAX_TOTAL_OCTETS", NULL, 0, NULL, NULL, &l);
+ sprintf(m, "%d MB", (appconn->params.maxinputoctets / 1024 / 1024));
+ set_env("CHILLISPOT_MAX_INPUT_OCTETS", m, 0, NULL, NULL, &l);
+ sprintf(m, "%d MB", (appconn->params.maxoutputoctets / 1024 / 1024));
+ set_env("CHILLISPOT_MAX_OUTPUT_OCTETS", m, 0, NULL, NULL, &l);
+ sprintf(m, "%d MB", (appconn->params.maxtotaloctets / 1024 / 1024));
+ set_env("CHILLISPOT_MAX_TOTAL_OCTETS", m, 0, NULL, NULL, &l);
if (execl(script, script, (char *) 0) != 0) {
log_err(errno,
@@ -1937,21 +1939,21 @@
/* Max input octets */
if (!radius_getattr(pack, &attr, RADIUS_ATTR_VENDOR_SPECIFIC,
RADIUS_VENDOR_CHILLISPOT, RADIUS_ATTR_CHILLISPOT_MAX_INPUT_OCTETS, 0))
- params->maxinputoctets = ntohl(attr->v.i);
+ params->maxinputoctets = ntohl(attr->v.i) * 1024 * 1024;
else if (!reconfig)
params->maxinputoctets = 0;
/* Max output octets */
if (!radius_getattr(pack, &attr, RADIUS_ATTR_VENDOR_SPECIFIC,
RADIUS_VENDOR_CHILLISPOT, RADIUS_ATTR_CHILLISPOT_MAX_OUTPUT_OCTETS, 0))
- params->maxoutputoctets = ntohl(attr->v.i);
+ params->maxoutputoctets = ntohl(attr->v.i) * 1024 * 1024;
else if (!reconfig)
params->maxoutputoctets = 0;
/* Max total octets */
if (!radius_getattr(pack, &attr, RADIUS_ATTR_VENDOR_SPECIFIC,
RADIUS_VENDOR_CHILLISPOT, RADIUS_ATTR_CHILLISPOT_MAX_TOTAL_OCTETS, 0))
- params->maxtotaloctets = ntohl(attr->v.i);
+ params->maxtotaloctets = ntohl(attr->v.i) * 1024 * 1024;
else if (!reconfig)
params->maxtotaloctets = 0;
diff -ur chillispot-1.0-coova.4/src/redir.c coova-chilli-1.0-coova.4/src/redir.c
--- chillispot-1.0-coova.4/src/redir.c 2007-02-01 00:37:55.000000000 +1100
+++ coova-chilli-1.0-coova.4/src/redir.c 2007-03-21 12:10:36.000000000 +1100
@@ -378,11 +378,11 @@
conn->input_octets);
redir_stradd(dst, dstsize, "%d\r\n",
conn->output_octets);
- redir_stradd(dst, dstsize, "%d\r\n",
+ redir_stradd(dst, dstsize, "%llu\r\n",
conn->params.maxinputoctets);
- redir_stradd(dst, dstsize, "%d\r\n",
+ redir_stradd(dst, dstsize, "%llu\r\n",
conn->params.maxoutputoctets);
- redir_stradd(dst, dstsize, "%d\r\n",
+ redir_stradd(dst, dstsize, "%llu\r\n",
conn->params.maxtotaloctets);
}
else {
diff -ur chillispot-1.0-coova.4/src/redir.h coova-chilli-1.0-coova.4/src/redir.h
--- chillispot-1.0-coova.4/src/redir.h 2007-01-31 22:18:52.000000000 +1100
+++ coova-chilli-1.0-coova.4/src/redir.h 2007-03-21 12:12:20.000000000 +1100
@@ -84,9 +84,9 @@
unsigned char filteridlen;
unsigned long bandwidthmaxup;
unsigned long bandwidthmaxdown;
- unsigned long maxinputoctets;
- unsigned long maxoutputoctets;
- unsigned long maxtotaloctets;
+ uint64_t maxinputoctets;
+ uint64_t maxoutputoctets;
+ uint64_t maxtotaloctets;
unsigned long sessiontimeout;
unsigned short idletimeout;
unsigned short interim_interval; /* Seconds. 0 = No interim accounting */
Re: ChilliSpot-Max-Input-Octets 32bit integer
The one I created to try and solve my problem...
Re: ChilliSpot-Max-Input-Octets 32bit integer
What patch are you talking about?
Re: ChilliSpot-Max-Input-Octets 32bit integer
Running the chilli daemon in debug mode i get the following error message:
chilli.c: 2918: 0 (Success) Processing cmdsock request...
cmdsock_accept()/read(): No message of desired type
Although the patch does work as desired to send the limit in MB instead of bytes, it just has unfortunate side effects I can't seem to kill.
Re: ChilliSpot-Max-Input-Octets 32bit integer
I really can't win, I finally built a package that seems to work, but other things like chilli_query list doesn't work any more and I'm tearing my hair out here :/
Re: ChilliSpot-Max-Input-Octets 32bit integer
Well the patch will depend on what's deemed acceptible, for me rounding off to the nearest megabyte is acceptable, for others a more complicated solution involving 2 attributes would be the only way to go, similar to how gigawords work.
I've been racking my brains out trying to build a replacement package but it's not easy when some of the files to build replacement packages aren't in svn etc, the coding was the simple part, just change int/long int to unsigned long long int, modify sent_env, and the values returned from radius get multipled by 1024*1024 (1M).
So instead of having a 2 or 4GB (signed or unsigned) limit, we get a 2 or 4PB limit which should be good enough for the foreseeable future imho ;)
Re: ChilliSpot-Max-Input-Octets 32bit integer
I will give it a look when I have the time. Thanks for the suggestion! Patches are also welcome... ;)