Linux netfilterÔ´Âë·ÖÎö(7)
תÌù×Ô£ºhttp://alexanderlaw.blog.hexun.com/8968960_d.html
Æß¡¢ target Æ¥Åä
7.1 ipt_targetºÍipt_entry_target½á¹¹ ip_tables.h
ipt_targetºÍipt_match½á¹¹ÀàËÆ£º
struct ipt_target
{
struct list_head list;
const char name[IPT_FUNCTION_MAXNAMELEN];
/* ÔÚʹÓñ¾MatchµÄ¹æÔò×¢Èë±íÖÐ֮ǰµ÷Ó㬽øÐÐÓÐЧÐÔ¼ì²é£¬Èç¹û·µ»Ø0£¬¹æÔò¾Í²»»á¼ÓÈëiptablesÖÐ */
int (*checkentry)(const char *tablename,
const struct ipt_entry *e,
void *targinfo,
unsigned int targinfosize,
unsigned int hook_mask);
/* ÔÚ°üº¬±¾TargetµÄ¹æÔò´Ó±íÖÐɾ³ýʱµ÷Óã¬ÓëcheckentryÅäºÏ¿ÉÓÃÓÚ¶¯Ì¬ÄÚ´æ·ÖÅäºÍÊÍ·Å */
void (*destroy)(void *targinfo, unsigned int targinfosize);
/* targetµÄÄ£¿éº¯Êý£¬Èç¹ûÐèÒª¼ÌÐø´¦ÀíÔò·µ»ØIPT_CONTINUE£¨-1£©£¬·ñÔò·µ»ØNF_ACCEPT¡¢NF_DROPµÈÖµ£¬ËüµÄµ÷ÓÃÕ߸ù¾ÝËüµÄ·µ»ØÖµÀ´ÅжÏÈçºÎ´¦ÀíËü´¦Àí¹ýµÄ±¨ÎÄ*/
unsigned int (*target)(struct sk_buff **pskb,
const struct net_device *in,
const struct net_device *out,
unsigned int hooknum,
&n
Ïà¹ØÎĵµ£º
Ò»£ºÇ°ÑÔ
×î½üÔÚÑо¿androidµÄsensor driver£¬Ö÷ÒªÊÇE-compass£¬ÆäÖÐÓõ½ÁËLinux input×Óϵͳ.ÔÚÍøÉÏÒ²¿´Á˺ܶàÕâ·½ÃæµÄ×ÊÁÏ£¬¸Ð¾õ»¹ÊÇÕâÆª·ÖÎöµÄ±È½ÏϸÖÂ͸³¹£¬Òò´Ë×ªÔØÒ»ÏÂÒÔ±ã×Ô¼ºÑ§Ï°£¬Í¬Ê±ºÍ´ó¼Ò·ÖÏí£¡
£¨ÕâÆª²©¿ÍÖ÷ÒªÊÇÒÔ¼üÅÌÇý¶¯ÎªÀýµÄ£¬²»¹ý½²½âµÄÊÇLinux Input Subsystem£¬¿ÉÒÔ×ÐϸµÄÑо¿Ò»Ï£¡£©
¼üÅÌÇý¶¯½«¼ì ......
Linux»·¾³½ø³Ì¼äͨÐÅ£¨Èý£©
ÏûÏ¢¶ÓÁÐ
ÎĵµÑ¡Ïî
<tr
valign="top"><td width="8"><img alt="" height="1" width="8"
src="//www.ibm.com/i/c.gif"/></td><td width="16"><img alt="" width=" ......
×ªÔØ×Ôhttp://www.examda.com/linux/fudao/20070919/112113103.html
ѧϰӦ¸ÃÊÇÒ»¸öÏȰÑÎÊÌâ¼òµ¥»¯£¬ÔÚ°ÑÎÊÌ⸴ÔÓ»¯µÄ¹ý³Ì¡£Ò»¿ªÊ¼¾Í×ÅÊÖ´¦Àí¸´ÔÓµÄÎÊÌ⣬ÄÑÃâÈà ÈËÓÐÐľªµ¨²ü£¬×½½ó¼ûÖâµÄ¸Ð¾õ¡£¶ÁLinuxÍø¿¨Çý¶¯Ò²ÊÇÒ»Ñù¡£Ädz¤³¤µÄÔ´Âë¼ÐÔÓ×ÅÄÇЩÎÒÃÇİÉúµÄ±äÁ¿ºÍ·ûºÅ£¬Íû¶øÉúη±ãÊ ......
ËÄ¡¢nf_hook_ops ¹³×ÓµÄ×¢²á
ÔÚfilter±íµÄ³õʼ»¯º¯Êýstatic int __init init(void)ÖгýÁËÓÐÒ»¸önf_register_hookº¯Êý×¢²áÒ»¸ötablesÍ⣬»¹ÓÉnf_register_hookº¯Êý×¢²áÁË3¸öhook
4.1 nf_hook_opsÊý¾Ý½á¹¹ netfilter.h
struct nf_hook_ops
{
......