Wireshark-dev: Re: [Wireshark-dev] Comparing address type
From: Qifan Xi <qxi@xxxxxxxxxxxxxxxxx>
Date: Wed, 26 Nov 2008 18:08:14 -0500
That was exactly what I was looking for. Mystery solved, thanks!


Qifan.

Stephen Fisher wrote:
On Wed, Nov 26, 2008 at 05:38:31PM -0500, Qifan Xi wrote:

  
I have a need to compare the addresses of two packets. Attempting to 
use the binary comparison operator, ==, on the packet info's address 
field fails miserably with "error: invalid operands to binary == (have 
‘address’ and ‘address’)". Is there a relatively pain-free way to 
perform such a comparison?
    
Include epan/address.h if you haven't already and use the macro 
ADDRESSES_EQUAL(addr1, addr2), which will "return true if they are equal 
and false otherwise."  This is assuming you're using the "address" type 
of variable to hold the addresses.


Steve

_______________________________________________
Wireshark-dev mailing list
Wireshark-dev@xxxxxxxxxxxxx
https://wireshark.org/mailman/listinfo/wireshark-dev