This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Printing the IP address in SSL dissector

0

I wanted to print the destination IP address of a packet to a file if the decoder variable is created after the cipher key exchange. i.e final output would be a file with a list of ip addresses.

To do so, I added code at the function static gint dissect_ssl3_record()

fprintf(f,"%s",address_to_str(NULL,(const guint8 *)session->srv_addr.data));

I have been unable to print out the IP address in numeric form so far.

Could someone please point me out how to print the destination ip address correctly in the ssl dissector.

asked 23 Nov '16, 00:33

mac9393's gravatar image

mac9393
36449
accept rate: 0%

edited 05 Dec '16, 11:50


One Answer:

0

This should work once you call it after ssl_set_server() has been called. There is also pinfo->dst and pinfo->src which might be useful as alternative when you know the side.

answered 05 Dec '16, 13:35

Lekensteyn's gravatar image

Lekensteyn
2.2k3724
accept rate: 30%