Function report | 
Source Code:lib\test_bpf.c | 
Create Date:2022-07-28 06:27:51 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:generate_filter
Proto:static struct bpf_prog *generate_filter(int which, int *err)
Type:struct bpf_prog
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| int | which | |
| int * | err | 
| 6580 | test_type = aux & TEST_TYPE_MASK | 
| 6581 | flen = filter_length(which) | 
| 6582 | fptr = filter_pointer(which) | 
| 6591 | err = bpf_prog_create( & fp, & fprog) | 
| 6592 | If aux & FLAG_EXPECTED_FAIL Then | 
| 6593 | If err == used when FLAG_EXPECTED_FAIL is set in the aux Then | 
| 6596 | err = 0 | 
| 6597 | Return NULL | 
| 6598 | Else | 
| 6599 | Like KERN_CONT, pr_cont() should only be used when continuing* a line with no newline ('\n') enclosed. Otherwise it defaults* back to KERN_DEFAULT.("UNEXPECTED_PASS\n") | 
| 6604 | Return NULL | 
| 6607 | If err Then | 
| 6608 | Like KERN_CONT, pr_cont() should only be used when continuing* a line with no newline ('\n') enclosed. Otherwise it defaults* back to KERN_DEFAULT.("FAIL to prog_create err=%d len=%d\n", * err, len) | 
| 6610 | Return NULL | 
| 6612 | Break | 
| 6615 | fp = bpf_prog_alloc(bpf_prog_size(flen), 0) | 
| 6616 | If (fp == NULL) Then | 
| 6617 | Like KERN_CONT, pr_cont() should only be used when continuing* a line with no newline ('\n') enclosed. Otherwise it defaults* back to KERN_DEFAULT.("UNEXPECTED_FAIL no memory left\n") | 
| 6619 | Return NULL | 
| 6622 | Number of filter blocks = flen | 
| 6625 | No 3D Now!(insnsi, fptr, Number of filter blocks * sizeof(structbpf_insn)) | 
| 6632 | If err Then | 
| 6633 | Like KERN_CONT, pr_cont() should only be used when continuing* a line with no newline ('\n') enclosed. Otherwise it defaults* back to KERN_DEFAULT.("FAIL to select_runtime err=%d\n", * err) | 
| 6634 | Return NULL | 
| 6636 | Break | 
| 6639 | err = 0 | 
| 6640 | Return fp | 
| Name | Describe | 
|---|---|
| test_bpf | 
| Source code conversion tool public plug-in interface  | X | 
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion  |