I did not write any article on coccigrep since the 1.0 release. Here is an update on what has been added to the software since that release.
C++ supportCoccinelle has a basic C++ support which can be activated by using the –cpp flag in coccigrep.
Patches informationThe -L -v options on command line will display a description of the match available on the system.
$ coccigrep -L -v set: Search where a given attribute of structure 'type' is set * Confidence: 80% * Author: Eric LeblondFor the developer, this is obtained from structured comments put at the start of the cocci file:
* Arguments: type, attribute * Revision: 2
$ head src/data/set.cocci // Author: Eric LeblondThis is thus an easy way to document the search operation. Please note, that this will also work for the operations put in the user or system custom directory.
// Desc: Search where a given attribute of structure 'type' is set // Confidence: 80% // Arguments: type, attribute // Revision: 2 @init@
Context line display improvementGuillaume Nault has contributed a series of patches that greatly improved the display of context lines:
$ coccigrep -C 3 -t Packet -a flags -o set decode*c decode.c-90 - } decode.c-91 - decode.c-92 - PACKET_INITIALIZE(p); decode.c:93 (Packet *p): p->flags |= PKT_ALLOC; decode.c-94 - decode.c-95 - SCLogDebug("allocated a new packet only using alloc..."); decode.c-96 -