type conversion

      I have a simple question: how to convert a string to a port? I
extract the
port information from a string and need to assign it to a port variable. Any
suggestion will be appreciated.

There's no support for that. You'll need to write a built-in function
(see src/bro.bif).

What's the context? Knowing that would help me in thinking about various
needs for type conversion in the Bro language.


Hi Vern,
   I am monitoring the pm_getport event. If a suspicious remote host sends a
reqest to the monitored server and successfully get the port # of a specific
rpc service, I would like to track all incoming traffic to this service. I need
the port # of the service for this purpose. I can parse the "addl" parameter of
the portmapper request event handler and pull out the port number. I hope I can
store this port number into a port variable and this is why I need to convert a
string to a port value. If I can't do so, are there other ways to get the port
number? Thank you for your time.


Quoting Vern Paxson <vern@icir.org>: