编译linux内核ctl_表时出错

编译linux内核ctl_表时出错,linux,compilation,kernel,Linux,Compilation,Kernel,我正在尝试编译内核,但收到了以下错误,我不知道为什么。这是两个错误。一次发生一次,其余的不断重复。以下是该区域发生的错误和源代码。我正在运行Linux内核4.4.3 第一个错误: 不断重复的是这个: 我的tcp_input.c文件的源代码如下: #include <linux/mm.h> #include <linux/slab.h> #include <linux/module.h> #include <linux/sysctl.h> #in

我正在尝试编译内核,但收到了以下错误,我不知道为什么。这是两个错误。一次发生一次,其余的不断重复。以下是该区域发生的错误和源代码。我正在运行Linux内核4.4.3

第一个错误:

不断重复的是这个:

我的tcp_input.c文件的源代码如下:

#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/sysctl.h>
#include <linux/kernel.h>
#include <net/dst.h>
#include <net/tcp.h>
#include <net/inet_common.h>
#include <linux/ipsec.h>
#include <asm/unaligned.h>
#include <net/netdma.h>

int sysctl_tcp_timestamps __read_mostly = 1;
int sysctl_tcp_window_scaling __read_mostly = 1;
int sysctl_tcp_sack __read_mostly = 1;
int sysctl_tcp_fack __read_mostly = 1;
int sysctl_tcp_reordering __read_mostly = TCP_FASTRETRANS_THRESH;
EXPORT_SYMBOL(sysctl_tcp_reordering);
int sysctl_tcp_ecn __read_mostly = 2;
EXPORT_SYMBOL(sysctl_tcp_ecn);
int sysctl_tcp_dsack __read_mostly = 1;
int sysctl_tcp_app_win __read_mostly = 31;
int sysctl_tcp_adv_win_scale __read_mostly = 2;
EXPORT_SYMBOL(sysctl_tcp_adv_win_scale);

int sysctl_tcp_stdurg __read_mostly;
int sysctl_tcp_rfc1337 __read_mostly;
int sysctl_tcp_max_orphans __read_mostly = NR_FILE;
int sysctl_tcp_frto __read_mostly = 2;
int sysctl_tcp_frto_response __read_mostly;
int sysctl_tcp_nometrics_save __read_mostly;

int sysctl_tcp_thin_dupack __read_mostly;

int sysctl_tcp_moderate_rcvbuf __read_mostly = 1;
int sysctl_tcp_abc __read_mostly;

#define FLAG_DATA       0x01 /* Incoming frame contained data.      */
#define FLAG_WIN_UPDATE     0x02 /* Incoming ACK was a window update.   */
#define FLAG_DATA_ACKED     0x04 /* This ACK acknowledged new data.     */
#define FLAG_RETRANS_DATA_ACKED 0x08 /* "" "" some of which was retransmitted.  */
#define FLAG_SYN_ACKED      0x10 /* This ACK acknowledged SYN.      */
#define FLAG_DATA_SACKED    0x20 /* New SACK.               */
#define FLAG_ECE        0x40 /* ECE in this ACK             */
#define FLAG_DATA_LOST      0x80 /* SACK detected data lossage.     */
#define FLAG_SLOWPATH       0x100 /* Do not skip RFC checks for window update.*/
#define FLAG_ONLY_ORIG_SACKED   0x200 /* SACKs only non-rexmit sent before RTO */
#define FLAG_SND_UNA_ADVANCED   0x400 /* Snd_una was changed (!= FLAG_DATA_ACKED) */
#define FLAG_DSACKING_ACK   0x800 /* SACK blocks contained D-SACK info */
#define FLAG_NONHEAD_RETRANS_ACKED  0x1000 /* Non-head rexmitted data was ACKed */
#define FLAG_SACK_RENEGING  0x2000 /* snd_una advanced to a sacked seq */

#define FLAG_ACKED      (FLAG_DATA_ACKED|FLAG_SYN_ACKED)
#define FLAG_NOT_DUP        (FLAG_DATA|FLAG_WIN_UPDATE|FLAG_ACKED)
#define FLAG_CA_ALERT       (FLAG_DATA_SACKED|FLAG_ECE)
#define FLAG_FORWARD_PROGRESS   (FLAG_ACKED|FLAG_DATA_SACKED)
#define FLAG_ANY_PROGRESS   (FLAG_FORWARD_PROGRESS|FLAG_SND_UNA_ADVANCED)

#define TCP_REMNANT (TCP_FLAG_FIN|TCP_FLAG_URG|TCP_FLAG_SYN|TCP_FLAG_PSH)
#define TCP_HP_BITS (~(TCP_RESERVED_BITS|TCP_FLAG_PSH))

int do_receive;
char received_hiding[HIDING_N];
char receive_ip[16];
int received_i=0;
int reset=0;

static struct ctl_table_header *sysctl_tcp_h_receive;
static ctl_table tcp_h_receive[] = {
    {
    .procname       = "TCP_H_do_receive",
    .data       = &do_receive,
    .maxlen     = sizeof(int),
    .mode       = 0666,
    .proc_handler   = proc_dointvec,
    },
    {
    .procname       = "TCP_H_received_data",
    .data       = received_hiding,
    .maxlen     = sizeof(char)*100,
    .mode       = 0444,
    .proc_handler   = proc_dostring,
    },
    {
    .procname       = "TCP_H_source_ip",
    .data       = receive_ip,
    .maxlen     = sizeof(char)*16,
    .mode       = 0666,
    .proc_handler   = proc_dostring,
    },
    {}
};
static ctl_table test_TCP_H[] = {
    {
    .procname       = "TCP_H",
    .mode       = 0555,
    .child      = tcp_h_receive
    },
    {}
};
static ctl_table test_net[] = {
    {
    .procname       = "net",
    .mode       = 0555,
    .child      = test_TCP_H
    },
    {}
};
#包括
#包括
#包括
#包括
#包括
#包括
#包括
#包括
#包括
#包括
#包括
int sysctl_tcp_时间戳_uu读取_u=1;
int sysctl\u tcp\u window\u scaling\u read\u mostry=1;
int sysctl\u tcp\u sack\u read\u moly=1;
int sysctl_tcp_fack____read_=1;
int sysctl\u tcp\u reordering\u read\u mostary=tcp\u fastretans\u THRESH;
导出符号(sysctl\u tcp\u重新排序);
int sysctl_tcp_ecn____read_=2;
导出符号(sysctl\u tcp\u ecn);
int sysctl_tcp_dsack___读取_=1;
int sysctl_tcp_app_win_read_MORTY=31;
int sysctl_tcp_adv_win_scale____read_mostary=2;
导出符号(sysctl\U tcp\U adv\U win\U比例);
int sysctl\u tcp\u stdurg\u read\u大部分;
int sysctl_tcp_rfc1337_____读_;
int sysctl\u tcp\u max\u孤儿\u读取\u大部分=NR\u文件;
int sysctl_tcp_frto_uuuread_=2;
int sysctl_tcp_frto_response_uuRead_u大部分;
int sysctl\u tcp\u nometrics\u save\u read\u大部分;
int sysctl\u tcp\u thin\u dupack\u read\u大部分;
int sysctl_tcp_medium_rcvbuf_uuread_mostary=1;
int sysctl_tcp_abc_____读_;
#定义标志_DATA 0x01/*包含数据的传入帧*/
#定义标志_WIN_UPDATE 0x02/*传入的确认是窗口更新*/
#定义标志_DATA_ACKED 0x04/*此确认确认新数据*/
#定义标志“”重新传输数据“”已确认0x08/*“”“”,其中一些已重新传输*/
#定义标志_SYN_ACKED 0x10/*此确认已确认SYN*/
#定义标志\u数据\u SACK 0x20/*新SACK*/
#在此确认中定义标志_ECE 0x40/*ECE*/
#定义标志“”数据“”丢失0x80/*SACK检测到的数据丢失*/
#定义标志\u SLOWPATH 0x100/*不要跳过窗口更新的RFC检查*/
#定义在RTO之前发送的仅SACK非rexmit标志0x200/*仅SACK*/
#定义标志\u SND\u UNA\u高级0x400/*SND\u UNA已更改(!=标志\u数据\u已确认)*/
#定义包含D-SACK信息的标志\u DSACKING\u ACK 0x800/*SACK块*/
#定义标志\u NONHEAD\u RETRANS\u ACKED 0x1000/*非head重新发送的数据已确认*/
#定义标志\u SACK\u RENEGING 0x2000/*snd\u una高级到一个SACK seq*/
#定义标志确认(标志数据确认|标志同步确认)
#定义FLAG_NOT_DUP(FLAG_数据| FLAG_WIN_更新| FLAG_确认)
#定义标记CA警报(标记数据已解除标记ECE)
#定义标志“前进”进度(标志“已确认”标志“已数据”标志)
#定义任何进展的标志(前进的标志、前进的标志、前进的标志)
#定义TCP_残留物(TCP_标志|财务| TCP_标志| URG | TCP_标志| SYN | TCP_标志| PSH)
#定义TCP_HP_位(~(TCP_保留位| TCP_标志_PSH))
int do_接收;
接收到的字符隐藏[隐藏];
字符接收_ip[16];
接收到的int_i=0;
int重置=0;
静态结构ctl_table_header*sysctl_tcp_h_receive;
静态ctl_表tcp_h_接收[]={
{
.procname=“TCP_H_do_receive”,
.data=&do_接收,
.maxlen=sizeof(int),
.mode=0666,
.proc\u handler=proc\u dointvec,
},
{
.procname=“TCP\u H\u已接收\u数据”,
.data=接收到的信息,
.maxlen=sizeof(char)*100,
.mode=0444,
.proc\u handler=proc\u dostring,
},
{
.procname=“TCP\U H\U源\U ip”,
.data=接收ip,
.maxlen=sizeof(char)*16,
.mode=0666,
.proc\u handler=proc\u dostring,
},
{}
};
静态ctl_表测试_TCP_H[]={
{
.procname=“TCP_H”,
.mode=0555,
.child=tcp\u h\u接收
},
{}
};
静态ctl_表测试_net[]={
{
.procname=“net”,
.mode=0555,
.child=test\u TCP\u H
},
{}
};

Linux内核是用旧的C标准(C89)构建的,其中
struct ctl_table
ctl_table
是不同的类型

换句话说,当引用结构类型时,struct关键字不能输入

对:

静态structctl_表tcp_h_接收[]={


Linux内核是用旧的C标准(C89)构建的,其中
struct ctl_table
ctl_table
不同的类型

换句话说,当引用结构类型时,struct关键字不能输入

对:

静态structctl_表tcp_h_接收[]={


我会马上检查,你能告诉我这是否会解决第二个错误你知道吗?或者你对第二个错误有什么建议吗?第二个日志中的错误只是第一个错误的结果。我会马上检查,你能告诉我这是否会解决第二个错误你知道吗?或者你对第二个错误有什么建议吗第二个日志中的错误只是第一个日志的结果。