This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
UDP 4-tuple problems
- From: "Born, Kenton P." <born2 at llnl dot gov>
- To: "systemtap at sourceware dot org" <systemtap at sourceware dot org>
- Date: Wed, 4 May 2011 11:55:54 -0700
- Subject: UDP 4-tuple problems
While there seems to be several ways of obtaining address and port information for TCP, I have been unable to locate anything for UDP. Because of this, I was attempting to access it through the "struct sock / sk_buff" structures, and have tried various things through both the socket.sendmsg[.return] and udp.sendmsg probes.
i.e.
laddr = ipmib_local_addr($sock->sk->sk_send_head,0)
or
laddr = __ip_skb_saddr(__get_skb_iphdr($sock->sk->sk_send_head))
or
laddr = @cast($sock->sk->sk_send_head->network_header,"struct iphdr", "<netinet/ip.h>")->saddr
etc.
I notice that with TCP, you have functions such as:? laddr = ip_ntop(htonl(tcpmib_local_addr(sk))), but I do not see similar functions for UDP. I did not see anything in the "struct msghdr" object that would provide me with the 4-tuple, either.
Could someone toss me a bone here and provide me with the code to access the 4-tuple for UDP through a probe such as socket.sendmsg.return? (saddr, daddr, sport, dport)
Thank you