1. header: 定義樣板
typedef int (*aegis_check_func)(const struct sk_buff*, const struct iphdr *);
備註: 樣板function 與原始function需要定義成相同參數格式
2.定義callback function array
aegis_check_func cb[NUM_ATTACK] = {
check_landattack, /* land */
};
3.定義更美觀易讀的語法
#define CHK_CB(x) cb[x](skb, iph)
4.使用
CHK_CB(packet_checkList[direction][i]