I have coded the conversation code to allow wildcards on the destination
port and/or address. Now the conversation_new call will include another
value (options) that can be used to create a conversation with the
destination port and/or address as a wildcard. A conversation wildcard
value will match any port and/or address.
I planned to use these functions to change a wildcard -
void conversation_set_dst_addr( conversation_t *conv, address *dst);
void conversation_set_dst_port( conversation_t *conv, port_type ptype,
guint32 port);
I have one problem, when the destination port or address is changed
from a wildcard to a defined value, the hash value needs to be updated
to include the change. I planned to delete the current entry with
g_hash_table_remove and then create a new entry using g_hash_table_insert.
However I don't know the original hash key.
Now I have several choices -
1) Use g_hash_table_foreach to find compare the conversation index
values and find the desired key.
2) Include a pointer to the hash key in the conversation_t data structure.
3) Require users to enter the source port and address, and any destination
information that is required.
I really don't like the third option because it seems to error prone and put
too much burden on the deveploer.
I don't like the first option because it will consume CPU cycles and doesn't
seem an efficent way to do the update.
That leaves the second option, it seems the best to me.
Before I implement the change I would like input/suggests from others.
Jeff Foster
jfoste@xxxxxxxxxxxx