Thread: error: ‘struct tcphdr’ has no member named ‘th_seq

  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    20

    Thumbs down error: ‘struct tcphdr’ has no member named ‘th_seq

    hello,
    Actually here i am trying to develop network security program. I used program such like
    1. Udpguard.c 2.tcpguard.c 3. tcpg_funcs.c and 4. tcpguard.h.
    But in tcpg_func.c getting these are error..........

    t
    Code:
    cpg_funcs.c:35: error: ‘struct tcphdr’ has no member named ‘th_dport’
    tcpg_funcs.c:36: error: ‘struct tcphdr’ has no member named ‘th_flags’
    tcpg_funcs.c: In function ‘tcpg_oob’:
    tcpg_funcs.c:45: error: ‘struct tcphdr’ has no member named ‘th_flags’
    tcpg_funcs.c: In function ‘tcpg_portd’:
    tcpg_funcs.c:53: error: ‘struct tcphdr’ has no member named ‘th_dport’
    tcpg_funcs.c: In function ‘tcpg_queso’:
    tcpg_funcs.c:59: error: ‘struct tcphdr’ has no member named ‘th_win’
    tcpg_funcs.c: In function ‘tcpg_synflood’:
    tcpg_funcs.c:67: error: ‘struct tcphdr’ has no member named ‘th_flags’
    tcpg_funcs.c:67: error: ‘struct tcphdr’ has no member named ‘th_flags’
    tcpg_funcs.c:68: error: ‘struct tcphdr’ has no member named ‘th_seq’
    tcpg_funcs.c:68: error: ‘struct tcphdr’ has no member named ‘th_seq’
    tcpg_funcs.c: In function ‘tcpg_syn’:
    tcpg_funcs.c:77: error: ‘struct tcphdr’ has no member named ‘th_flags’
    tcpg_funcs.c:77: error: ‘struct tcphdr’ has no member named ‘th_flags’
    tcpg_funcs.c:78: error: ‘struct tcphdr’ has no member named ‘th_sport’
    tcpg_funcs.c:78: error: ‘struct tcphdr’ has no member named ‘th_dport’
    tcpg_funcs.c: In function ‘tcpg_land’:
    tcpg_funcs.c:84: error: ‘struct tcphdr’ has no member named ‘th_sport’
    tcpg_funcs.c:84: error: ‘struct tcphdr’ has no member named ‘th_dport’
    tcpg_funcs.c: In function ‘tcpg_kill’:
    tcpg_funcs.c:94: error: ‘struct tcphdr’ has no member named ‘th_dport’
    tcpg_funcs.c:95: error: ‘struct tcphdr’ has no member named ‘th_sport’
    tcpg_funcs.c:96: error: ‘struct tcphdr’ has no member named ‘th_dport’
    tcpg_funcs.c:99: error: ‘struct tcphdr’ has no member named ‘th_seq


    This is my all header file..............
    tcpguad.c.......
    Code:
    /* If you want TCPguard to announce all connection attemps... */
    #define TCPG_SYN
    
    /* Log QUESO probes. */
    #define TCPG_QUESO
    
    /* SYN flooding detection. */
    #define TCPG_SYNFLOOD
    
    /* WinNuke detection. */
    #define TCPG_OOB
    
    /* Log LAND attacks. */
    #define TCPG_LAND
    
    /* Log HPing probes and port 0 connection packets. */
    #define TCPG_HPING
    
    /* Shell daemon default port probe detection. */
    #define TCPG_PORTD
    
    /* Kill connections to TCP port TCPG_KILL. */
    #define TCPG_KILL	110 
    
    /* DON'T CHANGE ANYTHING BELOW THIS LINE !!!!!!!!!!!!!! */
    /* DON'T CHANGE ANYTHING BELOW THIS LINE !!!!!!!!!!!!!! */
    /* DON'T CHANGE ANYTHING BELOW THIS LINE !!!!!!!!!!!!!! */
    
    /* Biggest list of includes you've ever seen, eh?! =;-) */
    #include <libnet.h>
    #include <syslog.h>
    
    /* Why not make all variables global ?! */ 
    struct ippkt {
     struct iphdr ip;
     struct tcphdr tcp;
     char buffer[5000];
    } pkt;
    
    int s, lns;
    int IP_H, TCP_H;
    char VERSION;
    struct in_addr src_addr;
    u_char *buff;
    u_int sport, dport;
    
    void tcpg_syn();
    void tcpg_hping();
    void tcpg_synflood();
    void tcpg_portd();
    void tcpg_queso();
    void tcpg_land();
    void tcpg_oob();
    void tcpg_die();
    void tcpg_init();
    void tcpg_kill(u_short);
    tcpguard.c..........

    Code:
    #include "tcpguard.h"
    udpguard.c

    Code:
    #include <stdlib.h>
    #include <syslog.h>
    #include <stdio.h>
    #include <unistd.h>
    #include <netdb.h>
    #include <arpa/inet.h>
    #include <sys/types.h>
    #include <sys/socket.h>
    #include <netinet/ip.h>
    #include <netinet/in.h>
    #include <netinet/udp.h>
    #define __FAVOR_BSD
    #include <netinet/tcp.h>
    #include <string.h
    tcpg_funcs.c............

    Code:
    #include "tcpguard.h"
    Actually i got those error in tcpg_funcs.c. what i did mistake here.

  2. #2
    Cogito Ergo Sum
    Join Date
    Mar 2007
    Location
    Sydney, Australia
    Posts
    463
    SHow us the code where you are trying to access these elements
    =========================================
    Everytime you segfault, you murder some part of the world

  3. #3
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. TCP Header problem (error)
    By nasim751 in forum C Programming
    Replies: 1
    Last Post: 04-25-2008, 07:30 AM
  3. Replies: 2
    Last Post: 04-22-2008, 12:07 PM
  4. Replies: 1
    Last Post: 04-17-2008, 07:45 PM
  5. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM