0

I've recently inherited an almost 7 year old codebase, including a library with public headers with definitions of IP-, TCP, VLAN-structs and a shitload of defines (like #define TCP_NODELAY 1).

I tried to look for headers with these structs but I couldn't find anything (this is primary on linux, but also various BSD-variants). Surely there must be headers for this already?

I think net/ethernet.h helped with all the defines.

EDIT: Found most of the structs I'm looking for:
struct tcphdr in netinet/tcp.h
struct udphdr in netinet/udp.h
struct ip in netinet/ip.h

Does anyone have any clue about a struct with the vlan-header? (ether_vlan_header?)

ext
  • 2,593
  • 4
  • 32
  • 45
  • I don't want to accept "answers" not answering my question, or faulty solutions. – ext Mar 16 '11 at 12:34
  • 2
    @ext: As a sample, the answer to your current question is simply "yes". Would you accept that? If not, then rephrase the question to something that *can* be answered to your satisfaction. – Erik Mar 16 '11 at 12:38
  • It's not that I don't get your point, but look at http://stackoverflow.com/questions/3412832/python-line-editing-telnet-server for instance, only 1/3 answers is briefly related to my question (other is a _client_ library and one is a semi-shell). I've asked 6 questions in total. And English is not my native language. – ext Mar 16 '11 at 12:56
  • It doesn't appear to me that you've made any attempt to clarify what you want in that old question. I still think the fault is yours. – San Jacinto Mar 16 '11 at 17:22

1 Answers1

1

Try

find /usr/include -type f | xargs grep TCP_NODELAY

where TCP_NODELAY is the symbol you're looking for.

You can look for all symbols at the same time by writing them to a file (one per line), and using grep -f FILE.

NPE
  • 486,780
  • 108
  • 951
  • 1,012
  • Yes, I used something similar to find TCP_NODELAY, but did not find the struct literally called `ip` (to many matches to find anything) or `ether_vlan_header` (no matches) – ext Mar 16 '11 at 12:33