Forum Discussion

Tomasz_Radzisze's avatar
Tomasz_Radzisze
Icon for Nimbostratus rankNimbostratus
Jun 12, 2007

Problem with TCP::notify request

I'm trying to use TCP::notify request to implement something like a procedure ("normal" TCL procedures are disabled within iRules). It seems that notify request doesn't work. I tried with a simple iRule presented below.


when CLIENT_ACCEPTED {
  TCP::collect 12
}
when CLIENT_DATA {
  if { [TCP::payload 12] contains "x" } {
    log local0.debug "Calling notify request"
    TCP::notify request
    log local0.debug "Called notify request"
  }
}
when USER_REQUEST {
  log local0.debug "User request triggered"
}

I run this and I send some "xxxxxxxxxxxxxxxxxxxxx" over TCP. Then I look into the logs and there is:


Jun 12 09:12:06 tmm tmm[315]: Rule test_notify_request : Calling notify request
Jun 12 09:12:06 tmm tmm[315]: Rule test_notify_request : Called notify request

And nothing more. The log from USER_REQUEST does not appear. Am I doing something wrong or there is some bug in the Big-IP ?

I'm using BIG-IP 9.4.0 build 517.5

There are no other iRules attached to this virtual server. Or does "notify request" require some specific profile, for example HTTP?

  • I found out that it works after changing collect to unspecified length and adding TCP::release. Now the iRule looks as follows

    
    when CLIENT_ACCEPTED {
      TCP::collect
    }
    when CLIENT_DATA {
      if { [TCP::payload] contains "x" } {
        TCP::release
        log local0.debug "Calling notify request"
        TCP::notify request
        log local0.debug "Called notify request"
      }
    }
    when USER_REQUEST {
      log local0.debug "User request triggered"
    }

    Is this correct behaviour that USER_REQUEST doesn't work in my previous example?
  • These events are triggered after the commands TCP::notify response and TCP::notify request. See wiki page for TCP::notify
  • Deb_Allen_18's avatar
    Deb_Allen_18
    Historic F5 Account
    (Sorry I never updated the wiki page once I found out more -- thank you, tora, for doing so)

     

     

    I found it useful to trigger an extra event at a specific point from within another event, either on request or response, for insertion of specific logic at a place that doesn't naturally occur in the standard events. (Not sure that was its intended use, but it sure came in handy once...)

     

     

    /deb