code_junkie

“error: 'struct udphdr' has no member named 'source'” … huh?

Nov 11th, 2011
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. ngrep.c: In function ‘process’:
  2. ngrep.c:544: error: ‘struct udphdr’ has no member named ‘source’
  3. ngrep.c:545: error: ‘struct udphdr’ has no member named ‘dest’
  4. make: *** [ngrep.o] Error 1
  5.  
  6. #ifdef HAVE_DUMB_UDPHDR
  7. printf("%s:%d -", inet_ntoa(ip_packet->ip_src), ntohs(udp->source));
  8. printf("> %s:%d", inet_ntoa(ip_packet->ip_dst), ntohs(udp->dest));
  9. #else
  10. printf("%s:%d -", inet_ntoa(ip_packet->ip_src), ntohs(udp->uh_sport));
  11. printf("> %s:%d", inet_ntoa(ip_packet->ip_dst), ntohs(udp->uh_dport));
  12. #endif
Add Comment
Please, Sign In to add comment