这个是Linux的TCP结构:
/* Structure of a TCP header */
struct tcp {
unsigned short tcp_source_port;
unsigned short tcp_dest_port;
unsigned int tcp_seqno;
unsigned int tcp_ackno;
unsigned int tcp_res1:4, /*little-endian*/
tcp_hlen:4,
tcp_fin:1,
tcp_syn:1,
tcp_rst:1,
tcp_psh:1,
tcp_ack:1,
tcp_urg:1,
tcp_res2:2;
unsigned short tcp_winsize;
unsigned short tcp_cksum;
unsigned short tcp_urgent;
};
我是ROOT用户,也做了更改,以下是出错信息:
flood.c:19: parse error before character 0241
flood.c:32: parse error before `}'
flood.c:39: `data' undeclared here (not in a function)
flood.c:41: parse error before character 0241
flood.c:51: redefinition of `sum'
flood.c:38: `sum' previously defined here
flood.c:51: initializer element is not constant
flood.c:51: warning: data definition has no type or storage class
flood.c:52: parse error before `+='
flood.c:53: conflicting types for `value'
flood.c:40: previous declaration of `value'
flood.c:53: initializer element is not constant
flood.c:53: warning: data definition has no type or storage class
flood.c:54: parse error before `return'
flood.c: In function `main':
flood.c:69: storage size of `pseudoheader' isn't known
flood.c:71: parse error before character 0241
flood.c: At top level:
flood.c:83: parse error before string constant
flood.c:83: warning: data definition has no type or storage class
flood.c:84: parse error before `&'
flood.c:175: parse error before `('
flood.c:175: conflicting types for `tcpheader'
flood.c:31: previous declaration of `tcpheader'
flood.c:175: parse error before `char'
flood.c:193: parse error before `2'
flood.c:193: warning: data definition has no type or storage class
flood.c:195: warning: parameter names (without types) in function declaration
flood.c:195: warning: data definition has no type or storage class
flood.c:195: parse error before `}'
flood.c:203: warning: parameter names (without types) in function declaration
flood.c:203: warning: data definition has no type or storage class
flood.c:204: parse error before `return'
打搅两位的讨论了,我想请帮个忙,是我朋友的,再liunx下装网卡驱动的时候出现的问题。redhat7.1
下面是出错的信息:
-----------
[root@localhost Linux]# gcc -DCARDBUS -DMODULE -D__KERNEL__ -Wall -Wstrict-prototypes -O6 -c rtl8139.c -o realtek_cb.o -I/usr/src/linux-2.4.2/include/
In file included from rtl8139.c:130:
kern_compat.h:463: warning: static declaration for `pci_find_capability' follows non-static
rtl8139.c: In function `rtl8129_open':
rtl8139.c:714: structure has no member named `tbusy'
rtl8139.c:715: structure has no member named `interrupt'
rtl8139.c:716: structure has no member named `start'
rtl8139.c: In function `rtl8129_timer':
rtl8139.c:806: structure has no member named `interrupt'
rtl8139.c:812: structure has no member named `tbusy'
rtl8139.c: In function `rtl8129_tx_timeout':
rtl8139.c:939: structure has no member named `tbusy'
rtl8139.c: In function `rtl8129_start_xmit':
rtl8139.c:970: structure has no member named `tbusy'
rtl8139.c:993: structure has no member named `tbusy'
rtl8139.c:997: structure has no member named `tbusy'
rtl8139.c: In function `rtl8129_interrupt':
rtl8139.c:1022: structure has no member named `interrupt'
rtl8139.c:1025: structure has no member named `interrupt'
rtl8139.c:1122: structure has no member named `tbusy'
rtl8139.c:1123: `NET_BH' undeclared (first use in this function)
rtl8139.c:1123: (Each undeclared identifier is reported only once
rtl8139.c:1123: for each function it appears in.)
rtl8139.c:1198: structure has no member named `interrupt'
rtl8139.c: In function `rtl8129_close':
rtl8139.c:1321: structure has no member named `start'
rtl8139.c:1322: structure has no member named `tbusy'
rtl8139.c: In function `rtl8129_get_stats':
rtl8139.c:1387: structure has no member named `start'
rtl8139.c: In function `rtl8139_detach':
rtl8139.c:1558: warning: `next' might be used uninitialized in this function