Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    get source field from tcphdr

    Hi guys.
    I've a problem.
    I want get the source field from tcphdr. so i write:

    struct tcphdr* tcp_header = ....
    int source = (int)(tcp_header->source);
    but the compiler send this error message:
    error: dereferencing pointer to incomplete type
    what's the matter?

    thank you!

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    I assume you did a #include <linux/tcp.h> in your source code? That struct/field is there, in both user space and kernel space and it is the first field in struct tcphdr, declared on my system (CentOS 5) as a __u16 type.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts