Forum Discussion

linq936_303436's avatar
linq936_303436
Icon for Nimbostratus rankNimbostratus
Dec 18, 2016

What built in TCL commands are disallowed in iRule?

Is there a list of TCL 8.4 built in commands which are disallowed in iRule?

 

Thanks!

 

3 Replies

  • Hi linq936, i have extracted from the iRule list of commands, the ones that are TCL commands, and here after the list of them. all the other commands like client_side for example, are F5 provided commands, but not TCL.

     

    So here after, the list:

     

     

    tell

     

    subst

     

    eof

     

    list

     

    pid

     

    llookup

     

    time

     

    eval

     

    lrange

     

    fblocked

     

    lsearch

     

    gets

     

    case

     

    lappend

     

    proc

     

    break

     

    variable

     

    llength

     

    return

     

    linsert

     

    event

     

    error

     

    catch

     

    call

     

    clock

     

    info

     

    split

     

    array

     

    if

     

    concat

     

    join

     

    lreplace

     

    fcopy

     

    global

     

    switch

     

    update

     

    close

     

    for

     

    append

     

    format

     

    read

     

    package

     

    set

     

    htonl

     

    binary

     

    namespace

     

    scan

     

    trace

     

    seek

     

    while

     

    after

     

    flush

     

    vwait

     

    uplevel

     

    continue

     

    foreach

     

    lset

     

    rename

     

    send

     

    fileevent

     

    regexp

     

    crc32

     

    upvar

     

    unset

     

    expr

     

    regsub

     

    interp

     

    puts

     

    incr

     

    lindex

     

    lsort

     

    string

     

  • Hi Philippe,

    keep in mind that the list above is also containing certain TCL commands (e.g. [interp], [pid], etc.) which are still disallowed by LTMs iRule syntax checking which is enforced during iRule savings. Those commands would require special iRule codings techniques to not expose those commands during iRule savings.

    E.g.:

    The iRule below wont save:

    when RULE_INIT {
        log local0.debug "The PID of the TMM[TMM::cmp_unit] process is: [pid]"
    }
    

    The iRule below will work fine:

    when RULE_INIT {
        set cmd {
            log local0.debug "The PID of the TMM[TMM::cmp_unit] process is: [pid]"
        }
        eval $cmd
    }
    

    Cheers, Kai