On Wednesday 23 March 2005 05:18, Jaap Keuter wrote:
> Hi,
>
> Somewhere between 0.10.9 and 0.10.10 the conversation stuff changed
> forcing me to modify my plugin code. But since even
> trunk/doc/README.developer doesn't tell how and why to use the frame_num
> parameter it's a shot in the dark. Anyone willing to upgrade the API docs?
Here is the thread for this commit:
http://www.ethereal.com/lists/ethereal-dev/200501/msg00408.html
Attached is a patch to document the change to README.developer
Does this documentation address your question?
Jon
Index: README.developer
===================================================================
--- README.developer (revision 13705)
+++ README.developer (working copy)
@@ -2011,17 +2011,23 @@
information on usage of the options parameter.
The conversation_new prototype:
- conversation_t *conversation_new(address *addr1, address *addr2,
- port_type ptype, guint32 port1, guint32 port2, guint options);
+ conversation_t *conversation_new(guint32 setup_frame, address *addr1,
+ address *addr2, port_type ptype, guint32 port1, guint32 port2,
+ guint options);
Where:
- address* addr1 = first data packet address
- address* addr2 = second data packet address
- port_type ptype = port type, this is defined in packet.h
- guint32 port1 = first data packet port
- guint32 port2 = second data packet port
- guint options = conversation options, NO_ADDR2 and/or NO_PORT2
+ guint32 setup_frame = The lowest numbered frame for this conversation
+ address* addr1 = first data packet address
+ address* addr2 = second data packet address
+ port_type ptype = port type, this is defined in packet.h
+ guint32 port1 = first data packet port
+ guint32 port2 = second data packet port
+ guint options = conversation options, NO_ADDR2 and/or NO_PORT2
+setup_frame indicates the first frame for this conversation, and is used to
+distinguish multiple conversations with the same addr1/port1 and addr2/port2
+pair that occur within the same capture session.
+
"addr1" and "port1" are the first address/port pair; "addr2" and "port2"
are the second address/port pair. A conversation doesn't have source
and destination address/port pairs - packets in a conversation go in
@@ -2045,10 +2051,12 @@
The find_conversation prototype:
- conversation_t *find_conversation(address *addr_a, address *addr_b,
- port_type ptype, guint32 port_a, guint32 port_b, guint options);
+ conversation_t *find_conversation(guint32 frame_num, address *addr_a,
+ address *addr_b, port_type ptype, guint32 port_a, guint32 port_b,
+ guint options);
Where:
+ guint32 frame_num = a frame number to match
address* addr_a = first address
address* addr_b = second address
port_type ptype = port type
@@ -2056,6 +2064,17 @@
guint32 port_b = second data packet port
guint options = conversation options, NO_ADDR_B and/or NO_PORT_B
+frame_num is a frame number to match. The conversation returned is where
+ (frame_num >= conversation->setup_frame
+ && frame_num < conversation->next->setup_frame)
+Suppose there are a total of 3 conversations (A, B, and C) that match
+addr_a/port_a and addr_b/port_b, where the setup_frame used in
+conversation_new() for A, B and C are 10, 50, and 100 respectively. The
+frame_num passed in find_conversation is compared to the setup_frame of each
+conversation. So if (frame_num >= 10 && frame_num < 50), conversation A is
+returned. If (frame_num >= 50 && frame_num < 100), conversation B is returned.
+If (frame_num >= 100) conversation C is returned.
+
"addr_a" and "port_a" are the first address/port pair; "addr_b" and
"port_b" are the second address/port pair. Again, as a conversation
doesn't have source and destination address/port pairs, so