📄 target.c
字号:
/** This file is part of Firestorm NIDS* Copyright (c) 2002 Gianni Tedesco* This program is released under the terms of the GNU GPL version 2** This is the target subsystem. It manages alerts. Expect* this system to change dramatically...*/#include <stdio.h>#include <string.h>#include <firestorm.h>#include <loader.h>#include <packet.h>#include <alert.h>#include <args.h>#include <target.h>struct target *targets=NULL;/* Load all target plugins */void target_load(void){ struct plugin *p; proc_target_load fn; static struct target_api tapi={ .size=sizeof(tapi), .target_add=target_add, .args_parse=args_parse, }; for(p=ld_list; p; p=p->next) { if ( !(fn=loader_symbol(p, plugin_target)) ) continue; loader_perror(p, "target", fn(&tapi)); }}/* Find a target by its name */struct target *target_find(char *name){ struct target *ret; for(ret=targets; ret; ret=ret->next) { if ( !strcmp(ret->name, name) ) return ret; } return NULL;}/* Add a bunch of targets */int target_add(struct target *t){ int i; if ( !t ) return 0; for(i=0; t[i].name; i++) { t[i].next=targets; targets=&t[i]; } return i;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -