[Bro-Dev] Difference between port conversion functions

Matthias Vallentin vallentin at icir.org
Wed Nov 16 22:47:21 PST 2011

The file bro.bif in the src directory contains two functions to convert count
values into ports.

    function count_to_port%(c: count, t: transport_proto%): port
        return new PortVal(c, (TransportProto)(t->InternalInt()));

    function to_port%(num: count, proto: transport_proto%): port
        return new PortVal(num, (TransportProto)proto->AsEnum());

How do they differ and which one should be used? It looks like they do
the same but have a slightly different implementation. If that's the
case, can we remove one?


More information about the bro-dev mailing list