2 " Language: Berkeley Packet Filter
3 " Maintainer: Daniel Borkmann
4 " Latest Revision: 08/16/2011
6 " In order to make syntax highlighting for BPFs work in vim, copy this file
7 " to ~/.vim/syntax/ and activate it in vim by entering:
11 " If you want to automatically load the BPF syntax highlighting for *.bpf
12 " files create the ~/.vim/filetype.vim with the following content:
15 " if exists("did_load_filetypes")
19 " augroup filetypedetect
20 " au! BufRead,BufNewFile *.bpf setfiletype bpf
24 if exists("b:current_syntax")
28 syn keyword bpfTodo contained TODO FIXME XXX NOTE FUBAR
29 syn keyword bpfKeywords ldb ldh ld ldx ldxb st stx jmp ja jeq jgt jge skipwhite
30 syn keyword bpfKeywords jset add sub mul div and or lsh rsh ret tax txa skipwhite
32 syn match bpfLabel /[a-zA-Z0-9_]\+/
33 syn match bpfSpChar /[:,#\[\]\(\)+*&]\?/ contains=bpfNumber,bpfLabel
34 syn match bpfNumber /\(0[xX]\x\+\|\d\+\)/
35 syn match bpfComment ";.*$" contains=bpfTodo
37 hi def link bpfTodo Todo
38 hi def link bpfComment Comment
39 hi def link bpfKeywords Keyword
40 hi def link bpfLabel Type
41 hi def link bpfNumber Number
42 hi def link bpfSpChar Special
44 let b:current_syntax = "bpf"