tools/bpf/bpf_exp.l

Source file repositories/reference/linux-study-clean/tools/bpf/bpf_exp.l

File Facts

System
Linux kernel
Corpus path
tools/bpf/bpf_exp.l
Extension
.l
Size
4118 bytes
Lines
199
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: tools
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

%{

#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>

#include <linux/filter.h>

#include "bpf_exp.yacc.h"

extern void yyerror(const char *str);

%}

%option align
%option ecs

%option nounput
%option noreject
%option noinput
%option noyywrap

%option 8bit
%option caseless
%option yylineno

%%

"ldb"		{ return OP_LDB; }
"ldh"		{ return OP_LDH; }
"ld"		{ return OP_LD; }
"ldi"		{ return OP_LDI; }
"ldx"		{ return OP_LDX; }
"ldxi"		{ return OP_LDXI; }
"ldxb"		{ return OP_LDXB; }
"st"		{ return OP_ST; }
"stx"		{ return OP_STX; }
"jmp"		{ return OP_JMP; }
"ja"		{ return OP_JMP; }
"jeq"		{ return OP_JEQ; }
"jneq"		{ return OP_JNEQ; }
"jne"		{ return OP_JNEQ; }
"jlt"		{ return OP_JLT; }
"jle"		{ return OP_JLE; }
"jgt"		{ return OP_JGT; }
"jge"		{ return OP_JGE; }
"jset"		{ return OP_JSET; }
"add"		{ return OP_ADD; }
"sub"		{ return OP_SUB; }
"mul"		{ return OP_MUL; }
"div"		{ return OP_DIV; }
"mod"		{ return OP_MOD; }
"neg"		{ return OP_NEG; }
"and"		{ return OP_AND; }
"xor"		{ return OP_XOR; }
"or"		{ return OP_OR; }
"lsh"		{ return OP_LSH; }
"rsh"		{ return OP_RSH; }
"ret"		{ return OP_RET; }
"tax"		{ return OP_TAX; }
"txa"		{ return OP_TXA; }

"#"?("len")	{ return K_PKT_LEN; }

"#"?("proto")	{
		yylval.number = SKF_AD_PROTOCOL;
		return extension;
	}
"#"?("type")	{

Annotation

Implementation Notes