freeradius 3.0.x HOW TO ULANG read/write all list keys/values
Hello, Could you advice how to write and read all reply list parameters to/from database? I would like to store reply parameters between sessions of the same user without generating them from scratch. As I understand writing all parameters to the database is possible using e.g. such command: &AllReplyString := "%{pairs:reply:[*]}" Then I can write AllReplyString to e.g. SQL database. But how can I read it back and fill all reply parameters into freeradius? I can retrieve AllReplyString from database. How to assign all parameters from such string to radius reply list? I imagine there shall be a kind of construction like Update reply { .... list := AllReplyString } but I couldn't find proper construction in ulang manual nor any converting function. Could you suggest the proper way of solving such issue? Regards, Mike ________________________________________ Uwaga: Treść niniejszej wiadomości może być poufna i objęta zakazem jej ujawniania. Jeśli czytelnik tej wiadomości nie jest jej zamierzonym adresatem, pracownikiem lub pośrednikiem upoważnionym do jej przekazania adresatowi, informujemy że wszelkie rozprowadzanie, rozpowszechnianie lub powielanie niniejszej wiadomości jest zabronione. Jeśli otrzymałeś tę wiadomość omyłkowo, proszę bezzwłocznie odesłać ją nadawcy, a samą wiadomość usunąć z komputera. Dziękujemy. ________________________________ Note: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited.If you have received this communication in error, please notify the sender immediately by replying to the message and deleting it from your computer. Thank you. ________________________________
On Nov 9, 2015, at 5:26 PM, Michal Tomaszewski <Michal.Tomaszewski@cca.pl> wrote:
Could you advice how to write and read all reply list parameters to/from database?
Use v3.1.x from git. It has a "map" keyword, where you can map RADIUS attributes directly to SQL columns, and vice-versa.
I would like to store reply parameters between sessions of the same user without generating them from scratch.
You could use the cache module in v3.0. It can cache attributes based on a key (e.g. User-Name) for a long time.
As I understand writing all parameters to the database is possible using e.g. such command: &AllReplyString := "%{pairs:reply:[*]}" Then I can write AllReplyString to e.g. SQL database.
But how can I read it back and fill all reply parameters into free radius?
In v3.0, don't do that. Use 3.1, or the cache module in v3.0 SQL database are *terrible* at caching. You should avoid using them for caching. Alan DeKok.
Could you advice how to write and read all reply list parameters to/from database? Use v3.1.x from git. It has a "map" keyword, where you can map RADIUS attributes directly to SQL columns, and vice-versa.
I would like to store reply parameters between sessions of the same user without generating them from scratch. You could use the cache module in v3.0. It can cache attributes based on a key (e.g. User-Name) for a long time.
As I understand writing all parameters to the database is possible using e.g. such command: &AllReplyString := "%{pairs:reply:[*]}" Then I can write AllReplyString to e.g. SQL database.
But how can I read it back and fill all reply parameters into free radius?
In v3.0, don't do that. Use 3.1, or the cache module in v3.0 SQL database are *terrible* at caching. You should avoid using them for caching.
Thank you Alan. In fact I would like to use redis, which is much faster than SQL. I also would like to use stable version of freeradius for future compatibility as it is going to be a huge production environment so I'd like to use FR 3.0.x. I can store all string in redis and set the desired expiration on it what solves some other functionality requirement. Is there any other method of exporting all reply list to string and importing it back from string using freeradius 3.0.x? Or maybe you suggest other method in FR 3.0.x? Mike ________________________________________ Uwaga: Treść niniejszej wiadomości może być poufna i objęta zakazem jej ujawniania. Jeśli czytelnik tej wiadomości nie jest jej zamierzonym adresatem, pracownikiem lub pośrednikiem upoważnionym do jej przekazania adresatowi, informujemy że wszelkie rozprowadzanie, rozpowszechnianie lub powielanie niniejszej wiadomości jest zabronione. Jeśli otrzymałeś tę wiadomość omyłkowo, proszę bezzwłocznie odesłać ją nadawcy, a samą wiadomość usunąć z komputera. Dziękujemy. ________________________________ Note: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited.If you have received this communication in error, please notify the sender immediately by replying to the message and deleting it from your computer. Thank you. ________________________________
On Nov 9, 2015, at 5:44 PM, Michal Tomaszewski <Michal.Tomaszewski@cca.pl> wrote:
In fact I would like to use redis, which is much faster than SQL.
If you're caching, use the cache module. Don't use redis. It's just too hard to glue together the "cache random attributes" with databases. Alan DeKok.
In fact I would like to use redis, which is much faster than SQL. If you're caching, use the cache module. Don't use redis. It's just too hard to glue together the "cache random attributes" with databases.
I've already made all radius accounting using redis as well as connection between different sessions' records belonging to the same user roaming between different devices in the same pool of devices. The default cache mechanism is not suitable for me as I need to set different expirations on some records depending on session time parameter and other properties of the user as well as I need to have full control of data stored in redis. What is more - cache module working with redis has been introduced only in FR 3.1.x Thus I'd like to develop own-controlled redis storage. The only I need is the ulang syntax to extract reply parameters stored in string back to the reply list. Could you be so kind to explain how in ulang can I achieve reading data directly to the reply list from string created e.g. using "%{pairs:reply:[*]}" syntax? ________________________________________ Uwaga: Treść niniejszej wiadomości może być poufna i objęta zakazem jej ujawniania. Jeśli czytelnik tej wiadomości nie jest jej zamierzonym adresatem, pracownikiem lub pośrednikiem upoważnionym do jej przekazania adresatowi, informujemy że wszelkie rozprowadzanie, rozpowszechnianie lub powielanie niniejszej wiadomości jest zabronione. Jeśli otrzymałeś tę wiadomość omyłkowo, proszę bezzwłocznie odesłać ją nadawcy, a samą wiadomość usunąć z komputera. Dziękujemy. ________________________________ Note: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited.If you have received this communication in error, please notify the sender immediately by replying to the message and deleting it from your computer. Thank you. ________________________________
On Nov 9, 2015, at 6:18 PM, Michal Tomaszewski <Michal.Tomaszewski@cca.pl> wrote:
I've already made all radius accounting using redis as well as connection between different sessions' records belonging to the same user roaming between different devices in the same pool of devices.
That's different. Writing arbitrary attributes *to* a database is easier than reading them from a database.
The default cache mechanism is not suitable for me as I need to set different expirations on some records depending on session time parameter and other properties of the user
So set the expiration time per cache entry. The module supports that.
as well as I need to have full control of data stored in redis. What is more - cache module working with redis has been introduced only in FR 3.1.x
You don't need redis to cache data.
Thus I'd like to develop own-controlled redis storage. The only I need is the ulang syntax to extract reply parameters stored in string back to the reply list.
Except that's not possible in 3.0. That's why I suggested the cache module.
Could you be so kind to explain how in ulang can I achieve reading data directly to the reply list from string created e.g. using "%{pairs:reply:[*]}" syntax?
You can't. a) use the cache module in 3.0 b) use 3.1 c) write a custom Perl script which uses redis as a back-end to cache attributes Pick one. Alan DeKok.
Could you be so kind to explain how in ulang can I achieve reading data directly to the reply list from string created e.g. using "%{pairs:reply:[*]}" syntax?
You can't.
a) use the cache module in 3.0
b) use 3.1
c) write a custom Perl script which uses redis as a back-end to cache attributes
Pick one.
Thank you Alan. Regards, Mike ________________________________________ Uwaga: Treść niniejszej wiadomości może być poufna i objęta zakazem jej ujawniania. Jeśli czytelnik tej wiadomości nie jest jej zamierzonym adresatem, pracownikiem lub pośrednikiem upoważnionym do jej przekazania adresatowi, informujemy że wszelkie rozprowadzanie, rozpowszechnianie lub powielanie niniejszej wiadomości jest zabronione. Jeśli otrzymałeś tę wiadomość omyłkowo, proszę bezzwłocznie odesłać ją nadawcy, a samą wiadomość usunąć z komputera. Dziękujemy. ________________________________ Note: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited.If you have received this communication in error, please notify the sender immediately by replying to the message and deleting it from your computer. Thank you. ________________________________
participants (2)
-
Alan DeKok -
Michal Tomaszewski