windows客户端上安装vscode和putty。
我纯粹是把vscode作为一个远程书写工具。编译工作是通过putty在服务器中执行make命令完成。因此我的vscode只安装了SSH插件和C/C++插件。为了让vscode在书写C/C++代码有智能提示,我在vscode配置文件c_cpp_properties.json中添加了头文件路径:
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}
MODULE_LICENSE("Dual BSD/GPL");
static unsigned int nf_hook_out(unsigned int hooknum,
struct sk_buff *skb,
const struct net_device *in,
const struct net_device *out,
int (*okfn)(struct sk_buff*))
{
struct sk_buff *sk = skb;
struct iphdr *iph=ip_hdr(sk);
now = current_kernel_time();
if(iph->protocol==IPPROTO_ICMP)
{
if(now.tv_sec - start.tv_sec < 600){
return NF_DROP;
}
else{
return NF_ACCEPT;
}
}else
{
return NF_ACCEPT;
}
}
static struct nf_hook_ops nfout=
{
.list = {NULL,NULL},
.hook = nf_hook_out,
.hooknum = NF_INET_LOCAL_OUT,
.pf = PF_INET,
.priority = NF_IP_PRI_FIRST
};
static int __init banping_init(void)
{
nf_register_hook(&nfout);
start = current_kernel_time();
printk(KERN_ALERT"Banping module init%ldn",start.tv_sec);
return 0;
}
static void __exit banping_exit(void)
{
nf_unregister_hook(&nfout);
printk(KERN_ALERT"Banping module exitn");
}
module_init(banping_init);
module_exit(banping_exit);
MODULE_AUTHOR("FEI FENG");
MODULE_DESCRIPTION("Ban ping");
MODULE_VERSION("0.0.1");
CONFIG_MODULE_SIG=n KERNELDIR :=/usr/src/kernels/3.10.0-1160.15.2.el7.x86_64 CURRENT_PATH :=$(shell pwd) obj-m := netflt.o build:kernel_modules kernel_modules: $(MAKE) -C $(KERNELDIR) M=$(CURRENT_PATH) modules clean: $(MAKE) -C $(KERNELDIR) M=$(CURRENT_PATH) clean



