Forum Discussion

Mark_Rinfret_64's avatar
Mark_Rinfret_64
Icon for Nimbostratus rankNimbostratus
Jan 31, 2007

iRule Syntax Error???

I must be in one of those "forest vs. the trees" situations. I've written a bunch of iRules with no problem, but one I'm currently working on is generating an error that has me stumped. (I'm running BIG-IP 9.2.3 Build 34.8.)

 

 

This much of it (a small subset) will cause "b verify load" to fail (or bigstart restart to fail, if I force it to load):

 

rule pvns_update_sdp {

 

when RULE_INIT {

 

log local0.debug "Here I am."

 

Define an array of "DESCRIBE active" flags, indexed by client IP.

 

array set ::pvnsDescribeActive { }

 

Clear the array if it was previously defined.

 

array unset ::pvnsDescribeActive

 

 

Define an array of "SDP active" flags, indexed by client IP.

 

array set ::pvnsSdpActive { }

 

Clear the array if it was previously defined.

 

array unset ::pvnsSdpActive

 

Define an array of Streamer virtual server addresses,

 

indexed by client IP.

 

array set ::pvnsStreamerVS { }

 

array unset ::pvnsStreamerVS

 

}

 

 

This event fires when the client (e.g. pvPlayer) makes a request to the

 

virtual server. We indicate that we want to collect the incoming TCP data

 

so we can examine TCP::payload.

 

when CLIENT_ACCEPTED {

 

set clientIP [IP::client_addr]

 

log local0.debug "=========================================="

 

log local0.debug "$clientIP has been accepted"

 

Get the address of the virtual server that the client came through.

 

set ::pvnsStreamerVS($clientIP} [IP::local_addr]

 

set ::pvnsDescribeActive($clientIP) 0

 

set ::pvnsSdpActive($clientIP) 0

 

TCP::collect 20

 

}

 

}

 

 

The message reported at the console indicates a problem at the penultimate right brace:

 

 

[root@sdbigip1:INOPERATIVE] config b verify load

 

BIGpipe is only validating the commands.

 

Reading configuration from /config/bigip_base.conf.

 

Reading configuration from /usr/bin/monitors/builtins/base_monitors.conf.

 

Reading configuration from /config/profile_base.conf.

 

Reading configuration from /config/daemon.conf.

 

BIGpipe: 010a0040:3: Syntax error in /config/bigip.conf line 210:

 

}

 

 

[root@sdbigip1:INOPERATIVE] config

 

 

This rule is presently unused (not referenced by any other object) and is an attempt to incrementally rewrite a previous rule which presented problems. When I added the CLIENT_ACCEPTED event, it started causing problems. I know I'm gonna feel stooopid when someone tells me what I've done wrong, but I'm stumped.

 

Thanks for your help,

 

Mark

 

13 Replies