Forum Discussion

Matt_Breedlove_'s avatar
Icon for Nimbostratus rankNimbostratus
Apr 24, 2011

Functions for simulating CMP friendly global vars

Saw Aaron's post on his work using the session command to simulate the use of incrementing global var's in order to fully support CMP (related to a different post)


Naturally, it requires several lines to read the current value, expr + 1, and then update the value, as opposed to a one line "incr ::gvar"


Is it possible to create a function that is outside the irules that seek to use CMP compatible gvar incrementing? So rather than declaring the same class in every irule to address this or just doing it inline with a few lines, can something like a global function be saved that can be called from within any irule with the target simulated gvar handle?






3 Replies

  • Good idea Jason. That solution was written pre-subtables.



    Matt, we're hoping to see functions sometime soon in iRules. But for now, Jason's suggestion should make this a simpler process.



  • Colin_Walker_12's avatar
    Historic F5 Account
    Good call Jason, this is exactly what table incr was built for, last I checked. ;)



    Matt: Let us know if you've got any more questions or if you need help getting this working.