meanings. Typical loads are described below (excerpt from RFC) Notation Payload ----------------------------------------- AUTH authentication CERT Certificate certreq Certificate Request CP Configuration D Delete EAP Extensible Authentication HDR IKE Header (not a payload) IDi Identific ation - initiator IDr identification - Responder KE Key Exchange Ni, Nr Nonce N Notify SA Security Association SK Encrypted and authenticated TSi traffic Sel
| _ ioc_write (bidirectional ).The kernel defines the _ IO (), _ ior (), Iow (), and _ IOWR () macros to help generate the above cmd. The following describes the implementation of _ IO (). Others are similar:
You can see the definition of _ IO () in ASM-generic/IOCTL. h.:
# DEFINE _ IO (type, NR) _ IOC (_ ioc_none, (type), (NR), 0)
Let's look at the definition of _ IOC ().:
# DEFINE _ IOC (Dir, type,
, _ ioc_read (read), _ ioc_write (write ), _ ioc_read | _ ioc_write (bidirectional ).
The kernel defines the _ IO (), _ ior (), Iow (), and _ IOWR () macros to help generate the above cmd. The following describes the implementation of _ IO (), which is similar to others.
You can see the definition of _ IO () in ASM-generic/IOCTL. h.:
# DEFINE _ IO (type, NR) _ IOC (_ ioc_none, (type), (NR), 0)
); // atomic variable minus I // atomic variable auto-increment/auto-increment void atomic_inc (atomic_t * v ); // Add 1 void atomic_dec (atomic_t * v) to the atomic variable; // reduce the atomic variable by 1 // perform the following operations and test: perform auto-increment, auto-Subtract, and subtract operations on atomic variables (not added) to test whether the value is 0. If the value is 0, true is returned. Otherwise, falseint atomic_inc_and_test (atomic_t * v) is returned ); int atomi
Actual Application of awk: Text Merge
Use the awk command to combine the two lines with the same names in the following two files[Root @ localhost ~] # Cat 1.txtHan Hailin, 21 years oldHai linhan, 23 years oldHan Linhai, 22 years oldLin haihan, 24 years old[Root @ localhost ~] # Cat 2.txtHan Linhai maleHai Lin Han NanHan Hailin maleLin haihan Nan
Output result:Han Hailin, 21, male[Root @ localhost ~] # Awk 'nr = FNR {a [$1] = $2}
variables (no addition) Tests whether it is 0, 0 returns True, otherwise returns Falseintatomic_inc_and_test (ATOMIC_TNBSP;*V); Intatomic_dec_and_test (atomic_ TNBSP;*V); Intatomic_sub_and_test (INTNBSP;I,NBSP;ATOMIC_TNBSP;*V);// operation and return: to the atomic variable to add/ Subtract and increment/decrement operations, and return a new value Intatomic_add_return (INTNBSP;I,NBSP;ATOMIC_TNBSP;*V); Intatomic_sub_return (int NBSP;I,NBSP;ATOMIC_TNBSP;*V); Intatomic_inc_return (atomic_t*v); In
variables (no addition) Tests whether it is 0, 0 returns True, otherwise returns Falseintatomic_inc_and_test (ATOMIC_TNBSP;*V); Intatomic_dec_and_test (atomic_ TNBSP;*V); Intatomic_sub_and_test (INTNBSP;I,NBSP;ATOMIC_TNBSP;*V);// operation and return: to the atomic variable to add/ Subtract and increment/decrement operations, and return a new value Intatomic_add_return (INTNBSP;I,NBSP;ATOMIC_TNBSP;*V); Intatomic_sub_return (int NBSP;I,NBSP;ATOMIC_TNBSP;*V); Intatomic_inc_return (atomic_t*v); In
of the correct command for the wrong device, the command number should be unique within the system scope. In order to facilitate the programmer to create the displacement of the IOCTL command number, each command number is divided into multiple bit fields. In the 2.6 kernel, the command number is divided into 4 fields, defined as the type magic number in _io (Type, NR)///used to construct parameter-free command numbers _ior (type,
/2013:14:04:48+0800] "get/phpmyadmin/themes/pmahomme/img/tab_hover_bg.pnghttp/1.1" 200502
[Root@test3 ~]# awk ' {print $} '/usr/local/apache2/logs/access_log |sort|uniq-c|head-n 10
7 127.0.0.1
228 192.168.46.1
3. In the Apache log to find the most visited the number of minutes
The/usr/local/apache2/logs/access_log format is as follows
192.168.46.1-CHEN[21/SEP/2013:14:04:48+0800] "get/phpmyadmin/themes/pmahomme/img/tab_hover_bg.pnghttp/1.1" 200502
[Root@test3 ~]# awk ' {print $} '/usr/loca
On the text processing tools of Linuxawk, boss."Feature description"Language for text processing (row, filter), support for regularNR represents the number of rows, $n take a column, $NF the last columnNr==20,nr==30 from 20 rows to 30 rowsFS vertical cut, Column delimiterRS cross-cut, row separator"Syntax format"awk [–F] ["[Delimiter]"] [ ' {print$1, $NF} '] [destination file]awk ' begin{fs= "[column delimiter]+]; rs= "[Line delimiter]+";p r
; i2cdev_driver is defined as follows: static struct i2c_driver i2cdev_driver = {. driver = {. name = "dev_driver ",},. id = i2c_driverid_i2cdev ,. attach_adapter = i2cdev_attach_adapter ,. detach_adapter = i2cdev_detach_adapter ,. detach_client = i2cdev_detach_client,}; that is, when it registers or has a new adapter, it returns its attach_adapter () function. the code of this function is as follows: static int i2cdev_attach_adapter (struct i2c_adapter * ADAP) {struc T i2c_dev * i2c_dev; int re
identifier of the print file. '\ n' is used by default as the delimiter of the file;-Print adds a carriage return line break after each output, but-print0 does not. Use '\ 0' as the file's separator to search for files containing spaces;Files in the current directory are sorted in ascending order (including hidden files) and the file name is not ".":
find . -maxdepth 1 ! -name "." -print0 | xargs -0 du -b | sort -nr | head -10 | nl
Grep text searchGr
the BH function at a certain time point, a global spin lock is defined to protect the BH function, as shown below (kernel/softirq. C ):
spinlock_t global_bh_lock = SPIN_LOCK_UNLOCKED;
In softirq's initialization function softirq_init (), set the func function pointer in each tasklet in the bh_task_vec [32] array to point to the same function bh_action, the data member (that is, the call parameter of the func function) is set to the index value of the tasklet in the array, as shown below:
void _
or pages with the most visits
# Cat access. log | awk '{print $11}' | sort | uniq-c | sort-nr | head-20
5. List the largest number of exe files transmitted (commonly used when analyzing download sites)
# Cat access. log | awk '($7 ~ /\. Exe/) {print $10 "$1" $4 "$7} '| sort-nr | head-20
6. List the exe files with an output greater than 200000 bytes (about KB) and the number of occurrences of the correspond
Parameter size
Documentation/ioctl-number.txt
Lists the magic numbers used by the kernel
Type
Magic number, this field is 8 bits wide (_ioc_typebits)
Number
Ordinal, 8-bit wide (_ioc_nrbits)
Direction
_ioc_none (no data transfer)
_ioc_read
_ioc_write
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.