Hello Jordi,
Cool thing the possibility to do tcpdump in pd!
I was trying to build the version 0.0.3 on osx and i run into many
errors due to some difference in headers in osx and linux:
iphdr and icmphdr struct were not defined in osx,
so i added their definition.
and tcp and udp source and dest have different labelling:
http://en.wikipedia.org/wiki/Tcphdr
(the bsd standard seems to work on both platform though)
so i changed them.
it manages to compiles and now seems to run fine!
except that i have zero hexadecimal data on the outlet10... and i'd love
to have them.
maybe it would be nice to use the general ip struct definiton if possible?
http://en.wikipedia.org/wiki/Ip_%28struct%29
attached is the diff between your file and mine.
thx to share your work,
n
osx 10.5.8
pd-extended 0.42.5
Le 24/09/10 01:28, Jordi Sala a écrit :
Hi, I've made a patch to visualize on a world map the location of
remote hosts that connects to our computer.
Video demo: http://vimeo.com/15138625
Download the patch (It's a "dirty" patch) but I expect I works for
most linux computers...
http://musa.poperbu.net/content/view/94/1/
--
http://nim.on.free.fr
59,105d58
<
< struct iphdr
< {
< #if __BYTE_ORDER == __LITTLE_ENDIAN
< unsigned int ihl:4;
< unsigned int version:4;
< #elif __BYTE_ORDER == __BIG_ENDIAN
< unsigned int version:4;
< unsigned int ihl:4;
< #else
< # error "Please fix <bits/endian.h>"
< #endif
< u_int8_t tos;
< u_int16_t tot_len;
< u_int16_t id;
< u_int16_t frag_off;
< u_int8_t ttl;
< u_int8_t protocol;
< u_int16_t check;
< u_int32_t saddr;
< u_int32_t daddr;
< /*The options start here. */
< };
<
< struct icmphdr
< {
< u_int8_t type; /* message type */
< u_int8_t code; /* type sub-code */
< u_int16_t checksum;
< union
< {
< struct
< {
< u_int16_t id;
< u_int16_t sequence;
< } echo; /* echo datagram */
< u_int32_t gateway; /* gateway address */
< struct
< {
< u_int16_t __unused;
< u_int16_t mtu;
< } frag; /* path mtu discovery */
< } un;
< };
<
<
<
534c487
< x->x_sport = ntohs(tcp->th_sport);
---
> x->x_sport = ntohs(tcp->source);
537c490
< x->x_dport = ntohs(tcp->th_dport);
---
> x->x_dport = ntohs(tcp->dest);
560c513
< x->x_sport = ntohs(udp->uh_sport);
---
> x->x_sport = ntohs(udp->source);
563c516
< x->x_dport = ntohs(udp->uh_dport);
---
> x->x_dport = ntohs(udp->dest);
_______________________________________________
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list