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
Ïà¹ØÎĵµ£º
ÀýÒ»£º·¢ËÍSignaling Packet£º
Signaling CommandÊÇ2¸öBluetoothʵÌåÖ®¼äµÄL2CAP²ãÃüÁî´«Êä¡£ËùÒÔµÃSignaling CommandʹÓÃCID 0x0001.
¶à¸öCommand¿ÉÒÔÔÚÒ»¸öC-frame£¨control frame£©Öз¢ËÍ¡£
Èç¹ûÒªÖ±½Ó·¢ËÍSignaling Command.ÐèÒª½¨Á¢SOCK_RAWÀàÐ͵ÄL2CAPÁ¬½ÓSocket¡£ÕâÑù²ÅÓлú»á×Ô¼ºÌî³äCommand Code£¬Identi ......
Ò»£ºÇ°ÑÔ
×î½üÔÚÑо¿androidµÄsensor driver£¬Ö÷ÒªÊÇE-compass£¬ÆäÖÐÓõ½ÁËLinux input×Óϵͳ.ÔÚÍøÉÏÒ²¿´Á˺ܶàÕâ·½ÃæµÄ×ÊÁÏ£¬¸Ð¾õ»¹ÊÇÕâƪ·ÖÎöµÄ±È½ÏϸÖÂ͸³¹£¬Òò´ËתÔØÒ»ÏÂÒÔ±ã×Ô¼ºÑ§Ï°£¬Í¬Ê±ºÍ´ó¼Ò·ÖÏí£¡
£¨Õâƪ²©¿ÍÖ÷ÒªÊÇÒÔ¼üÅÌÇý¶¯ÎªÀýµÄ£¬²»¹ý½²½âµÄÊÇLinux Input Subsystem£¬¿ÉÒÔ×ÐϸµÄÑо¿Ò»Ï£¡£©
¼üÅÌÇý¶¯½«¼ì ......
תÌù×Ô£ºhttp://alexanderlaw.blog.hexun.com/8968782_d.html
Èý¡¢ipt_table±íµÄ×¢²á
init£¨£©º¯Êý³õʼ»¯Ê±µ÷ÓÃÁËipt_register_tableº¯Êý½øÐбíµÄ×¢²á
3.1 ip_tables.c ±íµÄ×¢²á ipt_register_table
int ipt_register_table(struct ipt_table *table)
{
......
linuxÏÂÌṩtop¡¢psÃüÁî²é¿´µ±Ç°cpu¡¢memʹÓÃÇé¿ö£¬¼òÒª½éÉÜÈçÏ£º
Ò»¡¢Ê¹ÓÃps²é¿´½ø³ÌµÄ×ÊÔ´Õ¼ÓÃ
ps -aux²é¿´½ø³ÌÐÅϢʱ£¬µÚÈýÁоÍÊÇCPUÕ¼Óá£
[root@localhost utx86]# ps -aux | grep my_process
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ
root 14415 3.4 ......
±¾ÎĽ²ÊöÁËLinuxÃüÁîÐб༿ì½Ý¼üµÄ·½·¨£¬Ï£Íû¶ÔÄúÓÐËù°ïÖú¡£
LinuxÃüÁîÐб༿ì½Ý¼ü£º
history ÏÔʾÃüÁîÀúÊ·Áбí
↑(Ctrl+p) ÏÔʾÉÏÒ»ÌõÃüÁî
↓(Ctrl+n) ÏÔʾÏÂÒ»ÌõÃüÁî
!num Ö´ÐÐÃüÁîÀúÊ·ÁбíµÄµÚnumÌõÃüÁî
!! Ö´ÐÐÉÏÒ»ÌõÃüÁî
!?string? Ö´Ðк¬ÓÐstring×Ö·û´®µÄ×îÐÂÃüÁî
Ctrl+r È»ºóÊäÈëÈô¸É×Ö· ......