This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]